mirror of
https://github.com/rxi/lovebird.git
synced 2024-11-27 12:04:21 +00:00
Made env.json page clean up extra dots in query path
This commit is contained in:
parent
571e1489c3
commit
0dbc491f07
@ -227,7 +227,7 @@ end
|
|||||||
var html = "<table>";
|
var html = "<table>";
|
||||||
for (var i = 0; json.vars[i]; i++) {
|
for (var i = 0; json.vars[i]; i++) {
|
||||||
var x = json.vars[i];
|
var x = json.vars[i];
|
||||||
var fullpath = (json.path + "." + x.key).replace(/^\.*/, "");
|
var fullpath = json.path + "." + x.key;
|
||||||
var k = x.key;
|
var k = x.key;
|
||||||
if (x.type == "table") {
|
if (x.type == "table") {
|
||||||
k = "<a href='#' onclick=\"setEnvPath('" + fullpath + "')\">" +
|
k = "<a href='#' onclick=\"setEnvPath('" + fullpath + "')\">" +
|
||||||
@ -264,6 +264,7 @@ lovebird.pages["env.json"] = [[
|
|||||||
<?lua
|
<?lua
|
||||||
local t = _G
|
local t = _G
|
||||||
local p = req.parsedurl.query.p or ""
|
local p = req.parsedurl.query.p or ""
|
||||||
|
p = p:gsub("%.+", "%."):match("^[%.]*(.*)[%.]*$")
|
||||||
if p ~= "" then
|
if p ~= "" then
|
||||||
for x in p:gmatch("[^%.]+") do
|
for x in p:gmatch("[^%.]+") do
|
||||||
t = t[x]
|
t = t[x]
|
||||||
|
Loading…
Reference in New Issue
Block a user