mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix the displayed unit for frequency and distance in the wireless section (#13614)
* Fix the displayed unit for frequency and distance in the wireless menu * Small style fix
This commit is contained in:
@@ -1319,6 +1319,14 @@ function get_sensor_label_color($sensor, $type = 'sensors')
|
||||
return "<span class='label $label_style'>" . trim($sensor['sensor_current']) . ' ' . $unit . '</span>';
|
||||
}
|
||||
|
||||
if ($type == 'wireless' && $sensor['sensor_class'] == 'frequency') {
|
||||
return "<span class='label $label_style'>" . trim(Number::formatSi($sensor['sensor_current'] * 1000000, 2, 3, 'Hz')) . '</span>';
|
||||
}
|
||||
|
||||
if ($type == 'wireless' && $sensor['sensor_class'] == 'distance') {
|
||||
return "<span class='label $label_style'>" . trim(Number::formatSi($sensor['sensor_current'] * 1000, 2, 3, 'm')) . '</span>';
|
||||
}
|
||||
|
||||
return "<span class='label $label_style'>" . trim(Number::formatSi($sensor['sensor_current'], 2, 3, $unit)) . '</span>';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user