From fecd2c74b59bd7a924724c50591cc7f6a56fb399 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Tue, 3 Dec 2019 13:00:59 +0100 Subject: [PATCH] Added button to refresh graph in container graphs --- .../godmode/reporting/graph_container.php | 14 ++++++++++++++ pandora_console/include/ajax/graph.ajax.php | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/graph_container.php b/pandora_console/godmode/reporting/graph_container.php index 3b87fc63e3..ca2acf7ca7 100644 --- a/pandora_console/godmode/reporting/graph_container.php +++ b/pandora_console/godmode/reporting/graph_container.php @@ -125,6 +125,20 @@ if ($report_r && $report_w) { get_graphs_container(id_container,hash,time); } }); + + $("div[id^=period_container_] a").on('click', function(e){ + if ($("div[id^=period_container_][id$=_default]").css('display') == 'none') { + $('#refresh_custom_time').show(); + $('#refresh_custom_time').on('click', function(e){ + var time = $('input[id *= hidden-period_container_'+hash+']').val(); + get_graphs_container(id_container,hash,time); + }); + } + else if ($("div[id^=period_container_][id$=_manual]").css('display') == 'none') { + $('#refresh_custom_time').hide(); + } + }); + } }); } diff --git a/pandora_console/include/ajax/graph.ajax.php b/pandora_console/include/ajax/graph.ajax.php index 410a6dd972..ad840f2e6c 100644 --- a/pandora_console/include/ajax/graph.ajax.php +++ b/pandora_console/include/ajax/graph.ajax.php @@ -171,8 +171,9 @@ if ($get_graphs) { '', false, $periods, - 'vertical-align: middle;' + 'vertical-align: middle; margin-bottom:0;' ); + $single_table .= html_print_image('images/refresh_mc.png', true, ['id' => 'refresh_custom_time', 'title' => 'Refresh graph', 'style' => 'cursor:pointer; vertical-align: middle; display:none;']); $single_table .= ''; $single_table .= ''; $single_table .= '';