From b203067dfd416bd45d34cc2dbaad85ab51fcb085 Mon Sep 17 00:00:00 2001 From: Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com> Date: Wed, 31 May 2023 01:47:07 +0430 Subject: fix urls + use the new buildURL func --- web/html/xui/settings.html | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'web/html/xui/settings.html') 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() { -- cgit v1.2.3