diff options
| author | Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com> | 2023-05-31 00:17:07 +0300 |
|---|---|---|
| committer | Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com> | 2023-05-31 00:29:41 +0300 |
| commit | b203067dfd416bd45d34cc2dbaad85ab51fcb085 (patch) | |
| tree | f9243bf31ea112fc6c51a53f9b3bcd76a18b2f1f /web/html/xui/settings.html | |
| parent | 1c9fc9422e304c8710b56e9719960e429e7a1878 (diff) | |
fix urls + use the new buildURL func
Diffstat (limited to 'web/html/xui/settings.html')
| -rw-r--r-- | web/html/xui/settings.html | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index e7d865f6..e4103c52 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -523,7 +523,7 @@ this.loading(false); if (msg.success) { this.user = {}; - window.location.replace(basePath + "logout") + window.location.replace(basePath + "logout"); } }, async restartPanel() { @@ -542,12 +542,10 @@ if (msg.success) { this.loading(true); await PromiseUtil.sleep(5000); - let protocol = "http://"; - if (this.allSetting.webCertFile !== "") { - protocol = "https://"; - } - const { host } = window.location; - window.location.replace(protocol + host + this.allSetting.webBasePath + "panel/settings"); + const { webCertFile, webKeyFile, webDomain: host, webPort: port, webBasePath: base } = this.allSetting; + const isTLS = webCertFile !== "" || webKeyFile !== ""; + const url = buildURL({ host, port, isTLS, base, path: "panel/settings" }); + window.location.replace(url); } }, async fetchUserSecret() { |
