1
0

client.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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="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.canEnableTlsFlow()" 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 TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  111. </a-select>
  112. </a-form-item>
  113. <a-form-item>
  114. <template slot="label">
  115. <a-tooltip>
  116. <template slot="title">
  117. 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span>
  118. </template>
  119. {{ i18n "pages.inbounds.totalFlow" }}
  120. <a-icon type="question-circle"></a-icon>
  121. </a-tooltip>
  122. </template>
  123. <a-input-number v-model="client._totalGB" :min="0"></a-input-number>
  124. </a-form-item>
  125. <a-form-item v-if="isEdit && clientStats" label='{{ i18n "usage" }}'>
  126. <a-tag :color="clientUsageColor(clientStats, app.trafficDiff)">
  127. [[ sizeFormat(clientStats.up) ]] /
  128. [[ sizeFormat(clientStats.down) ]]
  129. ([[ sizeFormat(clientStats.up + clientStats.down) ]])
  130. </a-tag>
  131. <a-tooltip>
  132. <template slot="title">{{ i18n "pages.inbounds.resetTraffic" }}</template>
  133. <a-icon type="retweet"
  134. @click="resetClientTraffic(client.email,clientStats.inboundId,$event.target)"
  135. v-if="client.email.length > 0"></a-icon>
  136. </a-tooltip>
  137. </a-form-item>
  138. <a-form-item label='{{ i18n "pages.client.delayedStart" }}'>
  139. <a-switch v-model="delayedStart" @click="client._expiryTime=0"></a-switch>
  140. </a-form-item>
  141. <a-form-item v-if="delayedStart" label='{{ i18n "pages.client.expireDays" }}'>
  142. <a-input-number v-model.number="delayedExpireDays" :min="0"></a-input-number>
  143. </a-form-item>
  144. <a-form-item v-else>
  145. <template slot="label">
  146. <a-tooltip>
  147. <template slot="title">{{ i18n "pages.inbounds.leaveBlankToNeverExpire" }}</template>
  148. {{ i18n "pages.inbounds.expireDate" }}
  149. <a-icon type="question-circle"></a-icon>
  150. </a-tooltip>
  151. </template>
  152. <a-date-picker v-if="datepicker == 'gregorian'" :show-time="{ format: 'HH:mm:ss' }" format="YYYY-MM-DD HH:mm:ss"
  153. :dropdown-class-name="themeSwitcher.currentTheme" v-model="client._expiryTime"></a-date-picker>
  154. <persian-datepicker v-else placeholder='{{ i18n "pages.settings.datepickerPlaceholder" }}'
  155. value="client._expiryTime" v-model="client._expiryTime"></persian-datepicker>
  156. <a-tag color="red" v-if="isEdit && isExpiry">Expired</a-tag>
  157. </a-form-item>
  158. <a-form-item v-if="client.expiryTime != 0">
  159. <template slot="label">
  160. <a-tooltip>
  161. <template slot="title">{{ i18n "pages.client.renewDesc" }}</template>
  162. {{ i18n "pages.client.renew" }}
  163. <a-icon type="question-circle"></a-icon>
  164. </a-tooltip>
  165. </template>
  166. <a-input-number v-model.number="client.reset" :min="0"></a-input-number>
  167. </a-form-item>
  168. </a-form>
  169. {{end}}