1
0

client.html 8.4 KB

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