settings.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. {{template "head" .}}
  4. <style>
  5. @media (min-width: 769px) {
  6. .ant-layout-content {
  7. margin: 24px 16px;
  8. }
  9. }
  10. @media (max-width: 768px) {
  11. .ant-tabs-nav .ant-tabs-tab {
  12. margin: 0;
  13. padding: 12px .5rem;
  14. }
  15. }
  16. .ant-tabs-bar {
  17. margin: 0;
  18. }
  19. .ant-list-item {
  20. display: block;
  21. }
  22. .alert-msg {
  23. color: rgb(194, 117, 18);
  24. font-weight: normal;
  25. font-size: 16px;
  26. padding: .5rem 1rem;
  27. text-align: center;
  28. background: rgb(255 145 0 / 15%);
  29. margin: 1.5rem 2.5rem 0rem 2.5rem;
  30. border-radius: .5rem;
  31. transition: all 0.5s;
  32. animation: signal 3s cubic-bezier(0.18, 0.89, 0.32, 1.28) infinite;
  33. }
  34. .alert-msg:hover {
  35. cursor: default;
  36. transition-duration: .3s;
  37. animation: signal 0.9s ease infinite;
  38. }
  39. @keyframes signal{
  40. 0%{
  41. box-shadow: 0 0 0 0 rgba(194, 118, 18, 0.5);
  42. }
  43. 50%{
  44. box-shadow: 0 0 0 6px rgba(0 ,0,0,0);
  45. }
  46. 100%{
  47. box-shadow: 0 0 0 6px rgba(0 ,0,0,0);
  48. }
  49. }
  50. .alert-msg > i {
  51. color: inherit;
  52. font-size: 24px;
  53. }
  54. .collapse-title {
  55. color: inherit;
  56. font-weight: bold;
  57. font-size: 18px;
  58. padding: 10px 20px;
  59. border-bottom: 2px solid;
  60. }
  61. .collapse-title > i {
  62. color: inherit;
  63. font-size: 24px;
  64. }
  65. </style>
  66. <body>
  67. <a-layout id="app" v-cloak :class="themeSwitcher.currentTheme">
  68. {{ template "commonSider" . }}
  69. <a-layout id="content-layout">
  70. <a-layout-content>
  71. <a-spin :spinning="spinning" :delay="500" tip='{{ i18n "loading"}}'>
  72. <a-space direction="vertical">
  73. <a-card hoverable style="margin-bottom: .5rem;">
  74. <a-row>
  75. <a-col :xs="24" :sm="8" style="padding: 4px;">
  76. <a-space direction="horizontal">
  77. <a-button type="primary" :disabled="saveBtnDisable" @click="updateAllSetting">{{ i18n "pages.settings.save" }}</a-button>
  78. <a-button type="danger" :disabled="!saveBtnDisable" @click="restartPanel">{{ i18n "pages.settings.restartPanel" }}</a-button>
  79. </a-space>
  80. </a-col>
  81. <a-col :xs="24" :sm="16">
  82. <template>
  83. <div>
  84. <template>
  85. <div>
  86. <a-back-top :target="() => document.getElementById('content-layout')" visibility-height="200">
  87. </a-back-top>
  88. <a-alert type="warning" style="float: right; width: fit-content"
  89. message='{{ i18n "pages.settings.infoDesc" }}'
  90. show-icon
  91. >
  92. </div>
  93. </template>
  94. </div>
  95. </template>
  96. </a-col>
  97. </a-row>
  98. </a-card>
  99. <a-tabs default-active-key="1">
  100. <a-tab-pane key="1" tab='{{ i18n "pages.settings.panelSettings"}}'>
  101. <a-list item-layout="horizontal">
  102. <a-list-item>
  103. <a-row style="padding: 20px">
  104. <a-col :lg="24" :xl="12">
  105. <a-list-item-meta title='{{ i18n "pages.settings.remarkModel"}}'>
  106. <template slot="description">{{ i18n "pages.settings.sampleRemark"}}: <i>#[[ remarkSample ]]</i></template>
  107. </a-list-item-meta>
  108. </a-col>
  109. <a-col :lg="24" :xl="12">
  110. <a-input-group style="width: 100%;">
  111. <a-select style="padding-right: .5rem; min-width: 80%; width: auto;"
  112. mode="multiple"
  113. v-model="remarkModel"
  114. :dropdown-class-name="themeSwitcher.currentTheme">
  115. <a-select-option v-for="(value, key) in remarkModels" :value="key">[[ value ]]</a-select-option>
  116. </a-select>
  117. <a-select style="width: 20%;" v-model="remarkSeparator" :dropdown-class-name="themeSwitcher.currentTheme">
  118. <a-select-option v-for="key in remarkSeparators" :value="key">[[ key ]]</a-select-option>
  119. </a-select>
  120. </a-input-group>
  121. </a-col>
  122. </a-row>
  123. </a-list-item>
  124. <setting-list-item type="text" title='{{ i18n "pages.settings.panelListeningIP"}}' desc='{{ i18n "pages.settings.panelListeningIPDesc"}}' v-model="allSetting.webListen"></setting-list-item>
  125. <setting-list-item type="text" title='{{ i18n "pages.settings.panelListeningDomain"}}' desc='{{ i18n "pages.settings.panelListeningDomainDesc"}}' v-model="allSetting.webDomain"></setting-list-item>
  126. <setting-list-item type="number" title='{{ i18n "pages.settings.panelPort"}}' desc='{{ i18n "pages.settings.panelPortDesc"}}' v-model="allSetting.webPort" :min="0"></setting-list-item>
  127. <setting-list-item type="text" title='{{ i18n "pages.settings.publicKeyPath"}}' desc='{{ i18n "pages.settings.publicKeyPathDesc"}}' v-model="allSetting.webCertFile"></setting-list-item>
  128. <setting-list-item type="text" title='{{ i18n "pages.settings.privateKeyPath"}}' desc='{{ i18n "pages.settings.privateKeyPathDesc"}}' v-model="allSetting.webKeyFile"></setting-list-item>
  129. <setting-list-item type="text" title='{{ i18n "pages.settings.panelUrlPath"}}' desc='{{ i18n "pages.settings.panelUrlPathDesc"}}' v-model="allSetting.webBasePath"></setting-list-item>
  130. <setting-list-item type="number" title='{{ i18n "pages.settings.sessionMaxAge" }}' desc='{{ i18n "pages.settings.sessionMaxAgeDesc" }}' v-model="allSetting.sessionMaxAge" :min="0"></setting-list-item>
  131. <setting-list-item type="number" title='{{ i18n "pages.settings.pageSize" }}' desc='{{ i18n "pages.settings.pageSizeDesc" }}' v-model="allSetting.pageSize" :min="0" :step="5"></setting-list-item>
  132. <setting-list-item type="number" title='{{ i18n "pages.settings.expireTimeDiff" }}' desc='{{ i18n "pages.settings.expireTimeDiffDesc" }}' v-model="allSetting.expireDiff" :min="0"></setting-list-item>
  133. <setting-list-item type="number" title='{{ i18n "pages.settings.trafficDiff" }}' desc='{{ i18n "pages.settings.trafficDiffDesc" }}' v-model="allSetting.trafficDiff" :min="0"></setting-list-item>
  134. <setting-list-item type="text" title='{{ i18n "pages.settings.timeZone"}}' desc='{{ i18n "pages.settings.timeZoneDesc"}}' v-model="allSetting.timeLocation"></setting-list-item>
  135. <a-list-item>
  136. <a-row style="padding: 20px">
  137. <a-col :lg="24" :xl="12">
  138. <a-list-item-meta title='{{ i18n "pages.settings.datepicker"}}'>
  139. <template slot="description">{{ i18n "pages.settings.datepickerDescription"}}</template>
  140. </a-list-item-meta>
  141. </a-col>
  142. <a-col :lg="24" :xl="12">
  143. <template>
  144. <a-select style="width: 100%"
  145. :dropdown-class-name="themeSwitcher.currentTheme"
  146. v-model="datepicker">
  147. <a-select-option v-for="item in datepickerList" :value="item.value">
  148. <span v-text="item.name"></span>
  149. </a-select-option>
  150. </a-select>
  151. </template>
  152. </a-col>
  153. </a-row>
  154. </a-list-item>
  155. <a-list-item>
  156. <a-row style="padding: 20px">
  157. <a-col :lg="24" :xl="12">
  158. <a-list-item-meta title="Language" />
  159. </a-col>
  160. <a-col :lg="24" :xl="12">
  161. <template>
  162. <a-select
  163. ref="selectLang"
  164. v-model="lang"
  165. @change="setLang(lang)"
  166. :dropdown-class-name="themeSwitcher.currentTheme"
  167. style="width: 100%"
  168. >
  169. <a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs">
  170. <span role="img" :aria-label="l.name" v-text="l.icon"></span>
  171. &nbsp;&nbsp;<span v-text="l.name"></span>
  172. </a-select-option>
  173. </a-select>
  174. </template>
  175. </a-col>
  176. </a-row>
  177. </a-list-item>
  178. </a-list>
  179. </a-tab-pane>
  180. <a-tab-pane key="2" tab='{{ i18n "pages.settings.securitySettings"}}' style="padding: 20px;">
  181. <a-divider>{{ i18n "pages.settings.security.admin"}}</a-divider>
  182. <a-form style="padding: 20px;" layout="inline">
  183. <table cellpadding="2">
  184. <tr>
  185. <td>{{ i18n "pages.settings.oldUsername"}}:</td>
  186. <td>
  187. <a-form-item>
  188. <a-input v-model="user.oldUsername" style="width: 200px"></a-input>
  189. </a-form-item>
  190. </td>
  191. </tr>
  192. <tr>
  193. <td>{{ i18n "pages.settings.currentPassword"}}:</td>
  194. <td>
  195. <a-form-item>
  196. <password-input v-model="user.oldPassword" style="width: 200px"></password-input>
  197. </a-form-item>
  198. </td>
  199. </tr>
  200. <tr>
  201. <td>{{ i18n "pages.settings.newUsername"}}:</td>
  202. <td>
  203. <a-form-item>
  204. <a-input v-model="user.newUsername" style="width: 200px"></a-input>
  205. </a-form-item>
  206. </td>
  207. </tr>
  208. <tr>
  209. <td>{{ i18n "pages.settings.newPassword"}}:</td>
  210. <td>
  211. <a-form-item>
  212. <password-input v-model="user.newPassword" style="width: 200px"></password-input>
  213. </a-form-item>
  214. </td>
  215. </tr>
  216. </table>
  217. <a-button type="primary" @click="updateUser">{{ i18n "confirm" }}</a-button>
  218. </a-form>
  219. <a-divider>{{ i18n "pages.settings.security.secret"}}</a-divider>
  220. <a-form style="padding: 20px;">
  221. <a-list-item>
  222. <a-row>
  223. <a-col :lg="24" :xl="12">
  224. <a-list-item-meta title='{{ i18n "pages.settings.security.loginSecurity" }}' description='{{ i18n "pages.settings.security.loginSecurityDesc" }}' />
  225. </a-col>
  226. <a-col :lg="24" :xl="12">
  227. <template>
  228. <a-switch @change="toggleToken(allSetting.secretEnable)" v-model="allSetting.secretEnable"></a-switch>
  229. <a-icon style="margin-left: 1rem;" v-if="allSetting.secretEnable" :spin="this.changeSecret" type="sync" @click="getNewSecret"></a-icon>
  230. </template>
  231. </a-col>
  232. </a-row>
  233. </a-list-item>
  234. <a-list-item>
  235. <a-row>
  236. <a-col :lg="24" :xl="12">
  237. <a-list-item-meta title='{{ i18n "pages.settings.security.secretToken" }}' description='{{ i18n "pages.settings.security.secretTokenDesc" }}' />
  238. </a-col>
  239. <a-col :lg="24" :xl="12">
  240. <template>
  241. <a-textarea type="text" :disabled="!allSetting.secretEnable" v-model="user.loginSecret"></a-textarea>
  242. </template>
  243. </a-col>
  244. </a-row>
  245. </a-list-item>
  246. <a-button type="primary" :loading="this.changeSecret" @click="updateSecret">{{ i18n "confirm" }}</a-button>
  247. </a-form>
  248. </a-tab-pane>
  249. <a-tab-pane key="3" tab='{{ i18n "pages.settings.TGBotSettings"}}'>
  250. <a-list item-layout="horizontal">
  251. <setting-list-item type="switch" title='{{ i18n "pages.settings.telegramBotEnable" }}' desc='{{ i18n "pages.settings.telegramBotEnableDesc" }}' v-model="allSetting.tgBotEnable"></setting-list-item>
  252. <setting-list-item type="text" title='{{ i18n "pages.settings.telegramToken"}}' desc='{{ i18n "pages.settings.telegramTokenDesc"}}' v-model="allSetting.tgBotToken"></setting-list-item>
  253. <setting-list-item type="text" title='{{ i18n "pages.settings.telegramChatId"}}' desc='{{ i18n "pages.settings.telegramChatIdDesc"}}' v-model="allSetting.tgBotChatId"></setting-list-item>
  254. <setting-list-item type="text" title='{{ i18n "pages.settings.telegramNotifyTime"}}' desc='{{ i18n "pages.settings.telegramNotifyTimeDesc"}}' v-model="allSetting.tgRunTime"></setting-list-item>
  255. <setting-list-item type="switch" title='{{ i18n "pages.settings.tgNotifyBackup" }}' desc='{{ i18n "pages.settings.tgNotifyBackupDesc" }}' v-model="allSetting.tgBotBackup"></setting-list-item>
  256. <setting-list-item type="switch" title='{{ i18n "pages.settings.tgNotifyLogin" }}' desc='{{ i18n "pages.settings.tgNotifyLoginDesc" }}' v-model="allSetting.tgBotLoginNotify"></setting-list-item>
  257. <setting-list-item type="number" title='{{ i18n "pages.settings.tgNotifyCpu" }}' desc='{{ i18n "pages.settings.tgNotifyCpuDesc" }}' v-model="allSetting.tgCpu" :min="0" :max="100"></setting-list-item>
  258. <setting-list-item type="text" title='{{ i18n "pages.settings.telegramProxy"}}' desc='{{ i18n "pages.settings.telegramProxyDesc"}}' v-model="allSetting.tgBotProxy" placeholder="socks5://[user:pass@]host:port"></setting-list-item>
  259. <a-list-item>
  260. <a-row style="padding: 20px">
  261. <a-col :lg="24" :xl="12">
  262. <a-list-item-meta title="Telegram Bot Language" />
  263. </a-col>
  264. <a-col :lg="24" :xl="12">
  265. <template>
  266. <a-select
  267. ref="selectBotLang"
  268. v-model="allSetting.tgLang"
  269. :dropdown-class-name="themeSwitcher.currentTheme"
  270. style="width: 100%"
  271. >
  272. <a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs">
  273. <span role="img" :aria-label="l.name" v-text="l.icon"></span>
  274. &nbsp;&nbsp;<span v-text="l.name"></span>
  275. </a-select-option>
  276. </a-select>
  277. </template>
  278. </a-col>
  279. </a-row>
  280. </a-list-item>
  281. </a-list>
  282. </a-tab-pane>
  283. <a-tab-pane key="4" tab='{{ i18n "pages.settings.subSettings" }}'>
  284. <a-list item-layout="horizontal">
  285. <setting-list-item type="switch" title='{{ i18n "pages.settings.subEnable"}}' desc='{{ i18n "pages.settings.subEnableDesc"}}' v-model="allSetting.subEnable"></setting-list-item>
  286. <setting-list-item type="switch" title='{{ i18n "pages.settings.subEncrypt"}}' desc='{{ i18n "pages.settings.subEncryptDesc"}}' v-model="allSetting.subEncrypt"></setting-list-item>
  287. <setting-list-item type="switch" title='{{ i18n "pages.settings.subShowInfo"}}' desc='{{ i18n "pages.settings.subShowInfoDesc"}}' v-model="allSetting.subShowInfo"></setting-list-item>
  288. <setting-list-item type="text" title='{{ i18n "pages.settings.subListen"}}' desc='{{ i18n "pages.settings.subListenDesc"}}' v-model="allSetting.subListen"></setting-list-item>
  289. <setting-list-item type="text" title='{{ i18n "pages.settings.subDomain"}}' desc='{{ i18n "pages.settings.subDomainDesc"}}' v-model="allSetting.subDomain"></setting-list-item>
  290. <setting-list-item type="number" title='{{ i18n "pages.settings.subPort"}}' desc='{{ i18n "pages.settings.subPortDesc"}}' v-model.number="allSetting.subPort"></setting-list-item>
  291. <setting-list-item type="text" title='{{ i18n "pages.settings.subPath"}}' desc='{{ i18n "pages.settings.subPathDesc"}}' v-model="allSetting.subPath"></setting-list-item>
  292. <setting-list-item type="text" title='{{ i18n "pages.settings.subCertPath"}}' desc='{{ i18n "pages.settings.subCertPathDesc"}}' v-model="allSetting.subCertFile"></setting-list-item>
  293. <setting-list-item type="text" title='{{ i18n "pages.settings.subKeyPath"}}' desc='{{ i18n "pages.settings.subKeyPathDesc"}}' v-model="allSetting.subKeyFile"></setting-list-item>
  294. <setting-list-item type="text" title='{{ i18n "pages.settings.subURI"}}' desc='{{ i18n "pages.settings.subURIDesc"}}' v-model="allSetting.subURI" placeholder="(http|https)://domain[:port]/path/"></setting-list-item>
  295. <setting-list-item type="number" title='{{ i18n "pages.settings.subUpdates"}}' desc='{{ i18n "pages.settings.subUpdatesDesc"}}' v-model="allSetting.subUpdates"></setting-list-item>
  296. </a-list>
  297. </a-tab-pane>
  298. </a-tabs>
  299. </a-space>
  300. </a-spin>
  301. </a-layout-content>
  302. </a-layout>
  303. </a-layout>
  304. {{template "js" .}}
  305. <script src="{{ .base_path }}assets/js/model/setting.js?{{ .cur_ver }}"></script>
  306. {{template "component/themeSwitcher" .}}
  307. {{template "component/password" .}}
  308. {{template "component/setting"}}
  309. <script>
  310. const app = new Vue({
  311. delimiters: ['[[', ']]'],
  312. el: '#app',
  313. data: {
  314. siderDrawer,
  315. themeSwitcher,
  316. spinning: false,
  317. changeSecret: false,
  318. oldAllSetting: new AllSetting(),
  319. allSetting: new AllSetting(),
  320. saveBtnDisable: true,
  321. user: {},
  322. lang: getLang(),
  323. showAlert: false,
  324. remarkModels: {i:'Inbound',e:'Email',o:'Other'},
  325. remarkSeparators: [' ','-','_','@',':','~','|',',','.','/'],
  326. datepickerList: [{name:'Gregorian (Standard)', value: 'gregorian'}, {name:'Jalalian (شمسی)', value: 'jalalian'}],
  327. remarkSample: '',
  328. get remarkModel() {
  329. rm = this.allSetting.remarkModel;
  330. return rm.length>1 ? rm.substring(1).split('') : [];
  331. },
  332. set remarkModel(value) {
  333. rs = this.allSetting.remarkModel[0];
  334. this.allSetting.remarkModel = rs + value.join('');
  335. this.changeRemarkSample();
  336. },
  337. get remarkSeparator() {
  338. return this.allSetting.remarkModel.length > 1 ? this.allSetting.remarkModel.charAt(0) : '-';
  339. },
  340. set remarkSeparator(value) {
  341. this.allSetting.remarkModel = value + this.allSetting.remarkModel.substring(1);
  342. this.changeRemarkSample();
  343. },
  344. get datepicker() {
  345. return this.allSetting.datepicker ? this.allSetting.datepicker : 'gregorian';
  346. },
  347. set datepicker(value) {
  348. this.allSetting.datepicker = value;
  349. },
  350. changeRemarkSample(){
  351. sample = []
  352. this.remarkModel.forEach(r => sample.push(this.remarkModels[r]));
  353. this.remarkSample = sample.length == 0 ? '' : sample.join(this.remarkSeparator);
  354. }
  355. },
  356. methods: {
  357. loading(spinning = true) {
  358. this.spinning = spinning;
  359. },
  360. async getAllSetting() {
  361. this.loading(true);
  362. const msg = await HttpUtil.post("/panel/setting/all");
  363. this.loading(false);
  364. if (msg.success) {
  365. this.oldAllSetting = new AllSetting(msg.obj);
  366. this.allSetting = new AllSetting(msg.obj);
  367. app.changeRemarkSample();
  368. this.saveBtnDisable = true;
  369. }
  370. await this.fetchUserSecret();
  371. },
  372. async updateAllSetting() {
  373. this.loading(true);
  374. const msg = await HttpUtil.post("/panel/setting/update", this.allSetting);
  375. this.loading(false);
  376. if (msg.success) {
  377. await this.getAllSetting();
  378. }
  379. },
  380. async updateUser() {
  381. this.loading(true);
  382. const msg = await HttpUtil.post("/panel/setting/updateUser", this.user);
  383. this.loading(false);
  384. if (msg.success) {
  385. this.user = {};
  386. window.location.replace(basePath + "logout");
  387. }
  388. },
  389. async restartPanel() {
  390. await new Promise(resolve => {
  391. this.$confirm({
  392. title: '{{ i18n "pages.settings.restartPanel" }}',
  393. content: '{{ i18n "pages.settings.restartPanelDesc" }}',
  394. class: themeSwitcher.currentTheme,
  395. okText: '{{ i18n "sure" }}',
  396. cancelText: '{{ i18n "cancel" }}',
  397. onOk: () => resolve(),
  398. });
  399. });
  400. this.loading(true);
  401. const msg = await HttpUtil.post("/panel/setting/restartPanel");
  402. this.loading(false);
  403. if (msg.success) {
  404. this.loading(true);
  405. await PromiseUtil.sleep(5000);
  406. let { webCertFile, webKeyFile, webDomain: host, webPort: port, webBasePath: base } = this.allSetting;
  407. const isTLS = webCertFile !== "" || webKeyFile !== "";
  408. const url = buildURL({ host, port, isTLS, base, path: "panel/settings" });
  409. window.location.replace(url);
  410. }
  411. },
  412. async fetchUserSecret() {
  413. this.loading(true);
  414. const userMessage = await HttpUtil.post("/panel/setting/getUserSecret", this.user);
  415. if (userMessage.success) {
  416. this.user = userMessage.obj;
  417. }
  418. this.loading(false);
  419. },
  420. async updateSecret() {
  421. this.loading(true);
  422. const msg = await HttpUtil.post("/panel/setting/updateUserSecret", this.user);
  423. if (msg.success) {
  424. this.user = msg.obj;
  425. window.location.replace(basePath + "logout");
  426. }
  427. this.loading(false);
  428. await this.updateAllSetting();
  429. },
  430. generateRandomString(length) {
  431. var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
  432. let randomString = "";
  433. for (let i = 0; i < length; i++) {
  434. randomString += chars[Math.floor(Math.random() * chars.length)];
  435. }
  436. return randomString;
  437. },
  438. async getNewSecret() {
  439. if (!this.changeSecret) {
  440. this.changeSecret = true;
  441. this.user.loginSecret = '';
  442. const newSecret = this.generateRandomString(64);
  443. await PromiseUtil.sleep(1000);
  444. this.user.loginSecret = newSecret;
  445. this.changeSecret = false;
  446. }
  447. },
  448. async toggleToken(value) {
  449. if (value) {
  450. await this.getNewSecret();
  451. } else {
  452. this.user.loginSecret = "";
  453. }
  454. },
  455. },
  456. async mounted() {
  457. await this.getAllSetting();
  458. while (true) {
  459. await PromiseUtil.sleep(600);
  460. this.saveBtnDisable = this.oldAllSetting.equals(this.allSetting);
  461. }
  462. },
  463. });
  464. </script>
  465. </body>
  466. </html>