diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2020-01-16 00:30:30 +0100 |
---|---|---|
committer | Ansuel Smith <ansuelsmth@gmail.com> | 2020-01-16 15:02:14 +0100 |
commit | 5e6ec8562fe828934ef835490cee405653b06d3a (patch) | |
tree | eb604f3f8c91d7d7b754611a2987eba19081ba82 /modules/luci-mod-system/htdocs/luci-static/resources | |
parent | 88b9d58a44ea52e812cf0c0db5b5b6b87783bd7e (diff) |
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 <ansuelsmth@gmail.com>
Diffstat (limited to 'modules/luci-mod-system/htdocs/luci-static/resources')
-rw-r--r-- | modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js | 4 |
1 files changed, 2 insertions, 2 deletions
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 05e1434f15..b1cc4d1a6f 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() }), |