Files
karma/ui/src/Common/Query.js
Łukasz Mierzwa 1093b38164 feat(ui): use not-equal operator when user alt+clicks on a label
When user clicks on a label we apply a foo=bar filter, this change allows to add a foo!=bar filter by holding Alt key when clicking.

Fixes #485
2019-03-01 19:44:08 +00:00

20 lines
404 B
JavaScript

const QueryOperators = Object.freeze({
Equal: "=",
NotEqual: "!=",
Regex: "=~"
});
const StaticLabels = Object.freeze({
AlertName: "alertname",
AlertManager: "@alertmanager",
Receiver: "@receiver",
State: "@state",
SilenceID: "@silence_id"
});
function FormatQuery(name, operator, value) {
return `${name}${operator}${value}`;
}
export { QueryOperators, StaticLabels, FormatQuery };