2012-09-05 Vanessa Gil <vanessa.gil@artica.es>

* general/header.php
	  include/functions_ui.php: Enable/disable autorefresh.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6933 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2012-09-05 07:50:07 +00:00
parent 9fb1c6bbe2
commit a69fec2102
3 changed files with 27 additions and 33 deletions

View File

@ -1,3 +1,8 @@
2012-09-05 Vanessa Gil <vanessa.gil@artica.es>
* general/header.php
include/functions_ui.php: Enable/disable autorefresh.
2012-09-04 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php

View File

@ -130,20 +130,23 @@ config_check();
<?php
// Autorefresh
$ignored_params = array ('agent_config' => false, 'code' => false);
if ($config["refr"]) {//autorefresh interval
$ignored_params['refr'] = 0;
if (($config['enable_refr']) || (($_GET['sec2'] == 'operation/agentes/tactical') || ($_GET['sec2'] == 'operation/agentes/estado_agente') ||
if ($config['enable_refr']) {
$ignored_params['refr'] = 0;
echo '<a id="autorefresh" class="white_bold" href="' . ui_get_url_refresh ($ignored_params).'">' . html_print_image("images/page_refresh.png", true, array("class" => 'bot', "alt" => 'lightning')) . '&nbsp;'. __('Autorefresh');
echo ' (<span id="refrcounter">'.date ("i:s", $config["refr"]).'</span>)';
echo '</a>';
} else {
if (($config['refr']) && (($_GET['sec2'] == 'operation/agentes/tactical') || ($_GET['sec2'] == 'operation/agentes/estado_agente') ||
($_GET['sec2'] == 'operation/agentes/group_view') || ($_GET['sec2'] == 'operation/events/events') ||
($_GET['sec2'] == 'enterprise/dashboard/main_dashboard'))) { //enable autorefresh to all pages or default pages
($_GET['sec2'] == 'enterprise/dashboard/main_dashboard'))) {
echo '<a id="autorefresh" class="white_bold" href="' . ui_get_url_refresh ($ignored_params).'">' . html_print_image("images/page_refresh.png", true, array("class" => 'bot', "alt" => 'lightning')) . '&nbsp;'. __('Autorefresh');
echo ' (<span id="refrcounter">'.date ("i:s", $config["refr"]).'</span>)';
echo '</a>';
}
else {
$ignored_params['refr'] = '';
} else {
$ignored_params['refr'] = '';
echo '<a id="autorefresh" class="white_bold" href="' . ui_get_url_refresh ($ignored_params).'">' . html_print_image("images/page_refresh.png", true, array("class" => 'bot', "alt" => 'lightning')) . '&nbsp;'. __('Autorefresh').'</a>';
$values = array (
'5' => __('5 seconds'),
@ -160,28 +163,9 @@ config_check();
html_print_select ($values, 'ref', '', '', __('Select'), '0', false, false, false);
unset ($values);
echo '</span>';
}
}
else {
$ignored_params['refr'] = '';
echo '<a id="autorefresh" class="white_bold" href="' . ui_get_url_refresh ($ignored_params).'">' . html_print_image("images/page_refresh.png", true, array("class" => 'bot', "alt" => 'lightning')) . '&nbsp;'. __('Autorefresh').'</a>';
$values = array (
'5' => __('5 seconds'),
'10' => __('10 seconds'),
'15' => __('15 seconds'),
'30' => __('30 seconds'),
(string)SECONDS_1MINUTE => __('1 minute'),
(string)SECONDS_2MINUTES => __('2 minutes'),
(string)SECONDS_5MINUTES => __('5 minutes'),
(string)SECONDS_15MINUTES => __('15 minutes'),
(string)SECONDS_30MINUTES => __('30 minutes'),
(string)SECONDS_1HOUR => __('1 hour'));
echo '<span id="combo_refr" style="display: none">';
html_print_select ($values, 'ref', '', '', __('Select'), '0', false, false, false);
unset ($values);
echo '</span>';
}
?>
</td>
<td width='20%' rowspan='2'>

View File

@ -1108,9 +1108,14 @@ function ui_process_page_head ($string, $bitfield) {
// If user is logged or displayed view is the public view of visual console
if ($config["refr"] > 0 && (isset($config['id_user']) || $vc_public_view == 1)) {
$query = ui_get_url_refresh (false);
$output .= '<meta http-equiv="refresh" content="'.$config["refr"].'; URL=' . $query . '" />';
if ($config['enable_refr'] || $GET['sec2'] == "operation/agentes/estado_agente" || $GET['sec2'] == "operation/agentes/tactical"||
$_GET['sec2'] == "operation/agentes/group_view" || $_GET['sec2'] == 'operation/events/events' ||
$_GET['sec2'] == "enterprise/dashboard/main_dashboard") {
$query = ui_get_url_refresh (false);
$output .= '<meta http-equiv="refresh" content="'.$config["refr"].'; URL=' . $query . '" />';
}
}
$output .= "\n\t";
$output .= '<title>Pandora FMS - '.__('the Flexible Monitoring System').'</title>