Fixed gauges in custom and dashboard. Tiquet: #2967
(cherry picked from commit 0ba80f3d3f
)
This commit is contained in:
parent
e199a0a013
commit
5d8c7a1c2b
|
@ -1481,8 +1481,11 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||
$temp[$module]['min'] = 0;
|
||||
$temp[$module]['max'] = 100;
|
||||
}else{
|
||||
$min = reporting_get_agentmodule_data_min($module,$period,$date);
|
||||
$min = $temp[$module]['min'];
|
||||
if ($temp[$module]['max'] == 0)
|
||||
$max = reporting_get_agentmodule_data_max($module,$period,$date);
|
||||
else
|
||||
$max = $temp[$module]['max'];
|
||||
$temp[$module]['min'] = ($min)== 0 ? 0 : $min;
|
||||
$temp[$module]['max'] = ($max)== 0 ? 100 : $max;
|
||||
}
|
||||
|
|
|
@ -872,13 +872,14 @@ function createGauge(name, etiqueta, value, min, max, min_warning,max_warning,mi
|
|||
|
||||
//var range = config.max - config.min;
|
||||
var range = config.max - config.min;
|
||||
if (value >= min_warning){
|
||||
if ( min_warning > 0 ) {
|
||||
config.yellowZones = [{ from: min_warning, to: max_warning }];
|
||||
}
|
||||
if ( min_critical > 0 ) {
|
||||
config.redZones = [{ from: min_critical, to: max_critical }];
|
||||
}
|
||||
|
||||
}
|
||||
gauges = new Gauge(name, config);
|
||||
gauges.render();
|
||||
gauges.redraw(value);
|
||||
|
|
Loading…
Reference in New Issue