client.html 8.7 KB

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