client.html 7.4 KB

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