Commit 9ad186bc by Patrick O'Carroll

not ok option to alert list, fixes: #9754

parent c44f6e2e
...@@ -94,7 +94,12 @@ func HandleAlertsQuery(query *m.GetAlertsQuery) error { ...@@ -94,7 +94,12 @@ func HandleAlertsQuery(query *m.GetAlertsQuery) error {
if i > 0 { if i > 0 {
sql.WriteString(" OR ") sql.WriteString(" OR ")
} }
if strings.HasPrefix(v, "not") {
sql.WriteString("state <> ? ")
v = v[4:]
} else {
sql.WriteString("state = ? ") sql.WriteString("state = ? ")
}
params = append(params, v) params = append(params, v)
} }
sql.WriteString(")") sql.WriteString(")")
......
...@@ -11,6 +11,7 @@ export class AlertListCtrl { ...@@ -11,6 +11,7 @@ export class AlertListCtrl {
stateFilters = [ stateFilters = [
{text: 'All', value: null}, {text: 'All', value: null},
{text: 'OK', value: 'ok'}, {text: 'OK', value: 'ok'},
{text: 'Not OK', value: 'not_ok'},
{text: 'Alerting', value: 'alerting'}, {text: 'Alerting', value: 'alerting'},
{text: 'No Data', value: 'no_data'}, {text: 'No Data', value: 'no_data'},
{text: 'Paused', value: 'paused'}, {text: 'Paused', value: 'paused'},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment