mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix NOT REGEXP rules (#8376)
* Fix NOT REGEXP rules * not_regex -> not regex * Fixed saving rules as well
This commit is contained in:
@@ -91,7 +91,7 @@ if (is_numeric($rule_id) && $rule_id > 0) {
|
||||
'alert_rules',
|
||||
'id=?',
|
||||
array($rule_id)
|
||||
) > 0) {
|
||||
) >= 0) {
|
||||
$message = "Edited Rule: <i>$name</i>";
|
||||
} else {
|
||||
$message = "Failed to edit Rule <i>$name</i>";
|
||||
|
@@ -158,19 +158,25 @@ if (is_admin()) {
|
||||
{type: 'less_or_equal', nb_inputs: 1, multiple: false, apply_to: ['string', 'number', 'datetime']},
|
||||
{type: 'greater', nb_inputs: 1, multiple: false, apply_to: ['string', 'number', 'datetime']},
|
||||
{type: 'greater_or_equal', nb_inputs: 1, multiple: false, apply_to: ['string', 'number', 'datetime']},
|
||||
{type: 'regexp', nb_inputs: 1, multiple: false, apply_to: ['string']}
|
||||
{type: 'regex', nb_inputs: 1, multiple: false, apply_to: ['string']},
|
||||
{type: 'not_regex', nb_inputs: 1, multiple: false, apply_to: ['string']}
|
||||
],
|
||||
lang: {
|
||||
operators: {
|
||||
regexp: 'regex'
|
||||
regexp: 'regex',
|
||||
not_regex: 'not regex'
|
||||
}
|
||||
},
|
||||
sqlOperators: {
|
||||
regexp: {op: 'REGEXP'}
|
||||
regexp: {op: 'REGEXP'},
|
||||
not_regexp: {op: 'NOT REGEXP'}
|
||||
},
|
||||
sqlRuleOperator: {
|
||||
'REGEXP': function (v) {
|
||||
return {val: v, op: 'regexp'};
|
||||
},
|
||||
'NOT REGEXP': function (v) {
|
||||
return {val: v, op: 'not_regexp'};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
2
html/js/sql-parser.min.js
vendored
2
html/js/sql-parser.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user