From 5e6ec8562fe828934ef835490cee405653b06d3a Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Thu, 16 Jan 2020 00:30:30 +0100 Subject: luci-base: remove hardcoded cgi-bin path Currently LuCI can be loaded only when placed in the root of the server as the cgi-bin path are hardcoded. Change the index.html to load the cgi-bin path from the current level. Also add a new entry in the env Object to make the cgi_base path easily accessible. This variable will be based on the position of /cgi-bin/luci. Signed-off-by: Ansuel Smith --- .../luci-mod-system/htdocs/luci-static/resources/view/system/flash.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/luci-mod-system') diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js index 05e1434f1..b1cc4d1a6 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js @@ -76,7 +76,7 @@ return L.view.extend({ handleBackup: function(ev) { var form = E('form', { method: 'post', - action: '/cgi-bin/cgi-backup', + action: L.env.cgi_base + '/cgi-backup', enctype: 'application/x-www-form-urlencoded' }, E('input', { type: 'hidden', name: 'sessionid', value: rpc.getSessionID() })); @@ -169,7 +169,7 @@ return L.view.extend({ var mtdblock = L.dom.parent(ev.target, '.cbi-section').querySelector('[data-name="mtdselect"] select').value; var form = E('form', { 'method': 'post', - 'action': '/cgi-bin/cgi-download', + 'action': L.env.cgi_base + '/cgi-download', 'enctype': 'application/x-www-form-urlencoded' }, [ E('input', { 'type': 'hidden', 'name': 'sessionid', 'value': rpc.getSessionID() }), -- cgit v1.2.3