Improve alert time format

This commit is contained in:
emanuele-f 2018-12-20 10:31:32 +01:00
parent 19052bcd62
commit 46b950b521
2 changed files with 9 additions and 2 deletions

View file

@ -9,6 +9,7 @@ require "lua_utils"
require "alert_utils"
require "flow_utils"
local format_utils = require "format_utils"
local json = require "dkjson"
sendHTTPContentTypeHeader('text/html')
@ -88,8 +89,10 @@ for _key,_value in ipairs(alerts) do
alert_entity_val = ""
end
if(tdiff < 60) then
column_date = secondsToTime(tdiff).." ago"
if(tdiff <= 600) then
column_date = secondsToTime(tdiff).. " " ..i18n("details.ago")
else
column_date = format_utils.formatPastEpochShort(_value["alert_tstamp"])
end
if engaged == true then