2012-03-08 19:24:24 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 20012 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation for version 2.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// Real start
|
|
|
|
|
|
|
|
require_once ("../../include/config.php");
|
|
|
|
|
|
|
|
// Set root on homedir, as defined in setup
|
|
|
|
chdir ($config["homedir"]);
|
|
|
|
|
|
|
|
session_start ();
|
|
|
|
ob_start ();
|
|
|
|
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
|
|
|
|
echo '<html xmlns="http://www.w3.org/1999/xhtml">'."\n";
|
|
|
|
echo '<head>';
|
|
|
|
|
2012-07-02 13:11:21 +02:00
|
|
|
global $vc_public_view;
|
|
|
|
$vc_public_view = true;
|
2012-03-08 19:24:24 +01:00
|
|
|
// This starts the page head. In the call back function,
|
|
|
|
// things from $page['head'] array will be processed into the head
|
|
|
|
ob_start ('ui_process_page_head');
|
|
|
|
|
2012-07-02 13:11:21 +02:00
|
|
|
|
2012-03-08 19:24:24 +01:00
|
|
|
require ('include/functions_visual_map.php');
|
|
|
|
|
|
|
|
// Auto Refresh page (can now be disabled anywhere in the script)
|
|
|
|
$config["refr"] = (int) get_parameter ("refr");
|
|
|
|
$config["remote_addr"] = $_SERVER['REMOTE_ADDR'];
|
|
|
|
|
|
|
|
$hash = get_parameter ('hash');
|
|
|
|
$id_layout = (int) get_parameter ('id_layout');
|
|
|
|
$config["id_user"] = get_parameter ('id_user');
|
|
|
|
|
|
|
|
$myhash = md5($config["dbpass"].$id_layout. $config["id_user"]);
|
|
|
|
|
|
|
|
// Check input hash
|
|
|
|
if ( $myhash != $hash){
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
$refr = (int) get_parameter ('refr', $config['vc_refr']);
|
|
|
|
$vc_refr = false;
|
|
|
|
$layout = db_get_row ('tlayout', 'id', $id_layout);
|
|
|
|
|
|
|
|
if (! $layout) {
|
|
|
|
db_pandora_audit("ACL Violation","Trying to access visual console without id layout");
|
|
|
|
include ("../../general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
$id_group = $layout["id_group"];
|
|
|
|
$layout_name = $layout["name"];
|
|
|
|
$fullscreen = $layout["fullscreen"];
|
|
|
|
$background = $layout["background"];
|
|
|
|
$bwidth = $layout["width"];
|
|
|
|
$bheight = $layout["height"];
|
|
|
|
|
2012-04-24 15:45:02 +02:00
|
|
|
if (!isset($config['pure']))
|
|
|
|
$config['pure'] = 0;
|
2012-03-08 19:24:24 +01:00
|
|
|
|
|
|
|
// Render map
|
|
|
|
$options = array();
|
2012-04-24 15:45:02 +02:00
|
|
|
echo '<div style="width: 95%; background: white; margin: 20px auto 20px auto; box-shadow: 10px 10px 5px #000;">';
|
2012-03-08 19:24:24 +01:00
|
|
|
echo "<h1>". $layout_name. "</h1>";
|
|
|
|
|
2012-03-20 12:03:06 +01:00
|
|
|
visual_map_print_visual_map ($id_layout, true, true, null, null, '../../');
|
2012-03-08 19:24:24 +01:00
|
|
|
|
|
|
|
$values = array ();
|
|
|
|
$values[5] = human_time_description_raw (5);
|
|
|
|
$values[30] = human_time_description_raw (30);
|
2012-07-16 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_modules.php, extensions/users_connected.php,
extensions/agents_alerts.php,
operation/visual_console/render_view.php,
operation/visual_console/public_console.php,
operation/agentes/networkmap.groups.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/networkmap.topology.php, general/header.php,
godmode/db/db_refine.php, godmode/agentes/configurar_agente.php,
godmode/alerts/configure_alert_compound.php,
godmode/setup/setup_visuals.php, godmode/snmpconsole/snmp_alert.php,
godmode/modules/manage_network_components_form_wmi.php,
include/functions_config.php, include/functions_api.php,
include/functions_agents.php, include/functions_forecast.php:
cleaned source code style and change magic numbers for time
constants.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6773 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-16 11:24:04 +02:00
|
|
|
$values[SECONDS_1MINUTE] = human_time_description_raw(SECONDS_1MINUTE);
|
|
|
|
$values[SECONDS_2MINUTES] = human_time_description_raw(SECONDS_2MINUTES);
|
|
|
|
$values[SECONDS_5MINUTES] = human_time_description_raw(SECONDS_5MINUTES);
|
|
|
|
$values[SECONDS_10MINUTES] = human_time_description_raw(SECONDS_10MINUTES);
|
|
|
|
$values[SECONDS_30MINUTES] = human_time_description_raw(SECONDS_30MINUTES);
|
2012-03-08 19:24:24 +01:00
|
|
|
|
|
|
|
$table->width = '90%';
|
|
|
|
$table->data = array ();
|
|
|
|
$table->style = array ();
|
|
|
|
$table->style[2] = 'text-align: center';
|
|
|
|
$table->data[0][0] = __('Autorefresh time');
|
|
|
|
|
2012-07-16 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_modules.php, extensions/users_connected.php,
extensions/agents_alerts.php,
operation/visual_console/render_view.php,
operation/visual_console/public_console.php,
operation/agentes/networkmap.groups.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/networkmap.topology.php, general/header.php,
godmode/db/db_refine.php, godmode/agentes/configurar_agente.php,
godmode/alerts/configure_alert_compound.php,
godmode/setup/setup_visuals.php, godmode/snmpconsole/snmp_alert.php,
godmode/modules/manage_network_components_form_wmi.php,
include/functions_config.php, include/functions_api.php,
include/functions_agents.php, include/functions_forecast.php:
cleaned source code style and change magic numbers for time
constants.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6773 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-16 11:24:04 +02:00
|
|
|
if (empty($config["vc_refr"])) {
|
2012-03-08 19:24:24 +01:00
|
|
|
$vc_refr = true;
|
2012-07-16 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_modules.php, extensions/users_connected.php,
extensions/agents_alerts.php,
operation/visual_console/render_view.php,
operation/visual_console/public_console.php,
operation/agentes/networkmap.groups.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/networkmap.topology.php, general/header.php,
godmode/db/db_refine.php, godmode/agentes/configurar_agente.php,
godmode/alerts/configure_alert_compound.php,
godmode/setup/setup_visuals.php, godmode/snmpconsole/snmp_alert.php,
godmode/modules/manage_network_components_form_wmi.php,
include/functions_config.php, include/functions_api.php,
include/functions_agents.php, include/functions_forecast.php:
cleaned source code style and change magic numbers for time
constants.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6773 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-16 11:24:04 +02:00
|
|
|
$config["vc_refr"] = $refr;
|
2012-03-08 19:24:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$table->data[0][1] = html_print_select ($values, 'refr', $config["vc_refr"], '', 'N/A', 0, true, false, false);
|
|
|
|
$table->data[0][2] = html_print_submit_button (__('Refresh'), '', false, 'class="sub next"', true);
|
|
|
|
$table->data[0][2] .= html_print_input_hidden ('vc_refr', $config["vc_refr"], true);
|
|
|
|
|
|
|
|
if ($vc_refr){
|
2012-04-24 15:45:02 +02:00
|
|
|
$config["vc_refr"] = 0;
|
2012-03-08 19:24:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
echo '<div style="height:30px"> </div>';
|
|
|
|
|
|
|
|
if ($config['pure'] && $config["refr"] != 0) {
|
|
|
|
echo '<div id="countdown"><br /></div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '<div style="height:30px"> </div>';
|
|
|
|
|
|
|
|
echo '<form method="post">';
|
|
|
|
html_print_input_hidden ('pure', $config["pure"]);
|
|
|
|
html_print_input_hidden ('id', $id_layout);
|
|
|
|
html_print_table ($table);
|
|
|
|
echo '</form>';
|
2012-04-24 15:45:02 +02:00
|
|
|
echo '</div>';
|
2012-03-08 19:24:24 +01:00
|
|
|
|
|
|
|
if ($config["pure"] && $config["refr"] != 0) {
|
|
|
|
ui_require_jquery_file ('countdown');
|
|
|
|
ui_require_css_file ('countdown');
|
|
|
|
}
|
|
|
|
ui_require_javascript_file ('wz_jsgraphics');
|
|
|
|
ui_require_javascript_file ('pandora_visual_console');
|
|
|
|
?>
|
|
|
|
<script language="javascript" type="text/javascript">
|
|
|
|
/* <![CDATA[ */
|
|
|
|
$(document).ready (function () {
|
2012-07-16 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_modules.php, extensions/users_connected.php,
extensions/agents_alerts.php,
operation/visual_console/render_view.php,
operation/visual_console/public_console.php,
operation/agentes/networkmap.groups.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/networkmap.topology.php, general/header.php,
godmode/db/db_refine.php, godmode/agentes/configurar_agente.php,
godmode/alerts/configure_alert_compound.php,
godmode/setup/setup_visuals.php, godmode/snmpconsole/snmp_alert.php,
godmode/modules/manage_network_components_form_wmi.php,
include/functions_config.php, include/functions_api.php,
include/functions_agents.php, include/functions_forecast.php:
cleaned source code style and change magic numbers for time
constants.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6773 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-16 11:24:04 +02:00
|
|
|
$("#refr").change(function () {
|
2012-03-08 19:24:24 +01:00
|
|
|
$("#hidden-vc_refr").val($("#refr option:selected").val());
|
2012-04-24 15:45:02 +02:00
|
|
|
});
|
2012-03-08 19:24:24 +01:00
|
|
|
|
2012-07-16 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_modules.php, extensions/users_connected.php,
extensions/agents_alerts.php,
operation/visual_console/render_view.php,
operation/visual_console/public_console.php,
operation/agentes/networkmap.groups.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/networkmap.topology.php, general/header.php,
godmode/db/db_refine.php, godmode/agentes/configurar_agente.php,
godmode/alerts/configure_alert_compound.php,
godmode/setup/setup_visuals.php, godmode/snmpconsole/snmp_alert.php,
godmode/modules/manage_network_components_form_wmi.php,
include/functions_config.php, include/functions_api.php,
include/functions_agents.php, include/functions_forecast.php:
cleaned source code style and change magic numbers for time
constants.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6773 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-16 11:24:04 +02:00
|
|
|
<?php
|
|
|
|
if ($config["pure"] && $config["refr"] > 0) {
|
|
|
|
?>
|
|
|
|
t = new Date();
|
|
|
|
t.setTime (t.getTime() + <?php echo $config["refr"] * 1000; ?>);
|
|
|
|
$("#countdown").countdown({until: t, format: 'MS', description: '<?php echo __('Until refresh'); ?>'});
|
2012-03-08 19:24:24 +01:00
|
|
|
|
2012-07-16 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_modules.php, extensions/users_connected.php,
extensions/agents_alerts.php,
operation/visual_console/render_view.php,
operation/visual_console/public_console.php,
operation/agentes/networkmap.groups.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/networkmap.topology.php, general/header.php,
godmode/db/db_refine.php, godmode/agentes/configurar_agente.php,
godmode/alerts/configure_alert_compound.php,
godmode/setup/setup_visuals.php, godmode/snmpconsole/snmp_alert.php,
godmode/modules/manage_network_components_form_wmi.php,
include/functions_config.php, include/functions_api.php,
include/functions_agents.php, include/functions_forecast.php:
cleaned source code style and change magic numbers for time
constants.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6773 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-16 11:24:04 +02:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2012-03-08 19:24:24 +01:00
|
|
|
draw_lines (lines, 'layout_map');
|
|
|
|
});
|
|
|
|
/* ]]> */
|
2012-07-16 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_modules.php, extensions/users_connected.php,
extensions/agents_alerts.php,
operation/visual_console/render_view.php,
operation/visual_console/public_console.php,
operation/agentes/networkmap.groups.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/networkmap.topology.php, general/header.php,
godmode/db/db_refine.php, godmode/agentes/configurar_agente.php,
godmode/alerts/configure_alert_compound.php,
godmode/setup/setup_visuals.php, godmode/snmpconsole/snmp_alert.php,
godmode/modules/manage_network_components_form_wmi.php,
include/functions_config.php, include/functions_api.php,
include/functions_agents.php, include/functions_forecast.php:
cleaned source code style and change magic numbers for time
constants.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6773 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-16 11:24:04 +02:00
|
|
|
</script>
|