settings.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. {{ template "page/head_start" .}}
  2. {{ template "page/head_end" .}}
  3. {{ template "page/body_start" .}}
  4. <a-layout id="app" v-cloak :class="themeSwitcher.currentTheme + ' settings-page'">
  5. <a-sidebar></a-sidebar>
  6. <a-layout id="content-layout">
  7. <a-layout-content>
  8. <a-spin :spinning="loadingStates.spinning" :delay="500" tip='{{ i18n "loading"}}'>
  9. <transition name="list" appear>
  10. <a-alert type="error" v-if="confAlerts.length>0 && loadingStates.fetched" :style="{ marginBottom: '10px' }"
  11. message='{{ i18n "secAlertTitle" }}' color="red" show-icon closable>
  12. <template slot="description">
  13. <b>{{ i18n "secAlertConf" }}</b>
  14. <ul>
  15. <li v-for="a in confAlerts">[[ a ]]</li>
  16. </ul>
  17. </template>
  18. </a-alert>
  19. </transition>
  20. <transition name="list" appear>
  21. <template>
  22. <a-row v-if="!loadingStates.fetched">
  23. <a-card
  24. :style="{ textAlign: 'center', padding: '30px 0', marginTop: '10px', background: 'transparent', border: 'none' }">
  25. <a-spin tip='{{ i18n "loading" }}'></a-spin>
  26. </a-card>
  27. </a-row>
  28. <a-row :gutter="[isMobile ? 8 : 16, isMobile ? 0 : 12]" v-else>
  29. <a-col>
  30. <a-card hoverable>
  31. <a-row :style="{ display: 'flex', flexWrap: 'wrap', alignItems: 'center' }">
  32. <a-col :xs="24" :sm="10" :style="{ padding: '4px' }">
  33. <a-space direction="horizontal">
  34. <a-button type="primary" :disabled="saveBtnDisable" @click="updateAllSetting">{{ i18n
  35. "pages.settings.save" }}</a-button>
  36. <a-button type="danger" :disabled="!saveBtnDisable" @click="restartPanel">{{ i18n
  37. "pages.settings.restartPanel" }}</a-button>
  38. </a-space>
  39. </a-col>
  40. <a-col :xs="24" :sm="14">
  41. <template>
  42. <div>
  43. <a-back-top :target="() => document.getElementById('content-layout')"
  44. visibility-height="200"></a-back-top>
  45. <a-alert type="warning" :style="{ float: 'right', width: 'fit-content' }"
  46. message='{{ i18n "pages.settings.infoDesc" }}' show-icon>
  47. </a-alert>
  48. </div>
  49. </template>
  50. </a-col>
  51. </a-row>
  52. </a-card>
  53. </a-col>
  54. <a-col>
  55. <a-tabs default-active-key="1">
  56. <a-tab-pane key="1" :style="{ paddingTop: '20px' }">
  57. <template #tab>
  58. <a-icon type="setting"></a-icon>
  59. <span>{{ i18n "pages.settings.panelSettings" }}</span>
  60. </template>
  61. {{ template "settings/panel/general" . }}
  62. </a-tab-pane>
  63. <a-tab-pane key="2" :style="{ paddingTop: '20px' }">
  64. <template #tab>
  65. <a-icon type="safety"></a-icon>
  66. <span>{{ i18n "pages.settings.securitySettings" }}</span>
  67. </template>
  68. {{ template "settings/panel/security" . }}
  69. </a-tab-pane>
  70. <a-tab-pane key="3" :style="{ paddingTop: '20px' }">
  71. <template #tab>
  72. <a-icon type="message"></a-icon>
  73. <span>{{ i18n "pages.settings.TGBotSettings" }}</span>
  74. </template>
  75. {{ template "settings/panel/telegram" . }}
  76. </a-tab-pane>
  77. <a-tab-pane key="4" :style="{ paddingTop: '20px' }">
  78. <template #tab>
  79. <a-icon type="cloud-server"></a-icon>
  80. <span>{{ i18n "pages.settings.subSettings" }}</span>
  81. </template>
  82. {{ template "settings/panel/subscription/general" . }}
  83. </a-tab-pane>
  84. <a-tab-pane key="5" v-if="allSetting.subJsonEnable" :style="{ paddingTop: '20px' }">
  85. <template #tab>
  86. <a-icon type="code"></a-icon>
  87. <span>{{ i18n "pages.settings.subSettings" }} (JSON)</span>
  88. </template>
  89. {{ template "settings/panel/subscription/json" . }}
  90. </a-tab-pane>
  91. </a-tabs>
  92. </a-col>
  93. </a-row>
  94. </template>
  95. </transition>
  96. </a-spin>
  97. </a-layout-content>
  98. </a-layout>
  99. </a-layout>
  100. {{template "page/body_scripts" .}}
  101. <script src="{{ .base_path }}assets/qrcode/qrious2.min.js?{{ .cur_ver }}"></script>
  102. <script src="{{ .base_path }}assets/otpauth/otpauth.umd.min.js?{{ .cur_ver }}"></script>
  103. <script src="{{ .base_path }}assets/js/model/setting.js?{{ .cur_ver }}"></script>
  104. {{template "component/aSidebar" .}}
  105. {{template "component/aThemeSwitch" .}}
  106. {{template "component/aSettingListItem" .}}
  107. {{template "modals/twoFactorModal"}}
  108. <script>
  109. const app = new Vue({
  110. delimiters: ['[[', ']]'],
  111. mixins: [MediaQueryMixin],
  112. el: '#app',
  113. data: {
  114. themeSwitcher,
  115. loadingStates: {
  116. fetched: false,
  117. spinning: false
  118. },
  119. oldAllSetting: new AllSetting(),
  120. allSetting: new AllSetting(),
  121. saveBtnDisable: true,
  122. user: {},
  123. lang: LanguageManager.getLanguage(),
  124. inboundOptions: [],
  125. remarkModels: { i: 'Inbound', e: 'Email', o: 'Other' },
  126. remarkSeparators: [' ', '-', '_', '@', ':', '~', '|', ',', '.', '/'],
  127. datepickerList: [{ name: 'Gregorian (Standard)', value: 'gregorian' }, { name: 'Jalalian (شمسی)', value: 'jalalian' }],
  128. remarkSample: '',
  129. defaultFragment: {
  130. tag: "fragment",
  131. protocol: "freedom",
  132. settings: {
  133. domainStrategy: "AsIs",
  134. fragment: {
  135. packets: "tlshello",
  136. length: "100-200",
  137. interval: "10-20",
  138. maxSplit: "300-400"
  139. }
  140. },
  141. streamSettings: {
  142. sockopt: {
  143. tcpKeepAliveIdle: 100,
  144. tcpMptcp: true,
  145. penetrate: true
  146. }
  147. }
  148. },
  149. defaultNoises: {
  150. tag: "noises",
  151. protocol: "freedom",
  152. settings: {
  153. domainStrategy: "AsIs",
  154. noises: [
  155. { type: "rand", packet: "10-20", delay: "10-16", applyTo: "ip" },
  156. ],
  157. },
  158. },
  159. defaultMux: {
  160. enabled: true,
  161. concurrency: 8,
  162. xudpConcurrency: 16,
  163. xudpProxyUDP443: "reject"
  164. },
  165. defaultRules: [
  166. {
  167. type: "field",
  168. outboundTag: "direct",
  169. domain: [
  170. "geosite:category-ir"
  171. ]
  172. },
  173. {
  174. type: "field",
  175. outboundTag: "direct",
  176. ip: [
  177. "geoip:private",
  178. "geoip:ir"
  179. ]
  180. },
  181. ],
  182. directIPsOptions: [
  183. { label: 'Private IP', value: 'geoip:private' },
  184. { label: '🇮🇷 Iran', value: 'geoip:ir' },
  185. { label: '🇨🇳 China', value: 'geoip:cn' },
  186. { label: '🇷🇺 Russia', value: 'geoip:ru' },
  187. { label: '🇻🇳 Vietnam', value: 'geoip:vn' },
  188. { label: '🇪🇸 Spain', value: 'geoip:es' },
  189. { label: '🇮🇩 Indonesia', value: 'geoip:id' },
  190. { label: '🇺🇦 Ukraine', value: 'geoip:ua' },
  191. { label: '🇹🇷 Türkiye', value: 'geoip:tr' },
  192. { label: '🇧🇷 Brazil', value: 'geoip:br' },
  193. ],
  194. diretDomainsOptions: [
  195. { label: 'Private DNS', value: 'geosite:private' },
  196. { label: '🇮🇷 Iran', value: 'geosite:category-ir' },
  197. { label: '🇨🇳 China', value: 'geosite:cn' },
  198. { label: '🇷🇺 Russia', value: 'geosite:category-ru' },
  199. { label: 'Apple', value: 'geosite:apple' },
  200. { label: 'Meta', value: 'geosite:meta' },
  201. { label: 'Google', value: 'geosite:google' },
  202. ],
  203. get remarkModel() {
  204. rm = this.allSetting.remarkModel;
  205. return rm.length > 1 ? rm.substring(1).split('') : [];
  206. },
  207. set remarkModel(value) {
  208. rs = this.allSetting.remarkModel[0];
  209. this.allSetting.remarkModel = rs + value.join('');
  210. this.changeRemarkSample();
  211. },
  212. get remarkSeparator() {
  213. return this.allSetting.remarkModel.length > 1 ? this.allSetting.remarkModel.charAt(0) : '-';
  214. },
  215. set remarkSeparator(value) {
  216. this.allSetting.remarkModel = value + this.allSetting.remarkModel.substring(1);
  217. this.changeRemarkSample();
  218. },
  219. get datepicker() {
  220. return this.allSetting.datepicker ? this.allSetting.datepicker : 'gregorian';
  221. },
  222. set datepicker(value) {
  223. this.allSetting.datepicker = value;
  224. },
  225. changeRemarkSample() {
  226. sample = []
  227. this.remarkModel.forEach(r => sample.push(this.remarkModels[r]));
  228. this.remarkSample = sample.length == 0 ? '' : sample.join(this.remarkSeparator);
  229. }
  230. },
  231. methods: {
  232. loading(spinning = true) {
  233. this.loadingStates.spinning = spinning;
  234. },
  235. async getAllSetting() {
  236. const msg = await HttpUtil.post("/panel/setting/all");
  237. if (msg.success) {
  238. if (!this.loadingStates.fetched) {
  239. this.loadingStates.fetched = true
  240. }
  241. this.oldAllSetting = new AllSetting(msg.obj);
  242. this.allSetting = new AllSetting(msg.obj);
  243. app.changeRemarkSample();
  244. this.saveBtnDisable = true;
  245. }
  246. },
  247. async loadInboundTags() {
  248. const msg = await HttpUtil.get("/panel/api/inbounds/list");
  249. if (msg && msg.success && Array.isArray(msg.obj)) {
  250. this.inboundOptions = msg.obj.map(ib => ({
  251. label: `${ib.tag} (${ib.protocol}@${ib.port})`,
  252. value: ib.tag,
  253. }));
  254. } else {
  255. this.inboundOptions = [];
  256. }
  257. },
  258. async updateAllSetting() {
  259. this.loading(true);
  260. const msg = await HttpUtil.post("/panel/setting/update", this.allSetting);
  261. this.loading(false);
  262. if (msg.success) {
  263. await this.getAllSetting();
  264. }
  265. },
  266. async updateUser() {
  267. const sendUpdateUserRequest = async () => {
  268. this.loading(true);
  269. const msg = await HttpUtil.post("/panel/setting/updateUser", this.user);
  270. this.loading(false);
  271. if (msg.success) {
  272. this.user = {};
  273. window.location.replace(basePath + "logout");
  274. }
  275. }
  276. if (this.allSetting.twoFactorEnable) {
  277. twoFactorModal.show({
  278. title: '{{ i18n "pages.settings.security.twoFactorModalChangeCredentialsTitle" }}',
  279. description: '{{ i18n "pages.settings.security.twoFactorModalChangeCredentialsStep" }}',
  280. token: this.allSetting.twoFactorToken,
  281. type: 'confirm',
  282. confirm: (success) => {
  283. if (success) {
  284. sendUpdateUserRequest();
  285. }
  286. }
  287. })
  288. } else {
  289. sendUpdateUserRequest();
  290. }
  291. },
  292. async restartPanel() {
  293. await new Promise(resolve => {
  294. this.$confirm({
  295. title: '{{ i18n "pages.settings.restartPanel" }}',
  296. content: '{{ i18n "pages.settings.restartPanelDesc" }}',
  297. class: themeSwitcher.currentTheme,
  298. okText: '{{ i18n "sure" }}',
  299. cancelText: '{{ i18n "cancel" }}',
  300. onOk: () => resolve(),
  301. });
  302. });
  303. this.loading(true);
  304. const msg = await HttpUtil.post("/panel/setting/restartPanel");
  305. this.loading(false);
  306. if (msg.success) {
  307. this.loading(true);
  308. await PromiseUtil.sleep(5000);
  309. var { webCertFile, webKeyFile, webDomain: host, webPort: port, webBasePath: base } = this.allSetting;
  310. if (host == this.oldAllSetting.webDomain) host = null;
  311. if (port == this.oldAllSetting.webPort) port = null;
  312. const isTLS = webCertFile !== "" || webKeyFile !== "";
  313. const url = URLBuilder.buildURL({ host, port, isTLS, base, path: "panel/settings" });
  314. window.location.replace(url);
  315. }
  316. },
  317. toggleTwoFactor(newValue) {
  318. if (newValue) {
  319. const newTwoFactorToken = RandomUtil.randomBase32String()
  320. twoFactorModal.show({
  321. title: '{{ i18n "pages.settings.security.twoFactorModalSetTitle" }}',
  322. token: newTwoFactorToken,
  323. type: 'set',
  324. confirm: (success) => {
  325. if (success) {
  326. Vue.prototype.$message['success']('{{ i18n "pages.settings.security.twoFactorModalSetSuccess" }}')
  327. this.allSetting.twoFactorToken = newTwoFactorToken
  328. }
  329. this.allSetting.twoFactorEnable = success
  330. }
  331. })
  332. } else {
  333. twoFactorModal.show({
  334. title: '{{ i18n "pages.settings.security.twoFactorModalDeleteTitle" }}',
  335. description: '{{ i18n "pages.settings.security.twoFactorModalRemoveStep" }}',
  336. token: this.allSetting.twoFactorToken,
  337. type: 'confirm',
  338. confirm: (success) => {
  339. if (success) {
  340. Vue.prototype.$message['success']('{{ i18n "pages.settings.security.twoFactorModalDeleteSuccess" }}')
  341. this.allSetting.twoFactorEnable = false
  342. this.allSetting.twoFactorToken = ""
  343. }
  344. }
  345. })
  346. }
  347. },
  348. addNoise() {
  349. const newNoise = { type: "rand", packet: "10-20", delay: "10-16", applyTo: "ip" };
  350. this.noisesArray = [...this.noisesArray, newNoise];
  351. },
  352. removeNoise(index) {
  353. const newNoises = [...this.noisesArray];
  354. newNoises.splice(index, 1);
  355. this.noisesArray = newNoises;
  356. },
  357. updateNoiseType(index, value) {
  358. const updatedNoises = [...this.noisesArray];
  359. updatedNoises[index] = { ...updatedNoises[index], type: value };
  360. this.noisesArray = updatedNoises;
  361. },
  362. updateNoisePacket(index, value) {
  363. const updatedNoises = [...this.noisesArray];
  364. updatedNoises[index] = { ...updatedNoises[index], packet: value };
  365. this.noisesArray = updatedNoises;
  366. },
  367. updateNoiseDelay(index, value) {
  368. const updatedNoises = [...this.noisesArray];
  369. updatedNoises[index] = { ...updatedNoises[index], delay: value };
  370. this.noisesArray = updatedNoises;
  371. },
  372. updateNoiseApplyTo(index, value) {
  373. const updatedNoises = [...this.noisesArray];
  374. updatedNoises[index] = { ...updatedNoises[index], applyTo: value };
  375. this.noisesArray = updatedNoises;
  376. },
  377. },
  378. computed: {
  379. ldapInboundTagList: {
  380. get: function () {
  381. const csv = this.allSetting.ldapInboundTags || "";
  382. return csv.length ? csv.split(',').map(s => s.trim()).filter(Boolean) : [];
  383. },
  384. set: function (list) {
  385. this.allSetting.ldapInboundTags = Array.isArray(list) ? list.join(',') : '';
  386. }
  387. },
  388. fragment: {
  389. get: function () { return this.allSetting?.subJsonFragment != ""; },
  390. set: function (v) {
  391. this.allSetting.subJsonFragment = v ? JSON.stringify(this.defaultFragment) : "";
  392. }
  393. },
  394. fragmentPackets: {
  395. get: function () { return this.fragment ? JSON.parse(this.allSetting.subJsonFragment).settings.fragment.packets : ""; },
  396. set: function (v) {
  397. if (v != "") {
  398. newFragment = JSON.parse(this.allSetting.subJsonFragment);
  399. newFragment.settings.fragment.packets = v;
  400. this.allSetting.subJsonFragment = JSON.stringify(newFragment);
  401. }
  402. }
  403. },
  404. fragmentLength: {
  405. get: function () { return this.fragment ? JSON.parse(this.allSetting.subJsonFragment).settings.fragment.length : ""; },
  406. set: function (v) {
  407. if (v != "") {
  408. newFragment = JSON.parse(this.allSetting.subJsonFragment);
  409. newFragment.settings.fragment.length = v;
  410. this.allSetting.subJsonFragment = JSON.stringify(newFragment);
  411. }
  412. }
  413. },
  414. fragmentInterval: {
  415. get: function () { return this.fragment ? JSON.parse(this.allSetting.subJsonFragment).settings.fragment.interval : ""; },
  416. set: function (v) {
  417. if (v != "") {
  418. newFragment = JSON.parse(this.allSetting.subJsonFragment);
  419. newFragment.settings.fragment.interval = v;
  420. this.allSetting.subJsonFragment = JSON.stringify(newFragment);
  421. }
  422. }
  423. },
  424. fragmentMaxSplit: {
  425. get: function () { return this.fragment ? JSON.parse(this.allSetting.subJsonFragment).settings.fragment.maxSplit : ""; },
  426. set: function (v) {
  427. if (v != "") {
  428. newFragment = JSON.parse(this.allSetting.subJsonFragment);
  429. newFragment.settings.fragment.maxSplit = v;
  430. this.allSetting.subJsonFragment = JSON.stringify(newFragment);
  431. }
  432. }
  433. },
  434. noises: {
  435. get() {
  436. return this.allSetting?.subJsonNoises != "";
  437. },
  438. set(v) {
  439. if (v) {
  440. this.allSetting.subJsonNoises = JSON.stringify(this.defaultNoises);
  441. } else {
  442. this.allSetting.subJsonNoises = "";
  443. }
  444. }
  445. },
  446. noisesArray: {
  447. get() {
  448. return this.noises ? JSON.parse(this.allSetting.subJsonNoises).settings.noises : [];
  449. },
  450. set(value) {
  451. if (this.noises) {
  452. const newNoises = JSON.parse(this.allSetting.subJsonNoises);
  453. newNoises.settings.noises = value;
  454. this.allSetting.subJsonNoises = JSON.stringify(newNoises);
  455. }
  456. }
  457. },
  458. enableMux: {
  459. get: function () { return this.allSetting?.subJsonMux != ""; },
  460. set: function (v) {
  461. this.allSetting.subJsonMux = v ? JSON.stringify(this.defaultMux) : "";
  462. }
  463. },
  464. muxConcurrency: {
  465. get: function () { return this.enableMux ? JSON.parse(this.allSetting.subJsonMux).concurrency : -1; },
  466. set: function (v) {
  467. newMux = JSON.parse(this.allSetting.subJsonMux);
  468. newMux.concurrency = v;
  469. this.allSetting.subJsonMux = JSON.stringify(newMux);
  470. }
  471. },
  472. muxXudpConcurrency: {
  473. get: function () { return this.enableMux ? JSON.parse(this.allSetting.subJsonMux).xudpConcurrency : -1; },
  474. set: function (v) {
  475. newMux = JSON.parse(this.allSetting.subJsonMux);
  476. newMux.xudpConcurrency = v;
  477. this.allSetting.subJsonMux = JSON.stringify(newMux);
  478. }
  479. },
  480. muxXudpProxyUDP443: {
  481. get: function () { return this.enableMux ? JSON.parse(this.allSetting.subJsonMux).xudpProxyUDP443 : "reject"; },
  482. set: function (v) {
  483. newMux = JSON.parse(this.allSetting.subJsonMux);
  484. newMux.xudpProxyUDP443 = v;
  485. this.allSetting.subJsonMux = JSON.stringify(newMux);
  486. }
  487. },
  488. enableDirect: {
  489. get: function () { return this.allSetting?.subJsonRules != ""; },
  490. set: function (v) {
  491. this.allSetting.subJsonRules = v ? JSON.stringify(this.defaultRules) : "";
  492. }
  493. },
  494. directIPs: {
  495. get: function () {
  496. if (!this.enableDirect) return [];
  497. const rules = JSON.parse(this.allSetting.subJsonRules);
  498. if (!Array.isArray(rules)) return [];
  499. const ipRule = rules.find(r => r.ip);
  500. return ipRule?.ip ?? [];
  501. },
  502. set: function (v) {
  503. let rules = JSON.parse(this.allSetting.subJsonRules);
  504. if (!Array.isArray(rules)) return;
  505. if (v.length == 0) {
  506. rules = rules.filter(r => !r.ip);
  507. } else {
  508. let ruleIndex = rules.findIndex(r => r.ip);
  509. if (ruleIndex == -1) ruleIndex = rules.push(this.defaultRules[1]) - 1;
  510. rules[ruleIndex].ip = [];
  511. v.forEach(d => {
  512. rules[ruleIndex].ip.push(d);
  513. });
  514. }
  515. this.allSetting.subJsonRules = JSON.stringify(rules);
  516. }
  517. },
  518. directDomains: {
  519. get: function () {
  520. if (!this.enableDirect) return [];
  521. const rules = JSON.parse(this.allSetting.subJsonRules);
  522. if (!Array.isArray(rules)) return [];
  523. const domainRule = rules.find(r => r.domain);
  524. return domainRule?.domain ?? [];
  525. },
  526. set: function (v) {
  527. let rules = JSON.parse(this.allSetting.subJsonRules);
  528. if (!Array.isArray(rules)) return;
  529. if (v.length == 0) {
  530. rules = rules.filter(r => !r.domain);
  531. } else {
  532. let ruleIndex = rules.findIndex(r => r.domain);
  533. if (ruleIndex == -1) ruleIndex = rules.push(this.defaultRules[0]) - 1;
  534. rules[ruleIndex].domain = v;
  535. }
  536. this.allSetting.subJsonRules = JSON.stringify(rules);
  537. }
  538. },
  539. confAlerts: {
  540. get: function () {
  541. if (!this.allSetting) return [];
  542. var alerts = []
  543. if (window.location.protocol !== "https:") alerts.push('{{ i18n "secAlertSSL" }}');
  544. if (this.allSetting.webPort === 2053) alerts.push('{{ i18n "secAlertPanelPort" }}');
  545. panelPath = window.location.pathname.split('/').length < 4
  546. if (panelPath && this.allSetting.webBasePath == '/') alerts.push('{{ i18n "secAlertPanelURI" }}');
  547. if (this.allSetting.subEnable) {
  548. subPath = this.allSetting.subURI.length > 0 ? new URL(this.allSetting.subURI).pathname : this.allSetting.subPath;
  549. if (subPath == '/sub/') alerts.push('{{ i18n "secAlertSubURI" }}');
  550. }
  551. if (this.allSetting.subJsonEnable) {
  552. subJsonPath = this.allSetting.subJsonURI.length > 0 ? new URL(this.allSetting.subJsonURI).pathname : this.allSetting.subJsonPath;
  553. if (subJsonPath == '/json/') alerts.push('{{ i18n "secAlertSubJsonURI" }}');
  554. }
  555. return alerts
  556. }
  557. }
  558. },
  559. async mounted() {
  560. await this.getAllSetting();
  561. await this.loadInboundTags();
  562. while (true) {
  563. await PromiseUtil.sleep(1000);
  564. this.saveBtnDisable = this.oldAllSetting.equals(this.allSetting);
  565. }
  566. }
  567. });
  568. </script>
  569. {{ template "page/body_end" .}}