Minor fixes for the alerts browser

This commit is contained in:
Simone Mainardi 2016-12-14 11:42:12 +01:00
parent 82c305de53
commit c4cd6200f9
2 changed files with 4 additions and 11 deletions

View file

@ -2389,16 +2389,9 @@ end
-- ####################################################
-- Note: can only handle basic types
function tableToJsObject(lua_table)
local parts = {}
for k,v in pairs(lua_table) do
if type(v) == 'string' then v = "'"..v.."'" end
parts[#parts + 1] = k..":"..v
end
return "{".. table.concat(parts, ", ") .."}"
local json = require("dkjson")
return json.encode(lua_table, nil)
end
-- ####################################################