2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
2008-08-22 20:07:32 +02:00
|
|
|
|
2009-06-08 20:26:14 +02:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
2007-04-18 11:58:26 +02:00
|
|
|
|
2006-07-06 19:06:59 +02:00
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2008-08-22 20:07:32 +02:00
|
|
|
// as published by the Free Software Foundation for version 2.
|
2006-07-06 19:06:59 +02:00
|
|
|
// 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.
|
2009-06-08 20:26:14 +02:00
|
|
|
|
|
|
|
|
2011-07-28 11:25:42 +02:00
|
|
|
if (! isset($_SESSION['id_usuario'])) {
|
2008-06-16 20:09:56 +02:00
|
|
|
session_start();
|
2015-04-20 15:30:16 +02:00
|
|
|
//session_write_close();
|
2008-06-16 20:09:56 +02:00
|
|
|
}
|
2007-04-18 11:58:26 +02:00
|
|
|
|
2012-03-01 17:41:02 +01:00
|
|
|
// Global & session management
|
|
|
|
require_once ('../../include/config.php');
|
2015-03-23 19:51:59 +01:00
|
|
|
require_once ($config['homedir'] . '/include/auth/mysql.php');
|
2011-07-28 11:25:42 +02:00
|
|
|
require_once ($config['homedir'] . '/include/functions.php');
|
|
|
|
require_once ($config['homedir'] . '/include/functions_db.php');
|
|
|
|
require_once ($config['homedir'] . '/include/functions_reporting.php');
|
|
|
|
require_once ($config['homedir'] . '/include/functions_graph.php');
|
|
|
|
require_once ($config['homedir'] . '/include/functions_modules.php');
|
2015-03-23 19:51:59 +01:00
|
|
|
require_once ($config['homedir'] . '/include/functions_agents.php');
|
2015-03-24 19:10:09 +01:00
|
|
|
require_once ($config['homedir'] . '/include/functions_tags.php');
|
2006-07-09 01:32:38 +02:00
|
|
|
|
2015-03-23 19:51:59 +01:00
|
|
|
check_login ();
|
|
|
|
|
|
|
|
// Metaconsole connection to the node
|
|
|
|
$server_id = (int) get_parameter("server");
|
2015-08-10 17:04:53 +02:00
|
|
|
if (is_metaconsole() && !empty($server_id)) {
|
2015-03-23 19:51:59 +01:00
|
|
|
$server = metaconsole_get_connection_by_id($server_id);
|
2012-07-26 18:49:35 +02:00
|
|
|
|
2015-03-23 19:51:59 +01:00
|
|
|
// Error connecting
|
|
|
|
if (metaconsole_connect($server) !== NOERR) {
|
|
|
|
echo "<html>";
|
|
|
|
echo "<body>";
|
|
|
|
ui_print_error_message(__('There was a problem connecting with the node'));
|
|
|
|
echo "</body>";
|
|
|
|
echo "</html>";
|
|
|
|
exit;
|
2015-06-08 13:13:09 +02:00
|
|
|
}
|
2012-07-26 18:06:52 +02:00
|
|
|
}
|
|
|
|
|
2012-04-14 04:30:59 +02:00
|
|
|
$user_language = get_user_language ($config['id_user']);
|
|
|
|
if (file_exists ('../../include/languages/'.$user_language.'.mo')) {
|
|
|
|
$l10n = new gettext_reader (new CachedFileReader ('../../include/languages/'.$user_language.'.mo'));
|
|
|
|
$l10n->load_tables();
|
|
|
|
}
|
|
|
|
|
2012-03-01 17:41:02 +01:00
|
|
|
echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/css"/>';
|
2015-04-20 15:32:12 +02:00
|
|
|
|
2015-04-21 09:06:05 +02:00
|
|
|
$label = get_parameter('label');
|
2015-04-07 16:26:20 +02:00
|
|
|
$label = base64_decode($label);
|
2011-04-18 16:05:54 +02:00
|
|
|
$id = get_parameter('id');
|
2015-04-07 16:26:20 +02:00
|
|
|
//$label = rawurldecode(urldecode(base64_decode(get_parameter('label', ''))));
|
2009-10-06 21:33:25 +02:00
|
|
|
?>
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
2012-07-18 11:34:10 +02:00
|
|
|
<head>
|
|
|
|
<?php
|
|
|
|
// Parsing the refresh before sending any header
|
|
|
|
$refresh = (int) get_parameter ("refresh", -1);
|
|
|
|
if ($refresh > 0) {
|
|
|
|
$query = ui_get_url_refresh (false);
|
|
|
|
|
|
|
|
echo '<meta http-equiv="refresh" content="'.$refresh.'; URL='.$query.'" />';
|
2012-04-18 18:08:48 +02:00
|
|
|
}
|
2012-07-18 11:34:10 +02:00
|
|
|
?>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>Pandora FMS Graph (<?php echo modules_get_agentmodule_agent_name ($id) . ' - ' . $label; ?>)</title>
|
|
|
|
<link rel="stylesheet" href="../../include/styles/pandora_minimal.css" type="text/css" />
|
2015-08-10 17:04:53 +02:00
|
|
|
<link rel="stylesheet" href="../../include/styles/jquery-ui-1.10.0.custom.css" type="text/css" />
|
2012-07-18 11:34:10 +02:00
|
|
|
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
|
2015-08-10 17:04:53 +02:00
|
|
|
<script type='text/javascript' src='../../include/javascript/jquery-1.9.0.js'></script>
|
2013-07-22 14:34:46 +02:00
|
|
|
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
|
2015-08-10 17:04:53 +02:00
|
|
|
<script type='text/javascript' src='../../include/javascript/jquery.jquery-ui-1.10.0.custom.js'></script>
|
2012-07-18 11:34:10 +02:00
|
|
|
<script type='text/javascript'>
|
|
|
|
<!--
|
|
|
|
window.onload = function() {
|
|
|
|
// Hack to repeat the init process to period select
|
|
|
|
var periodSelectId = $('[name="period"]').attr('class');
|
|
|
|
|
|
|
|
period_select_init(periodSelectId);
|
|
|
|
};
|
|
|
|
|
|
|
|
function show_others() {
|
|
|
|
if (!$("#checkbox-avg_only").attr('checked')) {
|
|
|
|
$("#hidden-show_other").val(1);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#hidden-show_other").val(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//-->
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body bgcolor="#ffffff" style='background:#ffffff;'>
|
|
|
|
<?php
|
|
|
|
|
2015-03-23 19:51:59 +01:00
|
|
|
// Module id
|
|
|
|
$id = (int) get_parameter ("id", 0);
|
|
|
|
// Agent id
|
|
|
|
$agent_id = (int) modules_get_agentmodule_agent($id);
|
|
|
|
if (empty($id) || empty($agent_id)) {
|
|
|
|
ui_print_error_message(__('There was a problem locating the source of the graph'));
|
2012-07-18 11:34:10 +02:00
|
|
|
exit;
|
2012-04-18 18:08:48 +02:00
|
|
|
}
|
2012-07-18 11:34:10 +02:00
|
|
|
|
2015-03-23 19:51:59 +01:00
|
|
|
// ACL
|
|
|
|
$permission = false;
|
|
|
|
$agent_group = (int) agents_get_agent_group($agent_id);
|
2015-03-24 19:10:09 +01:00
|
|
|
$strict_user = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']);
|
2015-03-23 19:51:59 +01:00
|
|
|
|
2015-03-24 19:10:09 +01:00
|
|
|
if (!empty($agent_group)) {
|
|
|
|
if ($strict_user) {
|
|
|
|
$permission = tags_check_acl_by_module($id, $config['id_user'], 'RR') === true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$permission = check_acl($config['id_user'], $agent_group, "RR");
|
|
|
|
}
|
2015-03-23 19:51:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!$permission) {
|
|
|
|
require ($config['homedir'] . "/general/noaccess.php");
|
2015-06-08 13:13:09 +02:00
|
|
|
exit;
|
|
|
|
}
|
2015-03-23 19:51:59 +01:00
|
|
|
|
2012-07-18 11:34:10 +02:00
|
|
|
$draw_alerts = get_parameter("draw_alerts", 0);
|
2012-10-02 11:07:20 +02:00
|
|
|
$avg_only = get_parameter ("avg_only", 0);
|
2012-07-18 11:34:10 +02:00
|
|
|
$show_other = (bool)get_parameter('show_other', false);
|
|
|
|
if ($show_other) {
|
|
|
|
$avg_only = 0;
|
2012-04-18 18:08:48 +02:00
|
|
|
}
|
2015-02-16 18:37:16 +01:00
|
|
|
$period = get_parameter ("period", SECONDS_1DAY);
|
2012-07-18 11:34:10 +02:00
|
|
|
$id = get_parameter ("id", 0);
|
|
|
|
$width = get_parameter ("width", 555);
|
|
|
|
$height = get_parameter ("height", 245);
|
|
|
|
$label = get_parameter ("label", "");
|
2015-08-10 17:04:53 +02:00
|
|
|
$start_date = get_parameter ("start_date", date("Y/m/d"));
|
|
|
|
$start_time = get_parameter ("start_time", date("H:i:s"));
|
2012-07-18 11:34:10 +02:00
|
|
|
$draw_events = get_parameter ("draw_events", 0);
|
|
|
|
$graph_type = get_parameter ("type", "sparse");
|
|
|
|
$zoom = get_parameter ("zoom", 1);
|
|
|
|
$baseline = get_parameter ("baseline", 0);
|
|
|
|
$show_events_graph = get_parameter ("show_events_graph", 0);
|
2012-08-31 13:59:46 +02:00
|
|
|
$time_compare_separated = get_parameter ("time_compare_separated", 0);
|
|
|
|
$time_compare_overlapped = get_parameter ("time_compare_overlapped", 0);
|
2012-09-18 11:02:49 +02:00
|
|
|
$unknown_graph = get_parameter_checkbox ("unknown_graph", 1);
|
2012-08-31 13:59:46 +02:00
|
|
|
|
|
|
|
$time_compare = false;
|
|
|
|
|
2013-04-04 19:44:07 +02:00
|
|
|
if ($time_compare_separated) {
|
2012-08-31 13:59:46 +02:00
|
|
|
$time_compare = 'separated';
|
|
|
|
}
|
2013-04-04 19:44:07 +02:00
|
|
|
else if ($time_compare_overlapped) {
|
2012-08-31 13:59:46 +02:00
|
|
|
$time_compare = 'overlapped';
|
|
|
|
}
|
2012-07-18 11:34:10 +02:00
|
|
|
|
|
|
|
if ($zoom > 1) {
|
|
|
|
$height = $height * ($zoom / 2.1);
|
|
|
|
$width = $width * ($zoom / 1.4);
|
|
|
|
|
|
|
|
echo "<script type='text/javascript'>window.resizeTo($width + 80, $height + 120);</script>";
|
2012-04-18 18:08:48 +02:00
|
|
|
}
|
2012-07-18 11:34:10 +02:00
|
|
|
|
2015-08-10 17:04:53 +02:00
|
|
|
// Build date
|
|
|
|
$date = strtotime("$start_date $start_time");
|
|
|
|
$now = time();
|
2012-07-18 11:34:10 +02:00
|
|
|
|
2015-08-10 17:04:53 +02:00
|
|
|
if ($date > $now)
|
|
|
|
$date = $now;
|
2012-07-18 11:34:10 +02:00
|
|
|
|
2015-03-23 19:51:59 +01:00
|
|
|
$urlImage = ui_get_full_url(false, false, false, false);
|
2012-07-18 11:34:10 +02:00
|
|
|
|
2013-02-13 10:41:59 +01:00
|
|
|
$unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id);
|
|
|
|
|
2012-07-18 11:34:10 +02:00
|
|
|
// log4x doesnt support flash yet
|
|
|
|
//
|
|
|
|
if ($config['flash_charts'] == 1)
|
2013-05-23 17:42:32 +02:00
|
|
|
echo '<div style="margin-left: 70px; padding-top: 10px;">';
|
2012-07-18 11:34:10 +02:00
|
|
|
else
|
2013-05-23 17:42:32 +02:00
|
|
|
echo '<div style="margin-left: 50px; padding-top: 10px;">';
|
2013-10-14 13:48:51 +02:00
|
|
|
|
2012-07-18 11:34:10 +02:00
|
|
|
switch ($graph_type) {
|
|
|
|
case 'boolean':
|
|
|
|
echo grafico_modulo_boolean ($id, $period, $draw_events, $width, $height,
|
2013-02-13 10:41:59 +01:00
|
|
|
$label, $unit, $draw_alerts, $avg_only, false, $date, false, $urlImage, 'adapter_'.$graph_type, $time_compare, $unknown_graph);
|
2012-09-19 16:59:31 +02:00
|
|
|
echo '<br>';
|
2012-07-18 11:34:10 +02:00
|
|
|
if ($show_events_graph)
|
2012-09-28 16:06:20 +02:00
|
|
|
echo graphic_module_events($id, $width, $height,
|
|
|
|
$period, $config['homeurl'], $zoom, 'adapted_'.$graph_type, $date);
|
2012-07-18 11:34:10 +02:00
|
|
|
break;
|
|
|
|
case 'sparse':
|
|
|
|
echo grafico_modulo_sparse ($id, $period, $draw_events, $width, $height,
|
2015-03-13 14:41:47 +01:00
|
|
|
$label, $unit, $draw_alerts, $avg_only, false, $date, $unit, $baseline,
|
2012-09-18 11:02:49 +02:00
|
|
|
0, true, false, $urlImage, 1, false, 'adapter_'.$graph_type, $time_compare, $unknown_graph);
|
2012-09-19 16:59:31 +02:00
|
|
|
echo '<br>';
|
2012-07-18 11:34:10 +02:00
|
|
|
if ($show_events_graph)
|
2012-09-28 16:06:20 +02:00
|
|
|
echo graphic_module_events($id, $width, $height,
|
|
|
|
$period, $config['homeurl'], $zoom, 'adapted_'.$graph_type, $date);
|
2012-07-18 11:34:10 +02:00
|
|
|
break;
|
|
|
|
case 'string':
|
|
|
|
echo grafico_modulo_string ($id, $period, $draw_events, $width, $height,
|
|
|
|
$label, null, $draw_alerts, 1, false, $date, false, $urlImage, 'adapter_'.$graph_type);
|
2012-09-19 16:59:31 +02:00
|
|
|
echo '<br>';
|
2012-07-18 11:34:10 +02:00
|
|
|
if ($show_events_graph)
|
2012-09-28 16:06:20 +02:00
|
|
|
echo graphic_module_events($id, $width, $height,
|
|
|
|
$period, $config['homeurl'], $zoom, 'adapted_'.$graph_type, $date);
|
2012-07-18 11:34:10 +02:00
|
|
|
break;
|
|
|
|
case 'log4x':
|
|
|
|
echo grafico_modulo_log4x ($id, $period, $draw_events, $width, $height,
|
2015-03-13 14:41:47 +01:00
|
|
|
$label, $unit, $draw_alerts, 1, $pure, $date);
|
2012-09-19 16:59:31 +02:00
|
|
|
echo '<br>';
|
2012-07-18 11:34:10 +02:00
|
|
|
if ($show_events_graph)
|
2012-09-28 16:06:20 +02:00
|
|
|
echo graphic_module_events($id, $width, $height,
|
|
|
|
$period, $config['homeurl'], $zoom, '', $date);
|
2012-07-18 11:34:10 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
echo fs_error_image ('../images');
|
|
|
|
break;
|
2009-01-21 19:55:29 +01:00
|
|
|
}
|
2012-07-18 11:34:10 +02:00
|
|
|
echo '</div>';
|
|
|
|
|
2014-10-01 11:18:03 +02:00
|
|
|
////////////////////////////////////////////////////////////////
|
2013-02-18 19:10:53 +01:00
|
|
|
// SIDE MENU
|
2014-10-01 11:18:03 +02:00
|
|
|
////////////////////////////////////////////////////////////////
|
2013-02-18 19:10:53 +01:00
|
|
|
$params = array();
|
|
|
|
// TOP TEXT
|
2015-08-17 14:54:04 +02:00
|
|
|
//Use the no_meta parameter because this image is only in the base console
|
2015-08-17 15:11:04 +02:00
|
|
|
$params['top_text'] = "<div style='color: white; width: 100%; text-align: center; font-weight: bold; vertical-align: top;'>" . html_print_image('images/wrench_blanco.png', true, array('width' => '16px'), false, false, true) . ' ' . __('Pandora FMS Graph configuration menu') . "</div>";
|
2013-05-23 17:42:32 +02:00
|
|
|
$params['body_text'] = "<div class='menu_sidebar_outer'>";
|
|
|
|
$params['body_text'] .=__('Please, make your changes and apply with the <i>Reload</i> button');
|
2013-02-18 19:10:53 +01:00
|
|
|
|
|
|
|
// MENU
|
2013-05-23 17:42:32 +02:00
|
|
|
$params['body_text'] .= '<form method="get" action="stat_win.php">';
|
2013-02-18 19:10:53 +01:00
|
|
|
$params['body_text'] .= html_print_input_hidden ("id", $id, true);
|
|
|
|
$params['body_text'] .= html_print_input_hidden ("label", $label, true);
|
|
|
|
|
2015-03-23 19:51:59 +01:00
|
|
|
if (!empty($server_id))
|
|
|
|
$params['body_text'] .= html_print_input_hidden ("server", $server_id, true);
|
|
|
|
|
2013-02-18 19:10:53 +01:00
|
|
|
if (isset($_GET["type"])) {
|
|
|
|
$type = get_parameter_get ("type");
|
|
|
|
$params['body_text'] .= html_print_input_hidden ("type", $type, true);
|
|
|
|
}
|
|
|
|
|
2013-04-11 13:13:44 +02:00
|
|
|
// FORM TABLE
|
2013-02-18 19:10:53 +01:00
|
|
|
|
2013-04-11 13:13:44 +02:00
|
|
|
$table = html_get_predefined_table('transparent', 2);
|
|
|
|
$table->width = '98%';
|
|
|
|
$table->id = 'stat_win_form_div';
|
2013-04-15 13:44:36 +02:00
|
|
|
$table->style[0] = 'text-align:left; padding: 7px;';
|
2013-04-11 13:13:44 +02:00
|
|
|
$table->style[1] = 'text-align:left;';
|
2013-05-27 17:16:54 +02:00
|
|
|
//$table->size[0] = '50%';
|
|
|
|
$table->styleTable = 'border-spacing: 4px;';
|
|
|
|
$table->class = 'alternate';
|
2014-10-01 11:18:03 +02:00
|
|
|
|
2013-02-18 19:10:53 +01:00
|
|
|
$data = array();
|
|
|
|
$data[0] = __('Refresh time');
|
2014-10-01 11:18:03 +02:00
|
|
|
$data[1] = html_print_extended_select_for_time("refresh",
|
|
|
|
$refresh, '', '', 0, 7, true);
|
2013-02-18 19:10:53 +01:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
2013-07-01 17:41:40 +02:00
|
|
|
if ($graph_type != "boolean" && $graph_type != "string") {
|
2013-02-18 19:10:53 +01:00
|
|
|
$data = array();
|
|
|
|
$data[0] = __('Avg. Only');
|
2014-10-01 11:18:03 +02:00
|
|
|
$data[1] = html_print_checkbox ("avg_only", 1,
|
|
|
|
(bool)$avg_only, true, false, 'show_others()');
|
2013-02-18 19:10:53 +01:00
|
|
|
$data[1] .= html_print_input_hidden('show_other', 0, true);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
$data = array();
|
|
|
|
$data[0] = __('Begin date');
|
2015-08-10 17:04:53 +02:00
|
|
|
$data[1] = html_print_input_text ("start_date", $start_date,'', 10, 20, true);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$data = array();
|
|
|
|
$data[0] = __('Begin time');
|
|
|
|
$data[1] = html_print_input_text ("start_time", $start_time,'', 10, 10, true);
|
2013-02-18 19:10:53 +01:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
2013-04-04 19:44:07 +02:00
|
|
|
|
2013-02-18 19:10:53 +01:00
|
|
|
$data = array();
|
|
|
|
$data[0] = __('Zoom factor');
|
|
|
|
$options = array ();
|
2014-10-01 11:18:03 +02:00
|
|
|
$options[$zoom] = 'x' . $zoom;
|
2013-02-18 19:10:53 +01:00
|
|
|
$options[1] = 'x1';
|
|
|
|
$options[2] = 'x2';
|
|
|
|
$options[3] = 'x3';
|
|
|
|
$options[4] = 'x4';
|
|
|
|
$data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
2013-04-04 19:44:07 +02:00
|
|
|
|
2013-02-18 19:10:53 +01:00
|
|
|
$data = array();
|
|
|
|
$data[0] = __('Time range');
|
2014-10-01 11:18:03 +02:00
|
|
|
$data[1] = html_print_extended_select_for_time('period',
|
|
|
|
$period, '', '', 0, 7, true);
|
2013-02-18 19:10:53 +01:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
2013-04-04 19:44:07 +02:00
|
|
|
|
2013-02-18 19:10:53 +01:00
|
|
|
$data = array();
|
|
|
|
$data[0] = __('Show events');
|
2013-05-16 10:58:18 +02:00
|
|
|
$disabled = false;
|
|
|
|
if (isset($config['event_replication'])) {
|
2013-06-13 17:03:07 +02:00
|
|
|
if ($config['event_replication'] && !$config['show_events_in_local']) {
|
2013-05-16 10:58:18 +02:00
|
|
|
$disabled = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$data[1] = html_print_checkbox ("draw_events", 1,
|
|
|
|
(bool)$draw_events, true, $disabled);
|
|
|
|
if ($disabled) {
|
|
|
|
$data[1] .= ui_print_help_tip(
|
|
|
|
__('Show events is disabled because this Pandora node is set the event replication.'), true);
|
|
|
|
}
|
2013-02-18 19:10:53 +01:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
2013-04-04 19:44:07 +02:00
|
|
|
|
2013-02-18 19:10:53 +01:00
|
|
|
$data = array();
|
|
|
|
$data[0] = __('Show alerts');
|
|
|
|
$data[1] = html_print_checkbox ("draw_alerts", 1, (bool) $draw_alerts, true);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
2013-04-04 19:44:07 +02:00
|
|
|
|
2013-02-18 19:10:53 +01:00
|
|
|
$data = array();
|
|
|
|
$data[0] = __('Show event graph');
|
|
|
|
$data[1] = html_print_checkbox ("show_events_graph", 1, (bool) $show_events_graph, true);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
2013-04-04 19:44:07 +02:00
|
|
|
|
2013-05-16 10:23:51 +02:00
|
|
|
|
2013-02-18 19:10:53 +01:00
|
|
|
switch ($graph_type) {
|
|
|
|
case 'boolean':
|
|
|
|
case 'sparse':
|
|
|
|
$data = array();
|
2015-06-11 20:19:50 +02:00
|
|
|
$data[0] = __('Time compare (Overlapped)');
|
2013-02-18 19:10:53 +01:00
|
|
|
$data[1] = html_print_checkbox ("time_compare_overlapped", 1, (bool) $time_compare_overlapped, true);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
2013-04-04 19:44:07 +02:00
|
|
|
|
2013-02-18 19:10:53 +01:00
|
|
|
$data = array();
|
2015-06-11 20:19:50 +02:00
|
|
|
$data[0] = __('Time compare (Separated)');
|
2013-02-18 19:10:53 +01:00
|
|
|
$data[1] = html_print_checkbox ("time_compare_separated", 1, (bool) $time_compare_separated, true);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$data = array();
|
|
|
|
$data[0] = __('Show unknown graph');
|
|
|
|
$data[1] = html_print_checkbox ("unknown_graph", 1, (bool) $unknown_graph, true);
|
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-04-11 13:13:44 +02:00
|
|
|
$form_table = html_print_table($table, true);
|
|
|
|
|
|
|
|
unset($table);
|
|
|
|
|
|
|
|
$table->id = 'stat_win_form';
|
|
|
|
$table->width = '100%';
|
|
|
|
$table->cellspacing = 2;
|
|
|
|
$table->cellpadding = 2;
|
2013-05-23 17:42:32 +02:00
|
|
|
$table->class = 'databox';
|
2013-04-11 13:13:44 +02:00
|
|
|
|
|
|
|
$data = array();
|
2015-06-11 20:19:50 +02:00
|
|
|
$data[0] = html_print_div(array('id' => 'field_list', 'content' => $form_table,
|
2014-10-01 11:18:03 +02:00
|
|
|
'style' => 'overflow: auto; height: 220px'), true);
|
2013-04-11 13:13:44 +02:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
2013-02-18 19:10:53 +01:00
|
|
|
$data = array();
|
2014-10-01 11:18:03 +02:00
|
|
|
$data[0] = '<div style="width:100%; text-align:right;">' .
|
|
|
|
html_print_submit_button(__('Reload'), "submit", false,
|
|
|
|
'class="sub upd"', true) .
|
|
|
|
"</div>";
|
2013-02-18 19:10:53 +01:00
|
|
|
$table->data[] = $data;
|
|
|
|
$table->rowclass[] = '';
|
|
|
|
|
|
|
|
$params['body_text'] .= html_print_table($table, true);
|
|
|
|
$params['body_text'] .= '</form>';
|
2013-05-23 17:42:32 +02:00
|
|
|
$params['body_text'] .= '</div>'; // outer
|
2013-02-18 19:10:53 +01:00
|
|
|
|
|
|
|
// ICONS
|
|
|
|
$params['icon_closed'] = '/images/graphmenu_arrow_hide.png';
|
|
|
|
$params['icon_open'] = '/images/graphmenu_arrow.png';
|
|
|
|
|
|
|
|
// SIZE
|
2013-04-15 13:44:36 +02:00
|
|
|
$params['width'] = 500;
|
2013-02-18 19:10:53 +01:00
|
|
|
|
|
|
|
// POSITION
|
|
|
|
$params['position'] = 'left';
|
|
|
|
|
|
|
|
html_print_side_layer($params);
|
2013-06-10 18:15:36 +02:00
|
|
|
|
|
|
|
// Hidden div to forced title
|
2014-10-01 11:18:03 +02:00
|
|
|
html_print_div(array('id' => 'forced_title_layer',
|
|
|
|
'class' => 'forced_title_layer', 'hidden' => true));
|
2012-07-18 11:34:10 +02:00
|
|
|
?>
|
2013-04-04 19:44:07 +02:00
|
|
|
|
2012-07-18 11:34:10 +02:00
|
|
|
</body>
|
2010-09-13 12:26:33 +02:00
|
|
|
</html>
|
2015-08-10 17:04:53 +02:00
|
|
|
|
|
|
|
<?php
|
|
|
|
// Echo the script tags of the datepicker and the timepicker
|
|
|
|
// Modify the user language cause the ui.datepicker language files use - instead _
|
|
|
|
$custom_user_language = str_replace('_', '-', $user_language);
|
|
|
|
ui_require_jquery_file("ui.datepicker-" . $custom_user_language, "include/javascript/i18n/", true);
|
|
|
|
ui_include_time_picker(true);
|
|
|
|
?>
|
|
|
|
|
2012-08-31 13:59:46 +02:00
|
|
|
<script>
|
|
|
|
$('#checkbox-time_compare_separated').click(function() {
|
|
|
|
$('#checkbox-time_compare_overlapped').removeAttr('checked');
|
|
|
|
});
|
|
|
|
$('#checkbox-time_compare_overlapped').click(function() {
|
|
|
|
$('#checkbox-time_compare_separated').removeAttr('checked');
|
|
|
|
});
|
2013-02-14 19:09:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
//Resize window when show the overview graph.
|
|
|
|
if ($config['flash_charts']) {
|
|
|
|
?>
|
|
|
|
var show_overview = false;
|
|
|
|
var height_window;
|
|
|
|
var width_window;
|
|
|
|
$(document).ready(function() {
|
|
|
|
height_window = $(window).height();
|
|
|
|
width_window = $(window).width();
|
|
|
|
});
|
|
|
|
|
|
|
|
$("*").filter(function() {
|
|
|
|
if (typeof(this.id) == "string")
|
|
|
|
return this.id.match(/menu_overview_graph.*/);
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
}).click(function() {
|
|
|
|
if (show_overview) {
|
2013-12-12 15:49:36 +01:00
|
|
|
window.resizeTo(width_window + 20, height_window + 50);
|
2013-02-14 19:09:02 +01:00
|
|
|
}
|
|
|
|
else {
|
2013-12-12 15:49:36 +01:00
|
|
|
window.resizeTo(width_window + 20, height_window + 200);
|
2013-02-14 19:09:02 +01:00
|
|
|
}
|
|
|
|
show_overview = !show_overview;
|
|
|
|
|
|
|
|
});
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2013-06-10 18:15:36 +02:00
|
|
|
|
2015-08-10 17:04:53 +02:00
|
|
|
// Add datepicker and timepicker
|
|
|
|
$("#text-start_date").datepicker({
|
|
|
|
dateFormat: "<?php echo DATE_FORMAT_JS; ?>"
|
|
|
|
});
|
|
|
|
$("#text-start_time").timepicker({
|
|
|
|
showSecond: true,
|
|
|
|
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
|
|
|
timeOnlyTitle: '<?php echo __('Choose time');?>',
|
|
|
|
timeText: '<?php echo __('Time');?>',
|
|
|
|
hourText: '<?php echo __('Hour');?>',
|
|
|
|
minuteText: '<?php echo __('Minute');?>',
|
|
|
|
secondText: '<?php echo __('Second');?>',
|
|
|
|
currentText: '<?php echo __('Now');?>',
|
|
|
|
closeText: '<?php echo __('Close');?>'
|
|
|
|
});
|
|
|
|
|
|
|
|
$.datepicker.setDefaults($.datepicker.regional["<?php echo $custom_user_language; ?>"]);
|
|
|
|
|
2013-06-10 18:15:36 +02:00
|
|
|
forced_title_callback();
|
2015-06-11 20:19:50 +02:00
|
|
|
|
|
|
|
$(window).ready(function() {
|
|
|
|
$("#field_list").css('height', ($(window).height() - 160) + 'px');
|
|
|
|
});
|
|
|
|
|
|
|
|
$(window).resize(function() {
|
|
|
|
$("#field_list").css('height', ($(window).height() - 160) + 'px');
|
|
|
|
});
|
2012-08-31 13:59:46 +02:00
|
|
|
</script>
|