mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Implements AJAX discovery progress updates
This commit is contained in:
parent
437a04f91f
commit
31c0fe6fe7
3 changed files with 56 additions and 3 deletions
22
scripts/lua/get_discover_progress.lua
Normal file
22
scripts/lua/get_discover_progress.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
--
|
||||
-- (C) 2013-18 - ntop.org
|
||||
--
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
require "lua_utils"
|
||||
local json = require("dkjson")
|
||||
local discover = require "discover_utils"
|
||||
|
||||
local ifId = _GET["ifid"]
|
||||
|
||||
local discovery_requested = discover.networkDiscoveryRequested(ifId)
|
||||
|
||||
sendHTTPHeader('application/json')
|
||||
|
||||
local res = {
|
||||
discovery_requested = discovery_requested,
|
||||
progress = discover.getDiscoveryProgress()
|
||||
}
|
||||
|
||||
print(json.encode(res, nil))
|
||||
Loading…
Add table
Add a link
Reference in a new issue