mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Added module value control to shows units in max, min and avg values. Ticket #159
(cherry picked from commit 1f07d8a022cec8988fdf148e5c4c35f447eb6fa0) Conflicts resolved: pandora_console/include/functions_visual_map.php
This commit is contained in:
parent
9791f2aacb
commit
0e031b50e3
@ -334,6 +334,14 @@ $table_font->data[$row][1] = html_print_input_text('item_title_size_text',
|
|||||||
$config["item_title_size_text"], '', 3, 3, true);
|
$config["item_title_size_text"], '', 3, 3, true);
|
||||||
$row++;
|
$row++;
|
||||||
|
|
||||||
|
$table_font->data[$row][0] = __('Show units in values report') .
|
||||||
|
ui_print_help_tip(__('This enabling this, max, min and avg values will be shown with units.'), true);
|
||||||
|
$table_font->data[$row][1] = __('Yes') . ' ' .
|
||||||
|
html_print_radio_button ('simple_module_value', 1, '', $config["simple_module_value"], true).' ';
|
||||||
|
$table_font->data[$row][1] .= __('No') . ' ' .
|
||||||
|
html_print_radio_button ('simple_module_value', 0, '', $config["simple_module_value"], true);
|
||||||
|
$row++;
|
||||||
|
|
||||||
echo "<fieldset>";
|
echo "<fieldset>";
|
||||||
echo "<legend>" . __('Font and Text configuration') . "</legend>";
|
echo "<legend>" . __('Font and Text configuration') . "</legend>";
|
||||||
html_print_table ($table_font);
|
html_print_table ($table_font);
|
||||||
|
@ -482,6 +482,8 @@ function config_update_config () {
|
|||||||
$error_update[] = __('Item title size text');
|
$error_update[] = __('Item title size text');
|
||||||
if (!config_update_value ('gis_label', get_parameter ('gis_label')))
|
if (!config_update_value ('gis_label', get_parameter ('gis_label')))
|
||||||
$error_update[] = __('GIS Labels');
|
$error_update[] = __('GIS Labels');
|
||||||
|
if (!config_update_value ('simple_module_value', get_parameter ('simple_module_value')))
|
||||||
|
$error_update[] = __('Show units in values report');
|
||||||
if (!config_update_value ('gis_default_icon', get_parameter ('gis_default_icon')))
|
if (!config_update_value ('gis_default_icon', get_parameter ('gis_default_icon')))
|
||||||
$error_update[] = __('Default icon in GIS');
|
$error_update[] = __('Default icon in GIS');
|
||||||
if (!config_update_value ('autohidden_menu', get_parameter('autohidden_menu')))
|
if (!config_update_value ('autohidden_menu', get_parameter('autohidden_menu')))
|
||||||
@ -1440,6 +1442,10 @@ function config_process_config () {
|
|||||||
config_update_value ('item_title_size_text', 45);
|
config_update_value ('item_title_size_text', 45);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($config['simple_module_value'])) {
|
||||||
|
config_update_value ('simple_module_value', 1);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($config['gis_label'])) {
|
if (!isset($config['gis_label'])) {
|
||||||
config_update_value ('gis_label', 0);
|
config_update_value ('gis_label', 0);
|
||||||
}
|
}
|
||||||
|
@ -3712,18 +3712,33 @@ function reporting_value($report, $content, $type) {
|
|||||||
break;
|
break;
|
||||||
case 'min':
|
case 'min':
|
||||||
$value = reporting_get_agentmodule_data_min(
|
$value = reporting_get_agentmodule_data_min(
|
||||||
$content['id_agent_module'], $content['period'], $report["datetime"]);
|
$content['id_agent_module'], $content['period'], $report["datetime"]);
|
||||||
$formated_value = format_for_graph($value, 2) . " " . $unit;
|
if (!$config['simple_module_value']) {
|
||||||
|
$formated_value = $value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$formated_value = format_for_graph($value, 2) . " " . $unit;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'avg':
|
case 'avg':
|
||||||
$value = reporting_get_agentmodule_data_average(
|
$value = reporting_get_agentmodule_data_average(
|
||||||
$content['id_agent_module'], $content['period'], $report["datetime"]);
|
$content['id_agent_module'], $content['period'], $report["datetime"]);
|
||||||
$formated_value = format_for_graph($value, 2) . " " . $unit;
|
if (!$config['simple_module_value']) {
|
||||||
|
$formated_value = $value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$formated_value = format_for_graph($value, 2) . " " . $unit;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'sum':
|
case 'sum':
|
||||||
$value = reporting_get_agentmodule_data_sum(
|
$value = reporting_get_agentmodule_data_sum(
|
||||||
$content['id_agent_module'], $content['period'], $report["datetime"]);
|
$content['id_agent_module'], $content['period'], $report["datetime"]);
|
||||||
$formated_value = format_for_graph($value, 2) . " " . $unit;
|
if (!$config['simple_module_value']) {
|
||||||
|
$formated_value = $value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$formated_value = format_for_graph($value, 2) . " " . $unit;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'MTTR':
|
case 'MTTR':
|
||||||
$value = reporting_get_agentmodule_mttr(
|
$value = reporting_get_agentmodule_mttr(
|
||||||
|
@ -1159,8 +1159,11 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
|
|||||||
$value = __('Unknown');
|
$value = __('Unknown');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( is_numeric($value) )
|
if ( is_numeric($value) ) {
|
||||||
$value = format_for_graph($value, $config['graph_precision']);
|
if ($config['simple_module_value']) {
|
||||||
|
$value = remove_right_zeros(number_format($value, $config['graph_precision']));
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!empty($unit_text)) {
|
if (!empty($unit_text)) {
|
||||||
$value .= " " . $unit_text;
|
$value .= " " . $unit_text;
|
||||||
}
|
}
|
||||||
@ -1178,8 +1181,11 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
|
|||||||
$value = __('Unknown');
|
$value = __('Unknown');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( is_numeric($value) )
|
if ( is_numeric($value) ) {
|
||||||
$value = format_for_graph($value, 2);
|
if ($config['simple_module_value']) {
|
||||||
|
$value = format_for_graph($value, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!empty($unit_text))
|
if (!empty($unit_text))
|
||||||
$value .= " " . $unit_text;
|
$value .= " " . $unit_text;
|
||||||
}
|
}
|
||||||
@ -1191,8 +1197,11 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
|
|||||||
$value = __('Unknown');
|
$value = __('Unknown');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( is_numeric($value) )
|
if ( is_numeric($value) ) {
|
||||||
$value = format_for_graph($value, 2);
|
if ($config['simple_module_value']) {
|
||||||
|
$value = format_for_graph($value, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!empty($unit_text))
|
if (!empty($unit_text))
|
||||||
$value .= " " . $unit_text;
|
$value .= " " . $unit_text;
|
||||||
}
|
}
|
||||||
@ -1204,8 +1213,11 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
|
|||||||
$value = __('Unknown');
|
$value = __('Unknown');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( is_numeric($value) )
|
if ( is_numeric($value) ) {
|
||||||
$value = format_for_graph($value, 2);
|
if ($config['simple_module_value']) {
|
||||||
|
$value = format_for_graph($value, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!empty($unit_text))
|
if (!empty($unit_text))
|
||||||
$value .= " " . $unit_text;
|
$value .= " " . $unit_text;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user