From 8718a3e2b993c9e9e2c5e3bdb727a595d602d92e Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 14 Nov 2017 12:20:28 +0100 Subject: [PATCH] Fixed non interactive status graphs --- pandora_console/include/functions_reporting.php | 6 +++++- pandora_console/include/functions_reporting_html.php | 11 ++++++++++- pandora_console/mobile/operation/agent.php | 8 +++++++- .../operation/agentes/estado_generalagente.php | 8 +++++++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 40530eb96b..5a3860fb66 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -7053,6 +7053,10 @@ function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_he $urls['monitor_not_init'] = $links['monitor_not_init']; } + // Fixed width non interactive charts + $status_chart_width = $config["flash_charts"] == false + ? 100 : $graph_width; + // Modules by status table $table_mbs = html_get_predefined_table(); @@ -7092,7 +7096,7 @@ function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_he $table_mbs->colspan[count($table_mbs->data)][0] = 4; $table_mbs->cellstyle[count($table_mbs->data)][0] = 'text-align: center;'; $tdata[0] = '
' . - '
' . + '
' . graph_agent_status(false, $graph_width, $graph_height, true, true, $data_agents) . '
'; $table_mbs->rowclass[] = ''; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 44d6c9ee6a..71140ad5b7 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2741,7 +2741,16 @@ function reporting_get_stats_summary($data, $graph_width, $graph_height) { $table_sum->cellstyle[count($table_sum->data)][2] = 'text-align: center;'; if ($data["monitor_checks"] > 0) { - $tdata[0] = '
' . graph_agent_status (false, $graph_width, $graph_height, true, true) . '
'; + // Fixed width non interactive charts + $status_chart_width = $config["flash_charts"] == false + ? 100 : $graph_width; + + $tdata[0] = + '
' . + '
' . + graph_agent_status (false, $graph_width, $graph_height, true, true) . + '
' . + '
'; } else { $tdata[2] = html_print_image('images/image_problem.png', true, array('width' => $graph_width)); diff --git a/pandora_console/mobile/operation/agent.php b/pandora_console/mobile/operation/agent.php index 5a765eaedb..93fc991887 100644 --- a/pandora_console/mobile/operation/agent.php +++ b/pandora_console/mobile/operation/agent.php @@ -198,10 +198,16 @@ class Agent { $ui->contentGridAddCell($html, 'agent_details'); ob_start(); + + // Fixed width non interactive charts + $status_chart_width = $config["flash_charts"] == false ? 100 : 160; + $graph_width = $config["flash_charts"] == false ? 200 : 160; $html = '
'; $html .= "" . __('Modules by status') . ""; - $html .= graph_agent_status ($this->id, 160, 160, true); + $html .= '
'; + $html .= graph_agent_status ($this->id, $graph_width, 160, true); + $html .= '
'; $graph_js = ob_get_clean(); $html = $graph_js . $html; diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index c0f33884c0..c3660e6089 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -114,8 +114,14 @@ $data = array(); //$data[0] = reporting_tiny_stats ($agent, true, 'agent', '
'); //$table_agent->rowspan[count($table_agent->data)][0] = 6; +// Fixed width non interactive charts +$status_chart_width = $config["flash_charts"] == false ? 100 : 150; +$graph_width = $config["flash_charts"] == false ? 200 : 150; + $data[0] = '
'; -$data[0] .= graph_agent_status ($id_agente, 150, 120, true); +$data[0] .= '
'; +$data[0] .= graph_agent_status ($id_agente, $graph_width, 120, true); +$data[0] .= '
'; $data[0] .= '
' . reporting_tiny_stats ($agent, true); $data[0] .= ui_print_help_tip(__('Agent statuses are re-calculated by the server, they are not shown in real time.'), true); $data[0] .= '
';