1
0

inbound.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. {{define "form/inbound"}}
  2. <!-- base -->
  3. <a-form :colon="false" :label-col="{ md: {span:8} }"
  4. :wrapper-col="{ md: {span:14} }">
  5. <a-form-item label='{{ i18n "enable" }}'>
  6. <a-switch v-model="dbInbound.enable"></a-switch>
  7. </a-form-item>
  8. <a-form-item label='{{ i18n "remark" }}'>
  9. <a-input v-model.trim="dbInbound.remark"></a-input>
  10. </a-form-item>
  11. <a-form-item label='{{ i18n "protocol" }}'>
  12. <a-select v-model="inbound.protocol" :disabled="isEdit"
  13. :dropdown-class-name="themeSwitcher.currentTheme">
  14. <a-select-option v-for="p in Protocols" :key="p" :value="p">[[ p
  15. ]]</a-select-option>
  16. </a-select>
  17. </a-form-item>
  18. <a-form-item>
  19. <template slot="label">
  20. <a-tooltip>
  21. <template slot="title">
  22. <span>{{ i18n "pages.inbounds.monitorDesc" }}</span>
  23. </template>
  24. {{ i18n "monitor" }}
  25. <a-icon type="question-circle"></a-icon>
  26. </a-tooltip>
  27. </template>
  28. <a-input v-model.trim="inbound.listen"></a-input>
  29. </a-form-item>
  30. <a-form-item label='{{ i18n "pages.inbounds.port" }}'>
  31. <a-input-number v-model.number="inbound.port" :min="1"
  32. :max="65535"></a-input-number>
  33. </a-form-item>
  34. <a-form-item>
  35. <template slot="label">
  36. <a-tooltip>
  37. <template slot="title">
  38. 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span>
  39. </template>
  40. {{ i18n "pages.inbounds.totalFlow" }}
  41. <a-icon type="question-circle"></a-icon>
  42. </a-tooltip>
  43. </template>
  44. <a-input-number v-model.number="dbInbound.totalGB"
  45. :min="0"></a-input-number>
  46. </a-form-item>
  47. <a-form-item>
  48. <template slot="label">
  49. <a-tooltip>
  50. <template slot="title">
  51. <span>{{ i18n "pages.inbounds.periodicTrafficResetDesc"
  52. }}</span>
  53. <br
  54. v-if="dbInbound.lastTrafficResetTime && dbInbound.lastTrafficResetTime > 0">
  55. <span
  56. v-if="dbInbound.lastTrafficResetTime && dbInbound.lastTrafficResetTime > 0">
  57. <strong>{{ i18n "pages.inbounds.lastReset" }}:</strong>
  58. <span>[[
  59. IntlUtil.formatDate(dbInbound.lastTrafficResetTime)
  60. ]]</span>
  61. </span>
  62. </template>
  63. {{ i18n "pages.inbounds.periodicTrafficResetTitle" }}
  64. <a-icon type="question-circle"></a-icon>
  65. </a-tooltip>
  66. </template>
  67. <a-select v-model="dbInbound.trafficReset"
  68. :dropdown-class-name="themeSwitcher.currentTheme">
  69. <a-select-option value="never">{{ i18n
  70. "pages.inbounds.periodicTrafficReset.never" }}</a-select-option>
  71. <a-select-option value="daily">{{ i18n
  72. "pages.inbounds.periodicTrafficReset.daily" }}</a-select-option>
  73. <a-select-option value="weekly">{{ i18n
  74. "pages.inbounds.periodicTrafficReset.weekly"
  75. }}</a-select-option>
  76. <a-select-option value="monthly">{{ i18n
  77. "pages.inbounds.periodicTrafficReset.monthly"
  78. }}</a-select-option>
  79. </a-select>
  80. </a-form-item>
  81. <a-form-item>
  82. <template slot="label">
  83. <a-tooltip>
  84. <template slot="title">
  85. <span>{{ i18n "pages.inbounds.leaveBlankToNeverExpire"
  86. }}</span>
  87. </template>
  88. {{ i18n "pages.inbounds.expireDate" }}
  89. <a-icon type="question-circle"></a-icon>
  90. </a-tooltip>
  91. </template>
  92. <a-date-picker :style="{ width: '100%' }"
  93. v-if="datepicker == 'gregorian'" :show-time="{ format: 'HH:mm:ss' }"
  94. format="YYYY-MM-DD HH:mm:ss"
  95. :dropdown-class-name="themeSwitcher.currentTheme"
  96. v-model="dbInbound._expiryTime"></a-date-picker>
  97. <a-persian-datepicker v-else
  98. placeholder='{{ i18n "pages.settings.datepickerPlaceholder" }}'
  99. value="dbInbound._expiryTime" v-model="dbInbound._expiryTime">
  100. </a-persian-datepicker>
  101. </a-form-item>
  102. </a-form>
  103. <!-- vmess settings -->
  104. <template v-if="inbound.protocol === Protocols.VMESS">
  105. {{template "form/vmess"}}
  106. </template>
  107. <!-- vless settings -->
  108. <template v-if="inbound.protocol === Protocols.VLESS">
  109. {{template "form/vless"}}
  110. </template>
  111. <!-- trojan settings -->
  112. <template v-if="inbound.protocol === Protocols.TROJAN">
  113. {{template "form/trojan"}}
  114. </template>
  115. <!-- shadowsocks -->
  116. <template v-if="inbound.protocol === Protocols.SHADOWSOCKS">
  117. {{template "form/shadowsocks"}}
  118. </template>
  119. <!-- tunnel -->
  120. <template v-if="inbound.protocol === Protocols.TUNNEL">
  121. {{template "form/tunnel"}}
  122. </template>
  123. <!-- mixed -->
  124. <template v-if="inbound.protocol === Protocols.MIXED">
  125. {{template "form/mixed"}}
  126. </template>
  127. <!-- http -->
  128. <template v-if="inbound.protocol === Protocols.HTTP">
  129. {{template "form/http"}}
  130. </template>
  131. <!-- wireguard -->
  132. <template v-if="inbound.protocol === Protocols.WIREGUARD">
  133. {{template "form/wireguard"}}
  134. </template>
  135. <!-- tun -->
  136. <template v-if="inbound.protocol === Protocols.TUN">
  137. {{template "form/tun"}}
  138. </template>
  139. <!-- stream settings -->
  140. <template v-if="inbound.canEnableStream()">
  141. {{template "form/streamSettings"}}
  142. {{template "form/externalProxy" }}
  143. </template>
  144. <!-- tls settings -->
  145. <template v-if="inbound.canEnableTls()">
  146. {{template "form/tlsSettings"}}
  147. </template>
  148. <!-- sniffing -->
  149. <a-collapse>
  150. <a-collapse-panel header='Sniffing'>
  151. {{template "form/sniffing"}}
  152. </a-collapse-panel>
  153. </a-collapse>
  154. {{end}}