From 5df9b4f5c2fc50ab491a48a0a0383858bb676b23 Mon Sep 17 00:00:00 2001 From: kr-ilya Date: Wed, 3 Dec 2025 23:12:03 +0300 Subject: [PATCH] remove duplicate code --- web/html/settings.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/html/settings.html b/web/html/settings.html index 722dc64f..20fa238e 100644 --- a/web/html/settings.html +++ b/web/html/settings.html @@ -322,8 +322,9 @@ const { webDomain, webPort, webBasePath, webCertFile, webKeyFile } = this.allSetting; const newProtocol = (webCertFile || webKeyFile) ? "https:" : "http:"; + const base = webBasePath ? webBasePath.replace(/^\//, "") : ""; + if (!this.entryIsIP) { - const base = webBasePath ? webBasePath.replace(/^\//, "") : ""; const url = new URL(window.location.href); url.pathname = `/${base}panel/settings`; window.location.replace(url.toString()); @@ -341,8 +342,6 @@ finalPort = String(webPort); } - const base = webBasePath ? webBasePath.replace(/^\//, "") : ""; - const url = new URL(`${newProtocol}//${finalHost}`); if (finalPort) url.port = finalPort; url.pathname = `/${base}panel/settings`;