mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: Number comparisons in alerts and device groups (#7695)
Remove quotes so if the field we are comparing against is a string type, we still do a number comparison.
This commit is contained in:
committed by
Neil Lathwood
parent
de6266cb88
commit
8b3bd57303
@@ -357,7 +357,7 @@ $('#and').click('', function(e) {
|
||||
strategy: 'array',
|
||||
tagFieldName: 'rules[]'
|
||||
});
|
||||
if(value.indexOf("%") < 0) {
|
||||
if(value.indexOf("%") < 0 && isNaN(value)) {
|
||||
value = '"'+value+'"';
|
||||
}
|
||||
if(entity.indexOf("%") < 0) {
|
||||
|
||||
@@ -181,11 +181,13 @@ $('#and, #or').click('', function(e) {
|
||||
strategy: 'array',
|
||||
tagFieldName: 'patterns[]'
|
||||
});
|
||||
if(entity.indexOf("%") >= 0) {
|
||||
$('#response').data('tagmanager').populate([ entity+' '+condition+' '+value+' '+glue ]);
|
||||
} else {
|
||||
$('#response').data('tagmanager').populate([ '%'+entity+' '+condition+' "'+value+'" '+glue ]);
|
||||
if(value.indexOf("%") < 0 && isNaN(value)) {
|
||||
value = '"'+value+'"';
|
||||
}
|
||||
if(entity.indexOf("%") < 0) {
|
||||
entity = '%'+entity;
|
||||
}
|
||||
$('#response').data('tagmanager').populate([ entity+' '+condition+' '+value+' '+glue ]);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user