Fix tunnel disply order (#286)

This commit is contained in:
Tim Wilkinson 2022-03-11 13:59:50 -08:00 committed by GitHub
parent d03be0c2ae
commit 8409ffe6ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 28 deletions

View File

@ -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) for _, var in ipairs(gci_vars)
do do
if myclient[".type"] == "client" then local key = "client" .. c .. "_" .. var
for _, var in ipairs(gci_vars) parms[key] = section[var]
do if not parms[key] then
local key = "client" .. c .. "_" .. var parms[key] = ""
parms[key] = myclient[var]
if not parms[key] then
parms[key] = ""
end
end end
c = c + 1
end end
c = c + 1
end end
end )
parms.client_num = c parms.client_num = c
end end

View File

@ -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) for _, var in ipairs(gci_vars)
do do
if myconn[".type"] == "server" then local key = "conn" .. c .. "_" .. var
for _, var in ipairs(gci_vars) parms[key] = section[var]
do if not parms[key] then
local key = "conn" .. c .. "_" .. var parms[key] = ""
parms[key] = myconn[var]
if not parms[key] then
parms[key] = ""
end
end end
c = c + 1
end end
c = c + 1
end end
end )
parms.conn_num = c parms.conn_num = c
end end