Handle operators in (view only) tags

This commit is contained in:
Alfredo Cardigliano 2021-06-01 10:53:46 +02:00
parent f242b94b6d
commit ee7c012926
6 changed files with 33 additions and 27 deletions

View file

@ -14,6 +14,7 @@ local alert_consts = require "alert_consts"
local alert_utils = require "alert_utils"
local alert_severities = require "alert_severities"
local alert_roles = require "alert_roles"
local tag_utils = require "tag_utils"
-- ##############################################
@ -89,12 +90,10 @@ function alert_store:strip_filter_operator(value)
local filter = split(value, ",")
local value = filter[1]
local op = filter[2]
if op == 'lt' then
op = '<='
elseif op == 'gt' then
op = '>='
if tag_utils.tag_operators[op] then
op = tag_utils.tag_operators[op]
else
op = '='
op = tag_utils.tag_operators['eq']
end
return value, op
end