mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Reworked applications and categories tabs (#)
This commit is contained in:
parent
356f3002f3
commit
cec956fa1b
16 changed files with 1061 additions and 441 deletions
44
scripts/lua/rest/v2/get/interface/tcp_stats.lua
Normal file
44
scripts/lua/rest/v2/get/interface/tcp_stats.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
--
|
||||
-- (C) 2013-21 - ntop.org
|
||||
--
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
local rest_utils = require("rest_utils")
|
||||
local graph_utils = require "graph_utils"
|
||||
|
||||
local rc = rest_utils.consts.success.ok
|
||||
local res = {}
|
||||
|
||||
local ifid = _GET["ifid"]
|
||||
|
||||
if isEmptyString(ifid) then
|
||||
rc = rest_utils.consts.err.invalid_interface
|
||||
rest_utils.answer(rc)
|
||||
return
|
||||
end
|
||||
|
||||
interface.select(ifid)
|
||||
|
||||
local ifstats = interface.getFlowsStatus()
|
||||
local res = {
|
||||
{
|
||||
label = i18n('enstablished'),
|
||||
value = ifstats["Established"],
|
||||
},
|
||||
{
|
||||
label = i18n('syn'),
|
||||
value = ifstats["SYN"],
|
||||
},
|
||||
{
|
||||
label = i18n('rst'),
|
||||
value = ifstats["RST"],
|
||||
},
|
||||
{
|
||||
label = i18n('fin'),
|
||||
value = ifstats["FIN"],
|
||||
},
|
||||
}
|
||||
|
||||
rest_utils.answer(rc, graph_utils.convert_pie_data(res, true, "formatValue"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue