trojan.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. {{define "form/trojan"}}
  2. <a-form layout="inline">
  3. <label>{{ i18n "clients"}} </label>
  4. <a-collapse activeKey="0" v-for="(trojan, index) in inbound.settings.trojans"
  5. :key="`trojan-${index}`">
  6. <a-collapse-panel :class="getHeaderStyle(trojan.email)" :header="getHeaderText(trojan.email)">
  7. <a-tag v-if="isExpiry(index) || ((getUpStats(trojan.email) + getDownStats(trojan.email)) > trojan.totalGB && trojan.totalGB != 0)" color="red" style="margin-bottom: 10px;display: block;text-align: center;">Account is (Expired|Traffic Ended) And Disabled</a-tag>
  8. <a-form layout="inline">
  9. <a-form-item>
  10. <span slot="label">
  11. Email
  12. <a-tooltip>
  13. <template slot="title">
  14. The Email Must Be Completely Unique
  15. </template>
  16. <!--Renew Svg Icon-->
  17. <svg
  18. @click="getNewEmail(trojan)"
  19. xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="anticon anticon-question-circle" viewBox="0 0 16 16"> <path d="M11.534 7h3.932a.25.25 0 0 1 .192.41l-1.966 2.36a.25.25 0 0 1-.384 0l-1.966-2.36a.25.25 0 0 1 .192-.41zm-11 2h3.932a.25.25 0 0 0 .192-.41L2.692 6.23a.25.25 0 0 0-.384 0L.342 8.59A.25.25 0 0 0 .534 9z"/> <path fill-rule="evenodd" d="M8 3c-1.552 0-2.94.707-3.857 1.818a.5.5 0 1 1-.771-.636A6.002 6.002 0 0 1 13.917 7H12.9A5.002 5.002 0 0 0 8 3zM3.1 9a5.002 5.002 0 0 0 8.757 2.182.5.5 0 1 1 .771.636A6.002 6.002 0 0 1 2.083 9H3.1z"/> </svg>
  20. </a-tooltip>
  21. </span>
  22. <a-input v-model.trim="trojan.email"></a-input>
  23. </a-form-item>
  24. </a-form>
  25. <a-form-item label="Password">
  26. <a-input v-model.trim="trojan.password"></a-input>
  27. </a-form-item>
  28. <a-form-item v-if="inbound.xtls" label="Flow">
  29. <a-select v-model="trojan.flow" style="width: 150px">
  30. <a-select-option value="">{{ i18n "none" }}</a-select-option>
  31. <a-select-option v-for="key in XTLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
  32. </a-select>
  33. </a-form-item>
  34. <a-form-item>
  35. <span slot="label">
  36. <span >{{ i18n "pages.inbounds.totalFlow" }}</span>(GB)
  37. <a-tooltip>
  38. <template slot="title">
  39. 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span>
  40. </template>
  41. <a-icon type="question-circle" theme="filled"></a-icon>
  42. </a-tooltip>
  43. </span>
  44. <a-input-number v-model="trojan._totalGB" :min="0"></a-input-number>
  45. </a-form-item>
  46. <a-form-item>
  47. <span slot="label">
  48. <span >{{ i18n "pages.inbounds.expireDate" }}</span>
  49. <a-tooltip>
  50. <template slot="title">
  51. <span>{{ i18n "pages.inbounds.leaveBlankToNeverExpire" }}</span>
  52. </template>
  53. <a-icon type="question-circle" theme="filled"></a-icon>
  54. </a-tooltip>
  55. </span>
  56. <a-date-picker :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD HH:mm"
  57. v-model="trojan._expiryTime" style="width: 300px;"></a-date-picker>
  58. </a-form-item>
  59. <a-form layout="inline">
  60. <a-tooltip v-if="trojan._totalGB > 0">
  61. <template slot="title">
  62. {{ i18n "pages.inbounds.resetTraffic" }}
  63. </template>
  64. <span style="color: #FF4D4F">
  65. <a-icon type="delete" @click="resetClientTraffic(trojan,$event)"></a-icon>
  66. </span>
  67. </a-tooltip>
  68. <a-tag color="blue">[[ sizeFormat(getUpStats(trojan.email)) ]] / [[ sizeFormat(getDownStats(trojan.email)) ]]</a-tag>
  69. <a-tag v-if="trojan._totalGB > 0" color="red">used : [[ sizeFormat(getUpStats(trojan.email) + getDownStats(trojan.email)) ]]</a-tag>
  70. <a-tag v-show="inbound.settings.trojans.length > 1" @click="removeClient(index, inbound.settings.trojans)">
  71. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" width="22" height="22" class="mt-2 cursor-pointer">
  72. <path fill="none" d="M0 0h24v24H0z" />
  73. <path fill="#EC4899"
  74. d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-9.414l2.828-2.829 1.415 1.415L13.414 12l2.829 2.828-1.415 1.415L12 13.414l-2.828 2.829-1.415-1.415L10.586 12 7.757 9.172l1.415-1.415L12 10.586z"
  75. />
  76. </svg>
  77. </a-tag>
  78. </a-form>
  79. </a-collapse-panel>
  80. </a-collapse>
  81. <a-tag @click="addClient(inbound.protocol, inbound.settings.trojans)">
  82. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" class="ml-2 cursor-pointer">
  83. <path fill="none" d="M0 0h24v24H0z" />
  84. <path fill="green"
  85. d="M11 11V7h2v4h4v2h-4v4h-2v-4H7v-2h4zm1 11C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z"
  86. />
  87. </svg>
  88. </a-tag>
  89. <a-form layout="inline">
  90. <a-form-item label="Fallbacks">
  91. <a-row>
  92. <a-button type="primary" size="small"
  93. @click="inbound.settings.addTrojanFallback()">
  94. +
  95. </a-button>
  96. </a-row>
  97. </a-form-item>
  98. </a-form>
  99. <!-- trojan fallbacks -->
  100. <a-form v-for="(fallback, index) in inbound.settings.fallbacks" layout="inline">
  101. <a-divider>
  102. fallback[[ index + 1 ]]
  103. <a-icon type="delete" @click="() => inbound.settings.delTrojanFallback(index)"
  104. style="color: rgb(255, 77, 79);cursor: pointer;"/>
  105. </a-divider>
  106. <a-form-item label="Name">
  107. <a-input v-model="fallback.name"></a-input>
  108. </a-form-item>
  109. <a-form-item label="Alpn">
  110. <a-input v-model="fallback.alpn"></a-input>
  111. </a-form-item>
  112. <a-form-item label="Path">
  113. <a-input v-model="fallback.path"></a-input>
  114. </a-form-item>
  115. <a-form-item label="Dest">
  116. <a-input v-model="fallback.dest"></a-input>
  117. </a-form-item>
  118. <a-form-item label="xVer">
  119. <a-input type="number" v-model.number="fallback.xver"></a-input>
  120. </a-form-item>
  121. <a-divider v-if="inbound.settings.fallbacks.length - 1 === index"/>
  122. </a-form>
  123. {{end}}