client.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. {{define "form/client"}}
  2. <a-form layout="inline" v-if="client">
  3. <template v-if="isEdit">
  4. <a-tag v-if="isExpiry || isTrafficExhausted" color="red" style="margin-bottom: 10px;display: block;text-align: center;">Account is (Expired|Traffic Ended) And Disabled</a-tag>
  5. </template>
  6. <a-form-item>
  7. <span slot="label">
  8. Email
  9. <a-tooltip>
  10. <template slot="title">
  11. The Email Must Be Completely Unique
  12. </template>
  13. <a-icon type="sync" @click="getNewEmail(client)"></a-icon>
  14. </a-tooltip>
  15. </span>
  16. <a-input v-model.trim="client.email" style="width: 150px;" ></a-input>
  17. </a-form-item>
  18. <a-form-item label="Password" v-if="inbound.protocol === Protocols.TROJAN">
  19. <a-input v-model.trim="client.password" style="width: 150px;" ></a-input>
  20. </a-form-item>
  21. <a-form-item label="ID" v-if="inbound.protocol === Protocols.VMESS || inbound.protocol === Protocols.VLESS">
  22. <a-input v-model.trim="client.id" style="width: 300px;"></a-input>
  23. </a-form-item>
  24. <a-form-item label='{{ i18n "additional" }} ID' v-if="inbound.protocol === Protocols.VMESS">
  25. <a-input type="number" v-model.number="client.alterId" style="width: 70px;"></a-input>
  26. </a-form-item>
  27. <a-form-item>
  28. <span slot="label">
  29. IP Count Limit
  30. <a-tooltip>
  31. <template slot="title">
  32. Disable inbound if more than entered count (0 for disable limit ip)
  33. </template>
  34. <a-icon type="question-circle" theme="filled"></a-icon>
  35. </a-tooltip>
  36. </span>
  37. <a-input type="number" v-model.number="client.limitIp" min="0" style="width: 70px;" ></a-input>
  38. </a-form-item>
  39. <a-form-item v-if="client.email && client.limitIp > 0 && isEdit">
  40. <span slot="label">
  41. IP Log
  42. <a-tooltip>
  43. <template slot="title">
  44. IPs history Log (before enabling inbound after it has been disabled by IP limit, you should clear the log)
  45. </template>
  46. <a-icon type="question-circle" theme="filled"></a-icon>
  47. </a-tooltip>
  48. <a-tooltip>
  49. <template slot="title">
  50. Clear The Log
  51. </template>
  52. <span style="color: #FF4D4F">
  53. <a-icon type="delete" @click="clearDBClientIps(client.email,$event)"></a-icon>
  54. </span>
  55. </a-tooltip>
  56. </span>
  57. <a-form layout="block">
  58. <a-textarea readonly @click="getDBClientIps(client.email,$event)" placeholder="Click To Get IPs" :auto-size="{ minRows: 2, maxRows: 10 }">
  59. </a-textarea>
  60. </a-form>
  61. </a-form-item>
  62. <a-form-item v-if="inbound.XTLS" label="Flow">
  63. <a-select v-model="client.flow" style="width: 150px">
  64. <a-select-option value="">{{ i18n "none" }}</a-select-option>
  65. <a-select-option v-for="key in XTLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  66. </a-select>
  67. </a-form-item>
  68. <a-form-item v-else-if="inbound.canEnableTlsFlow()" label="Flow" layout="inline">
  69. <a-select v-model="client.flow" style="width: 150px">
  70. <a-select-option value="" selected>{{ i18n "none" }}</a-select-option>
  71. <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  72. </a-select>
  73. </a-form-item>
  74. <a-form-item>
  75. <span slot="label">
  76. <span >{{ i18n "pages.inbounds.totalFlow" }}</span>(GB)
  77. <a-tooltip>
  78. <template slot="title">
  79. 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span>
  80. </template>
  81. <a-icon type="question-circle" theme="filled"></a-icon>
  82. </a-tooltip>
  83. </span>
  84. <a-input-number v-model="client._totalGB":min="0" style="width: 70px;"></a-input-number>
  85. <template v-if="isEdit && clientStats">
  86. {{ i18n "usage" }}:
  87. <a-tag :color="statsColor">
  88. [[ sizeFormat(clientStats.up) ]] /
  89. [[ sizeFormat(clientStats.down) ]]
  90. ([[ sizeFormat(clientStats.up + clientStats.down) ]])
  91. </a-tag>
  92. </template>
  93. </a-form-item>
  94. <a-form-item>
  95. <span slot="label">
  96. <span >{{ i18n "pages.inbounds.expireDate" }}</span>
  97. <a-tooltip>
  98. <template slot="title">
  99. <span>{{ i18n "pages.inbounds.leaveBlankToNeverExpire" }}</span>
  100. </template>
  101. <a-icon type="question-circle" theme="filled"></a-icon>
  102. </a-tooltip>
  103. </span>
  104. <a-date-picker :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD HH:mm"
  105. :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"
  106. v-model="client._expiryTime" style="width: 170px;"></a-date-picker>
  107. <a-tag color="red" v-if="isExpiry">Expired</a-tag>
  108. </a-form-item>
  109. </a-form>
  110. {{end}}