Fixes issues with assets insert in clickhouse

This commit is contained in:
Matteo Biscosi 2025-03-13 10:10:18 +01:00
parent 86a35a1494
commit 0f7344c79a
4 changed files with 42 additions and 75 deletions

View file

@ -59,7 +59,7 @@ local assets = asset_utils.getHostsAssets(ifid, order, gui_to_db_columns[sort],
for _, value in pairs(assets or {}) do
local record = {}
local json_info = json.decode(value.json_info or "")
local json_info = json.decode(value.json_info or "") or {}
local column_ip = {
ip = value.ip

View file

@ -29,7 +29,7 @@ if table.len(manufacturers) > 0 then
if max_manufacturers >= 0 then
max_manufacturers = max_manufacturers - 1
rsp[#rsp + 1] = {
label = value.manufacturer .. " (" .. tostring(value.count) .. ")",
label = shortenString(value.manufacturer, 25) .. " (" .. tostring(value.count) .. ")",
value = tonumber(value.count),
url = ntop.getHttpPrefix() .. '/lua/assets.lua?page=details&manufacturer=' .. value.manufacturer
}