client.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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)" type="sync"></a-icon>
  27. <a-icon v-if="inbound.protocol === Protocols.TROJAN" @click="client.password = RandomUtil.randomSeq(10)"
  28. type="sync">
  29. </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
  53. <a-icon @click="client.id = RandomUtil.randomUUID()" type="sync"></a-icon>
  54. </a-tooltip>
  55. </template>
  56. <a-input v-model.trim="client.id"></a-input>
  57. </a-form-item>
  58. <a-form-item v-if="inbound.protocol === Protocols.VMESS" label='{{ i18n "security" }}'>
  59. <a-select v-model="client.security" :dropdown-class-name="themeSwitcher.currentTheme">
  60. <a-select-option v-for="key in USERS_SECURITY" :value="key">[[ key ]]</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 ]]</a-select-option>
  130. </a-select>
  131. </a-form-item>
  132. <a-form-item>
  133. <template slot="label">
  134. <a-tooltip>
  135. <template slot="title">
  136. 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span>
  137. </template>
  138. {{ i18n "pages.inbounds.totalFlow" }}
  139. <a-icon type="question-circle"></a-icon>
  140. </a-tooltip>
  141. </template>
  142. <a-input-number v-model.number="client._totalGB" :min="0"></a-input-number>
  143. </a-form-item>
  144. <a-form-item v-if="isEdit && clientStats" label='{{ i18n "usage" }}'>
  145. <a-tag :color="ColorUtils.clientUsageColor(clientStats, app.trafficDiff)">
  146. [[ SizeFormatter.sizeFormat(clientStats.up) ]] / [[
  147. SizeFormatter.sizeFormat(clientStats.down) ]] ([[
  148. SizeFormatter.sizeFormat(clientStats.up + clientStats.down) ]])
  149. </a-tag>
  150. <a-tooltip>
  151. <template slot="title">{{ i18n "pages.inbounds.resetTraffic" }}</template>
  152. <a-icon type="retweet" @click="resetClientTraffic(client.email,clientStats.inboundId,$event.target)"
  153. v-if="client.email.length > 0"></a-icon>
  154. </a-tooltip>
  155. </a-form-item>
  156. <a-form-item label='{{ i18n "pages.client.delayedStart" }}'>
  157. <a-switch v-model="delayedStart" @click="client._expiryTime=0"></a-switch>
  158. </a-form-item>
  159. <a-form-item v-if="delayedStart" label='{{ i18n "pages.client.expireDays" }}'>
  160. <a-input-number v-model.number="delayedExpireDays" :min="0"></a-input-number>
  161. </a-form-item>
  162. <a-form-item v-else>
  163. <template slot="label">
  164. <a-tooltip>
  165. <template slot="title">{{ i18n "pages.inbounds.leaveBlankToNeverExpire" }}</template>
  166. {{ i18n "pages.inbounds.expireDate" }}
  167. <a-icon type="question-circle"></a-icon>
  168. </a-tooltip>
  169. </template>
  170. <a-date-picker v-if="datepicker == 'gregorian'" :show-time="{ format: 'HH:mm:ss' }" format="YYYY-MM-DD HH:mm:ss"
  171. :dropdown-class-name="themeSwitcher.currentTheme" v-model="client._expiryTime"></a-date-picker>
  172. <a-persian-datepicker v-else placeholder='{{ i18n "pages.settings.datepickerPlaceholder" }}'
  173. value="client._expiryTime" v-model="client._expiryTime"></a-persian-datepicker>
  174. <a-tag color="red" v-if="isEdit && isExpiry">Expired</a-tag>
  175. </a-form-item>
  176. <a-form-item v-if="client.expiryTime != 0">
  177. <template slot="label">
  178. <a-tooltip>
  179. <template slot="title">{{ i18n "pages.client.renewDesc" }}</template>
  180. {{ i18n "pages.client.renew" }}
  181. <a-icon type="question-circle"></a-icon>
  182. </a-tooltip>
  183. </template>
  184. <a-input-number v-model.number="client.reset" :min="0"></a-input-number>
  185. </a-form-item>
  186. </a-form>
  187. {{end}}