vless.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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-icon @click="client.email = RandomUtil.randomText()" type="sync"> </a-icon>
  13. </a-tooltip>
  14. </span>
  15. <a-input v-model.trim="client.email" style="width: 150px;"></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-input v-model.trim="client.subId"></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="inbound.settings.vlesses[index].flow" style="width: 200px" :dropdown-class-name="themeSwitcher.darkCardClass">
  60. <a-select-option value="" selected>{{ 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 v-else-if="inbound.canEnableTlsFlow()" label="Flow">
  65. <a-select v-model="inbound.settings.vlesses[index].flow" style="width: 200px" :dropdown-class-name="themeSwitcher.darkCardClass">
  66. <a-select-option value="" selected>{{ i18n "none" }}</a-select-option>
  67. <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  68. </a-select>
  69. </a-form-item>
  70. <a-form-item>
  71. <span slot="label">
  72. <span>{{ i18n "pages.inbounds.totalFlow" }}</span> (GB)
  73. <a-tooltip>
  74. <template slot="title">
  75. 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span>
  76. </template>
  77. <a-icon type="question-circle" theme="filled"></a-icon>
  78. </a-tooltip>
  79. </span>
  80. <a-input-number v-model="client._totalGB" :min="0"></a-input-number>
  81. </a-form-item>
  82. <br>
  83. <a-form-item label='{{ i18n "pages.client.delayedStart" }}'>
  84. <a-switch v-model="delayedStart" @click="client._expiryTime=0"></a-switch>
  85. </a-form-item>
  86. <br>
  87. <a-form-item v-if="delayedStart" label='{{ i18n "pages.client.expireDays" }}'>
  88. <a-input-number v-model.number="delayedExpireDays" :min="0"></a-input-number>
  89. </a-form-item>
  90. <a-form-item v-else>
  91. <span slot="label">
  92. <span>{{ i18n "pages.inbounds.expireDate" }}</span>
  93. <a-tooltip>
  94. <template slot="title">
  95. <span>{{ i18n "pages.inbounds.leaveBlankToNeverExpire" }}</span>
  96. </template>
  97. <a-icon type="question-circle" theme="filled"></a-icon>
  98. </a-tooltip>
  99. </span>
  100. <a-date-picker :show-time="{ format: 'HH:mm:ss' }" format="YYYY-MM-DD HH:mm:ss"
  101. :dropdown-class-name="themeSwitcher.darkCardClass"
  102. v-model="client._expiryTime" style="width: 170px;"></a-date-picker>
  103. </a-form-item>
  104. </a-collapse-panel>
  105. </a-collapse>
  106. <a-collapse v-else>
  107. <a-collapse-panel :header="'{{ i18n "pages.client.clientCount"}} : ' + inbound.settings.vlesses.length">
  108. <table width="100%">
  109. <tr class="client-table-header">
  110. <th v-for="col in Object.keys(inbound.settings.vlesses[0]).slice(0, 3)">[[ col ]]</th>
  111. </tr>
  112. <tr v-for="(client, index) in inbound.settings.vlesses" :class="index % 2 == 1 ? 'client-table-odd-row' : ''">
  113. <td v-for="col in Object.values(client).slice(0, 3)">[[ col ]]</td>
  114. </tr>
  115. </table>
  116. </a-collapse-panel>
  117. </a-collapse>
  118. </a-form>
  119. <template v-if="inbound.isTcp">
  120. <a-form layout="inline">
  121. <a-form-item label="Fallbacks">
  122. <a-row>
  123. <a-button type="primary" size="small" @click="inbound.settings.addFallback()">
  124. +
  125. </a-button>
  126. </a-row>
  127. </a-form-item>
  128. </a-form>
  129. <!-- vless fallbacks -->
  130. <a-form v-for="(fallback, index) in inbound.settings.fallbacks" layout="inline">
  131. <a-divider>
  132. fallback[[ index + 1 ]]
  133. <a-icon type="delete" @click="() => inbound.settings.delFallback(index)"
  134. style="color: rgb(255, 77, 79);cursor: pointer;"/>
  135. </a-divider>
  136. <a-form-item label="Name">
  137. <a-input v-model="fallback.name"></a-input>
  138. </a-form-item>
  139. <a-form-item label="Alpn">
  140. <a-input v-model="fallback.alpn"></a-input>
  141. </a-form-item>
  142. <a-form-item label="Path">
  143. <a-input v-model="fallback.path"></a-input>
  144. </a-form-item>
  145. <a-form-item label="Dest">
  146. <a-input v-model="fallback.dest"></a-input>
  147. </a-form-item>
  148. <a-form-item label="xVer">
  149. <a-input-number v-model="fallback.xver"></a-input-number>
  150. </a-form-item>
  151. <a-divider v-if="inbound.settings.fallbacks.length - 1 === index"/>
  152. </a-form>
  153. </template>
  154. {{end}}