client.html 8.2 KB

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