Fixes local and remote badges not formatted

This commit is contained in:
MatteoBiscosi 2022-06-30 11:29:43 +02:00
parent 90c2279d0d
commit 8c1fb61e60
3 changed files with 21 additions and 3 deletions

View file

@ -5482,6 +5482,22 @@ function format_confidence_from_json(record)
return confidence
end
-- ##############################################
function format_location_badge(location)
local loc = string.lower(location) or ""
if loc == "l" then
loc = i18n("details.label_short_local_host_badge")
elseif loc == "r" then
loc = i18n("details.label_short_remote_host_badge")
end
return loc
end
--
-- IMPORTANT
-- Leave it at the end so it can use the functions