mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-04 18:00:10 +00:00
Added datasource extraction check
This commit is contained in:
parent
370c7bb8ec
commit
eb2c2dd47a
3 changed files with 17 additions and 9 deletions
|
|
@ -188,18 +188,22 @@ function widgets_utils.generate_response(widget, params)
|
|||
-- Remove trailer .lua from the origin
|
||||
local origin = ds.origin:gsub("%.lua", "")
|
||||
|
||||
-- io.write("Executing "..origin.."\n")
|
||||
|
||||
-- io.write("Executing "..origin..".lua\n")
|
||||
--tprint(widget)
|
||||
|
||||
-- Call the origin to return
|
||||
local response = require(origin)
|
||||
response = response:getData(widget.type)
|
||||
|
||||
tprint(widget.type)
|
||||
if((response == nil) or (response == true)) then
|
||||
response = "{}"
|
||||
else
|
||||
response = response:getData(widget.type)
|
||||
end
|
||||
|
||||
return json.encode({
|
||||
widgetName = widget.name,
|
||||
widgetType = widget.type,
|
||||
dsRetention = ds.data_retention * 1000, -- msec
|
||||
widgetType = widget.type,
|
||||
dsRetention = ds.data_retention * 1000, -- msec
|
||||
success = true,
|
||||
data = response
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue