inbound.html 5.5 KB

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