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();
|
|
|
|
session_write_close();
|
|
|
|
}
|
2007-04-18 11:58:26 +02:00
|
|
|
|
2012-03-01 17:41:02 +01:00
|
|
|
// Global & session management
|
|
|
|
require_once ('../../include/config.php');
|
|
|
|
require_once ('../../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');
|
2006-07-09 01:32:38 +02:00
|
|
|
|
2012-07-26 18:06:52 +02:00
|
|
|
// Hash login process
|
2012-07-26 18:49:35 +02:00
|
|
|
if (! isset ($config['id_user']) && get_parameter("loginhash", 0)) {
|
2012-07-26 18:06:52 +02:00
|
|
|
$loginhash_data = get_parameter("loginhash_data", "");
|
|
|
|
$loginhash_user = get_parameter("loginhash_user", "");
|
|
|
|
|
|
|
|
if ($config["loginhash_pwd"] != "" && $loginhash_data == md5($loginhash_user.$config["loginhash_pwd"])) {
|
|
|
|
db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
|
|
|
$_SESSION['id_usuario'] = $loginhash_user;
|
|
|
|
$config["id_user"] = $loginhash_user;
|
2013-02-11 11:26:16 +01:00
|
|
|
|
2012-09-21 13:24:16 +02:00
|
|
|
$hash_connection_data = true;
|
2012-07-26 18:06:52 +02:00
|
|
|
}
|
2012-07-26 18:49:35 +02:00
|
|
|
|
2012-07-26 18:06:52 +02:00
|
|
|
}
|
|
|
|
|
2008-08-12 Esteban Sanchez <estebans@artica.es>
* pandoradb_data.sql: Added default languages.
* include/streams.php, include/gettext.php: Added to repository. New
files to add gettext support of mo files.
* include/functions_db.php: Function lang_string() functionallity
changed to use gettext library.
* include/languages/language_es_es.php,
include/languages/language_gl.php, include/languages/language_en.php,
include/languages/language_pt_br.php,
include/languages/language_it.php,
include/languages/language_ast_es.php,
include/languages/language_es_la.php,
include/languages/language_de.php, include/languages/language_fr.php,
include/languages/language_ca.php: Files deleted, they are
deprecated since we have moved to gettext.
* lude/languages/pt_br.mo, include/languages/es.mo,
include/languages/fr.po, include/languages/it.po,
include/languages/ca.po, include/languages/ast.po,
include/languages/de.po, include/languages/gl.mo: Gettext translations
of the previous languages we have in language_*.php files.
* include/languages/Makefile: Added to repository to generate
index.pot and mo files of each translation.
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/config_process.php,
include/functions.php, include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/sla_view.php, operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, general/logoff.php,
general/pandora_help.php, general/footer.php, general/noaccess.php,
general/logon_failed.php, general/links_menu.php,
general/login_page.php, general/logon_ok.php, general/header.php,
general/main_menu.php, godmode/groups/configure_group.php,
godmode/groups/group_list.php, godmode/setup/news.php,
godmode/setup/links.php, godmode/setup/setup.php,
godmode/users/user_list.php, godmode/users/configure_user.php,
godmode/profiles/profile_list.php, godmode/admin_access_logs.php,
godmode/db/db_info_data.php, godmode/db/db_main.php,
godmode/db/db_audit.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced string parameters of __() callings to
plain english. Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1006 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-12 14:06:25 +02:00
|
|
|
check_login ();
|
2011-04-18 16:05:54 +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"/>';
|
|
|
|
|
2011-04-18 16:05:54 +02:00
|
|
|
$id = get_parameter('id');
|
|
|
|
$label = 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" />
|
|
|
|
<script type='text/javaScript' src='../../include/javascript/calendar.js'></script>
|
|
|
|
<script type='text/javascript' src='../../include/javascript/x_core.js'></script>
|
|
|
|
<script type='text/javascript' src='../../include/javascript/x_event.js'></script>
|
|
|
|
<script type='text/javascript' src='../../include/javascript/x_slide.js'></script>
|
|
|
|
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
|
|
|
|
<script type='text/javascript' src='../../include/javascript/jquery-1.7.1.js'></script>
|
|
|
|
<script type='text/javascript'>
|
|
|
|
<!--
|
|
|
|
var defOffset = 2;
|
|
|
|
var defSlideTime = 220;
|
|
|
|
var tnActive = 0;
|
|
|
|
var visibleMargin = 45;
|
|
|
|
var menuW = 400;
|
|
|
|
var menuH = 310;
|
|
|
|
var showed = 0;
|
|
|
|
window.onload = function() {
|
|
|
|
var d;
|
|
|
|
d = xGetElementById('divmenu');
|
|
|
|
d.termNumber = 1;
|
|
|
|
xMoveTo(d, visibleMargin - menuW, 0);
|
|
|
|
xShow(d);
|
|
|
|
|
|
|
|
// If navigator is IE then call attachEvent, else call addEventListener
|
|
|
|
if ('\v'=='v')
|
|
|
|
document.getElementById('show_menu').attachEvent('onclick', docOnMousemoveIn);
|
|
|
|
else
|
|
|
|
document.getElementById('show_menu').addEventListener('click', docOnMousemoveIn, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Hack to repeat the init process to period select
|
|
|
|
var periodSelectId = $('[name="period"]').attr('class');
|
|
|
|
|
|
|
|
period_select_init(periodSelectId);
|
|
|
|
|
|
|
|
$("#graph_menu_arrow").click(function(){
|
|
|
|
if ($("#graph_menu_arrow").attr("src").indexOf("hide") == -1){
|
2012-09-21 13:24:16 +02:00
|
|
|
$("#graph_menu_arrow").attr("src", <?php echo '"' . $config['homeurl'] . '"'; ?> + "/images/graphmenu_arrow_hide.png");
|
2012-07-18 11:34:10 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("#graph_menu_arrow").attr("src", <?php echo '"' . $config['homeurl'] . '"'; ?> + "/images/graphmenu_arrow.png");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
function docOnMousemoveIn(evt) {
|
|
|
|
var e = new xEvent(evt);
|
|
|
|
var d = getTermEle(e.target);
|
|
|
|
|
|
|
|
// mouse is over a term, activate its def
|
|
|
|
if (showed == 0) {
|
|
|
|
xSlideTo('divmenu', 0, xPageY(d), defSlideTime);
|
|
|
|
showed = 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
xSlideTo('divmenu', visibleMargin - menuW, xPageY(d), defSlideTime);
|
|
|
|
showed = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function docOnMousemove(evt) {
|
|
|
|
var e = new xEvent(evt);
|
|
|
|
var d = getTermEle(e.target);
|
|
|
|
if (!tnActive) { // no def is active
|
|
|
|
if (d) { // mouse is over a term, activate its def
|
|
|
|
xSlideTo('divmenu', 0, xPageY(d), defSlideTime);
|
|
|
|
tnActive = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else { // a def is active
|
|
|
|
if (!d) { // mouse is not over a term, deactivate active def
|
|
|
|
xSlideTo('divmenu', visibleMargin - menuW, xPageY(d), defSlideTime);
|
|
|
|
tnActive = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function getTermEle(ele) {
|
|
|
|
//window.status = ele;
|
|
|
|
while(ele && !ele.termNumber) {
|
|
|
|
if (ele == document) return null;
|
|
|
|
ele = xParent(ele);
|
|
|
|
}
|
|
|
|
return ele;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
// Get input parameters
|
|
|
|
$label = get_parameter ("label","");
|
|
|
|
if (!isset($_GET["period"]) OR (!isset($_GET["id"]))) {
|
|
|
|
echo "<h3 class='error'>" .
|
|
|
|
__('There was a problem locating the source of the graph') .
|
|
|
|
"</h3>";
|
|
|
|
exit;
|
2012-04-18 18:08:48 +02:00
|
|
|
}
|
2012-07-18 11:34:10 +02:00
|
|
|
|
|
|
|
$period = get_parameter ( "period", SECONDS_1HOUR);
|
|
|
|
$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
|
|
|
}
|
2012-07-18 11:34:10 +02:00
|
|
|
$period = get_parameter ("period", 86400);
|
|
|
|
$id = get_parameter ("id", 0);
|
|
|
|
$width = get_parameter ("width", 555);
|
|
|
|
$height = get_parameter ("height", 245);
|
|
|
|
$label = get_parameter ("label", "");
|
|
|
|
$start_date = get_parameter ("start_date", date("Y-m-d"));
|
|
|
|
$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;
|
|
|
|
|
|
|
|
if($time_compare_separated) {
|
|
|
|
$time_compare = 'separated';
|
|
|
|
}
|
|
|
|
else if($time_compare_overlapped) {
|
|
|
|
$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
|
|
|
|
|
|
|
$utime = get_system_time ();
|
|
|
|
$current = date("Y-m-d", $utime);
|
|
|
|
|
|
|
|
if ($start_date != $current)
|
|
|
|
$date = strtotime($start_date);
|
|
|
|
else
|
|
|
|
$date = $utime;
|
|
|
|
|
2012-09-04 17:58:48 +02:00
|
|
|
$urlImage = ui_get_full_url(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)
|
|
|
|
echo '<div style="margin-left: 70px">';
|
|
|
|
else
|
|
|
|
echo '<div style="margin-left: 50px">';
|
|
|
|
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,
|
2013-02-13 10:41:59 +01:00
|
|
|
$label, null, $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,
|
|
|
|
$label, $unit_name, $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>';
|
|
|
|
|
|
|
|
//z-index is 1 because 2 made the calendar show under the divmenu.
|
|
|
|
?>
|
|
|
|
<div id="divmenu" class="menu" style="z-index:1; height: 98%;">
|
|
|
|
<b> <?php echo __('Pandora FMS Graph configuration menu');?></b>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<?php
|
|
|
|
echo __('Please, make your changes and apply with the <i>Reload</i> button');
|
|
|
|
?>
|
2013-02-11 11:26:16 +01:00
|
|
|
<div style="float: left; width: 85%;">
|
2012-07-26 18:49:35 +02:00
|
|
|
|
2013-02-11 11:26:16 +01:00
|
|
|
<form method="get" action="stat_win.php">
|
|
|
|
<?php
|
2012-07-26 18:49:35 +02:00
|
|
|
html_print_input_hidden ("id", $id);
|
|
|
|
html_print_input_hidden ("label", $label);
|
2013-02-11 11:26:16 +01:00
|
|
|
|
2012-07-26 18:49:35 +02:00
|
|
|
if (isset($hash_connection_data)) {
|
2013-02-11 11:26:16 +01:00
|
|
|
|
|
|
|
html_print_input_hidden("loginhash", "auto");
|
|
|
|
html_print_input_hidden("loginhash_data", $loginhash_data);
|
|
|
|
html_print_input_hidden("loginhash_user", $loginhash_user);
|
2012-07-26 18:49:35 +02:00
|
|
|
}
|
|
|
|
|
2012-07-18 11:34:10 +02:00
|
|
|
html_print_input_hidden ("id", $id);
|
|
|
|
html_print_input_hidden ("label", $label);
|
|
|
|
|
|
|
|
if (isset($_GET["type"])) {
|
|
|
|
$type = get_parameter_get ("type");
|
|
|
|
html_print_input_hidden ("type", $type);
|
|
|
|
}
|
|
|
|
?>
|
2013-02-11 11:26:16 +01:00
|
|
|
<table class="databox_frame" cellspacing="2" width="100%">
|
2012-07-18 11:34:10 +02:00
|
|
|
<tr>
|
|
|
|
<td><?php echo __('Refresh time');?></td>
|
2013-02-11 11:26:16 +01:00
|
|
|
<td width="50%">
|
2012-07-18 11:34:10 +02:00
|
|
|
<?php
|
|
|
|
html_print_extended_select_for_time(
|
|
|
|
"refresh", $refresh, '', '', 0, 7);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2012-10-02 17:54:22 +02:00
|
|
|
<?php
|
|
|
|
if ($graph_type != "boolean") {
|
|
|
|
echo '<tr>
|
|
|
|
<td>'.
|
|
|
|
__('Avg. Only').
|
|
|
|
'</td>
|
|
|
|
<td>';
|
|
|
|
html_print_checkbox ("avg_only", 1, (bool) $avg_only, false, false, 'show_others()');
|
|
|
|
html_print_input_hidden('show_other', 0);
|
|
|
|
echo '</td>
|
|
|
|
</tr>';
|
|
|
|
}
|
|
|
|
?>
|
2012-07-18 11:34:10 +02:00
|
|
|
<tr>
|
|
|
|
<td><?php echo __('Begin date'); ?></td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
html_print_input_text ("start_date", substr ($start_date, 0, 10),'', 10);
|
|
|
|
html_print_image ("images/calendar_view_day.png", false, array ("onclick" => "scwShow(scwID('text-start_date'),this);"));
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><?php echo __('Zoom factor');?></td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
$options = array ();
|
|
|
|
$options[$zoom] = 'x'.$zoom;
|
|
|
|
$options[1] = 'x1';
|
|
|
|
$options[2] = 'x2';
|
|
|
|
$options[3] = 'x3';
|
|
|
|
$options[4] = 'x4';
|
|
|
|
html_print_select ($options, "zoom", $zoom);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><?php echo __('Time range'); ?></td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
html_print_extended_select_for_time('period',
|
|
|
|
$period, '', '', 0, 7);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><?php echo __('Show events');?></td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
html_print_checkbox ("draw_events", 1, (bool) $draw_events);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><?php echo __('Show alerts');?></td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
html_print_checkbox ("draw_alerts", 1, (bool) $draw_alerts);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><?php echo __('Show event graph');?></td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
html_print_checkbox ("show_events_graph",
|
|
|
|
1, (bool) $show_events_graph);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2012-08-30 11:22:03 +02:00
|
|
|
<?php
|
|
|
|
switch ($graph_type) {
|
2012-08-30 17:50:18 +02:00
|
|
|
case 'boolean':
|
2012-08-30 11:22:03 +02:00
|
|
|
case 'sparse':
|
|
|
|
?>
|
2013-02-11 11:26:16 +01:00
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
echo __('Time compare') . ' (' .
|
|
|
|
__('Overlapped') . ')';
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
html_print_checkbox ("time_compare_overlapped",
|
|
|
|
1, (bool) $time_compare_overlapped);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
echo __('Time compare') . ' ('.
|
|
|
|
__('Separated').')';
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
html_print_checkbox ("time_compare_separated",
|
|
|
|
1, (bool) $time_compare_separated);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><?php echo __('Show unknown graph');?></td>
|
|
|
|
<td>
|
|
|
|
<?php
|
|
|
|
html_print_checkbox ("unknown_graph",
|
|
|
|
1, (bool) $unknown_graph);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2012-08-30 11:22:03 +02:00
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
?>
|
2012-07-18 11:34:10 +02:00
|
|
|
<tr>
|
|
|
|
<td></td>
|
|
|
|
<td style="text-align: right">
|
|
|
|
<?php
|
|
|
|
html_print_submit_button (__('Reload'), "submit", false, 'class="sub next"');
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div id="show_menu" style="position: relative; border:1px solid #FFF; float: right; height: 50px; width: 50px;">
|
|
|
|
<?php
|
|
|
|
html_print_image("images/graphmenu_arrow.png", false, array('id' => 'graph_menu_arrow'));
|
|
|
|
?>
|
|
|
|
<div>
|
|
|
|
</div>
|
|
|
|
</body>
|
2010-09-13 12:26:33 +02:00
|
|
|
</html>
|
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) {
|
|
|
|
window.resizeTo(width_window, height_window + 15);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
window.resizeTo(width_window, height_window + 100);
|
|
|
|
}
|
|
|
|
show_overview = !show_overview;
|
|
|
|
|
|
|
|
});
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2012-08-31 13:59:46 +02:00
|
|
|
</script>
|