Avoid timeseries read operations to display the chart icon

Now the icon is displayed whenever the timeseries are enabled for the given context
This commit is contained in:
emanuele-f 2020-02-19 13:26:05 +01:00
parent 5b70db90ad
commit d1140ec9fd
42 changed files with 201 additions and 149 deletions

View file

@ -1396,12 +1396,11 @@ function toggleAlert(disable) {
end
local status_reset = (status == nil)
local ts_utils = require "ts_utils"
if(has_engaged_alerts) then
alert_items[#alert_items + 1] = {
["label"] = i18n("show_alerts.engaged_alerts"),
["chart"] = ternary(ts_utils.exists("iface:engaged_alerts", {ifid = ifid}), "iface:engaged_alerts", ""),
["chart"] = ternary(areInterfaceTimeseriesEnabled(ifid), "iface:engaged_alerts", ""),
["div-id"] = "table-engaged-alerts", ["status"] = "engaged"}
elseif status == "engaged" then
status = nil; status_reset = 1