Preserve proxy prefix for LuCI hub redirect

This commit is contained in:
kzolotarev95 committed 2026-07-06 20:41:35 +04:00
1 parent 036be640be
commit eb9fdebd5c
1 file changed
+7 -1
@@ -21,7 +21,13 @@ return view.extend({
]); ]);
} }
var url = '/cgi-bin/owrt-remote?key=' + encodeURIComponent(key); var path = String((window.location && window.location.pathname) || ''),
proxyPrefix = path.replace(/\/cgi-bin\/luci(?:\/.*)?$/, '');
if (proxyPrefix === path)
proxyPrefix = '';
var url = proxyPrefix + '/cgi-bin/owrt-remote?key=' + encodeURIComponent(key);
window.setTimeout(function() { window.setTimeout(function() {
window.location.replace(url); window.location.replace(url);