small fix
This commit is contained in:
@@ -21,9 +21,9 @@ function on_alarm()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local key = aio:get_args()[1]
|
local key = aio:get_args()[1]
|
||||||
local body = "api_key="..key.."&format=json"
|
local body = "api_key="..key.."&format=json"
|
||||||
|
|
||||||
http:post(api_url.."getMonitors", body, media_type)
|
http:post(api_url.."getMonitors", body, media_type)
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_click()
|
function on_click()
|
||||||
@@ -35,7 +35,7 @@ function on_click()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function on_network_result(result)
|
function on_network_result(result)
|
||||||
local parsed = json.decode(result)
|
local parsed = json.decode(result)
|
||||||
|
|
||||||
if (parsed.stat ~= "ok") then
|
if (parsed.stat ~= "ok") then
|
||||||
ui:show_text("Error: "..parsed.error.message)
|
ui:show_text("Error: "..parsed.error.message)
|
||||||
@@ -43,7 +43,7 @@ function on_network_result(result)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local strings_tab = {}
|
local strings_tab = {}
|
||||||
|
|
||||||
for k,v in ipairs(parsed.monitors) do
|
for k,v in ipairs(parsed.monitors) do
|
||||||
strings_tab[k] = v.friendly_name..": "..format_status(v.status)
|
strings_tab[k] = v.friendly_name..": "..format_status(v.status)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user