Added button to refresh graph in container graphs

This commit is contained in:
Tatiana Llorente 2019-12-03 13:00:59 +01:00
parent 60aaf4363e
commit fecd2c74b5
2 changed files with 16 additions and 1 deletions

View File

@ -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();
}
});
}
});
}

View File

@ -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 .= '</td>';
$single_table .= '</tr>';
$single_table .= '</table>';