vless.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. {{define "form/vless"}}
  2. <a-form layout="inline">
  3. <label style="color: green;">{{ 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" style="width: 150px;"></a-input>
  23. </a-form-item>
  24. <a-form-item label="ID">
  25. <a-input v-model.trim="vless.id" style="width: 300px;" ></a-input>
  26. </a-form-item>
  27. <a-form-item>
  28. <span slot="label">
  29. IP Count Limit
  30. <a-tooltip>
  31. <template slot="title">
  32. disable inbound if more than entered count (0 for disable limit ip)
  33. </template>
  34. <a-icon type="question-circle" theme="filled"></a-icon>
  35. </a-tooltip>
  36. </span>
  37. <a-input type="number" v-model.number="vless.limitIp" min="0" style="width: 70px;"></a-input>
  38. </a-form-item>
  39. <a-form-item v-if="vless.email && vless.limitIp > 0 && isEdit">
  40. <span slot="label">
  41. IP log
  42. <a-tooltip>
  43. <template slot="title">
  44. IPs history Log (before enabling inbound after it has been disabled by IP limit, you should clear the log)
  45. </template>
  46. <a-icon type="question-circle" theme="filled"></a-icon>
  47. </a-tooltip>
  48. <a-tooltip>
  49. <template slot="title">
  50. clear the log
  51. </template>
  52. <span style="color: #FF4D4F">
  53. <a-icon type="delete" @click="clearDBClientIps(vless.email,$event)"></a-icon>
  54. </span>
  55. </a-tooltip>
  56. </span>
  57. <a-form layout="block">
  58. <a-textarea readonly @click="getDBClientIps(vless.email,$event)" placeholder="Click To Get IPs" :auto-size="{ minRows: 2, maxRows: 10 }">
  59. </a-textarea>
  60. </a-form>
  61. </a-form-item>
  62. </a-form>
  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>
  76. <span slot="label">
  77. <span >{{ i18n "pages.inbounds.totalFlow" }}</span>(GB)
  78. <a-tooltip>
  79. <template slot="title">
  80. 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span>
  81. </template>
  82. <a-icon type="question-circle" theme="filled"></a-icon>
  83. </a-tooltip>
  84. </span>
  85. <a-input-number v-model="vless._totalGB" :min="0"></a-input-number>
  86. </a-form-item>
  87. <a-form-item>
  88. <span slot="label">
  89. <span >{{ i18n "pages.inbounds.expireDate" }}</span>
  90. <a-tooltip>
  91. <template slot="title">
  92. <span>{{ i18n "pages.inbounds.leaveBlankToNeverExpire" }}</span>
  93. </template>
  94. <a-icon type="question-circle" theme="filled"></a-icon>
  95. </a-tooltip>
  96. </span>
  97. <a-date-picker :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD HH:mm"
  98. v-model="vless._expiryTime" style="width: 300px;"></a-date-picker>
  99. </a-form-item>
  100. <a-form layout="inline">
  101. <a-tooltip v-if="vless._totalGB > 0">
  102. <template slot="title">
  103. {{ i18n "pages.inbounds.resetTraffic" }}
  104. </template>
  105. <span style="color: #FF4D4F">
  106. <a-icon type="delete" @click="resetClientTraffic(vless,$event)"></a-icon>
  107. </span>
  108. </a-tooltip>
  109. <a-tag color="blue">[[ sizeFormat(getUpStats(vless.email)) ]] / [[ sizeFormat(getDownStats(vless.email)) ]]</a-tag>
  110. <a-tag v-if="vless._totalGB > 0" color="red">used : [[ sizeFormat(getUpStats(vless.email) + getDownStats(vless.email)) ]]</a-tag>
  111. <a-tag v-show="inbound.settings.vlesses.length > 1" @click="removeClient(index, inbound.settings.vlesses)">
  112. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" width="22" height="22" class="mt-2 cursor-pointer">
  113. <path fill="none" d="M0 0h24v24H0z" />
  114. <path fill="#EC4899"
  115. 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"
  116. />
  117. </svg>
  118. </a-tag>
  119. </a-form>
  120. </a-collapse-panel>
  121. </a-collapse>
  122. <a-tag @click="addClient(inbound.protocol, inbound.settings.vlesses)">
  123. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" class="ml-2 cursor-pointer">
  124. <path fill="none" d="M0 0h24v24H0z" />
  125. <path fill="green"
  126. 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"
  127. />
  128. </svg>
  129. </a-tag>
  130. <template v-if="inbound.isTcp && inbound.tls">
  131. <a-form layout="inline">
  132. <a-form-item label="Fallbacks">
  133. <a-row>
  134. <a-button type="primary" size="small"
  135. @click="inbound.settings.addFallback()">
  136. +
  137. </a-button>
  138. </a-row>
  139. </a-form-item>
  140. </a-form>
  141. <!-- vless fallbacks -->
  142. <a-form v-for="(fallback, index) in inbound.settings.fallbacks" layout="inline">
  143. <a-divider>
  144. fallback[[ index + 1 ]]
  145. <a-icon type="delete" @click="() => inbound.settings.delFallback(index)"
  146. style="color: rgb(255, 77, 79);cursor: pointer;"/>
  147. </a-divider>
  148. <a-form-item label="name">
  149. <a-input v-model="fallback.name"></a-input>
  150. </a-form-item>
  151. <a-form-item label="alpn">
  152. <a-input v-model="fallback.alpn"></a-input>
  153. </a-form-item>
  154. <a-form-item label="path">
  155. <a-input v-model="fallback.path"></a-input>
  156. </a-form-item>
  157. <a-form-item label="dest">
  158. <a-input v-model="fallback.dest"></a-input>
  159. </a-form-item>
  160. <a-form-item label="xver">
  161. <a-input type="number" v-model.number="fallback.xver"></a-input>
  162. </a-form-item>
  163. <a-divider v-if="inbound.settings.fallbacks.length - 1 === index"/>
  164. </a-form>
  165. </template>
  166. {{end}}