vless.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. {{define "form/vless"}}
  2. <a-form layout="inline">
  3. <label>{{ i18n "clients"}}</label>
  4. <a-collapse activeKey="0" v-for="(vless, index) in inbound.settings.vlesses"
  5. :key="`vless-${index}`">
  6. <a-collapse-panel :class="getHeaderStyle(vless.email)" :header="getHeaderText(vless.email)">
  7. <a-tag v-if="isExpiry(index) || ((getUpStats(vless.email) + getDownStats(vless.email)) > vless.totalGB && vless.totalGB != 0)" color="red" style="margin-bottom: 10px;display: block;text-align: center;">Account is (Expired|Traffic Ended) And Disabled</a-tag>
  8. <a-form layout="inline">
  9. <a-form-item>
  10. <span slot="label">
  11. Email
  12. <a-tooltip>
  13. <template slot="title">
  14. The Email Must Be Completely Unique
  15. </template>
  16. <!--Renew Svg Icon-->
  17. <svg
  18. @click="getNewEmail(vless)"
  19. xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="anticon anticon-question-circle" viewBox="0 0 16 16"> <path d="M11.534 7h3.932a.25.25 0 0 1 .192.41l-1.966 2.36a.25.25 0 0 1-.384 0l-1.966-2.36a.25.25 0 0 1 .192-.41zm-11 2h3.932a.25.25 0 0 0 .192-.41L2.692 6.23a.25.25 0 0 0-.384 0L.342 8.59A.25.25 0 0 0 .534 9z"/> <path fill-rule="evenodd" d="M8 3c-1.552 0-2.94.707-3.857 1.818a.5.5 0 1 1-.771-.636A6.002 6.002 0 0 1 13.917 7H12.9A5.002 5.002 0 0 0 8 3zM3.1 9a5.002 5.002 0 0 0 8.757 2.182.5.5 0 1 1 .771.636A6.002 6.002 0 0 1 2.083 9H3.1z"/> </svg>
  20. </a-tooltip>
  21. </span>
  22. <a-input v-model.trim="vless.email"></a-input>
  23. </a-form-item>
  24. <a-form-item>
  25. <span slot="label">
  26. IP Count Limit
  27. <a-tooltip>
  28. <template slot="title">
  29. disable inbound if more than entered count (0 for disable limit ip)
  30. </template>
  31. <a-icon type="question-circle" theme="filled"></a-icon>
  32. </a-tooltip>
  33. </span>
  34. <a-input type="number" v-model.number="vless.limitIp" min="0" ></a-input>
  35. </a-form-item>
  36. <a-form-item v-if="vless.email && vless.limitIp > 0 && isEdit">
  37. <span slot="label">
  38. IP log
  39. <a-tooltip>
  40. <template slot="title">
  41. IPs history Log (before enabling inbound after it has been disabled by IP limit, you should clear the log)
  42. </template>
  43. <a-icon type="question-circle" theme="filled"></a-icon>
  44. </a-tooltip>
  45. <a-tooltip>
  46. <template slot="title">
  47. clear the log
  48. </template>
  49. <span style="color: #FF4D4F">
  50. <a-icon type="delete" @click="clearDBClientIps(vless.email,$event)"></a-icon>
  51. </span>
  52. </a-tooltip>
  53. </span>
  54. <a-form layout="block">
  55. <a-textarea readonly @click="getDBClientIps(vless.email,$event)" placeholder="Click To Get IPs" :auto-size="{ minRows: 0.5, maxRows: 10 }">
  56. </a-textarea>
  57. </a-form>
  58. </a-form-item>
  59. </a-form>
  60. <a-form-item label="ID">
  61. <a-input v-model.trim="vless.id"></a-input>
  62. </a-form-item>
  63. <a-form-item v-if="inbound.xtls" label="Flow">
  64. <a-select v-model="inbound.settings.vlesses[index].flow" style="width: 150px">
  65. <a-select-option value="" selected>{{ i18n "none" }}</a-select-option>
  66. <a-select-option v-for="key in XTLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  67. </a-select>
  68. </a-form-item>
  69. <a-form-item v-else-if="inbound.canEnableTlsFlow()" label="Flow" layout="inline">
  70. <a-select v-model="inbound.settings.vlesses[index].flow" style="width: 150px">
  71. <a-select-option value="" selected>{{ i18n "none" }}</a-select-option>
  72. <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  73. </a-select>
  74. </a-form-item>
  75. <a-form-item v-if="inbound.tls" label="uTLS" layout="inline">
  76. <a-select v-model="inbound.settings.vlesses[index].fingerprint" label="uTLS" style="width: 150px">
  77. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  78. </a-select>
  79. </a-form-item>
  80. <a-form-item>
  81. <span slot="label">
  82. <span >{{ i18n "pages.inbounds.totalFlow" }}</span>(GB)
  83. <a-tooltip>
  84. <template slot="title">
  85. 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span>
  86. </template>
  87. <a-icon type="question-circle" theme="filled"></a-icon>
  88. </a-tooltip>
  89. </span>
  90. <a-input-number v-model="vless._totalGB" :min="0"></a-input-number>
  91. </a-form-item>
  92. <a-form-item>
  93. <span slot="label">
  94. <span >{{ i18n "pages.inbounds.expireDate" }}</span>
  95. <a-tooltip>
  96. <template slot="title">
  97. <span>{{ i18n "pages.inbounds.leaveBlankToNeverExpire" }}</span>
  98. </template>
  99. <a-icon type="question-circle" theme="filled"></a-icon>
  100. </a-tooltip>
  101. </span>
  102. <a-date-picker :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD HH:mm"
  103. v-model="vless._expiryTime" style="width: 300px;"></a-date-picker>
  104. </a-form-item>
  105. <a-form layout="inline">
  106. <a-tooltip v-if="vless._totalGB > 0">
  107. <template slot="title">
  108. {{ i18n "pages.inbounds.resetTraffic" }}
  109. </template>
  110. <span style="color: #FF4D4F">
  111. <a-icon type="delete" @click="resetClientTraffic(vless,$event)"></a-icon>
  112. </span>
  113. </a-tooltip>
  114. <a-tag color="blue">[[ sizeFormat(getUpStats(vless.email)) ]] / [[ sizeFormat(getDownStats(vless.email)) ]]</a-tag>
  115. <a-tag v-if="vless._totalGB > 0" color="red">used : [[ sizeFormat(getUpStats(vless.email) + getDownStats(vless.email)) ]]</a-tag>
  116. <a-tag v-show="inbound.settings.vlesses.length > 1" @click="removeClient(index, inbound.settings.vlesses)">
  117. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" width="22" height="22" class="mt-2 cursor-pointer">
  118. <path fill="none" d="M0 0h24v24H0z" />
  119. <path fill="#EC4899"
  120. d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-9.414l2.828-2.829 1.415 1.415L13.414 12l2.829 2.828-1.415 1.415L12 13.414l-2.828 2.829-1.415-1.415L10.586 12 7.757 9.172l1.415-1.415L12 10.586z"
  121. />
  122. </svg>
  123. </a-tag>
  124. </a-form>
  125. </a-collapse-panel>
  126. </a-collapse>
  127. <a-tag @click="addClient(inbound.protocol, inbound.settings.vlesses)">
  128. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" class="ml-2 cursor-pointer">
  129. <path fill="none" d="M0 0h24v24H0z" />
  130. <path fill="green"
  131. d="M11 11V7h2v4h4v2h-4v4h-2v-4H7v-2h4zm1 11C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z"
  132. />
  133. </svg>
  134. </a-tag>
  135. <a-form layout="inline">
  136. <a-form-item label="Fallbacks">
  137. <a-row>
  138. <a-button type="primary" size="small"
  139. @click="inbound.settings.addFallback()">
  140. +
  141. </a-button>
  142. </a-row>
  143. </a-form-item>
  144. </a-form>
  145. <!-- vless fallbacks -->
  146. <a-form v-for="(fallback, index) in inbound.settings.fallbacks" layout="inline">
  147. <a-divider>
  148. fallback[[ index + 1 ]]
  149. <a-icon type="delete" @click="() => inbound.settings.delFallback(index)"
  150. style="color: rgb(255, 77, 79);cursor: pointer;"/>
  151. </a-divider>
  152. <a-form-item label="Name">
  153. <a-input v-model="fallback.name"></a-input>
  154. </a-form-item>
  155. <a-form-item label="Alpn">
  156. <a-input v-model="fallback.alpn"></a-input>
  157. </a-form-item>
  158. <a-form-item label="Path">
  159. <a-input v-model="fallback.path"></a-input>
  160. </a-form-item>
  161. <a-form-item label="Dest">
  162. <a-input v-model="fallback.dest"></a-input>
  163. </a-form-item>
  164. <a-form-item label="xVer">
  165. <a-input type="number" v-model.number="fallback.xver"></a-input>
  166. </a-form-item>
  167. <a-divider v-if="inbound.settings.fallbacks.length - 1 === index"/>
  168. </a-form>
  169. {{end}}