diff --git a/pandora_console/extras/mr/42.sql b/pandora_console/extras/mr/42.sql
index 2714e3f491..914ae0fae7 100644
--- a/pandora_console/extras/mr/42.sql
+++ b/pandora_console/extras/mr/42.sql
@@ -22,4 +22,7 @@ ALTER TABLE talert_actions ADD COLUMN `field18_recovery` TEXT NOT NULL DEFAULT "
ALTER TABLE talert_actions ADD COLUMN `field19_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN `field20_recovery` TEXT NOT NULL DEFAULT "";
+ALTER TABLE `treport_content` add column `graph_render` tinyint(1) UNSIGNED NOT NULL default 0;
+ALTER TABLE `treport_content_template` add column `graph_render` tinyint(1) UNSIGNED NOT NULL default 0;
+
COMMIT;
\ No newline at end of file
diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
index edfeeb7996..e6208f034a 100644
--- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
+++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
@@ -849,7 +849,8 @@ ALTER TABLE `treport_content_template` MODIFY COLUMN `historical_db` tinyint(1)
MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0';
ALTER TABLE `treport_content_template` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
-ALTER TABLE `treport_content_template` add column `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0;
+ALTER TABLE `treport_content_template` ADD COLUMN `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0;
+ALTER TABLE `treport_content_template` ADD COLUMN `graph_render` tinyint(1) UNSIGNED NOT NULL default 0;
-- ----------------------------------------------------------------------
-- Table `tnews`
@@ -1370,13 +1371,13 @@ ALTER TABLE `ttag` ADD COLUMN `previous_name` text NULL;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 41);
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 42);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '749');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', 750);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
@@ -1692,7 +1693,8 @@ ALTER TABLE `treport_content` MODIFY COLUMN `historical_db` tinyint(1) unsigned
MODIFY COLUMN `failover_type` tinyint(1) NULL DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
-ALTER TABLE `treport_content` add column `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0;
+ALTER TABLE `treport_content` ADD COLUMN `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0;
+ALTER TABLE `treport_content` ADD COLUMN `graph_render` tinyint(1) UNSIGNED NOT NULL default 0;
-- ---------------------------------------------------------------------
-- Table `tmodule_relationship`
diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
index 471866bdb3..ed12e6b714 100755
--- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php
+++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
@@ -156,6 +156,8 @@ $agent_max_value = true;
$agent_min_value = true;
$uncompressed_module = true;
+$graph_render = (empty($config['type_mode_graph']) === true) ? 0 : $config['type_mode_graph'];
+
switch ($action) {
case 'new':
$actionParameter = 'save';
@@ -259,7 +261,8 @@ switch ($action) {
case 'simple_graph':
$fullscale = isset($style['fullscale']) ? (bool) $style['fullscale'] : 0;
- $percentil = isset($style['percentil']) ? $config['percentil'] : 0;
+ $percentil = isset($style['percentil']) ? (bool) $style['percentil'] : 0;
+ $graph_render = $item['graph_render'];
// The break hasn't be forgotten.
case 'simple_baseline_graph':
case 'projection_graph':
@@ -653,6 +656,7 @@ switch ($action) {
$period = $item['period'];
$fullscale = isset($style['fullscale']) ? (bool) $style['fullscale'] : 0;
$recursion = $item['recursion'];
+ $graph_render = $item['graph_render'];
break;
case 'top_n':
@@ -2091,18 +2095,24 @@ $class = 'databox filters';
-
+
|
__('Avg, max & min'),
+ 2 => __('Max only'),
+ 3 => __('Min only'),
+ 0 => __('Avg only'),
+ ];
+ html_print_select(
+ $list_graph_render,
+ 'graph_render',
+ $graph_render
);
?>
|
@@ -2128,9 +2138,26 @@ $class = 'databox filters';
+
+
+
+ |
+
+
+ |
+
+
|
- |
+ |
@@ -3891,6 +3918,16 @@ $(document).ready (function () {
});
});
+ $("#checkbox-fullscale").change(function(e){
+ if(e.target.checked === true) {
+ $("#graph_render").prop('disabled', 'disabled');
+ } else {
+ $("#graph_render").prop('disabled', false);
+ }
+ });
+
+ $('#checkbox-fullscale').trigger('change');
+
$("#submit-create_item").click(function () {
var type = $('#type').val();
var name = $('#text-name').val();
@@ -4906,6 +4943,7 @@ function chooseType() {
$("#row_show_graph").hide();
$("#row_max_min_avg").hide();
$("#row_fullscale").hide();
+ $("#row_graph_render").hide();
$("#row_time_compare_overlapped").hide();
$("#row_quantity").hide();
$("#row_exception_condition_value").hide();
@@ -5010,8 +5048,14 @@ function chooseType() {
case 'simple_graph':
$("#row_time_compare_overlapped").show();
$("#row_fullscale").show();
- if ($("#checkbox-percentil").prop("checked"))
- $("#row_percentil").show();
+ $("#row_graph_render").show();
+ $("#row_percentil").show();
+
+ // Force type.
+ if('' === 'new'){
+ $("#graph_render").val();
+ }
+
// The break hasn't be forgotten, this element
// only should be shown on the simple graphs.
case 'simple_baseline_graph':
@@ -5377,7 +5421,12 @@ function chooseType() {
$("#row_description").show();
$("#row_period").show();
$("#row_historical_db_check").hide();
+ $("#row_graph_render").show();
$("#row_fullscale").show();
+ // Force MAX type.
+ if('' === 'new'){
+ $("#graph_render").val(2);
+ }
break;
case 'top_n':
diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php
index b88cc5d64e..4df826d2b3 100755
--- a/pandora_console/godmode/reporting/reporting_builder.php
+++ b/pandora_console/godmode/reporting/reporting_builder.php
@@ -1632,6 +1632,9 @@ switch ($action) {
break;
case 'simple_graph':
+ $values['graph_render'] = (int) get_parameter(
+ 'graph_render'
+ );
case 'simple_baseline_graph':
// HACK it is saved in show_graph field.
$values['show_graph'] = (int) get_parameter(
@@ -1641,6 +1644,14 @@ switch ($action) {
$good_format = true;
break;
+ case 'network_interfaces_report':
+ $values['graph_render'] = (int) get_parameter(
+ 'graph_render'
+ );
+ $values['period'] = get_parameter('period');
+ $good_format = true;
+ break;
+
case 'min_value':
case 'max_value':
case 'avg_value':
@@ -2274,6 +2285,9 @@ switch ($action) {
break;
case 'simple_graph':
+ $values['graph_render'] = (int) get_parameter(
+ 'graph_render'
+ );
case 'simple_baseline_graph':
// HACK it is saved in show_graph field.
$values['show_graph'] = (int) get_parameter(
@@ -2283,6 +2297,14 @@ switch ($action) {
$good_format = true;
break;
+ case 'network_interfaces_report':
+ $values['graph_render'] = (int) get_parameter(
+ 'graph_render'
+ );
+ $values['period'] = get_parameter('period');
+ $good_format = true;
+ break;
+
case 'min_value':
case 'max_value':
case 'avg_value':
diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php
index f8974e9770..e21c3b6e55 100755
--- a/pandora_console/godmode/setup/setup_visuals.php
+++ b/pandora_console/godmode/setup/setup_visuals.php
@@ -738,67 +738,166 @@ $row++;
$table_chars->data = [];
$table_chars->data[$row][0] = __('Graph color #1');
- $table_chars->data[$row][1] = html_print_input_text('graph_color1', $config['graph_color1'], '', 8, 8, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'graph_color1',
+ $config['graph_color1'],
+ '',
+ 8,
+ 8,
+ true
+ );
$row++;
$table_chars->data[$row][0] = __('Graph color #2');
- $table_chars->data[$row][1] = html_print_input_text('graph_color2', $config['graph_color2'], '', 8, 8, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'graph_color2',
+ $config['graph_color2'],
+ '',
+ 8,
+ 8,
+ true
+ );
$row++;
$table_chars->data[$row][0] = __('Graph color #3');
- $table_chars->data[$row][1] = html_print_input_text('graph_color3', $config['graph_color3'], '', 8, 8, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'graph_color3',
+ $config['graph_color3'],
+ '',
+ 8,
+ 8,
+ true
+ );
$row++;
$table_chars->data[$row][0] = __('Graph color #4');
- $table_chars->data[$row][1] = html_print_input_text('graph_color4', $config['graph_color4'], '', 8, 8, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'graph_color4',
+ $config['graph_color4'],
+ '',
+ 8,
+ 8,
+ true
+ );
$row++;
$table_chars->data[$row][0] = __('Graph color #5');
- $table_chars->data[$row][1] = html_print_input_text('graph_color5', $config['graph_color5'], '', 8, 8, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'graph_color5',
+ $config['graph_color5'],
+ '',
+ 8,
+ 8,
+ true
+ );
$row++;
$table_chars->data[$row][0] = __('Graph color #6');
- $table_chars->data[$row][1] = html_print_input_text('graph_color6', $config['graph_color6'], '', 8, 8, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'graph_color6',
+ $config['graph_color6'],
+ '',
+ 8,
+ 8,
+ true
+ );
$row++;
$table_chars->data[$row][0] = __('Graph color #7');
- $table_chars->data[$row][1] = html_print_input_text('graph_color7', $config['graph_color7'], '', 8, 8, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'graph_color7',
+ $config['graph_color7'],
+ '',
+ 8,
+ 8,
+ true
+ );
$row++;
$table_chars->data[$row][0] = __('Graph color #8');
- $table_chars->data[$row][1] = html_print_input_text('graph_color8', $config['graph_color8'], '', 8, 8, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'graph_color8',
+ $config['graph_color8'],
+ '',
+ 8,
+ 8,
+ true
+ );
$row++;
$table_chars->data[$row][0] = __('Graph color #9');
- $table_chars->data[$row][1] = html_print_input_text('graph_color9', $config['graph_color9'], '', 8, 8, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'graph_color9',
+ $config['graph_color9'],
+ '',
+ 8,
+ 8,
+ true
+ );
$row++;
$table_chars->data[$row][0] = __('Graph color #10');
- $table_chars->data[$row][1] = html_print_input_text('graph_color10', $config['graph_color10'], '', 8, 8, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'graph_color10',
+ $config['graph_color10'],
+ '',
+ 8,
+ 8,
+ true
+ );
$row++;
$table_chars->data[$row][0] = __('Value to interface graphics');
- $table_chars->data[$row][1] = html_print_input_text('interface_unit', $config['interface_unit'], '', 20, 20, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'interface_unit',
+ $config['interface_unit'],
+ '',
+ 20,
+ 20,
+ true
+ );
$row++;
$disabled_graph_precision = false;
- if (!enterprise_installed()) {
+ if (enterprise_installed() === false) {
$disabled_graph_precision = true;
}
$table_chars->data[$row][0] = __('Data precision');
- $table_chars->data[$row][1] = html_print_input_text('graph_precision', $config['graph_precision'], '', 5, 5, true, $disabled_graph_precision, false, 'onChange="change_precision()"');
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'graph_precision',
+ $config['graph_precision'],
+ '',
+ 5,
+ 5,
+ true,
+ $disabled_graph_precision,
+ false,
+ 'onChange="change_precision()"'
+ );
$row++;
- if (!isset($config['short_module_graph_data'])) {
+ if (isset($config['short_module_graph_data']) === false) {
$config['short_module_graph_data'] = true;
}
$table_chars->data[$row][0] = __('Data precision in graphs');
- $table_chars->data[$row][1] = html_print_input_text('short_module_graph_data', $config['short_module_graph_data'], '', 5, 5, true, $disabled_graph_precision, false, 'onChange="change_precision()"');
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'short_module_graph_data',
+ $config['short_module_graph_data'],
+ '',
+ 5,
+ 5,
+ true,
+ $disabled_graph_precision,
+ false,
+ 'onChange="change_precision()"'
+ );
$row++;
- $table_chars->data[$row][0] = __('Default line thickness for the Custom Graph.');
+ $table_chars->data[$row][0] = __(
+ 'Default line thickness for the Custom Graph.'
+ );
$table_chars->data[$row][1] = html_print_input_text(
'custom_graph_width',
$config['custom_graph_width'],
@@ -853,7 +952,14 @@ $row++;
$row++;
$table_chars->data[$row][0] = __('Percentile');
- $table_chars->data[$row][1] = html_print_input_text('percentil', $config['percentil'], '', 20, 20, true);
+ $table_chars->data[$row][1] = html_print_input_text(
+ 'percentil',
+ $config['percentil'],
+ '',
+ 20,
+ 20,
+ true
+ );
$row++;
$table_chars->data[$row][0] = __('Graph TIP view:');
@@ -863,17 +969,37 @@ $row++;
$options_full_escale[1] = __('All');
$options_full_escale[2] = __('On Boolean graphs');
- $table_chars->data[$row][1] = html_print_select($options_full_escale, 'full_scale_option', $config['full_scale_option'], '', '', 0, true, false, false);
+ $table_chars->data[$row][1] = html_print_select(
+ $options_full_escale,
+ 'full_scale_option',
+ $config['full_scale_option'],
+ '',
+ '',
+ 0,
+ true,
+ false,
+ false
+ );
$row++;
- $table_chars->data[$row][0] = __('Show only average');
+ $table_chars->data[$row][0] = __('Graph mode');
$options_soft_graphs = [];
$options_soft_graphs[0] = __('Show only average by default');
$options_soft_graphs[1] = __('Show MAX/AVG/MIN by default');
- $table_chars->data[$row][1] = html_print_select($options_soft_graphs, 'type_mode_graph', $config['type_mode_graph'], '', '', 0, true, false, false);
+ $table_chars->data[$row][1] = html_print_select(
+ $options_soft_graphs,
+ 'type_mode_graph',
+ $config['type_mode_graph'],
+ '',
+ '',
+ 0,
+ true,
+ false,
+ false
+ );
$row++;
$table_chars->data[$row][0] = __('Zoom graphs:');
@@ -885,18 +1011,19 @@ $row++;
$options_zoom_graphs[4] = 'x4';
$options_zoom_graphs[5] = 'x5';
- $table_chars->data[$row][1] = html_print_select($options_zoom_graphs, 'zoom_graph', $config['zoom_graph'], '', '', 0, true, false, false);
+ $table_chars->data[$row][1] = html_print_select(
+ $options_zoom_graphs,
+ 'zoom_graph',
+ $config['zoom_graph'],
+ '',
+ '',
+ 0,
+ true,
+ false,
+ false
+ );
$row++;
- /*
- $table_font->data[$row][0] = __('Font path');
- $fonts = load_fonts();
- $table_font->data[$row][1] = html_print_select($fonts, 'fontpath',
- io_safe_output($config["fontpath"]), '', '', 0, true);
-
- $row++;
- */
-
echo '