client.html 7.9 KB

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