Widget Eventlog Sensors Link and Mouseover functionality (#11380)

* Global Settings - Alert Default Settings

* Revert "Global Settings - Alert Default Settings"

This reverts commit a1af62b146.

* Widget Eventlog - Sensors link and overlib Image

* travis fix

* handling via AppServiceProvider

* collect function

* Travis ...

* static list of Sensor Types

* adding all sensor graph_types

* remove collect

* correct getTypes - remove change to lower case

* class sensor_descr switch

* class sensor_descr switch - revert

* Use standard sensor type names

* move types to attribute list

* going back to changes from 9eee7fad58

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
SourceDoctor
2020-04-19 19:57:49 +02:00
committed by GitHub
parent bb9ebb4e45
commit cc2894c0df
7 changed files with 167 additions and 32 deletions

View File

@@ -200,10 +200,10 @@ function record_sensor_data($device, $all_sensors)
// FIXME also warn when crossing WARN level!
if ($sensor['sensor_limit_low'] != '' && $prev_sensor_value > $sensor['sensor_limit_low'] && $sensor_value < $sensor['sensor_limit_low'] && $sensor['sensor_alert'] == 1) {
echo 'Alerting for '.$device['hostname'].' '.$sensor['sensor_descr']."\n";
log_event("$class {$sensor['sensor_descr']} under threshold: $sensor_value $unit (< {$sensor['sensor_limit_low']} $unit)", $device, $class, 4, $sensor['sensor_id']);
log_event("$class under threshold: $sensor_value $unit (< {$sensor['sensor_limit_low']} $unit)", $device, $sensor['sensor_class'], 4, $sensor['sensor_id']);
} elseif ($sensor['sensor_limit'] != '' && $prev_sensor_value < $sensor['sensor_limit'] && $sensor_value > $sensor['sensor_limit'] && $sensor['sensor_alert'] == 1) {
echo 'Alerting for '.$device['hostname'].' '.$sensor['sensor_descr']."\n";
log_event("$class {$sensor['sensor_descr']} above threshold: $sensor_value $unit (> {$sensor['sensor_limit']} $unit)", $device, $class, 4, $sensor['sensor_id']);
log_event("$class above threshold: $sensor_value $unit (> {$sensor['sensor_limit']} $unit)", $device, $sensor['sensor_class'], 4, $sensor['sensor_id']);
}
if ($sensor['sensor_class'] == 'state' && $prev_sensor_value != $sensor_value) {
$trans = array_column(