mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Make the user defined device type a preference and fix host pool member icon assignment
This commit is contained in:
parent
08ec407fbb
commit
8b92590287
6 changed files with 40 additions and 30 deletions
|
|
@ -2884,6 +2884,22 @@ end
|
|||
|
||||
-- ####################################################
|
||||
|
||||
-- Functions to set/get a device type of user choice
|
||||
|
||||
local function getCustomDeviceKey(mac)
|
||||
return "ntopng.prefs.device_types." .. string.upper(mac)
|
||||
end
|
||||
|
||||
function getCustomDeviceType(mac)
|
||||
return tonumber(ntop.getPref(getCustomDeviceKey(mac)))
|
||||
end
|
||||
|
||||
function setCustomDeviceType(mac, device_type)
|
||||
ntop.setPref(getCustomDeviceKey(mac), tostring(device_type))
|
||||
end
|
||||
|
||||
-- ####################################################
|
||||
|
||||
function tableToJsObject(lua_table)
|
||||
local json = require("dkjson")
|
||||
return json.encode(lua_table, nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue