Developing lightweight computation at the DSG edge

Commit cdf05725 authored by p4u's avatar p4u
Browse files

Fixed some bugs of bmx6-luci

parent 5a55a794
config 'bmx6' 'luci'
option ignore '0'
#option place 'admin status Bmx6'
option place 'qmp bmx6'
#option json 'http://127.0.0.1/cgi-bin/bmx6-info?'
option json 'exec:/www/cgi-bin/bmx6-info -s'
option ignore '0'
#option place 'admin status Bmx6'
option place 'qmp bmx6'
#option json 'http://127.0.0.1/cgi-bin/bmx6-info?'
option json 'exec:/www/cgi-bin/bmx6-info -s'
......@@ -75,9 +75,9 @@ function action_status()
end
function action_neighbours()
local orig = bmx6json.get("originators").originators or nil
local orig = bmx6json.get("originators").originators or nil
if orig == nil then
if orig == nil then
luci.template.render("bmx6/error", {txt="Cannot fetch data from bmx6 json"})
return nil
end
......@@ -95,11 +95,13 @@ function action_neighbours()
end
function action_links()
local links = bmx6json.get("links").links or nil
if links == nil then
luci.template.render("bmx6/error", {txt="Cannot fetch data from bmx6 json"})
else
luci.template.render("bmx6/links", {links=links})
end
local links = bmx6json.get("links")
if links ~= nil then
-- luci.template.render("bmx6/error", {txt="Cannot fetch data from bmx6 json"})
links = links.links
else
links = {}
end
luci.template.render("bmx6/links", {links=links})
end
......@@ -41,9 +41,9 @@ function get(field)
local decoder = json.Decoder()
ltn12.pump.all(ltn12.source.string(raw), decoder:sink())
data = decoder:get()
else
print_error("Cannot get data from bmx6 daemon",true)
return nil
-- else
-- print_error("Cannot get data from bmx6 daemon",true)
-- return nil
end
return data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment