2013-04-10 Sergio Martin <sergio.martin@artica.es>
* include/styles/pandora.css include/functions_ui.php include/functions_events.php include/graphs/functions_flot.php operation/events/events_list.php operation/agentes/tactical.php images/cross_undo.png images/header_user.png images/pandora_header_logo_enterprise.png images/note.png images/header_chat.png images/enterprise_icon.png images/header_warning.png images/header_ready.png images/header_blackout.png images/header_refresh.png images/header_logout.png images/eye.png images/header_email.png images/pandora_header_logo.png images/header_down.png images/header_user_admin.png images/header_help.png images/bin.png general/header.php: Change the header to tiny version and clean/change more icons * operation/agentes/datos_agente.php: Restore accidentaly deleted file git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7959 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
|
@ -1,3 +1,35 @@
|
|||
2013-04-10 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/styles/pandora.css
|
||||
include/functions_ui.php
|
||||
include/functions_events.php
|
||||
include/graphs/functions_flot.php
|
||||
operation/events/events_list.php
|
||||
operation/agentes/tactical.php
|
||||
images/cross_undo.png
|
||||
images/header_user.png
|
||||
images/pandora_header_logo_enterprise.png
|
||||
images/note.png
|
||||
images/header_chat.png
|
||||
images/enterprise_icon.png
|
||||
images/header_warning.png
|
||||
images/header_ready.png
|
||||
images/header_blackout.png
|
||||
images/header_refresh.png
|
||||
images/header_logout.png
|
||||
images/eye.png
|
||||
images/header_email.png
|
||||
images/pandora_header_logo.png
|
||||
images/header_down.png
|
||||
images/header_user_admin.png
|
||||
images/header_help.png
|
||||
images/bin.png
|
||||
general/header.php: Change the header to tiny
|
||||
version and clean/change more icons
|
||||
|
||||
* operation/agentes/datos_agente.php: Restore
|
||||
accidentaly deleted file
|
||||
|
||||
2013-04-10 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/reporting/visual_console_builder.editor.js: fixed the
|
||||
|
|
|
@ -31,29 +31,33 @@ config_check();
|
|||
?>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" style="margin:0px; padding:0px; margin-top: 0px; height: 100%" border="0">
|
||||
<tr>
|
||||
<td style="width:250px; vertical-align: top;">
|
||||
<td style="width:90%;">
|
||||
<a href="index.php?sec=main">
|
||||
<?php
|
||||
if (!defined ('PANDORA_ENTERPRISE')) {
|
||||
echo html_print_image('images/pandora_header_logo.png', true, array("alt" => 'Pandora FMS Opensource', "border" => '0'));
|
||||
}
|
||||
else {
|
||||
echo html_print_image('images/pandora_header_logo_enterprise.png', true, array("alt" => 'Pandora FMS Enterprise', "border" => '0', 'width' => '250px'));
|
||||
echo html_print_image('images/pandora_header_logo_enterprise.png', true, array("alt" => 'Pandora FMS Enterprise', "border" => '0'));
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
</td>
|
||||
<td style="min-width:120px;">
|
||||
<td style="min-width:200px;">
|
||||
<?php
|
||||
$table->class = "none";
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->head = array ();
|
||||
$table->data = array ();
|
||||
$table->style[0] = $table->style[2] = $table->style[4] = 'width: 22px; text-align:center; height: 22px; padding-left: 12px; padding-right: 2px;';
|
||||
$table->style[0] = $table->style[1] = $table->style[3] = $table->style[4] = $table->style[5] = $table->style[6] = $table->style[9] = 'width: 22px; text-align:center; height: 22px; padding-right: 9px;';
|
||||
$table->style[7] = 'width: 20px; padding-right: 9px;';
|
||||
$table->style['searchbar'] = 'width: 180px; min-width: 180px;';
|
||||
$table->style[11] = 'padding-left: 10px; padding-right: 5px;width: 16px;';
|
||||
$table->width = "100%";
|
||||
$table->styleTable = 'margin: auto; margin-top: 0px;';
|
||||
$table->rowclass[0] = '';
|
||||
$table->styleTable = 'margin: auto; margin-top: 15px;';
|
||||
|
||||
|
||||
// Servers check
|
||||
$servers = array();
|
||||
$servers["all"] = (int) db_get_value ('COUNT(id_server)','tserver');
|
||||
|
@ -62,17 +66,14 @@ config_check();
|
|||
if ($servers["up"] == 0) {
|
||||
//All Servers down or no servers at all
|
||||
$servers_check_img = html_print_image("images/header_down.png", true, array("alt" => 'cross', "class" => 'bot', 'title' => __('All systems').': '.__('Down')));
|
||||
$servers_check_txt = __('All systems').': '.__('Down');
|
||||
}
|
||||
elseif ($servers["down"] != 0) {
|
||||
//Some servers down
|
||||
$servers_check_img = html_print_image("images/header_warning.png", true, array("alt" => 'error', "class" => 'bot', 'title' => $servers["down"].' '.__('servers down')));
|
||||
$servers_check_txt = $servers["down"].' '.__('servers down');
|
||||
}
|
||||
else {
|
||||
//All servers up
|
||||
$servers_check_img = html_print_image("images/header_ready.png", true, array("alt" => 'ok', "class" => 'bot', 'title' => __('All systems').': '.__('Ready')));
|
||||
$servers_check_txt = __('All systems').': '.__('Ready');
|
||||
}
|
||||
unset ($servers); // Since this is the header, we don't like to trickle down variables.
|
||||
|
||||
|
@ -80,11 +81,10 @@ config_check();
|
|||
$servers_link_close = '</a>';
|
||||
|
||||
$table->data[0][0] = $servers_link_open . $servers_check_img . $servers_link_close;
|
||||
$table->data[0][1] = $servers_link_open . $servers_check_txt . $servers_link_close;
|
||||
|
||||
// Autorefresh
|
||||
$autorefresh_img = html_print_image("images/header_refresh.png", true, array("class" => 'bot', "alt" => 'lightning', 'title' => __('Configure autorefresh')));
|
||||
$autorefresh_txt = __('Autorefresh');
|
||||
$autorefresh_txt = '';
|
||||
$autorefresh_additional = '';
|
||||
|
||||
$ignored_params = array ('agent_config' => false, 'code' => false);
|
||||
|
@ -126,11 +126,8 @@ config_check();
|
|||
$autorefresh_link_open_txt = '<a class="white autorefresh autorefresh_txt" href="' . ui_get_url_refresh ($ignored_params) . '">';
|
||||
$autorefresh_link_close = '</a>';
|
||||
|
||||
$table->data[0][2] = $autorefresh_link_open_img . $autorefresh_img . $autorefresh_link_close;
|
||||
$table->data[0][3] = $autorefresh_link_open_txt . $autorefresh_txt . $autorefresh_link_close . $autorefresh_additional;
|
||||
|
||||
// Maintenance
|
||||
//$maintenance_txt = __('Maintenance');
|
||||
$table->data[0][1] = $autorefresh_link_open_img . $autorefresh_img . $autorefresh_link_close;
|
||||
$table->data[0][2] .= $autorefresh_link_open_txt . $autorefresh_txt . $autorefresh_link_close . $autorefresh_additional;
|
||||
|
||||
if ($config["alert_cnt"] > 0) {
|
||||
echo '<div id="alert_messages" style="display: none"></div>';
|
||||
|
@ -150,62 +147,32 @@ config_check();
|
|||
$maintenance_img = html_print_image ("images/header_ready.png", true, array ("title" => __('There are not warnings'), "id" => "yougotalert", "class" => "bot"));
|
||||
}
|
||||
|
||||
$table->data[0][4] = $maintenance_img;
|
||||
//$table->data[0][5] = $maintenance_txt;
|
||||
|
||||
html_print_table($table);
|
||||
$table->data[0][3] = $maintenance_img;
|
||||
|
||||
unset($table);
|
||||
?>
|
||||
</td>
|
||||
<td style="min-width:120px;">
|
||||
<?php
|
||||
$table->class = "none";
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->head = array ();
|
||||
$table->data = array ();
|
||||
$table->style[0] = $table->style[1] = 'width: 22px; text-align:center; height: 22px; padding-right: 2px;';
|
||||
$table->rowclass[0] = '';
|
||||
$table->styleTable = 'margin-top: 15px;';
|
||||
// Main help icon
|
||||
$table->data[0][4] = ui_print_help_icon ("main_help", true, '', 'images/header_help.png');
|
||||
|
||||
// Logout
|
||||
$table->data[0][0] = '<a class="white" href="' . ui_get_full_url('index.php?bye=bye') . '">';
|
||||
$table->data[0][0] .= html_print_image("images/header_logout.png", true, array("alt" => __('Logout'), "class" => 'bot', "title" => __('Logout')));
|
||||
$table->data[0][0] .= '</a>';
|
||||
$table->data[0][5] = '<a class="white" href="' . ui_get_full_url('index.php?bye=bye') . '">';
|
||||
$table->data[0][5] .= html_print_image("images/header_logout.png", true, array("alt" => __('Logout'), "class" => 'bot', "title" => __('Logout')));
|
||||
$table->data[0][5] .= '</a>';
|
||||
|
||||
// User
|
||||
if (is_user_admin ($config["id_user"]) == 1)
|
||||
$table->data[0][1] = html_print_image("images/header_user_admin.png" , true, array("title" => __('Edit my user'), "class" => 'bot', "alt" => 'user'));
|
||||
$table->data[0][6] = html_print_image("images/header_user_admin.png" , true, array("title" => __('Edit my user'), "class" => 'bot', "alt" => 'user'));
|
||||
else
|
||||
$table->data[0][1] = html_print_image("images/header_user.png" , true, array("title" => __('Edit my user'), "class" => 'bot', "alt" => 'user'));
|
||||
$table->data[0][6] = html_print_image("images/header_user.png" , true, array("title" => __('Edit my user'), "class" => 'bot', "alt" => 'user'));
|
||||
|
||||
$table->data[0][1] = '<a href="index.php?sec=workspace&sec2=operation/users/user_edit">' . $table->data[0][1] . '</a>';
|
||||
$table->data[0][6] = '<a href="index.php?sec=workspace&sec2=operation/users/user_edit">' . $table->data[0][6] . '</a>';
|
||||
|
||||
$table->data[0][2] = '<a href="index.php?sec=workspace&sec2=operation/users/user_edit" class="white"> [<b>' . $config["id_user"] . '</b>]</a>';
|
||||
|
||||
html_print_table($table);
|
||||
$table->data[0][7] = '<a href="index.php?sec=workspace&sec2=operation/users/user_edit" class="white_bold"> (' . $config["id_user"] . ')</a>';
|
||||
|
||||
unset($table);
|
||||
?>
|
||||
</td>
|
||||
<td style="min-width:200px;">
|
||||
<?php
|
||||
$table->class = "none";
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->head = array ();
|
||||
$table->data = array ();
|
||||
$table->style[0] = $table->style[1] = 'width: 22px; text-align:center; height: 22px; padding-right: 2px;';
|
||||
$table->style[3] = $table->style[4] = $table->style[5] = 'text-align:right; padding-right: 2px; width: 1px;';
|
||||
$table->style[6] = 'width: 120px;';
|
||||
$table->style[7] = 'padding-left: 10px; padding-left: 10px; width: 20px;';
|
||||
$table->width = "100%";
|
||||
$table->styleTable = 'margin: auto; margin-top: 15px; padding-right: 5px;';
|
||||
$table->rowclass[0] = '';
|
||||
|
||||
// Main help icon
|
||||
$table->data[0][3] = ui_print_help_icon ("main_help", true, '', 'images/header_help.png');
|
||||
// Chat messages
|
||||
$table->data[0][8] = "<span id='icon_new_messages_chat' style='display: none;'>";
|
||||
$table->data[0][8] .= "<a href='index.php?sec=workspace&sec2=operation/users/webchat'>";
|
||||
$table->data[0][8] .= html_print_image('images/header_chat.png', true, array('style' => 'width:22px;', "title" => __('New chat message')));
|
||||
$table->data[0][8] .= "</a>";
|
||||
$table->data[0][8] .= "</span>";
|
||||
|
||||
// Messages
|
||||
$msg_cnt = messages_get_count ($config["id_user"]);
|
||||
|
@ -213,21 +180,11 @@ config_check();
|
|||
echo '<div id="dialog_messages" style="display: none"></div>';
|
||||
ui_require_css_file ('dialog');
|
||||
|
||||
$table->data[0][4] = '<a href="ajax.php?page=operation/messages/message_list" title="' . __("Message overview") . '" id="show_messages_dialog">';
|
||||
$table->data[0][4] .= html_print_image ("images/header_email.png", true, array ("title" => __('You have %d unread message(s)', $msg_cnt), "id" => "yougotmail", "class" => "bot", 'style' => 'width:24px;'));
|
||||
$table->data[0][4] .= '</a>';
|
||||
}
|
||||
else {
|
||||
$table->data[0][4] = '';
|
||||
$table->data[0][9] = '<a href="ajax.php?page=operation/messages/message_list" title="' . __("Message overview") . '" id="show_messages_dialog">';
|
||||
$table->data[0][9] .= html_print_image ("images/header_email.png", true, array ("title" => __('You have %d unread message(s)', $msg_cnt), "id" => "yougotmail", "class" => "bot", 'style' => 'width:24px;'));
|
||||
$table->data[0][9] .= '</a>';
|
||||
}
|
||||
|
||||
// Chat messages
|
||||
$table->data[0][5] = "<span id='icon_new_messages_chat' style='display: none;'>";
|
||||
$table->data[0][5] .= "<a href='index.php?sec=workspace&sec2=operation/users/webchat'>";
|
||||
$table->data[0][5] .= html_print_image('images/header_chat.png', true, array('style' => 'width:22px;', "title" => __('New chat message')));
|
||||
$table->data[0][5] .= "</a>";
|
||||
$table->data[0][5] .= "</span>";
|
||||
|
||||
// Search bar
|
||||
$search_bar = '<form method="get" style="display: inline;" name="quicksearch" action="">';
|
||||
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
|
||||
|
@ -240,16 +197,16 @@ config_check();
|
|||
$search_bar .= "value='" . $config['search_keywords'] . "'";
|
||||
|
||||
$search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');"
|
||||
size="60" class="search_input" />';
|
||||
style="margin-top:5px;" class="search_input" />';
|
||||
|
||||
//$search_bar .= 'onClick="javascript: document.quicksearch.submit()"';
|
||||
|
||||
$search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />";
|
||||
$search_bar .= '</form>';
|
||||
|
||||
$table->data[0][6] = $search_bar;
|
||||
$table->data[0]['searchbar'] = $search_bar;
|
||||
|
||||
$table->data[0][7] = ui_print_help_tip (__("Blank characters are used as AND conditions"), true);
|
||||
$table->data[0][11] = ui_print_help_tip (__("Blank characters are used as AND conditions"), true);
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
|
|
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 699 B After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 963 B After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 474 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 3.7 KiB |
|
@ -903,7 +903,7 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
|
|||
}
|
||||
|
||||
$events_table = html_print_table ($table, true);
|
||||
$out = '<table width="98%"><tr><td style="width: 90%; padding-right: 10px;">';
|
||||
$out = '<table width="98%"><tr><td style="width: 90%; padding-right: 10px; vertical-align: top; padding-top: 0px;">';
|
||||
$out .= $events_table;
|
||||
|
||||
if($agent_id != 0) {
|
||||
|
|
|
@ -949,7 +949,7 @@ function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image =
|
|||
$home_url = "../../" . $home_url;
|
||||
}
|
||||
|
||||
$output = ' '.html_print_image ($image, true,
|
||||
$output = html_print_image ($image, true,
|
||||
array ("class" => "img_help",
|
||||
"title" => __('Help'),
|
||||
"onclick" => "open_help ('".$help_id."','".$home_url."')"));
|
||||
|
@ -1341,7 +1341,7 @@ function ui_process_page_head ($string, $bitfield) {
|
|||
|
||||
if ($config['flash_charts']) {
|
||||
//Include the javascript for the js charts library
|
||||
include_once('include/graphs/functions_flot.php');
|
||||
include_once($config["homedir"] . '/include/graphs/functions_flot.php');
|
||||
$output .= include_javascript_dependencies_flot_graph(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $long_in
|
|||
$nbuttons++;
|
||||
}
|
||||
|
||||
$menu_width = 18 * $nbuttons + 8;
|
||||
$menu_width = 25 * $nbuttons + 8;
|
||||
$return .= "<div id='menu_$graph_id' style='display:none; text-align:center; width:".$menu_width."px; position:relative; border: solid 1px #666; border-bottom: 0px; padding: 4px 4px 4px 4px'>
|
||||
<a href='javascript:'><img id='menu_cancelzoom_$graph_id' src='".$homeurl."images/zoom_cross.disabled.png' alt='".__('Cancel zoom')."' title='".__('Cancel zoom')."'></a>";
|
||||
if ($threshold) {
|
||||
|
@ -690,4 +690,4 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
|
|||
|
||||
return $return;
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -1698,16 +1698,11 @@ div#head {
|
|||
height: auto;
|
||||
background-color: #000;
|
||||
background-image: url(../../images/header_blackout.png);
|
||||
height: 68px;
|
||||
height: 47px;
|
||||
min-width: 882px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
div#head .bot{
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
|
||||
div#foot {
|
||||
width: auto;
|
||||
}
|
||||
|
@ -2068,9 +2063,9 @@ li.links a:hover {
|
|||
input#text-id_parent.ac_input, input, textarea, select {
|
||||
background-color: #ffffff !important;
|
||||
border: 1px solid #cbcbcb;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
span#plugin_description {
|
||||
|
|
|
@ -0,0 +1,317 @@
|
|||
<?php
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2010 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.
|
||||
|
||||
|
||||
|
||||
// Load global vars
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
require_once('include/functions_modules.php');
|
||||
|
||||
$module_id = get_parameter_get ("id", 0);
|
||||
$period = get_parameter ("period", 86400);
|
||||
$group = agents_get_agentmodule_group ($module_id);
|
||||
$agentId = get_parameter("id_agente");
|
||||
$freestring = get_parameter ("freestring");
|
||||
|
||||
// Select active connection
|
||||
$connection = get_parameter ("connection", 'main');
|
||||
if ($connection == 'history' && $config['history_db_enabled'] == 1) {
|
||||
if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) {
|
||||
$config['history_db_connection'] = db_connect($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], $config['history_db_pass'], $config['history_db_port'], false);
|
||||
}
|
||||
$connection_handler = $config['history_db_connection'];
|
||||
}
|
||||
else {
|
||||
$connection_handler = $config['dbconnection'];
|
||||
}
|
||||
|
||||
$selection_mode = get_parameter('selection_mode', 'fromnow');
|
||||
$date_from = (string) get_parameter ('date_from', date ('Y-m-j'));
|
||||
$time_from = (string) get_parameter ('time_from', date ('h:iA'));
|
||||
$date_to = (string) get_parameter ('date_to', date ('Y-m-j'));
|
||||
$time_to = (string) get_parameter ('time_to', date ('h:iA'));
|
||||
|
||||
if (! check_acl ($config['id_user'], $group, "AR") || $module_id == 0) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Agent Data view");
|
||||
require ("general/noaccess.php");
|
||||
return;
|
||||
}
|
||||
|
||||
$table->cellpadding = 3;
|
||||
$table->cellspacing = 3;
|
||||
$table->width = '98%';
|
||||
$table->class = "databox";
|
||||
$table->head = array ();
|
||||
$table->data = array ();
|
||||
$table->align = array ();
|
||||
$table->size = array ();
|
||||
|
||||
|
||||
$moduletype_name = modules_get_moduletype_name (modules_get_agentmodule_type ($module_id));
|
||||
|
||||
$offset = (int) get_parameter("offset");
|
||||
$block_size = (int) $config["block_size"];
|
||||
|
||||
// The "columns" array is the number(and definition) of columns in the report:
|
||||
// $columns = array(
|
||||
// "COLUMN1" => array(ROW_FROM_DB_TABLE, FUNCTION_NAME_TO_FORMAT_THE_DATA, "align"=>COLUMN_ALIGNMENT, "width"=>COLUMN_WIDTH)
|
||||
// "COLUMN2" => array(ROW_FROM_DB_TABLE, FUNCTION_NAME_TO_FORMAT_THE_DATA, "align"=>COLUMN_ALIGNMENT, "width"=>COLUMN_WIDTH)
|
||||
// ....
|
||||
// )
|
||||
//
|
||||
// For each row from the query, and for each column, we'll call the FUNCTION passing as argument
|
||||
// the value of the ROW.
|
||||
//
|
||||
$columns = array ();
|
||||
|
||||
$datetime_from = strtotime ($date_from.' '.$time_from);
|
||||
$datetime_to = strtotime ($date_to.' '.$time_to);
|
||||
|
||||
if ($moduletype_name == "log4x") {
|
||||
$table->width = "100%";
|
||||
$sql_freestring = '%' . $freestring . '%';
|
||||
|
||||
if ($selection_mode == "fromnow") {
|
||||
$sql_body = sprintf ("FROM tagente_datos_log4x WHERE id_agente_modulo = %d AND message like '%s' AND utimestamp > %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, get_system_time () - $period);
|
||||
}
|
||||
else {
|
||||
$sql_body = sprintf ("FROM tagente_datos_log4x WHERE id_agente_modulo = %d AND message like '%s' AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, $datetime_from, $datetime_to);
|
||||
}
|
||||
|
||||
$columns = array(
|
||||
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center" ),
|
||||
"Sev" => array("severity", "modules_format_data", "align" => "center", "width" => "70px"),
|
||||
"Message"=> array("message", "modules_format_verbatim", "align" => "left", "width" => "45%"),
|
||||
"StackTrace" => array("stacktrace", "modules_format_verbatim", "align" => "left", "width" => "50%")
|
||||
);
|
||||
}
|
||||
else if (preg_match ("/string/", $moduletype_name)) {
|
||||
$sql_freestring = '%' . $freestring . '%';
|
||||
if ($selection_mode == "fromnow") {
|
||||
$sql_body = sprintf (" FROM tagente_datos_string WHERE id_agente_modulo = %d AND datos like '%s' AND utimestamp > %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, get_system_time () - $period);
|
||||
}
|
||||
else {
|
||||
$sql_body = sprintf (" FROM tagente_datos_string WHERE id_agente_modulo = %d AND datos like '%s' AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, $datetime_from, $datetime_to);
|
||||
}
|
||||
|
||||
$columns = array(
|
||||
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"),
|
||||
"Data" => array("datos", "modules_format_data", "align" => "left"),
|
||||
"Time" => array("utimestamp", "modules_format_time", "align" => "center")
|
||||
);
|
||||
}
|
||||
else {
|
||||
if ($selection_mode == "fromnow") {
|
||||
$sql_body = sprintf (" FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d ORDER BY utimestamp DESC", $module_id, get_system_time () - $period);
|
||||
}
|
||||
else {
|
||||
$sql_body = sprintf (" FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $datetime_from, $datetime_to);
|
||||
}
|
||||
|
||||
$columns = array(
|
||||
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"),
|
||||
"Data" => array("datos", "modules_format_data", "align" => "left"),
|
||||
"Time" => array("utimestamp", "modules_format_time", "align" => "center")
|
||||
);
|
||||
}
|
||||
|
||||
$sql_body = io_safe_output($sql_body);
|
||||
// Clean all codification characters
|
||||
|
||||
$sql = "SELECT * " . $sql_body;
|
||||
$sql_count = "SELECT count(*) " . $sql_body;
|
||||
|
||||
$count = db_get_value_sql ($sql_count, $connection_handler);
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$sql .= " LIMIT " . $offset . "," . $block_size;
|
||||
break;
|
||||
case "postgresql":
|
||||
$sql .= " LIMIT " . $block_size . " OFFSET " . $offset;
|
||||
break;
|
||||
case "oracle":
|
||||
$set = array();
|
||||
$set['limit'] = $block_size;
|
||||
$set['offset'] = $offset;
|
||||
$sql = oracle_recode_query ($sql, $set);
|
||||
break;
|
||||
}
|
||||
|
||||
$result = db_get_all_rows_sql ($sql, false, true, $connection_handler);
|
||||
if ($result === false) {
|
||||
$result = array ();
|
||||
}
|
||||
|
||||
if (($config['dbtype'] == 'oracle') && ($result !== false)) {
|
||||
for ($i=0; $i < count($result); $i++) {
|
||||
unset($result[$i]['rnum']);
|
||||
}
|
||||
}
|
||||
|
||||
$header_title = __('Received data from')." ".modules_get_agentmodule_agent_name ($module_id)." / ".modules_get_agentmodule_name ($module_id);
|
||||
|
||||
echo "<form method='post' action='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=" . $agentId . "&tab=data_view&id=" . $module_id . "'>";
|
||||
|
||||
echo "<h4>".$header_title;
|
||||
if ($config['history_db_enabled'] == 1) {
|
||||
echo " ";
|
||||
html_print_select (array ('main' => __('Main database'), 'history' => __('History database')), "connection", $connection);
|
||||
ui_print_help_tip (__('Switch between the main database and the history database to retrieve module data'));
|
||||
}
|
||||
echo "</h4>";
|
||||
|
||||
$formtable->width = '98%';
|
||||
$formtable->class = "databox";
|
||||
$formtable->data = array ();
|
||||
$formtable->size = array ();
|
||||
$formtable->size[0] = '40%';
|
||||
$formtable->size[1] = '20%';
|
||||
$formtable->size[2] = '30%';
|
||||
|
||||
$formtable->data[0][0] = html_print_radio_button_extended ("selection_mode", 'fromnow', '', $selection_mode, false, '', 'style="margin-right: 15px;"', true) . __("Choose a time from now");
|
||||
$formtable->data[0][1] = html_print_extended_select_for_time ('period', $period, '', '', '0', 10, true);
|
||||
|
||||
$formtable->data[1][0] = html_print_radio_button_extended ("selection_mode", 'range','', $selection_mode, false, '', 'style="margin-right: 15px;"', true) . __("Specify time range");
|
||||
$formtable->data[1][1] = __('Timestamp from:');
|
||||
|
||||
$formtable->data[1][2] = html_print_input_text ('date_from', $date_from, '', 10, 10, true);
|
||||
$formtable->data[1][2] .= html_print_input_text ('time_from', $time_from, '', 7, 7, true);
|
||||
|
||||
$formtable->data[1][1] .= '<br />';
|
||||
$formtable->data[1][1] .= __('Timestamp to:');
|
||||
|
||||
$formtable->data[1][2] .= '<br />';
|
||||
$formtable->data[1][2] .= html_print_input_text ('date_to', $date_to, '', 10, 10, true);
|
||||
$formtable->data[1][2] .= html_print_input_text ('time_to', $time_to, '', 7, 7, true);
|
||||
|
||||
if (preg_match ("/string/", $moduletype_name) || $moduletype_name == "log4x") {
|
||||
$formtable->data[2][0] = __('Free text for search');
|
||||
$formtable->data[2][1] = html_print_input_text ("freestring", $freestring, '', 20,30, true);
|
||||
}
|
||||
|
||||
html_print_table ($formtable);
|
||||
|
||||
echo '<div class="action-buttons" style="width:98%">';
|
||||
html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
|
||||
echo '</div>';
|
||||
|
||||
echo "</form><br />";
|
||||
|
||||
$table->width = '98%';
|
||||
|
||||
//
|
||||
$index = 0;
|
||||
foreach($columns as $col => $attr) {
|
||||
$table->head[$index] = $col;
|
||||
|
||||
if (isset($attr["align"]))
|
||||
$table->align[$index] = $attr["align"];
|
||||
|
||||
if (isset($attr["width"]))
|
||||
$table->size[$index] = $attr["width"];
|
||||
|
||||
$index++;
|
||||
}
|
||||
|
||||
$id_type_web_content_string = db_get_value('id_tipo', 'ttipo_modulo',
|
||||
'nombre', 'web_content_string');
|
||||
|
||||
foreach ($result as $row) {
|
||||
$data = array ();
|
||||
|
||||
$is_web_content_string = (bool)db_get_value_filter('id_agente_modulo',
|
||||
'tagente_modulo',
|
||||
array('id_agente_modulo' => $row['id_agente_modulo'],
|
||||
'id_tipo_modulo' => $id_type_web_content_string));
|
||||
|
||||
foreach($columns as $col => $attr) {
|
||||
if ($attr[1] != "modules_format_data") {
|
||||
$data[] = $attr[1] ($row[$attr[0]]);
|
||||
|
||||
|
||||
}
|
||||
elseif (($config['command_snapshot']) && (preg_match ("/[\n]+/i", $row[$attr[0]]))) {
|
||||
// Its a single-data, multiline data (data snapshot) ?
|
||||
|
||||
|
||||
// Detect string data with \n and convert to <br>'s
|
||||
$datos = preg_replace ('/\n/i','<br>',$row[$attr[0]]);
|
||||
$datos = preg_replace ('/\s/i',' ',$datos);
|
||||
|
||||
// Because this *SHIT* of print_table monster, I cannot format properly this cells
|
||||
// so, eat this, motherfucker :))
|
||||
|
||||
$datos = "<span style='font-family: mono,monospace;'>".$datos."</span>";
|
||||
|
||||
// I dont why, but using index (value) method, data is automatically converted to html entities ¿?
|
||||
$data[$attr[1]] = $datos;
|
||||
|
||||
}
|
||||
elseif ($is_web_content_string) {
|
||||
//Fixed the goliat sends the strings from web
|
||||
//without HTML entities
|
||||
|
||||
$data[$attr[1]] = io_safe_input($row[$attr[0]]);
|
||||
}
|
||||
else {
|
||||
// Just a string of alphanumerical data... just do print
|
||||
|
||||
//Fixed the data from Selenium Plugin
|
||||
if ($row[$attr[0]] != strip_tags($row[$attr[0]]))
|
||||
$data[$attr[1]] = io_safe_input($row[$attr[0]]);
|
||||
else
|
||||
$data[$attr[1]] = $row[$attr[0]];
|
||||
}
|
||||
}
|
||||
|
||||
array_push ($table->data, $data);
|
||||
if (count($table->data) > 200) break;
|
||||
}
|
||||
|
||||
if (empty ($table->data)) {
|
||||
echo '<h3 class="error">'.__('No available data to show').'</h3>';
|
||||
}
|
||||
else {
|
||||
ui_pagination($count);
|
||||
html_print_table ($table);
|
||||
unset ($table);
|
||||
}
|
||||
|
||||
ui_require_jquery_file ("ui-timepicker-addon");
|
||||
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
$(document).ready (function () {
|
||||
$("#text-time_from, #text-time_to").timepicker({
|
||||
showSecond: true,
|
||||
timeFormat: 'hh:mm:ss',
|
||||
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');?>'});
|
||||
$("#text-date_from, #text-date_to").datepicker ();
|
||||
$.datepicker.regional["<?php echo $config['language']; ?>"];
|
||||
});
|
||||
</script>
|
||||
|
|
@ -56,7 +56,7 @@ if(tags_has_user_acl_tags()) {
|
|||
}
|
||||
|
||||
echo '<table border=0 style="width:100%;"><tr>';
|
||||
echo '<td style="vertical-align: top; min-width: 180px; width:25%; padding-right: 10px;" id="leftcolumn">';
|
||||
echo '<td style="vertical-align: top; min-width: 180px; width:25%; padding-right: 10px; vertical-align: top; padding-top: 0px;" id="leftcolumn">';
|
||||
// ---------------------------------------------------------------------
|
||||
// The status horizontal bars (Global health, Monitor sanity...
|
||||
// ---------------------------------------------------------------------
|
||||
|
@ -115,7 +115,7 @@ if ($is_admin) {
|
|||
|
||||
echo '</td>'; //Left column
|
||||
|
||||
echo '<td style="vertical-align: top; width: 75%;" id="rightcolumn">';
|
||||
echo '<td style="vertical-align: top; width: 75%; padding-top: 0px;" id="rightcolumn">';
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
|
|
@ -158,14 +158,23 @@ if ($update_pressed || $open_filter) {
|
|||
$open_filter = true;
|
||||
}
|
||||
|
||||
$table = html_get_predefined_table('transparent', 2);
|
||||
$table->width = '98%';
|
||||
$table->style[0] = 'text-align:left;';
|
||||
$table->style[1] = 'text-align:right;';
|
||||
|
||||
//Link to toggle filter
|
||||
if ($open_filter) {
|
||||
echo '<a href="#" id="tgl_event_control"><b>' . __('Event control filter') . '</b> '.html_print_image ("images/go.png", true, array ("title" => __('Toggle filter(s)'), "id" => 'toggle_arrow')).'</a><br><br>';
|
||||
$table->data[0][0] = '<a href="#" id="tgl_event_control"><b>' . __('Event control filter') . '</b> '.html_print_image ("images/go.png", true, array ("title" => __('Toggle filter(s)'), "id" => 'toggle_arrow')).'</a>';
|
||||
}
|
||||
else {
|
||||
echo '<a href="#" id="tgl_event_control"><b>' . __('Event control filter') . '</b> '.html_print_image ("images/down.png", true, array ("title" => __('Toggle filter(s)'), "id" => 'toggle_arrow')).'</a><br><br>';
|
||||
$table->data[0][0] = '<a href="#" id="tgl_event_control"><b>' . __('Event control filter') . '</b> '.html_print_image ("images/down.png", true, array ("title" => __('Toggle filter(s)'), "id" => 'toggle_arrow')).'</a>';
|
||||
}
|
||||
|
||||
$table->data[0][1] = '<a id="events_graph_link" href="javascript:show_events_graph_dialog()">' . html_print_image('images/chart_curve.png', true, array('title' => __('Show events graph'))) . '</a>';
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
$filters = events_get_event_filter_select();
|
||||
|
||||
// Some translated words to be used from javascript
|
||||
|
@ -332,7 +341,7 @@ else{
|
|||
}
|
||||
|
||||
$table->id = 'events_filter_form';
|
||||
$table->width = '98%';
|
||||
$table->width = '99%';
|
||||
$table->cellspacing = 4;
|
||||
$table->cellpadding = 4;
|
||||
$table->class = 'databox';
|
||||
|
@ -478,21 +487,13 @@ else {
|
|||
$result = events_get_events_grouped($sql_post, $offset, $pagination, $meta, $history);
|
||||
}
|
||||
|
||||
if (!empty($result)) {
|
||||
$params = array();
|
||||
$params['position'] = 'right';
|
||||
$params['icon_closed'] = 'images/setup.png';
|
||||
$params['body_text'] = '<b>' . __('Events graph by agent') . '</b>';
|
||||
$params['body_text'] .= grafico_eventos_grupo(350, 248, rawurlencode ($sql_post), $meta, $history);
|
||||
$params['icon_closed'] = '/images/chart_curve.png';
|
||||
$params['icon_open'] = '/images/chart_curve.png';
|
||||
$params['height'] = '250px';
|
||||
$params['top'] = 'auto_below';
|
||||
$params['autotop'] = 'menu_tab_frame_view';
|
||||
$params['icon_width'] = 16;
|
||||
$params['icon_height'] = 16;
|
||||
|
||||
html_print_side_layer($params);
|
||||
if (!empty($result)) {
|
||||
$graph .= '<fieldset class="databox tactical_set" style="width:93%;">
|
||||
<legend>' .
|
||||
__('Events generated -by module-') .
|
||||
'</legend>' .
|
||||
grafico_eventos_grupo(350, 148, rawurlencode ($sql_post), $meta, $history) . '</fieldset>';
|
||||
html_print_div(array('id' => 'events_graph', 'hidden' => true, 'content' => $graph));
|
||||
}
|
||||
|
||||
// Delete rnum field generated by oracle_recode_query() function
|
||||
|
@ -546,6 +547,11 @@ var val_none = 0;
|
|||
var text_none = "<?php echo __('None'); ?>";
|
||||
|
||||
$(document).ready( function() {
|
||||
// If the events are not charged, dont show graphs link
|
||||
if ($('#events_graph').val() == undefined) {
|
||||
$('#events_graph_link').hide();
|
||||
}
|
||||
|
||||
// Don't collapse filter if update button has been pushed
|
||||
if ($("#hidden-open_filter").val() == 'true'){
|
||||
$("#event_control").toggle();
|
||||
|
@ -1078,5 +1084,22 @@ function reorder_tags_inputs() {
|
|||
$("#button-remove_without").removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
|
||||
// Show the modal window of an module
|
||||
function show_events_graph_dialog() {
|
||||
$("#events_graph").hide ()
|
||||
.dialog ({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
width: 400,
|
||||
height: 360
|
||||
})
|
||||
.show ();
|
||||
}
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
|