vless.html 7.5 KB

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