mirror of https://github.com/aredn/aredn.git
Fix tunnel disply order (#286)
This commit is contained in:
parent
d03be0c2ae
commit
8409ffe6ea
|
@ -210,23 +210,19 @@ end
|
||||||
local gci_vars = { "enabled", "name", "passwd", "netip", "contact" }
|
local gci_vars = { "enabled", "name", "passwd", "netip", "contact" }
|
||||||
function get_client_info()
|
function get_client_info()
|
||||||
local c = 0
|
local c = 0
|
||||||
local all = cursor:get_all("vtun")
|
cursor:foreach("vtun", "client",
|
||||||
if all then
|
function(section)
|
||||||
for _, myclient in pairs(all)
|
|
||||||
do
|
|
||||||
if myclient[".type"] == "client" then
|
|
||||||
for _, var in ipairs(gci_vars)
|
for _, var in ipairs(gci_vars)
|
||||||
do
|
do
|
||||||
local key = "client" .. c .. "_" .. var
|
local key = "client" .. c .. "_" .. var
|
||||||
parms[key] = myclient[var]
|
parms[key] = section[var]
|
||||||
if not parms[key] then
|
if not parms[key] then
|
||||||
parms[key] = ""
|
parms[key] = ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
c = c + 1
|
c = c + 1
|
||||||
end
|
end
|
||||||
end
|
)
|
||||||
end
|
|
||||||
parms.client_num = c
|
parms.client_num = c
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -194,23 +194,19 @@ end
|
||||||
local gci_vars = { "enabled", "host", "passwd", "netip", "contact" }
|
local gci_vars = { "enabled", "host", "passwd", "netip", "contact" }
|
||||||
function get_connection_info()
|
function get_connection_info()
|
||||||
local c = 0
|
local c = 0
|
||||||
local conns = cursor:get_all("vtun")
|
cursor:foreach("vtun", "server",
|
||||||
if conns then
|
function(section)
|
||||||
for _, myconn in pairs(conns)
|
|
||||||
do
|
|
||||||
if myconn[".type"] == "server" then
|
|
||||||
for _, var in ipairs(gci_vars)
|
for _, var in ipairs(gci_vars)
|
||||||
do
|
do
|
||||||
local key = "conn" .. c .. "_" .. var
|
local key = "conn" .. c .. "_" .. var
|
||||||
parms[key] = myconn[var]
|
parms[key] = section[var]
|
||||||
if not parms[key] then
|
if not parms[key] then
|
||||||
parms[key] = ""
|
parms[key] = ""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
c = c + 1
|
c = c + 1
|
||||||
end
|
end
|
||||||
end
|
)
|
||||||
end
|
|
||||||
parms.conn_num = c
|
parms.conn_num = c
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue