client.html 8.5 KB

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