client.html 8.1 KB

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