client.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. {{define "form/client"}}
  2. <a-form layout="horizontal" v-if="client" :colon="false"
  3. :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
  4. <a-form-item label='{{ i18n "pages.inbounds.enable" }}'>
  5. <a-switch v-model="client.enable"></a-switch>
  6. </a-form-item>
  7. <a-form-item>
  8. <template slot="label">
  9. <a-tooltip>
  10. <template slot="title">
  11. <span>{{ i18n "pages.inbounds.emailDesc" }}</span>
  12. </template>
  13. {{ i18n "pages.inbounds.email" }}
  14. <a-icon type="sync"
  15. @click="client.email = RandomUtil.randomLowerAndNum(9)"></a-icon>
  16. </a-tooltip>
  17. </template>
  18. <a-input v-model.trim="client.email"></a-input>
  19. </a-form-item>
  20. <a-form-item
  21. v-if="inbound.protocol === Protocols.TROJAN || inbound.protocol === Protocols.SHADOWSOCKS">
  22. <template slot="label">
  23. <a-tooltip>
  24. <template slot="title">
  25. <span>{{ i18n "reset" }}</span>
  26. </template>
  27. {{ i18n "password" }}
  28. <a-icon v-if="inbound.protocol === Protocols.SHADOWSOCKS"
  29. @click="client.password = RandomUtil.randomShadowsocksPassword(inbound.settings.method)"
  30. type="sync"></a-icon>
  31. <a-icon v-if="inbound.protocol === Protocols.TROJAN"
  32. @click="client.password = RandomUtil.randomSeq(10)"
  33. type="sync"> </a-icon>
  34. </a-tooltip>
  35. </template>
  36. <a-input v-model.trim="client.password"></a-input>
  37. </a-form-item>
  38. <a-form-item v-if="inbound.protocol === Protocols.HYSTERIA">
  39. <template slot="label">
  40. <a-tooltip>
  41. <template slot="title">
  42. <span>{{ i18n "reset" }}</span>
  43. </template>
  44. Auth Password
  45. <a-icon @click="client.auth = RandomUtil.randomSeq(10)"
  46. type="sync"></a-icon>
  47. </a-tooltip>
  48. </template>
  49. <a-input v-model.trim="client.auth"></a-input>
  50. </a-form-item>
  51. <a-form-item
  52. v-if="inbound.protocol === Protocols.VMESS || inbound.protocol === Protocols.VLESS">
  53. <template slot="label">
  54. <a-tooltip>
  55. <template slot="title">
  56. <span>{{ i18n "reset" }}</span>
  57. </template>
  58. ID <a-icon @click="client.id = RandomUtil.randomUUID()"
  59. type="sync"></a-icon>
  60. </a-tooltip>
  61. </template>
  62. <a-input v-model.trim="client.id"></a-input>
  63. </a-form-item>
  64. <a-form-item v-if="inbound.protocol === Protocols.VMESS"
  65. label='{{ i18n "security" }}'>
  66. <a-select v-model="client.security"
  67. :dropdown-class-name="themeSwitcher.currentTheme">
  68. <a-select-option v-for="key in USERS_SECURITY" :value="key">[[ key
  69. ]]</a-select-option>
  70. </a-select>
  71. </a-form-item>
  72. <a-form-item v-if="client.email && app.subSettings?.enable">
  73. <template slot="label">
  74. <a-tooltip>
  75. <template slot="title">
  76. <span>{{ i18n "pages.inbounds.subscriptionDesc" }}</span>
  77. </template>
  78. Subscription
  79. <a-icon @click="client.subId = RandomUtil.randomLowerAndNum(16)"
  80. type="sync"></a-icon>
  81. </a-tooltip>
  82. </template>
  83. <a-input v-model.trim="client.subId"></a-input>
  84. </a-form-item>
  85. <a-form-item v-if="client.email && app.tgBotEnable">
  86. <template slot="label">
  87. <a-tooltip>
  88. <template slot="title">
  89. <span>{{ i18n "pages.inbounds.telegramDesc" }}</span>
  90. </template>
  91. Telegram ChatID
  92. <a-icon type="question-circle"></a-icon>
  93. </a-tooltip>
  94. </template>
  95. <a-input-number :style="{ width: '50%' }" v-model.number="client.tgId"
  96. min="0"></a-input-number>
  97. </a-form-item>
  98. <a-form-item v-if="client.email" label='{{ i18n "comment" }}'>
  99. <a-input v-model.trim="client.comment"></a-input>
  100. </a-form-item>
  101. <a-form-item v-if="app.ipLimitEnable">
  102. <template slot="label">
  103. <a-tooltip>
  104. <template slot="title">
  105. <span>{{ i18n "pages.inbounds.IPLimitDesc"}}</span>
  106. </template>
  107. <span>{{ i18n "pages.inbounds.IPLimit"}} </span>
  108. <a-icon type="question-circle"></a-icon>
  109. </a-tooltip>
  110. </template>
  111. <a-input-number v-model.number="client.limitIp"
  112. min="0"></a-input-number>
  113. </a-form-item>
  114. <a-form-item
  115. v-if="app.ipLimitEnable && client.limitIp > 0 && client.email && isEdit">
  116. <template slot="label">
  117. <a-tooltip>
  118. <template slot="title">
  119. <span>{{ i18n "pages.inbounds.IPLimitlogDesc" }}</span>
  120. </template>
  121. <span>{{ i18n "pages.inbounds.IPLimitlog" }} </span>
  122. <a-icon type="question-circle"></a-icon>
  123. </a-tooltip>
  124. </template>
  125. <a-tooltip>
  126. <template slot="title">
  127. <span>{{ i18n "pages.inbounds.IPLimitlogclear" }}</span>
  128. </template>
  129. <span :style="{ color: '#FF4D4F' }">
  130. <a-icon type="delete"
  131. @click="clearDBClientIps(client.email)"></a-icon>
  132. </span>
  133. </a-tooltip>
  134. <a-form layout="block">
  135. <a-textarea id="clientIPs" readonly
  136. @click="getDBClientIps(client.email)"
  137. placeholder="Click To Get IPs"
  138. :auto-size="{ minRows: 5, maxRows: 10 }">
  139. </a-textarea>
  140. </a-form>
  141. </a-form-item>
  142. <a-form-item v-if="inbound.canEnableTlsFlow()" label='Flow'>
  143. <a-select v-model="client.flow"
  144. :dropdown-class-name="themeSwitcher.currentTheme">
  145. <a-select-option value selected>{{ i18n "none" }}</a-select-option>
  146. <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key
  147. ]]</a-select-option>
  148. </a-select>
  149. </a-form-item>
  150. <a-form-item>
  151. <template slot="label">
  152. <a-tooltip>
  153. <template slot="title">
  154. 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span>
  155. </template>
  156. {{ i18n "pages.inbounds.totalFlow" }}
  157. <a-icon type="question-circle"></a-icon>
  158. </a-tooltip>
  159. </template>
  160. <a-input-number v-model.number="client._totalGB"
  161. :min="0"></a-input-number>
  162. </a-form-item>
  163. <a-form-item v-if="isEdit && clientStats" label='{{ i18n "usage" }}'>
  164. <a-tag
  165. :color="ColorUtils.clientUsageColor(clientStats, app.trafficDiff)">
  166. [[ SizeFormatter.sizeFormat(clientStats.up) ]] /
  167. [[ SizeFormatter.sizeFormat(clientStats.down) ]]
  168. ([[ SizeFormatter.sizeFormat(clientStats.up + clientStats.down) ]])
  169. </a-tag>
  170. <a-tooltip>
  171. <template slot="title">{{ i18n "pages.inbounds.resetTraffic"
  172. }}</template>
  173. <a-icon type="retweet"
  174. @click="resetClientTraffic(client.email,clientStats.inboundId,$event.target)"
  175. v-if="client.email.length > 0"></a-icon>
  176. </a-tooltip>
  177. </a-form-item>
  178. <a-form-item label='{{ i18n "pages.client.delayedStart" }}'>
  179. <a-switch v-model="delayedStart"
  180. @click="client._expiryTime=0"></a-switch>
  181. </a-form-item>
  182. <a-form-item v-if="delayedStart"
  183. label='{{ i18n "pages.client.expireDays" }}'>
  184. <a-input-number v-model.number="delayedExpireDays"
  185. :min="0"></a-input-number>
  186. </a-form-item>
  187. <a-form-item v-else>
  188. <template slot="label">
  189. <a-tooltip>
  190. <template slot="title">{{ i18n
  191. "pages.inbounds.leaveBlankToNeverExpire" }}</template>
  192. {{ i18n "pages.inbounds.expireDate" }}
  193. <a-icon type="question-circle"></a-icon>
  194. </a-tooltip>
  195. </template>
  196. <a-date-picker v-if="datepicker == 'gregorian'"
  197. :show-time="{ format: 'HH:mm:ss' }" format="YYYY-MM-DD HH:mm:ss"
  198. :dropdown-class-name="themeSwitcher.currentTheme"
  199. v-model="client._expiryTime"></a-date-picker>
  200. <a-persian-datepicker v-else
  201. placeholder='{{ i18n "pages.settings.datepickerPlaceholder" }}'
  202. value="client._expiryTime"
  203. v-model="client._expiryTime"></a-persian-datepicker>
  204. <a-tag color="red" v-if="isEdit && isExpiry">Expired</a-tag>
  205. </a-form-item>
  206. <a-form-item v-if="client.expiryTime != 0">
  207. <template slot="label">
  208. <a-tooltip>
  209. <template slot="title">{{ i18n "pages.client.renewDesc"
  210. }}</template>
  211. {{ i18n "pages.client.renew" }}
  212. <a-icon type="question-circle"></a-icon>
  213. </a-tooltip>
  214. </template>
  215. <a-input-number v-model.number="client.reset" :min="0"></a-input-number>
  216. </a-form-item>
  217. </a-form>
  218. {{end}}