Fix IPv6 support in shaper

This commit is contained in:
emanuele-f 2017-01-08 12:32:45 +01:00
parent ed63d81a71
commit 9c1c4eb75b
4 changed files with 83 additions and 20 deletions

View file

@ -2662,3 +2662,33 @@ function makeResolutionButtons(fmt_to_data, ctrl_id, fmt, value, extra)
return {html=html, init=js_init_code, js=js_specific_code, value=nil}
end
end
-- ###########################################
--
-- Extracts parameters from a lua table.
-- This function performs the inverse conversion of javascript paramsPairsEncode.
--
-- Note: plain parameters (not encoded with paramsPairsEncode) remain unchanged
--
function paramsPairsDecode(params)
local res = {}
for k,v in pairs(params) do
local sp = split(k, "key_")
if #sp == 2 then
local keyid = sp[2]
local value = "val_"..keyid
if params[value] then
res[v] = params[value]
end
end
if res[v] == nil then
-- this is a plain parameter
res[k] = v
end
end
return res
end