summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static/resources/fs.js
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2020-01-16 00:30:30 +0100
committerAnsuel Smith <ansuelsmth@gmail.com>2020-01-16 15:02:14 +0100
commit5e6ec8562fe828934ef835490cee405653b06d3a (patch)
treeeb604f3f8c91d7d7b754611a2987eba19081ba82 /modules/luci-base/htdocs/luci-static/resources/fs.js
parent88b9d58a44ea52e812cf0c0db5b5b6b87783bd7e (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-base/htdocs/luci-static/resources/fs.js')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/fs.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/fs.js b/modules/luci-base/htdocs/luci-static/resources/fs.js
index e1bf4f874a..d32b20f2f1 100644
--- a/modules/luci-base/htdocs/luci-static/resources/fs.js
+++ b/modules/luci-base/htdocs/luci-static/resources/fs.js
@@ -342,7 +342,7 @@ var FileSystem = L.Class.extend(/** @lends LuCI.fs.prototype */ {
var postdata = 'sessionid=%s&path=%s'
.format(encodeURIComponent(L.env.sessionid), encodeURIComponent(path));
- return L.Request.post('/cgi-bin/cgi-download', postdata, {
+ return L.Request.post(L.env.cgi_base + '/cgi-download', postdata, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}).then(handleCgiIoReply);
},
@@ -385,7 +385,7 @@ var FileSystem = L.Class.extend(/** @lends LuCI.fs.prototype */ {
var postdata = 'sessionid=%s&command=%s'
.format(encodeURIComponent(L.env.sessionid), encodeURIComponent(cmdstr));
- return L.Request.post('/cgi-bin/cgi-exec', postdata, {
+ return L.Request.post(L.env.cgi_base + '/cgi-exec', postdata, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}).then(handleCgiIoReply);
}