mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Allow _perc and _current columns to be string for alert rules (#8532)
* refactor: Allow _perc and _current columns to be string for alert rules * Moved the check for column type
This commit is contained in:
@@ -110,8 +110,12 @@ class QueryBuilderFilter implements \JsonSerializable
|
||||
|
||||
$field = "$table.$column";
|
||||
|
||||
// format enums as radios
|
||||
if ($type == 'enum') {
|
||||
if (ends_with($column, ['_perc', '_current'])) {
|
||||
$this->filter[$field] = [
|
||||
'id' => $field,
|
||||
'type' => 'string',
|
||||
];
|
||||
} elseif ($type == 'enum') {// format enums as radios
|
||||
$values = explode(',', substr($column_type, 4));
|
||||
$values = array_map(function ($val) {
|
||||
return trim($val, "()' ");
|
||||
|
||||
Reference in New Issue
Block a user