vless.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. {{define "form/vless"}}
  2. <a-form layout="inline">
  3. <a-collapse activeKey="0" v-for="(vless, index) in inbound.settings.vlesses"
  4. :key="`vless-${index}`">
  5. <a-collapse-panel :class="getHeaderStyle(vless.email)" :header="getHeaderText(vless.email)">
  6. <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>
  7. <a-form layout="inline">
  8. <a-form-item>
  9. <span slot="label">
  10. Email
  11. <a-tooltip>
  12. <template slot="title">
  13. The email must be completely unique
  14. </template>
  15. <!--Renew Svg Icon-->
  16. <svg
  17. @click="getNewEmail(vless)"
  18. 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>
  19. </a-tooltip>
  20. </span>
  21. <a-input v-model.trim="vless.email"></a-input>
  22. </a-form-item>
  23. </a-form>
  24. <a-form-item label="id">
  25. <a-input v-model.trim="vless.id"></a-input>
  26. </a-form-item>
  27. <a-form-item v-if="inbound.xtls" label="flow">
  28. <a-select v-model="inbound.settings.vlesses[index].flow" style="width: 150px">
  29. <a-select-option value="" selected>none</a-select-option>
  30. <a-select-option v-for="key in XTLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  31. </a-select>
  32. </a-form-item>
  33. <a-form-item v-else-if="inbound.canEnableTlsFlow()" label="flow" layout="inline">
  34. <a-select v-model="inbound.settings.vlesses[index].flow" style="width: 150px">
  35. <a-select-option value="" selected>none</a-select-option>
  36. <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  37. </a-select>
  38. </a-form-item>
  39. <a-form-item v-if="inbound.tls" label="utls" layout="inline">
  40. <a-select v-model="inbound.settings.vlesses[index].fingerprint" label="utls" style="width: 150px">
  41. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  42. </a-select>
  43. </a-form-item>
  44. <a-form-item>
  45. <span slot="label">
  46. <span >{{ i18n "pages.inbounds.totalFlow" }}</span>(GB)
  47. <a-tooltip>
  48. <template slot="title">
  49. 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span>
  50. </template>
  51. <a-icon type="question-circle" theme="filled"></a-icon>
  52. </a-tooltip>
  53. </span>
  54. <a-input-number v-model="vless._totalGB" :min="0"></a-input-number>
  55. </a-form-item>
  56. <a-form-item>
  57. <span slot="label">
  58. <span >{{ i18n "pages.inbounds.expireDate" }}</span>
  59. <a-tooltip>
  60. <template slot="title">
  61. <span>{{ i18n "pages.inbounds.leaveBlankToNeverExpire" }}</span>
  62. </template>
  63. <a-icon type="question-circle" theme="filled"></a-icon>
  64. </a-tooltip>
  65. </span>
  66. <a-date-picker :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD HH:mm"
  67. v-model="vless._expiryTime" style="width: 300px;"></a-date-picker>
  68. </a-form-item>
  69. <a-form layout="inline">
  70. <a-tooltip v-if="vless._totalGB > 0">
  71. <template slot="title">
  72. reset traffic
  73. </template>
  74. <span style="color: #FF4D4F">
  75. <a-icon type="delete" @click="resetClientTraffic(vless,$event)"></a-icon>
  76. </span>
  77. </a-tooltip>
  78. <a-tag color="blue">[[ sizeFormat(getUpStats(vless.email)) ]] / [[ sizeFormat(getDownStats(vless.email)) ]]</a-tag>
  79. <a-tag v-if="vless._totalGB > 0" color="red">used : [[ sizeFormat(getUpStats(vless.email) + getDownStats(vless.email)) ]]</a-tag>
  80. <a-tag>
  81. <svg
  82. @click="addClient(inbound.protocol,vless, inbound.settings.vlesses)"
  83. xmlns="http://www.w3.org/2000/svg"
  84. viewBox="0 0 22 22"
  85. width="22"
  86. height="22"
  87. class="mt-2 cursor-pointer"
  88. >
  89. <path fill="none" d="M0 0h24v24H0z" />
  90. <path
  91. fill="green"
  92. 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"
  93. />
  94. </svg>
  95. </a-tag>
  96. <a-tag v-show="inbound.settings.vlesses.length > 1">
  97. <svg
  98. @click="removeClient(index, inbound.settings.vlesses)"
  99. xmlns="http://www.w3.org/2000/svg"
  100. viewBox="0 0 22 22"
  101. width="22"
  102. height="22"
  103. class="mt-2 cursor-pointer"
  104. >
  105. <path fill="none" d="M0 0h24v24H0z" />
  106. <path
  107. fill="#EC4899"
  108. 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"
  109. />
  110. </svg>
  111. </a-tag>
  112. </a-form>
  113. </a-form>
  114. <a-form layout="inline">
  115. <a-form-item label="fallbacks">
  116. <a-row>
  117. <a-button type="primary" size="small"
  118. @click="inbound.settings.addFallback()">
  119. +
  120. </a-button>
  121. </a-row>
  122. </a-form-item>
  123. </a-form>
  124. <!-- vless fallbacks -->
  125. <a-form v-for="(fallback, index) in inbound.settings.fallbacks" layout="inline">
  126. <a-divider>
  127. fallback[[ index + 1 ]]
  128. <a-icon type="delete" @click="() => inbound.settings.delFallback(index)"
  129. style="color: rgb(255, 77, 79);cursor: pointer;"/>
  130. </a-divider>
  131. <a-form-item label="name">
  132. <a-input v-model="fallback.name"></a-input>
  133. </a-form-item>
  134. <a-form-item label="alpn">
  135. <a-input v-model="fallback.alpn"></a-input>
  136. </a-form-item>
  137. <a-form-item label="path">
  138. <a-input v-model="fallback.path"></a-input>
  139. </a-form-item>
  140. <a-form-item label="dest">
  141. <a-input v-model="fallback.dest"></a-input>
  142. </a-form-item>
  143. <a-form-item label="xver">
  144. <a-input type="number" v-model.number="fallback.xver"></a-input>
  145. </a-form-item>
  146. <a-divider v-if="inbound.settings.fallbacks.length - 1 === index"/>
  147. </a-form>
  148. {{end}}