trojan.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. {{define "form/trojan"}}
  2. <a-form layout="inline" style="padding: 10px 0px;">
  3. <a-collapse activeKey="0" v-for="(client, index) in inbound.settings.trojans.slice(0,1)" v-if="!isEdit">
  4. <a-collapse-panel header='{{ i18n "pages.inbounds.client" }}'>
  5. <a-form-item>
  6. <span slot="label">
  7. <span>{{ i18n "pages.inbounds.email" }}</span>
  8. <a-tooltip>
  9. <template slot="title">
  10. <span>{{ i18n "pages.inbounds.emailDesc" }}</span>
  11. </template>
  12. </a-tooltip>
  13. </span>
  14. <a-icon @click="client.email = RandomUtil.randomText()" type="sync"> </a-icon>
  15. <a-input v-model.trim="client.email" style="width: 200px;"></a-input>
  16. </a-form-item>
  17. <a-form-item label="Password">
  18. <a-input v-model.trim="client.password" style="width: 150px;"></a-input>
  19. </a-form-item>
  20. <a-form-item v-if="client.email">
  21. <span slot="label">
  22. Subscription
  23. <a-tooltip>
  24. <template slot="title">
  25. <span>{{ i18n "pages.inbounds.subscriptionDesc" }}</span>
  26. </template>
  27. <a-icon type="question-circle" theme="filled"></a-icon>
  28. </a-tooltip>
  29. </span>
  30. <a-icon @click="client.subId = RandomUtil.randomText()" type="sync"> </a-icon>
  31. <a-input v-model.trim="client.subId" style="width: 150px;"></a-input>
  32. </a-form-item>
  33. <a-form-item v-if="client.email">
  34. <span slot="label">
  35. Telegram ID
  36. <a-tooltip>
  37. <template slot="title">
  38. <span>{{ i18n "pages.inbounds.telegramDesc" }}</span>
  39. </template>
  40. <a-icon type="question-circle" theme="filled"></a-icon>
  41. </a-tooltip>
  42. </span>
  43. <a-input v-model.trim="client.tgId"></a-input>
  44. </a-form-item>
  45. <a-form-item>
  46. <span slot="label">
  47. <span>{{ i18n "pages.inbounds.IPLimit" }}</span>
  48. <a-tooltip>
  49. <template slot="title">
  50. <span>{{ i18n "pages.inbounds.IPLimitDesc" }}</span>
  51. </template>
  52. <a-icon type="question-circle" theme="filled"></a-icon>
  53. </a-tooltip>
  54. </span>
  55. <a-input-number v-model="client.limitIp" min="0"></a-input-number>
  56. </a-form-item>
  57. <br>
  58. <a-form-item v-if="inbound.xtls" label="Flow">
  59. <a-select v-model="client.flow" style="width: 150px" :dropdown-class-name="themeSwitcher.darkCardClass">
  60. <a-select-option value="">{{ i18n "none" }}</a-select-option>
  61. <a-select-option v-for="key in XTLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  62. </a-select>
  63. </a-form-item>
  64. <a-form-item>
  65. <span slot="label">
  66. <span>{{ i18n "pages.inbounds.totalFlow" }}</span> (GB)
  67. <a-tooltip>
  68. <template slot="title">
  69. 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span>
  70. </template>
  71. <a-icon type="question-circle" theme="filled"></a-icon>
  72. </a-tooltip>
  73. </span>
  74. <a-input-number v-model="client._totalGB" :min="0"></a-input-number>
  75. </a-form-item>
  76. <br>
  77. <a-form-item label='{{ i18n "pages.client.delayedStart" }}'>
  78. <a-switch v-model="delayedStart" @click="client._expiryTime=0"></a-switch>
  79. </a-form-item>
  80. <br>
  81. <a-form-item v-if="delayedStart" label='{{ i18n "pages.client.expireDays" }}'>
  82. <a-input-number v-model.number="delayedExpireDays" :min="0"></a-input-number>
  83. </a-form-item>
  84. <a-form-item v-else>
  85. <span slot="label">
  86. <span>{{ i18n "pages.inbounds.expireDate" }}</span>
  87. <a-tooltip>
  88. <template slot="title">
  89. <span>{{ i18n "pages.inbounds.leaveBlankToNeverExpire" }}</span>
  90. </template>
  91. <a-icon type="question-circle" theme="filled"></a-icon>
  92. </a-tooltip>
  93. </span>
  94. <a-date-picker :show-time="{ format: 'HH:mm:ss' }" format="YYYY-MM-DD HH:mm:ss"
  95. :dropdown-class-name="themeSwitcher.darkCardClass"
  96. v-model="client._expiryTime" style="width: 170px;"></a-date-picker>
  97. </a-form-item>
  98. </a-collapse-panel>
  99. </a-collapse>
  100. <a-collapse v-else>
  101. <a-collapse-panel :header="'{{ i18n "pages.client.clientCount"}} : ' + inbound.settings.trojans.length">
  102. <table width="100%">
  103. <tr class="client-table-header">
  104. <th v-for="col in Object.keys(inbound.settings.trojans[0]).slice(0, 3)">[[ col ]]</th>
  105. </tr>
  106. <tr v-for="(client, index) in inbound.settings.trojans" :class="index % 2 == 1 ? 'client-table-odd-row' : ''">
  107. <td v-for="col in Object.values(client).slice(0, 3)">[[ col ]]</td>
  108. </tr>
  109. </table>
  110. </a-collapse-panel>
  111. </a-collapse>
  112. </a-form>
  113. <template v-if="inbound.isTcp">
  114. <a-form layout="inline">
  115. <a-form-item label="Fallbacks">
  116. <a-row>
  117. <a-button type="primary" size="small" @click="inbound.settings.addTrojanFallback()">
  118. +
  119. </a-button>
  120. </a-row>
  121. </a-form-item>
  122. </a-form>
  123. <!-- trojan fallbacks -->
  124. <a-form v-for="(fallback, index) in inbound.settings.fallbacks" layout="inline">
  125. <a-divider>
  126. fallback[[ index + 1 ]]
  127. <a-icon type="delete" @click="() => inbound.settings.delTrojanFallback(index)"
  128. style="color: rgb(255, 77, 79);cursor: pointer;"/>
  129. </a-divider>
  130. <a-form-item label="Name">
  131. <a-input v-model="fallback.name"></a-input>
  132. </a-form-item>
  133. <a-form-item label="Alpn">
  134. <a-input v-model="fallback.alpn"></a-input>
  135. </a-form-item>
  136. <a-form-item label="Path">
  137. <a-input v-model="fallback.path"></a-input>
  138. </a-form-item>
  139. <a-form-item label="Dest">
  140. <a-input v-model="fallback.dest"></a-input>
  141. </a-form-item>
  142. <a-form-item label="xVer">
  143. <a-input-number v-model="fallback.xver"></a-input-number>
  144. </a-form-item>
  145. <a-divider v-if="inbound.settings.fallbacks.length - 1 === index"/>
  146. </a-form>
  147. </template>
  148. {{end}}