diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php
index 7d5cbc0c99..3c576fecf2 100644
--- a/pandora_console/extensions/agents_modules.php
+++ b/pandora_console/extensions/agents_modules.php
@@ -801,7 +801,7 @@ function mainAgentsModules()
echo "
";
$win_handle = dechex(crc32($module_id.$module['name']));
$graph_type = return_graphtype(modules_get_agentmodule_type($module_id));
- $link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."')";
+ $link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."', 800, 480)";
echo '';
diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php
index 15616dfc51..6dcb95afd3 100755
--- a/pandora_console/include/ajax/module.php
+++ b/pandora_console/include/ajax/module.php
@@ -1084,7 +1084,7 @@ if (check_login()) {
$draw_events = 0;
}
- $link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&id='.$module['id_agente_modulo'].'&refresh='.SECONDS_10MINUTES.'&'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 700)";
+ $link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&id='.$module['id_agente_modulo'].'&refresh='.SECONDS_10MINUTES.'&'."draw_events=$draw_events', 'day_".$win_handle."', 800, 480)";
if (!is_snapshot_data($module['datos'])) {
$data[8] .= ''.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).' ';
}
diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php
index 77dee71bab..1fb4121454 100644
--- a/pandora_console/include/functions_events.php
+++ b/pandora_console/include/functions_events.php
@@ -4228,7 +4228,7 @@ function events_page_details($event, $server='')
$graph_params_str = http_build_query($graph_params);
- $link = "winopeng('".$url.'?'.$graph_params_str."','".$win_handle."')";
+ $link = "winopeng_var('".$url.'?'.$graph_params_str."','".$win_handle."', 800, 480)";
$data[1] = '';
$data[1] .= html_print_image('images/chart_curve.png', true);
diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php
index d30bc6b812..40b9ed0900 100644
--- a/pandora_console/include/functions_graph.php
+++ b/pandora_console/include/functions_graph.php
@@ -267,13 +267,13 @@ function grafico_modulo_sparse_data(
|| $data_module_graph['id_module_type'] == 31
|| $data_module_graph['id_module_type'] == 100
) {
- $array_data = grafico_modulo_sparse_data_chart(
- $agent_module_id,
- $date_array,
- $data_module_graph,
- $params,
- $series_suffix
- );
+ $array_data = grafico_modulo_sparse_data_chart(
+ $agent_module_id,
+ $date_array,
+ $data_module_graph,
+ $params,
+ $series_suffix
+ );
} else {
$data_slice = ($date_array['period'] / (250 * $params['zoom']) + 100);
$array_data = fullscale_data(
@@ -289,6 +289,10 @@ function grafico_modulo_sparse_data(
}
}
+ if (empty($array_data) === true) {
+ return [];
+ }
+
if ($array_data === false && (!$params['graph_combined']
&& !isset($array_data['sum1']['data'][0][1]) && !$params['baseline'])
) {
@@ -1005,7 +1009,7 @@ function grafico_modulo_sparse($params, $server_name='')
$return .= graph_nodata_image($params['width'], $params['height']);
}
} else {
- if (!empty($array_data)) {
+ if (empty($array_data) === false) {
$return = area_graph(
$agent_module_id,
$array_data,
@@ -4168,6 +4172,10 @@ function fullscale_data(
$data_slice
);
+ if ($data_uncompress === false) {
+ return [];
+ }
+
$data = [];
$previous_data = 0;
// Normal.
@@ -4413,10 +4421,6 @@ function fullscale_data(
$data['sum'.$series_suffix]['avg'] = ($sum_data_avg / $count_data_total);
}
} else {
- if ($data_uncompress === false) {
- $data_uncompress = [];
- }
-
foreach ($data_uncompress as $k) {
foreach ($k['data'] as $v) {
if (isset($v['type']) && $v['type'] == 1) {
@@ -4991,7 +4995,14 @@ function graph_nodata_image(
if ($percent === true) {
$div = $image_div;
} else {
- $style = 'width:'.$width.'px; height:'.$height.'px; background-color: white; margin: 0 auto;';
+ if (strpos($width, '%') === false) {
+ $width = 'width: '.$width.'px;';
+ } else {
+ $width = 'width: '.$width.';';
+ }
+
+ $style = $width.' height:'.$height.'px;';
+ $style .= ' background-color: white; margin: 0 auto;';
$div = ' '.$image_div.' ';
}
diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php
index 81991face5..9a5ea93f92 100755
--- a/pandora_console/include/functions_modules.php
+++ b/pandora_console/include/functions_modules.php
@@ -3456,7 +3456,7 @@ function get_module_realtime_link_graph($module)
$win_handle = 'realtime_'.dechex(crc32($module['id_agente_modulo'].$module['nombre']));
- $link_button = ''.html_print_image(
+ $link_button = ''.html_print_image(
'images/realtime_shortcut.png',
true,
[
diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php
index 96f8c0dfa9..25e0f67020 100755
--- a/pandora_console/include/functions_treeview.php
+++ b/pandora_console/include/functions_treeview.php
@@ -857,7 +857,13 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$graph_url = "$url?params=$params_encoded";
$win_handle = dechex(crc32($interface['status_module_id'].$interface_name));
- $graph_link = "".html_print_image('images/chart_curve.png', true, ['title' => __('Interface traffic')]).'';
+ $graph_link = "";
+ $graph_link .= html_print_image(
+ 'images/chart_curve.png',
+ true,
+ ['title' => __('Interface traffic')]
+ );
+ $graph_link .= '';
} else {
$graph_link = '';
}
diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js
index 1a100ba5c6..e764c6b20f 100644
--- a/pandora_console/include/graphs/flot/pandora.flot.js
+++ b/pandora_console/include/graphs/flot/pandora.flot.js
@@ -3030,7 +3030,7 @@ function number_format(number, force_integer, unit, short_data, divisor) {
var shorts = ["", "K", "M", "G", "T", "P", "E", "Z", "Y"];
var pos = 0;
- while (number >= divisor) {
+ while (Math.abs(number) >= divisor) {
// As long as the number can be divided by 1000 or 1024.
pos++;
number = number / divisor;
diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js
index fdcf6421bb..f3e6ecec52 100644
--- a/pandora_console/include/javascript/tree/TreeController.js
+++ b/pandora_console/include/javascript/tree/TreeController.js
@@ -758,8 +758,8 @@ var TreeController = {
winopeng_var(
element.moduleGraph.url,
element.moduleGraph.handle,
- 1000,
- 650
+ 800,
+ 480
);
} catch (error) {
// console.log(error);
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index 4cf03ca933..98963ee2a2 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -3077,6 +3077,18 @@ div.nodata_container {
display: table;
}
+div#stat-win-module-graph div.nodata_container {
+ width: 30%;
+ height: 100%;
+ background-repeat: no-repeat;
+ background-position: center;
+ margin: auto auto;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
#snmp_data {
width: 40%;
position: absolute;
@@ -5478,12 +5490,7 @@ table.info_table.policy_sub_table {
* ---------------------------------------------------------------------
*/
.module_graph_menu_dropdown {
- padding-top: 20px;
- padding-bottom: 20px;
- position: absolute;
- top: 10px;
width: 100%;
- z-index: 1001;
}
.module_graph_menu_content,
@@ -5501,7 +5508,7 @@ table.info_table.policy_sub_table {
padding: 6px 10px;
cursor: pointer;
display: flex;
- justify-content: space-between;
+ justify-content: flex-start;
align-items: center;
}
@@ -5511,12 +5518,20 @@ table.info_table.policy_sub_table {
}
.module_graph_menu_content {
+ position: absolute;
+ left: 2.5%;
+ top: 41px;
+ z-index: 1001;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
padding: 15px;
border-top: none;
}
+#stat-win-module-graph .flot-y-axis.flot-y1-axis.yAxis.y1Axis {
+ left: -10px !important;
+}
+
/*
* ---------------------------------------------------------------------
* - AGENT VIEW
diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php
index 3bcad1291a..58df460112 100755
--- a/pandora_console/operation/agentes/estado_generalagente.php
+++ b/pandora_console/operation/agentes/estado_generalagente.php
@@ -647,7 +647,7 @@ if (!empty($network_interfaces)) {
$win_handle = dechex(crc32($interface['status_module_id'].$interface_name));
$graph_link = "";
+ $graph_link .= $win_handle."', 800, 480)\">";
$graph_link .= html_print_image(
'images/chart_curve.png',
true,
diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php
index 0f1675fdb0..b34c92efec 100644
--- a/pandora_console/operation/agentes/interface_traffic_graph_win.php
+++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php
@@ -1,18 +1,31 @@
';
echo '';
- ui_print_error_message(__('There was a problem connecting with the node'));
+ ui_print_error_message(
+ __('There was a problem connecting with the node')
+ );
echo '';
echo ' |