2012-03-05 Miguel de Dios <miguel.dedios@artica.es>

* extensions/update_manager/main.php, general/shortcut_bar.php,
	godmode/reporting/reporting_builder.item_editor.php,
	godmode/reporting/reporting_builder.php,
	godmode/reporting/reporting_builder.preview.php, include/functions_api.php,
	include/functions_html.php, include/htmlawed.php, include/pchart_graph.php,
	operation/events/events_list.php, operation/netflow/nf_live_view.php:
	cleaned source code style.
	
	* godmode/menu.php, godmode/agentes/manage_config_remote.php: removed the
	enterprise feature that have been wrong for years.
	
	* general/header.php: changed to load the jquery-ui and jquery javascript
	library to last version.
	
	* extensions/insert_data.php, extensions/snmp_explorer.php,
	godmode/agentes/agent_manager.php, include/ajax/agent.php,
	include/javascript/pandora.js, operation/agentes/exportdata.php,
	operation/events/events.php: changed the unknow plugin autocomplete for
	the autocomple from jquery-ui.
	
	* include/functions_ui.php: cleaned source code style and into the function
	"ui_process_page_head" added the blacklist hardwrote for to use old jquery.
	
	* include/styles/jquery-ui-1.8.17.custom.css,
	include/javascript/jquery-1.7.1.min.js,
	include/javascript/jquery.jquery-ui-1.8.17.custom.min.js: added the last
	version of Jquery and Jquery-ui. 
	
	Merge from the branch "pandora_4.0"
	
	* godmode/reporting/visual_console_builder.constans.php,
	godmode/reporting/visual_console_builder.editor.js,
	godmode/reporting/visual_console_builder.editor.php,
	include/functions_visual_map.php,
	include/ajax/visual_console_builder.ajax.php,
	include/javascript/pandora_visual_console.js: changed the unknow
	plugin autocomplete for the autocomple from jquery-ui and added function to
	paint a Bubble Chart (http://en.wikipedia.org/wiki/Bubble_chart) with the
	name "progress_bubble".
	
	* images/percentile_item.disabled.png, images/percentile_item.png: added
	images for button of percentile item (new item in visual map).
	
	* include/styles/pandora.css: added the style for the new button percentile
	item.
	
	* include/functions_graph.php, include/graphs/fgraph.php,
	include/graphs/functions_gd.php: cleaned source code style, and added the
	params to set text and color in the function "progress_bar" and added
	function to paint a Bubble Chart (http://en.wikipedia.org/wiki/Bubble_chart)
	with the name "progress_bubble".
	


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5693 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-03-05 17:56:56 +00:00
parent 6104c80a98
commit 013585da6a
38 changed files with 2903 additions and 976 deletions

View File

@ -1,3 +1,57 @@
2012-03-05 Miguel de Dios <miguel.dedios@artica.es>
* extensions/update_manager/main.php, general/shortcut_bar.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/reporting_builder.preview.php, include/functions_api.php,
include/functions_html.php, include/htmlawed.php, include/pchart_graph.php,
operation/events/events_list.php, operation/netflow/nf_live_view.php:
cleaned source code style.
* godmode/menu.php, godmode/agentes/manage_config_remote.php: removed the
enterprise feature that have been wrong for years.
* general/header.php: changed to load the jquery-ui and jquery javascript
library to last version.
* extensions/insert_data.php, extensions/snmp_explorer.php,
godmode/agentes/agent_manager.php, include/ajax/agent.php,
include/javascript/pandora.js, operation/agentes/exportdata.php,
operation/events/events.php: changed the unknow plugin autocomplete for
the autocomple from jquery-ui.
* include/functions_ui.php: cleaned source code style and into the function
"ui_process_page_head" added the blacklist hardwrote for to use old jquery.
* include/styles/jquery-ui-1.8.17.custom.css,
include/javascript/jquery-1.7.1.min.js,
include/javascript/jquery.jquery-ui-1.8.17.custom.min.js: added the last
version of Jquery and Jquery-ui.
Merge from the branch "pandora_4.0"
* godmode/reporting/visual_console_builder.constans.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.editor.php,
include/functions_visual_map.php,
include/ajax/visual_console_builder.ajax.php,
include/javascript/pandora_visual_console.js: changed the unknow
plugin autocomplete for the autocomple from jquery-ui and added function to
paint a Bubble Chart (http://en.wikipedia.org/wiki/Bubble_chart) with the
name "progress_bubble".
* images/percentile_item.disabled.png, images/percentile_item.png: added
images for button of percentile item (new item in visual map).
* include/styles/pandora.css: added the style for the new button percentile
item.
* include/functions_graph.php, include/graphs/fgraph.php,
include/graphs/functions_gd.php: cleaned source code style, and added the
params to set text and color in the function "progress_bar" and added
function to paint a Bubble Chart (http://en.wikipedia.org/wiki/Bubble_chart)
with the name "progress_bubble".
2012-03-05 Vanessa Gil <vanessa.gil@artica.es>
* operation/search_alerts.php: Fixed sql error.

View File

@ -177,53 +177,42 @@ function mainInsertData() {
echo "</form>";
ui_require_css_file ('datepicker');
ui_require_jquery_file ('ui.core');
ui_require_jquery_file ('ui.datepicker');
ui_require_jquery_file ('timeentry');
ui_require_jquery_file ('autocomplete');
?>
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
$("#text_id_agent").autocomplete({
minLength: 2,
source: function( request, response ) {
var term = request.term; //Word to search
$("#text_id_agent").autocomplete(
"ajax.php",
{
minChars: 2,
scroll:true,
extraParams: {
var data_params = {
page: "operation/agentes/exportdata",
search_agents: 1,
id_group: function() { return $("#id_group").val(); }
},
formatItem: function (data, i, total) {
if (total == 0)
$("#text_id_agent").css ('background-color', '#cc0000');
else
$("#text_id_agent").css ('background-color', '');
if (data == "")
return false;
"search_agents_2": 1,
"q": term,
id_group: function() { return $("#id_group").val(); }};
return data[0]+'<br><span class="ac_extra_field"><?php echo __("IP") ?>: '+data[1]+'</span>';
},
delay: 200
jQuery.ajax ({
data: data_params,
async: false,
type: "POST",
url: action="ajax.php",
timeout: 10000,
dataType: "json",
success: function (data) {
response(data);
return;
}
);
$("#text-time").timeEntry ({
spinnerImage: 'images/time-entry.png',
spinnerSize: [20, 20, 0]
});
return;
},
select: function( event, ui ) {
var agent_name = ui.item.name;
$("#text-date").datepicker ();
//Put the name
$(this).val(agent_name);
});
$("#text_id_agent").result (
function () {
selectAgent = true;
var agent_name = this.value;
$('#id_agent_module').fadeOut ('normal', function () {
$('#id_agent_module').empty ();
var inputs = [];
inputs.push ("agent_name=" + agent_name);
@ -249,11 +238,44 @@ function mainInsertData() {
$('#submit-submit').fadeIn ('normal');
}
});
return false;
}
})
.data( "autocomplete")._renderItem = function( ul, item ) {
if ((item.ip == "") || (typeof(item.ip) == "undefined")) {
text = "<a>" + item.name + "</a>";
}
else {
text = "<a>" + item.name
+ "<br><span style=\"font-size: 70%; font-style: italic;\">IP:" + item.ip + "</span></a>";
}
return $("<li></li>")
.data("item.autocomplete", item)
.append(text)
.appendTo(ul);
};
//Force the size of autocomplete
$(".ui-autocomplete").css("max-height", "100px");
$(".ui-autocomplete").css("overflow-y", "auto");
/* prevent horizontal scrollbar */
$(".ui-autocomplete").css("overflow-x", "hidden");
/* add padding to account for vertical scrollbar */
$(".ui-autocomplete").css("padding-right", "20px");
//Force to style of items
$(".ui-autocomplete").css("text-align", "left");
$("#text-time").timeEntry ({
spinnerImage: 'images/time-entry.png',
spinnerSize: [20, 20, 0]
});
$("#text-date").datepicker ();
}
);
});
/* ]]> */
</script>
<?php

View File

@ -397,7 +397,7 @@ function snmp_explorer() {
ui_require_jquery_file ('pandora.controls');
ui_require_jquery_file ('ajaxqueue');
ui_require_jquery_file ('bgiframe');
ui_require_jquery_file ('autocomplete');
//ui_require_jquery_file ('autocomplete');
?>
<script language="javascript" type="text/javascript">

View File

@ -37,7 +37,8 @@ config_check();
<?php
if (!defined ('PANDORA_ENTERPRISE')){
echo html_print_image('images/pandora_header_logo.png', true, array("alt" => 'Pandora FMS Opensource', "border" => '0'));
} else {
}
else {
echo html_print_image('images/pandora_header_logo_enterprise.png', true, array("alt" => 'Pandora FMS Enterprise', "border" => '0'));
}
?>
@ -59,8 +60,7 @@ config_check();
echo '<div id="dialog_messages" style="display: none"></div>';
ui_require_css_file ('dialog');
ui_require_jquery_file ('ui.core');
ui_require_jquery_file ('ui.dialog');
echo '<a href="ajax.php?page=operation/messages/message" title="' . __("Message overview") . '" id="show_messages_dialog">';
html_print_image ("images/email.png", false,
array ("title" => __('You have %d unread message(s)', $msg_cnt), "id" => "yougotmail", "class" => "bot"));
@ -73,8 +73,6 @@ config_check();
if ($config["alert_cnt"] > 0){
echo '<div id="alert_messages" style="display: none"></div>';
ui_require_css_file ('dialog');
ui_require_jquery_file ('ui.core');
ui_require_jquery_file ('ui.dialog');
echo '<a href="ajax.php?page=operation/system_alert" title="'.__("System alerts detected - Please fix as soon as possible").'" id="show_systemalert_dialog">';
html_print_image ("images/error.png", false,
@ -109,7 +107,8 @@ config_check();
}
unset ($servers); // Since this is the header, we don't like to trickle down variables.
echo '</a>';
} else {
}
else {
// TODO: Put here to remark this is a metaconsole
echo "";
@ -161,7 +160,7 @@ config_check();
if ($config["metaconsole"] == 0){
?>
<form method="get" style="" name="quicksearch" action="">
<script type="text/javascript" language="javascript">
<script type="text/javascript">
var fieldKeyWordEmpty = true;
</script>
<input type="text" id="keywords" name="keywords"
@ -192,15 +191,17 @@ if ($config["metaconsole"] == 0){
</table>
<?php
ui_require_jquery_file ('countdown');
ui_require_css_file ('jquery-ui-1.8.17.custom');
ui_require_jquery_file('jquery-ui-1.8.17.custom.min');
?>
<!--
<script type="text/javascript" src="include/javascript/jquery.ui.dialog.js "></script>
<script type="text/javascript" src="include/javascript/jquery.ui.draggable.js "></script>
<script type="text/javascript" src="include/javascript/jquery.ui.droppable.js "></script>
<script type="text/javascript" src="include/javascript/jquery.ui.resizable.js "></script>
-->
<script language="javascript" type="text/javascript">
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
/* Temporal fix to hide graphics when ui_dialog are displayed */

View File

@ -18,6 +18,7 @@ if (is_ajax ()) {
global $config;
$search_parents = (bool) get_parameter ('search_parents');
$search_parents_2 = (bool) get_parameter ('search_parents_2');
if ($search_parents) {
require_once ('include/functions_agents.php');
@ -49,6 +50,41 @@ if (is_ajax ()) {
return;
}
if ($search_parents_2) {
require_once ('include/functions_agents.php');
$id_agent = (int) get_parameter ('id_agent');
$string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */
$filter = array ();
switch ($config['dbtype']){
case "mysql":
case "postgresql":
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
break;
case "oracle":
$filter[] = '(upper(nombre) LIKE upper("%'.$string.'%") OR upper(direccion) LIKE upper("%'.$string.'%") OR upper(comentarios) LIKE upper("%'.$string.'%"))';
break;
}
$filter[] = 'id_agente != '.$id_agent;
$agents = agents_get_agents ($filter, array ('id_agente', 'nombre', 'direccion'));
if ($agents === false)
$agents = array();
$data = array();
foreach ($agents as $agent) {
$data[] = array('id' => $agent['id_agente'],
'name' => io_safe_output($agent['nombre']),
'ip' => io_safe_output($agent['direccion']));
}
echo json_encode($data);
return;
}
$get_modules_json_for_multiple_snmp = (bool) get_parameter("get_modules_json_for_multiple_snmp", 0);
if ($get_modules_json_for_multiple_snmp) {
require_once ('include/graphs/functions_utils.php');
@ -363,7 +399,6 @@ echo '</div></form>';
ui_require_jquery_file ('pandora.controls');
ui_require_jquery_file ('ajaxqueue');
ui_require_jquery_file ('bgiframe');
ui_require_jquery_file ('autocomplete');
?>
<script type="text/javascript">
/* <![CDATA[ */
@ -403,28 +438,65 @@ function changeIcons() {
$(document).ready (function () {
$("select#id_os").pandoraSelectOS ();
$("#text-id_parent").autocomplete ("ajax.php",
{
scroll: true,
minChars: 2,
extraParams: {
page: "godmode/agentes/agent_manager",
search_parents: 1,
id_group: function() { return $("#grupo").val(); },
id_agent: <?php echo $id_agente ?>
},
formatItem: function (data, i, total) {
if (total == 0)
$("#text-id_parent").css ('background-color', '#cc0000');
else
$("#text-id_parent").css ('background-color', '');
if (data == "")
return false;
return data[0]+'<br><span class="ac_extra_field"><?php echo __("IP") ?>: '+data[1]+'</span>';
},
delay: 200
$("#text-id_parent").autocomplete({
minLength: 2,
source: function( request, response ) {
var term = request.term; //Word to search
var data_params = {
"page": "godmode/agentes/agent_manager",
"search_parents_2": 1,
"q": term};
jQuery.ajax ({
data: data_params,
async: false,
type: "POST",
url: action="ajax.php",
timeout: 10000,
dataType: "json",
success: function (data) {
response(data);
return;
}
);
});
return;
},
select: function( event, ui ) {
var agent_name = ui.item.name;
//Put the name
$(this).val(agent_name);
return false;
}
})
.data( "autocomplete")._renderItem = function( ul, item ) {
if (item.ip == "") {
text = "<a>" + item.name + "</a>";
}
else {
text = "<a>" + item.name
+ "<br><span style=\"font-size: 70%; font-style: italic;\">IP:" + item.ip + "</span></a>";
}
return $("<li></li>")
.data("item.autocomplete", item)
.append(text)
.appendTo(ul);
};
//Force the size of autocomplete
$(".ui-autocomplete").css("max-height", "100px");
$(".ui-autocomplete").css("overflow-y", "auto");
/* prevent horizontal scrollbar */
$(".ui-autocomplete").css("overflow-x", "hidden");
/* add padding to account for vertical scrollbar */
$(".ui-autocomplete").css("padding-right", "20px");
//Force to style of items
$(".ui-autocomplete").css("text-align", "left");
});
/* ]]> */
</script>

View File

@ -1,208 +0,0 @@
<?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();
$origen = get_parameter ("origen", -1);
$id_group = get_parameter ("id_group", -1);
$update_agent = get_parameter ("update_agent", -1);
$update_group = get_parameter ("update_group", -1);
if (! check_acl ($config['id_user'], 0, "AW")) {
db_pandora_audit("ACL Violation",
"Trying to access remote config copy tool");
require ("general/noaccess.php");
exit;
}
require_once ($config['homedir'].'/include/functions_agents.php');
require_once ($config['homedir'].'/include/functions_users.php');
// Operations
if ((isset($_GET["operacion"])) AND ($update_group == -1) ) {
// DATA COPY
// ---------
if (isset($_POST["copy"])) {
// Header
ui_print_page_header (__("Data Copy"), "images/god1.png", false, "", true, "");
// Initial checkings
// if selected more than 0 agents
if (isset($_POST["destino"])) {
$destino = $_POST["destino"];
if (count($destino) <= 0){
echo "<h3 class='error'>ERROR: ".__('No selected agents to copy')."</h3>";
echo "</table>";
echo '</div>';
echo '<div style="clear:both">&nbsp;</div>';
echo '</div>';
echo '<div id="foot">';
require ("general/footer.php");
echo '</div>';
echo '</div>';
exit;
}
}
else {
echo "<h3 class='error'>ERROR: ".__('No source agent selected')."</h3>";
echo "</table>";
echo '</div>';
echo '<div style="clear:both">&nbsp;</div>';
echo '</div>';
echo '<div id="foot">';
require ("general/footer.php");
echo '</div>';
echo '</div>';
exit;
}
// Source
$id_origen = get_parameter ("origen");
// Security check here
if (!users_access_to_agent ($id_origen)) {
db_pandora_audit("ACL Violation", "Trying to forge a source agent in remote config tool");
require ("general/noaccess.php");
exit;
}
// Copy files
for ($a=0;$a <count($destino); $a++){
// For every agent in destination
//Security check here
$id_agente = $destino[$a];
// Security check here
if (!users_access_to_agent ($id_agente)){
db_pandora_audit("ACL Violation", "Trying to forge a source agent in remote config tool");
require ("general/noaccess.php");
exit;
}
$agent_name_src = agents_get_name($id_origen, "");
$agent_name_dst = agents_get_name($id_agente, "");
echo "<br><br>".__('Making copy of configuration file for')." [<b>".$agent_name_src."</b>] ".__('to')." [<b>".$agent_name_dst."</b>]";
$agent_md5_src = md5($agent_name_src);
$agent_md5_dst = md5($agent_name_dst);
copy ( $config["remote_config"]."/md5/".$agent_md5_src.".md5", $config["remote_config"]."/md5/".$agent_md5_dst.".md5" );
copy ( $config["remote_config"]."/conf/".$agent_md5_src.".conf", $config["remote_config"]."/conf/".$agent_md5_dst.".conf" );
} // for each destination agent
} //end if copy modules or alerts
// ============
// Form view
// ============
} else {
// title
// Header
ui_print_page_header (__("Remote configuration management"), "images/god1.png", false, "", true, "");
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/manage_config_remote&operacion=1">';
echo "<table width='98%' border='0' cellspacing='4' cellpadding='4' class='databox'>";
// Source group
echo '<tr><td class="datost"><b>'. __('Source group'). '</b><br><br>';
$group_select = users_get_groups ($config['id_user']);
$grouplist = implode (',', array_keys ($group_select));
echo html_print_select_groups($config['id_user'], "AR", true, 'id_group', $id_group, '', '', '', true, false, true, '', false, 'width:180px;');
echo '&nbsp;&nbsp;';
echo '<input type=submit name="update_group" class="sub upd" value="'.__('Filter').'">';
echo '<br><br>';
// Source agent
echo '<b>'. __('Source agent').'</b>';
ui_print_help_icon ('duplicateconfig');
echo '<br><br>';
// Show combo with SOURCE agents
if ($id_group > 0)
$sql1 = "SELECT * FROM tagente WHERE id_grupo = $id_group ORDER BY nombre ";
else
$sql1 = "SELECT * FROM tagente WHERE id_grupo IN ($grouplist) ORDER BY nombre";
echo '<select name="origen" style="width:200px">';
$rows = db_get_all_rows_sql($sql1);
if ($rows === false) {
$rows = array();
}
foreach ($rows as $row) {
if (check_acl ($config["id_user"], $row["id_grupo"], "AR")){
$source = $config["remote_config"]."/conf/". md5($row["nombre"]).".conf";
if (file_exists($source)){
echo "<option value=".$row["id_agente"].">".$row["nombre"]."</option>";
}
}
}
echo '</select>';
echo '</td></tr>';
// Destination agent
echo '<tr><td class="datost">';
echo '<b>'.__('To agent(s):').'</b><br><br>';
echo "<select name=destino[] size='10' multiple='multiple' style='width: 350px;'>";
if ($id_group > 0)
$sql1 = "SELECT * FROM tagente WHERE id_grupo = $id_group ORDER BY nombre ";
else
$sql1 = "SELECT * FROM tagente WHERE id_grupo IN ($grouplist) ORDER BY nombre";
$rows = db_get_all_rows_sql($sql1);
if ($rows === false) {
$rows = array();
}
foreach ($rows as $row) {
if (check_acl ($config["id_user"], $row["id_grupo"], "AW"))
echo "<option value=".$row["id_agente"].">".$row["nombre"]."</option>";
}
echo '</select>';
echo '</td>';
// Form buttons
echo '<td align="right" class="datosb">';
echo '<input type="submit" name="copy" class="sub next" value="'.__('Replicate configuration').'" onClick="if (!confirm("'.__('Are you sure?').'")) return false;>';
echo '</td></tr>';
echo '</table>';
}
?>
<script type="text/javascript">
$(document).ready (function () {
$("#id_group").click (
function () {
$(this).css ("width", "auto");
});
$("#id_group").blur (function () {
$(this).css ("width", "180px");
});
});
</script>

View File

@ -30,7 +30,6 @@ if (check_acl ($config['id_user'], 0, "AW")) {
$menu["gagente"]["id"] = "god-agents";
$sub = array ();
$sub["godmode/agentes/manage_config_remote"]["text"] = __('Duplicate config');
if (check_acl ($config["id_user"], 0, "PM")) {
$sub["godmode/groups/group_list"]["text"] = __('Manage groups');

View File

@ -370,19 +370,54 @@ html_print_input_hidden('id_item', $idItem);
</tr>
<tr id="row_description" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Description'); ?></td>
<td style=""><?php echo html_print_textarea('description', 3, 25, $description); ?></td>
<td style="">
<?php
echo html_print_textarea('description', 3, 25, $description);
?>
</td>
</tr>
<tr id="row_period" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Period'); ?></td>
<td style=""><?php html_print_extended_select_for_time ($intervals, 'period', $period, '', '', '0', 10); echo __(" seconds."); ?></td>
<td style="vertical-align: top;">
<?php
echo __('Period');
?>
</td>
<td style="">
<?php
html_print_extended_select_for_time ($intervals, 'period', $period, '', '', '0', 10);
echo __(" seconds."); ?></td>
</tr>
<tr id="row_period1" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Period'); if ($type == 'projection_graph'){ echo ui_print_help_icon('projection_graph', true); }else{ echo ui_print_help_icon('prediction_date', true); } ?></td>
<td style=""><?php html_print_extended_select_for_time ($intervals_1, 'period1', $period_pg, '', '', '0', 10); echo __(" seconds."); ?></td>
<td style="vertical-align: top;">
<?php
echo __('Period');
if ($type == 'projection_graph') {
echo ui_print_help_icon('projection_graph', true);
}
else {
echo ui_print_help_icon('prediction_date', true);
}
?>
</td>
<td style="">
<?php
html_print_extended_select_for_time ($intervals_1, 'period1', $period_pg, '', '', '0', 10);
echo __(" seconds.");
?>
</td>
</tr>
<tr id="row_estimate" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Projection period') . ui_print_help_icon('projection_graph', true); ?></td>
<td style=""><?php html_print_extended_select_for_time ($intervals_1, 'period2', $projection_period, '', '', '0', 10); echo __(" seconds."); ?></td>
<td style="vertical-align: top;">
<?php
echo __('Projection period') . ui_print_help_icon('projection_graph', true);
?>
</td>
<td style="">
<?php
html_print_extended_select_for_time ($intervals_1, 'period2', $projection_period, '', '', '0', 10);
echo __(" seconds.");
?>
</td>
</tr>
<tr id="row_interval" style="" class="datos">
<td style="vertical-align: top;"><?php echo __('Data range') . ui_print_help_icon('prediction_date', true); ?></td>
@ -395,7 +430,11 @@ html_print_input_hidden('id_item', $idItem);
</tr>
<tr id="row_only_display_wrong" style="" class="datos">
<td><?php echo __('Only display wrong SLAs');?></td>
<td><?php html_print_checkbox('checkbox_only_display_wrong', 1, $only_display_wrong);?></td>
<td>
<?php
html_print_checkbox('checkbox_only_display_wrong', 1, $only_display_wrong);
?>
</td>
</tr>
<tr id="row_working_time">
<td style="vertical-align: top;"><?php echo __('Working time');?></td>
@ -439,7 +478,8 @@ html_print_input_hidden('id_item', $idItem);
<td style="">
<?php
html_print_input_hidden('id_agent', $idAgent) .
html_print_input_text_extended ('agent', agents_get_name ($idAgent), 'text-agent', '', 30, 100, false, '',
html_print_input_text_extended ('agent', agents_get_name ($idAgent),
'text-agent', '', 30, 100, false, '',
array('style' => 'background: url(images/lightning.png) no-repeat right;'))
. ui_print_help_tip(__("Type at least two characters to search"), false);
html_print_input_hidden ('server_name', $server_name);

View File

@ -236,7 +236,8 @@ switch ($action) {
$values['top_n_value'] = get_parameter('quantity');
$values['text'] = get_parameter('text');
$good_format = true;
}else{
}
else {
$values['period'] = get_parameter('period');
$values['top_n'] = get_parameter('radiobutton_max_min_avg');
$values['top_n_value'] = get_parameter('quantity');
@ -321,7 +322,8 @@ switch ($action) {
$values['top_n_value'] = get_parameter('period2');
$values['text'] = get_parameter('text');
$good_format = true;
}else if ($values['type'] == 'prediction_date'){
}
else if ($values['type'] == 'prediction_date') {
$values['period'] = get_parameter('period1');
$values['top_n'] = get_parameter('radiobutton_max_min_avg');
$values['top_n_value'] = get_parameter('quantity');
@ -333,13 +335,15 @@ switch ($action) {
}
$intervals = get_parameter('max_interval') . ';' . get_parameter('min_interval');
$values['text'] = $intervals;
}else if ($values['type'] == 'SLA'){
}
else if ($values['type'] == 'SLA') {
$values['period'] = get_parameter('period');
$values['top_n'] = get_parameter('combo_sla_sort_options',0);
$values['top_n_value'] = get_parameter('quantity');
$values['text'] = get_parameter('text');
$good_format = true;
}else{
}
else {
$values['period'] = get_parameter('period');
$values['top_n'] = get_parameter('radiobutton_max_min_avg',0);
$values['top_n_value'] = get_parameter('quantity');

View File

@ -142,7 +142,8 @@ $(document).ready (function () {
$("#table1-1-3").css("display", "");
$("#table1-1-4").css("display", "");
$("#table1-1-5").css("display", "none");
}else{
}
else {
$("#table1-1-3").css("display", "none");
$("#table1-1-4").css("display", "none");
$("#table1-1-5").css("display", "");
@ -183,7 +184,8 @@ switch ($config["dbtype"]) {
if ($contents === false) {
return;
} else {
}
else {
foreach($contents as $content) {
$id_report = $content['id_rc'];
switch ($content['type']) {

View File

@ -22,4 +22,5 @@ define('ICON', 5);
define('SIMPLE_VALUE_MAX', 6);
define('SIMPLE_VALUE_MIN', 7);
define('SIMPLE_VALUE_AVG', 8);
define('PERCENTILE_BUBBLE', 9);
?>

View File

@ -44,7 +44,11 @@ function initJavascript() {
eventsItems();
eventsTextAgent();
draw_lines(lines, 'background');
//Fixed to wait the load of images.
$(window).load(function() {
draw_lines(lines, 'background', true);
}
);
$(".item").css('z-index', '1'); //For paint the icons over lines
}
@ -52,34 +56,38 @@ function initJavascript() {
function eventsTextAgent() {
var idText = $("#ip_text").html();
$("#text-agent").autocomplete(
"ajax.php",
{
minChars: 2,
scroll:true,
extraParams: {
page: "operation/agentes/exportdata",
all: "enabled",
search_agents: 1,
id_group: function() { return $("#group").val(); }
},
formatItem: function (data, i, total) {
if (total == 0)
$("#text-agent").css('background-color', '#cc0000');
else
$("#text-agent").css('background-color', '');
if (data == "")
return false;
return data[0]+'<br><span class="ac_extra_field">' + idText + ': '+data[1]+'</span>';
},
delay: 200
}
);
$("#text-agent").autocomplete({
minLength: 2,
source: function( request, response ) {
var term = request.term; //Word to search
$("#text-agent").result (
function () {
selectAgent = true;
var agent_name = this.value;
var params = [];
params.push("all=enabled");
params.push("search_agents_2=1");
params.push("page=operation/agentes/exportdata");
params.push("id_group="+ $("#group").val());
params.push("q="+ term);
jQuery.ajax ({
data: params.join ("&"),
async: false,
type: 'POST',
url: action="ajax.php",
timeout: 10000,
dataType: 'json',
success: function (data) {
response(data);
return;
}
});
return;
},
select: function( event, ui ) {
var agent_name = ui.item.name;
//Put the name
$(this).val(agent_name);
//Fill the modules select box
$('#module').fadeOut ('normal', function () {
$('#module').empty ();
var inputs = [];
@ -104,9 +112,34 @@ function eventsTextAgent() {
});
});
return false;
}
);
})
.data( "autocomplete")._renderItem = function( ul, item ) {
if (item.ip == '') {
text = "<a>" + item.name + "</a>";
}
else {
text = "<a>" + item.name
+ "<br><span style='font-size: 70%; font-style: italic;'>IP:" + item.ip + "</span></a>";
}
return $("<li></li>")
.data("item.autocomplete", item)
.append(text)
.appendTo(ul);
};
//Force the size of autocomplete
$(".ui-autocomplete").css("max-height", "100px");
$(".ui-autocomplete").css("overflow-y", "auto");
/* prevent horizontal scrollbar */
$(".ui-autocomplete").css("overflow-x", "hidden");
/* add padding to account for vertical scrollbar */
$(".ui-autocomplete").css("padding-right", "20px");
//Force to style of items
$(".ui-autocomplete").css("text-align", "left");
}
function cancelAction() {
@ -209,8 +242,15 @@ function updateAction() {
}
break;
case 'percentile_bar':
case 'percentile_item':
$("#text_" + idItem).html(values['label']);
$("#image_" + idItem).attr('src', getPercentileBar(idItem));
if (values['type_percentile'] == 'bubble') {
$("#image_" + idItem).attr('src', getPercentileBubble(idItem, values));
}
else {
$("#image_" + idItem).attr('src', getPercentileBar(idItem, values));
}
break;
case 'module_graph':
$("#text_" + idItem).html(values['label']);
@ -225,10 +265,9 @@ function updateAction() {
$("#text_" + idItem).html(values['label']);
break;
case 'icon':
var params = [];
params.push("get_image_path=1");
params.push("img_src=" + getImageElement(idItem));
params.push("img_src=images/console/icons/" + values['image'] + ".png");
params.push("page=include/ajax/skins.ajax");
params.push("only_src=1");
jQuery.ajax ({
@ -283,6 +322,8 @@ function readFields() {
values['max_percentile'] = $("input[name=max_percentile]").val();
values['width_module_graph'] = $("input[name=width_module_graph]").val();
values['height_module_graph'] = $("input[name=height_module_graph]").val();
values['type_percentile'] = $("input[name=type_percentile]:checked").val();
values['value_show'] = $("input[name=value_show]:checked").val();
return values;
}
@ -312,6 +353,7 @@ function createAction() {
}
break;
case 'percentile_bar':
case 'percentile_item':
if ((values['agent'] == '')) {
alert($("#message_alert_no_agent").html());
validate = false;
@ -370,11 +412,11 @@ function actionClick() {
if (openPropertiesPanel) {
activeToolboxButton('static_graph', true);
activeToolboxButton('percentile_bar', true);
activeToolboxButton('module_graph', true);
activeToolboxButton('simple_value', true);
activeToolboxButton('label', true);
activeToolboxButton('icon', true);
activeToolboxButton('percentile_item', true);
$(".item").draggable("enable");
$("#background").resizable('enable');
@ -393,11 +435,11 @@ function actionClick() {
$("#background").resizable('disable');
activeToolboxButton('static_graph', false);
activeToolboxButton('percentile_bar', false);
activeToolboxButton('module_graph', false);
activeToolboxButton('simple_value', false);
activeToolboxButton('label', false);
activeToolboxButton('icon', false);
activeToolboxButton('percentile_item', false);
activeToolboxButton('edit_item', false);
activeToolboxButton('delete_item', false);
@ -405,6 +447,7 @@ function actionClick() {
if (creationItem != null) {
//Create a item
activeToolboxButton(creationItem, true);
item = creationItem;
$("#button_update_row").css('display', 'none');
@ -414,8 +457,10 @@ function actionClick() {
}
else if (selectedItem != null) {
//Edit a item
item = selectedItem;
toolbuttonActive = item;
activeToolboxButton(toolbuttonActive, true);
$("#button_create_row").css('display', 'none');
$("#button_update_row").css('display', '');
cleanFields();
@ -482,6 +527,28 @@ function loadFieldsFromDB(item) {
if (key == 'max_percentile') $("input[name=max_percentile]").val(val);
if (key == 'width_module_graph') $("input[name=width_module_graph]").val(val);
if (key == 'height_module_graph') $("input[name=height_module_graph]").val(val);
if (key == 'type_percentile') {
if (val == 'percentile') {
$("input[name=type_percentile][value=percentile]")
.attr("checked", "checked");
}
else {
$("input[name=type_percentile][value=bubble]")
.attr("checked", "checked");
}
}
if (key == 'value_show') {
if (val == 'percent') {
$("input[name=value_show][value=percent]")
.attr("checked", "checked");
}
else {
$("input[name=value_show][value=value]")
.attr("checked", "checked");
}
}
});
}
});
@ -587,6 +654,12 @@ function hiddenFields(item) {
$("#percentile_bar_row_2").css('display', 'none');
$("#percentile_bar_row_2." + item).css('display', '');
$("#percentile_item_row_3").css('display', 'none');
$("#percentile_item_row_3." + item).css('display', '');
$("#percentile_item_row_4").css('display', 'none');
$("#percentile_item_row_4." + item).css('display', '');
$("#period_row").css('display', 'none');
$("#period_row." + item).css('display', '');
@ -697,13 +770,13 @@ function getModuleValue(id_data) {
return module_value;
}
function getPercentileBar(id_data) {
function getPercentileBar(id_data, values) {
var parameter = Array();
var percentile = 0;
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "action", value: "get_module_value"});
parameter.push ({name: "id_element", value: id_data});
parameter.push ({name: "value_show", value: values['value_show']});
jQuery.ajax({
async: false,
url: "ajax.php",
@ -715,6 +788,10 @@ function getPercentileBar(id_data) {
module_value = data['value'];
max_percentile = data['max_percentile'];
width_percentile = data['width_percentile'];
unit_text = false
if (data['unit_text'] != false)
unit_text = data['unit_text'];
colorRGB = data['colorRGB'];
}
});
@ -736,14 +813,84 @@ function getPercentileBar(id_data) {
});
if ( max_percentile > 0)
percentile = module_value / max_percentile * 100;
var percentile = Math.round(module_value / max_percentile * 100);
else
percentile = 100;
var percentile = 100;
if (unit_text == false) {
value_text = percentile + "%";
}
else {
value_text = module_value + " " + unit_text;
}
var img = 'include/graphs/fgraph.php?homeurl=../../&graph_type=progressbar&height=15&' +
'width=' + width_percentile + '&mode=1&progress=' + percentile + '&font=' + font;
'width=' + width_percentile + '&mode=1&progress=' + percentile +
'&font=' + font + '&value_text=' + value_text + '&colorRGB=' + colorRGB;
return img;
}
function getPercentileBubble(id_data, values) {
var parameter = Array();
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "action", value: "get_module_value"});
parameter.push ({name: "id_element", value: id_data});
parameter.push ({name: "value_show", value: values['value_show']});
jQuery.ajax({
async: false,
url: "ajax.php",
data: parameter,
type: "POST",
dataType: 'json',
success: function (data)
{
module_value = data['value'];
max_percentile = data['max_percentile'];
width_percentile = data['width_percentile'];
unit_text = false
if (data['unit_text'] != false)
unit_text = data['unit_text'];
colorRGB = data['colorRGB'];
}
});
//Get the actual system font.
parameter = Array();
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "action", value: "get_font"});
jQuery.ajax({
async: false,
url: "ajax.php",
data: parameter,
type: "POST",
dataType: 'json',
success: function (data)
{
font = data['font'];
}
});
if ( max_percentile > 0)
var percentile = Math.round(module_value / max_percentile * 100);
else
var percentile = 100;
if (unit_text == false) {
value_text = percentile + "%";
}
else {
value_text = module_value + " " + unit_text;
}
var img = 'include/graphs/fgraph.php?homeurl=../../&graph_type=progressbubble&height=' + width_percentile + '&' +
'width=' + width_percentile + '&mode=1&progress=' + percentile +
'&font=' + font + '&value_text=' + value_text + '&colorRGB=' + colorRGB;
return img;
}
@ -847,27 +994,41 @@ function createItem(type, values, id_data) {
item = $('<div id="' + id_data
+ '" class="item static_graph" '
+ 'style="left: 0px; top: 0px; color: ' + values['label_color'] + '; text-align: center; position: absolute; ' + sizeStyle + ' margin-top: ' + values['top'] + 'px; margin-left: ' + values['left'] + 'px;">' +
+ 'style="color: ' + values['label_color']
+ '; text-align: center; position: absolute; display: inline-block; '
+ sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
'<img id="image_' + id_data + '" class="image" src="' + img_src + '" ' + imageSize + ' /><br />' +
'<span id="text_' + id_data + '" class="text">' + values['label'] + '</span>' +
'</div><input id="hidden-status_' + id_data + '" type="hidden" value="' + element_status + '" name="status_' + id_data + '">'
);
break;
case 'percentile_bar':
sizeStyle = '';
imageSize = '';
case 'percentile_item':
var sizeStyle = '';
var imageSize = '';
item = $('<div id="' + id_data + '" class="item percentile_bar" style="left: 0px; top: 0px; color: ' + values['label_color'] + '; text-align: center; position: absolute; ' + sizeStyle + ' margin-top: ' + values['top'] + 'px; margin-left: ' + values['left'] + 'px;">' +
if (values['type_percentile'] == 'percentile') {
item = $('<div id="' + id_data + '" class="item percentile_item" style="color: ' + values['label_color'] +
'; text-align: center; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
'<span id="text_' + id_data + '" class="text">' + values['label'] + '</span><br />' +
'<img class="image" id="image_' + id_data + '" src="' + getPercentileBar(id_data) + '" />' +
'<img class="image" id="image_' + id_data + '" src="' + getPercentileBar(id_data, values) + '" />' +
'</div>'
);
}
else {
item = $('<div id="' + id_data + '" class="item percentile_item" style="color: ' + values['label_color'] +
'; text-align: center; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
'<span id="text_' + id_data + '" class="text">' + values['label'] + '</span><br />' +
'<img class="image" id="image_' + id_data + '" src="' + getPercentileBubble(id_data, values) + '" />' +
'</div>'
);
}
break;
case 'module_graph':
sizeStyle = '';
imageSize = '';
item = $('<div id="' + id_data + '" class="item module_graph" style="left: 0px; top: 0px; color: ' + values['label_color'] + '; text-align: center; position: absolute; ' + sizeStyle + ' margin-top: ' + values['top'] + 'px; margin-left: ' + values['left'] + 'px;">' +
item = $('<div id="' + id_data + '" class="item module_graph" style="color: ' + values['label_color'] + '; text-align: center; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
'<span id="text_' + id_data + '" class="text">' + values['label'] + '</span><br />' +
'<img class="image" id="image_' + id_data + '" src="' + getModuleGraph(id_data) + '" style="border:1px solid #808080;" />' +
'</div>'
@ -877,14 +1038,14 @@ function createItem(type, values, id_data) {
sizeStyle = '';
imageSize = '';
item = $('<div id="' + id_data + '" class="item simple_value" style="left: 0px; top: 0px; color: ' + values['label_color'] + '; text-align: center; position: absolute; ' + sizeStyle + ' margin-top: ' + values['top'] + 'px; margin-left: ' + values['left'] + 'px;">' +
item = $('<div id="' + id_data + '" class="item simple_value" style="color: ' + values['label_color'] + '; text-align: center; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
'<span id="text_' + id_data + '" class="text"> ' + values['label'] + '</span>' +
'<strong>' + getModuleValue(id_data) + '</strong>' +
'</div>'
);
break;
case 'label':
item = $('<div id="' + id_data + '" class="item label" style="left: 0px; top: 0px; color: ' + values['label_color'] + '; text-align: center; position: absolute; ' + sizeStyle + ' margin-top: ' + values['top'] + 'px; margin-left: ' + values['left'] + 'px;">' +
item = $('<div id="' + id_data + '" class="item label" style="color: ' + values['label_color'] + '; text-align: center; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
'<span id="text_' + id_data + '" class="text">' + values['label'] + '</span>' +
'</div>'
);
@ -917,7 +1078,7 @@ function createItem(type, values, id_data) {
}
});
item = $('<div id="' + id_data + '" class="item icon" style="left: 0px; top: 0px; color: ' + values['label_color'] + '; text-align: center; position: absolute; ' + sizeStyle + ' margin-top: ' + values['top'] + 'px; margin-left: ' + values['left'] + 'px;">' +
item = $('<div id="' + id_data + '" class="item icon" style="color: ' + values['label_color'] + '; text-align: center; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
'<img id="image_' + id_data + '" class="image" src="' + img_src + '" ' + imageSize + ' /><br />' +
'</div>'
);
@ -934,7 +1095,7 @@ function createItem(type, values, id_data) {
"color": visual_map_get_color_line_status(id_data) };
lines.push(line);
refresh_lines(lines, 'background');
refresh_lines(lines, 'background', true);
}
}
@ -980,24 +1141,24 @@ function updateDB_visual(type, idElement , values, event, top, left) {
case 'module_graph':
$("#image_" + idElement).attr("src", getModuleGraph(idElement));
case 'static_graph':
case 'percentile_bar':
case 'percentile_item':
case 'simple_value':
case 'label':
case 'icon':
if ((typeof(values['mov_left']) != 'undefined') &&
(typeof(values['mov_top']) != 'undefined')) {
$("#" + idElement).css('top', '0px').css('margin-top', top + 'px');
$("#" + idElement).css('left', '0px').css('margin-left', left + 'px');
$("#" + idElement).css('top', '0px').css('top', top + 'px');
$("#" + idElement).css('left', '0px').css('left', left + 'px');
}
else if ((typeof(values['absolute_left']) != 'undefined') &&
(typeof(values['absolute_top']) != 'undefined')) {
$("#" + idElement).css('top', '0px').css('margin-top', top + 'px');
$("#" + idElement).css('left', '0px').css('margin-left', left + 'px');
$("#" + idElement).css('top', '0px').css('top', top + 'px');
$("#" + idElement).css('left', '0px').css('left', left + 'px');
}
$("#" + idElement).css('color', values['label_color']);
found = false;
jQuery.each(lines, function(i, line) {
if (lines[i]['id'] == idElement) {
if (lines[i]['node_begin'] == idElement) {
found = true;
if (values['parent'] == 0) {
lines.splice(i);
@ -1021,7 +1182,7 @@ function updateDB_visual(type, idElement , values, event, top, left) {
lines.push(line);
}
refresh_lines(lines, 'background');
refresh_lines(lines, 'background', true);
break;
case 'background':
if(values['width'] == '0' || values['height'] == '0'){
@ -1067,11 +1228,8 @@ function updateDB(type, idElement , values, event) {
if ((typeof(values['mov_left']) != 'undefined') &&
(typeof(values['mov_top']) != 'undefined')) {
top = parseInt($("#" + idElement).css('margin-top').replace('px', ''));
left = parseInt($("#" + idElement).css('margin-left').replace('px', ''));
top = top + parseInt(values['mov_top']);
left = left + parseInt(values['mov_left']);
top = parseInt($("#" + idElement).css('top').replace('px', ''));
left = parseInt($("#" + idElement).css('left').replace('px', ''));
}
else if ((typeof(values['absolute_left']) != 'undefined') &&
(typeof(values['absolute_top']) != 'undefined')) {
@ -1080,9 +1238,16 @@ function updateDB(type, idElement , values, event) {
}
if ((typeof(top) != 'undefined') && (typeof(left) != 'undefined')) {
if ((typeof(values['top']) == 'undefined') &&
(typeof(values['left']) == 'undefined')) {
parameter.push ({name: 'top', value: top});
parameter.push ({name: 'left', value: left});
}
else {
values['top'] = top;
values['left'] = left;
}
}
success_update = false;
if (!autosave) {
@ -1127,7 +1292,7 @@ function deleteDB(idElement) {
lines.splice(i);
}
});
refresh_lines(lines, 'background');
refresh_lines(lines, 'background', true);
$('#' + idElement).remove();
activeToolboxButton('delete_item', false);
@ -1187,9 +1352,9 @@ function eventsItems(drag) {
activeToolboxButton('delete_item', true);
activeToolboxButton('show_grid', false);
}
if ($(divParent).hasClass('percentile_bar')) {
if ($(divParent).hasClass('percentile_item')) {
creationItem = null;
selectedItem = 'percentile_bar';
selectedItem = 'percentile_item';
idItem = $(divParent).attr('id');
activeToolboxButton('edit_item', true);
activeToolboxButton('delete_item', true);
@ -1238,54 +1403,39 @@ function eventsItems(drag) {
}
});
$(".item").draggable({grid: drag});
//Set the limit of draggable in the div with id "background" and set drag
//by default is false.
$(".item").draggable({containment: "#background", grid: drag});
$('.item').bind('dragstart', function(event, ui) {
event.stopPropagation();
if (!openPropertiesPanel) {
divParent = $(event.target).parent();
unselectAll();
$(divParent).css('border', '2px blue dotted');
$(event.target).css('border', '2px blue dotted');
if ($(divParent).hasClass('static_graph')) {
creationItem = null;
selectedItem = null;
if ($(event.target).hasClass('static_graph')) {
selectedItem = 'static_graph';
idItem = $(divParent).attr('id');
activeToolboxButton('edit_item', true);
activeToolboxButton('delete_item', true);
}
if ($(divParent).hasClass('percentile_bar')) {
creationItem = null;
selectedItem = 'percentile_bar';
idItem = $(divParent).attr('id');
activeToolboxButton('edit_item', true);
activeToolboxButton('delete_item', true);
if ($(event.target).hasClass('percentile_item')) {
selectedItem = 'percentile_item';
}
if ($(divParent).hasClass('module_graph')) {
creationItem = null;
if ($(event.target).hasClass('module_graph')) {
selectedItem = 'module_graph';
idItem = $(divParent).attr('id');
activeToolboxButton('edit_item', true);
activeToolboxButton('delete_item', true);
}
if ($(divParent).hasClass('simple_value')) {
creationItem = null;
if ($(event.target).hasClass('simple_value')) {
selectedItem = 'simple_value';
idItem = $(divParent).attr('id');
activeToolboxButton('edit_item', true);
activeToolboxButton('delete_item', true);
}
if ($(divParent).hasClass('label')) {
creationItem = null;
if ($(event.target).hasClass('label')) {
selectedItem = 'label';
idItem = $(divParent).attr('id');
activeToolboxButton('edit_item', true);
activeToolboxButton('delete_item', true);
}
if ($(divParent).hasClass('icon')) {
creationItem = null;
if ($(event.target).hasClass('icon')) {
selectedItem = 'icon';
idItem = $(divParent).attr('id');
}
if (selectedItem != null) {
creationItem = null;
idItem = $(event.target).attr('id');
activeToolboxButton('edit_item', true);
activeToolboxButton('delete_item', true);
}
@ -1296,7 +1446,6 @@ function eventsItems(drag) {
event.stopPropagation();
var values = {};
values['mov_left'] = ui.position.left;
values['mov_top'] = ui.position.top;
@ -1371,8 +1520,8 @@ function move_elements_resize(original_width, original_height, width, height) {
.replace('ui-draggable', '').replace('ui-draggable-disabled', '')
.replace(/^\s+/g,'').replace(/\s+$/g,'');
old_height = parseInt($(item).css('margin-top').replace('px', ''));
old_width = parseInt($(item).css('margin-left').replace('px', ''));
old_height = parseInt($(item).css('top').replace('px', ''));
old_width = parseInt($(item).css('left').replace('px', ''));
ratio_width = width / original_width;
ratio_height = height / original_height;
@ -1401,7 +1550,8 @@ function click_button_toolbox(id) {
actionClick();
break;
case 'percentile_bar':
toolbuttonActive = creationItem = 'percentile_bar';
case 'percentile_item':
toolbuttonActive = creationItem = 'percentile_item';
actionClick();
break;
case 'module_graph':
@ -1441,7 +1591,7 @@ function click_button_toolbox(id) {
//And it is necesary to re-code more parts of code to change
//this method.
activeToolboxButton('static_graph', false);
activeToolboxButton('percentile_bar', false);
activeToolboxButton('percentile_item', false);
activeToolboxButton('module_graph', false);
activeToolboxButton('simple_value', false);
activeToolboxButton('label', false);
@ -1468,7 +1618,7 @@ function click_button_toolbox(id) {
}
activeToolboxButton('static_graph', true);
activeToolboxButton('percentile_bar', true);
activeToolboxButton('percentile_item', true);
activeToolboxButton('module_graph', true);
activeToolboxButton('simple_value', true);
activeToolboxButton('label', true);
@ -1584,8 +1734,8 @@ function showGrid() {
.replace('ui-draggable', '').replace('ui-draggable-disabled', '')
.replace(/^\s+/g,'').replace(/\s+$/g,'');
pos_y = parseInt($(item).css('margin-top').replace('px', ''));
pos_x = parseInt($(item).css('margin-left').replace('px', ''));
pos_y = parseInt($(item).css('top').replace('px', ''));
pos_x = parseInt($(item).css('left').replace('px', ''));
pos_y = Math.floor(pos_y / SIZE_GRID) * SIZE_GRID;
pos_x = Math.floor(pos_x / SIZE_GRID) * SIZE_GRID;

View File

@ -47,7 +47,7 @@ foreach ($all_images as $image_file) {
echo '<div id="editor" style="margin-top: -10px;">';
echo '<div id="toolbox">';
visual_map_print_button_editor('static_graph', __('Static Graph'), 'left', false, 'camera_min', true);
visual_map_print_button_editor('percentile_bar', __('Percentile Bar'), 'left', false, 'percentile_min', true);
visual_map_print_button_editor('percentile_item', __('Percentile Item'), 'left', false, 'percentile_item_min', true);
visual_map_print_button_editor('module_graph', __('Module Graph'), 'left', false, 'graph_min', true);
visual_map_print_button_editor('simple_value', __('Simple Value'), 'left', false, 'binary_min', true);
visual_map_print_button_editor('label', __('Label'), 'left', false, 'label_min', true);
@ -97,15 +97,27 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
?>
<table class="databox" border="0" cellpadding="4" cellspacing="4" width="300">
<caption>
<span id="title_panel_span_background" class="title_panel_span" style="display: none; visibility:hidden; font-weight: bolder;"><?php echo __('Background');?></span>
<span id="title_panel_span_static_graph" class="title_panel_span" style="display: none; font-weight: bolder;"><?php echo __('Static Graph');?></span>
<span id="title_panel_span_percentile_bar" class="title_panel_span" style="display: none; font-weight: bolder;"><?php echo __('Percentile Bar');?></span>
<span id="title_panel_span_simple_value" class="title_panel_span" style="display: none; font-weight: bolder;"><?php echo __('Simple value');?></span>
<span id="title_panel_span_label" class="title_panel_span" style="display: none; font-weight: bolder;"><?php echo __('Label');?></span>
<span id="title_panel_span_icon" class="title_panel_span" style="display: none; font-weight: bolder;"><?php echo __('Icon');?></span>
<span id="title_panel_span_background"
class="title_panel_span"
style="display: none; visibility:hidden; font-weight: bolder;"><?php echo __('Background');?></span>
<span id="title_panel_span_static_graph"
class="title_panel_span"
style="display: none; font-weight: bolder;"><?php echo __('Static Graph');?></span>
<span id="title_panel_span_percentile_item"
class="title_panel_span"
style="display: none; font-weight: bolder;"><?php echo __('Percentile Item');?></span>
<span id="title_panel_span_simple_value"
class="title_panel_span"
style="display: none; font-weight: bolder;"><?php echo __('Simple value');?></span>
<span id="title_panel_span_label"
class="title_panel_span"
style="display: none; font-weight: bolder;"><?php echo __('Label');?></span>
<span id="title_panel_span_icon"
class="title_panel_span"
style="display: none; font-weight: bolder;"><?php echo __('Icon');?></span>
</caption>
<tbody>
<tr id="label_row" style="" class="static_graph percentile_bar module_graph simple_value label datos icon">
<tr id="label_row" style="" class="static_graph percentile_bar percentile_item module_graph simple_value label datos icon">
<td style=""><?php echo __('Label');?></td>
<td style=""><?php html_print_input_text ('label', '', '', 20, 200); ?></td>
</tr>
@ -116,18 +128,19 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
<tr id="preview_row" style="" class="static_graph datos icon">
<td colspan="2" style="text-align: right;"><div id="preview" style="text-align: right;"></div></td>
</tr>
<tr id="agent_row" class="static_graph percentile_bar module_graph simple_value datos">
<tr id="agent_row" class="static_graph percentile_bar percentile_item module_graph simple_value datos">
<td><?php echo __('Agent') . '<a href="#" class="tip">&nbsp;<span>' . __("Type at least two characters to search.") . '</span></a>';?></td>
<td><?php html_print_input_text_extended ('agent', '', 'text-agent', '', 25, 100, false, '',
array('style' => 'background: #ffffff url(images/lightning.png) no-repeat right;'), false);?></td>
</tr>
<tr id="module_row" class="static_graph percentile_bar module_graph simple_value datos">
<tr id="module_row" class="static_graph percentile_bar percentile_item module_graph simple_value datos">
<td><?php echo __('Module');?></td>
<td><?php html_print_select (array (), 'module', '', '', __('Any'), 0);?></td>
</tr>
<tr id="process_value_row" class="simple_value datos">
<td><?php echo '<span>' . __('Process') . '</span>';?></td>
<td><?php html_print_select (array ('1' => __('Min value'),
<td><?php html_print_select (
array ('1' => __('Min value'),
'2' => __('Max value'),
'3' => __('Avg value')), 'process_value', '', '', __('None'), 0);?></td>
</tr>
@ -147,7 +160,7 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
<td></td>
<td><?php html_print_button(__('Height proportional'), 'original_false', false, "setAspectRatioBackground('height')", 'class="sub"');?></td>
</tr>
<tr id="percentile_bar_row_1" class="percentile_bar datos">
<tr id="percentile_bar_row_1" class="percentile_bar percentile_item datos">
<td><?php echo __('Width');?></td>
<td>
<?php
@ -155,7 +168,7 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
?>
</td>
</tr>
<tr id="percentile_bar_row_2" class="percentile_bar datos">
<tr id="percentile_bar_row_2" class="percentile_bar percentile_item datos">
<td><?php echo __('Max value');?></td>
<td>
<?php
@ -163,6 +176,24 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
?>
</td>
</tr>
<tr id="percentile_item_row_3" class="percentile_item datos">
<td><?php echo __('Type');?></td>
<td>
<?php
html_print_radio_button_extended('type_percentile', 'percentile', ('Percentile'), 'percentile', false, '', 'style="float: left;"', false);
html_print_radio_button_extended('type_percentile', 'bubble', ('Bubble'), 'percentile', false, '', 'style="float: left;"', false);
?>
</td>
</tr>
<tr id="percentile_item_row_4" class="percentile_item datos">
<td><?php echo __('Value to show');?></td>
<td>
<?php
html_print_radio_button_extended('value_show', 'percent', ('Percent'), 'value', false, '', 'style="float: left;"', false);
html_print_radio_button_extended('value_show', 'value', ('Value'), 'value', false, '', 'style="float: left;"', false);
?>
</td>
</tr>
<tr id="period_row" class="module_graph datos">
<td><?php echo __('Period');?></td>
<td><?php html_print_select ($intervals, 'period', '', '', '--', 0, false, false, false);?></td>
@ -200,7 +231,7 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
</tr>
</tbody>
<tbody id="advance_options" style="display: none;">
<tr id="position_row" class="static_graph percentile_bar module_graph simple_value label icon datos">
<tr id="position_row" class="static_graph percentile_bar percentile_item module_graph simple_value label icon datos">
<td><?php echo __('Position');?></td>
<td>
<?php
@ -222,7 +253,7 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
?>
</td>
</tr>
<tr id="parent_row" class="static_graph percentile_bar module_graph simple_value label icon datos">
<tr id="parent_row" class="static_graph percentile_bar percentile_item module_graph simple_value label icon datos">
<td><?php echo __('Parent');?></td>
<td>
<?php
@ -231,7 +262,7 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
?>
</td>
</tr>
<tr id="map_linked_row" class="static_graph percentile_bar module_graph simple_value icon label datos">
<tr id="map_linked_row" class="static_graph percentile_bar percentile_item module_graph simple_value icon label datos">
<td><?php echo __('Map linked');?></td>
<td>
<?php
@ -239,7 +270,7 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
?>
</td>
</tr>
<tr id="label_color_row" class="static_graph percentile_bar module_graph simple_value label datos">
<tr id="label_color_row" class="static_graph percentile_bar percentile_item module_graph simple_value label datos">
<td><?php echo __('Label color');?></td>
<td><?php html_print_input_text_extended ('label_color', '#000000', 'text-'.'label_color', '', 7, 7, false, '', 'class="label_color"', false);?></td>
</tr>
@ -249,16 +280,15 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
//------------------------------------------------------------------------------
echo '</div>';
echo '<div id="frame_view" style="width: 100%; height: 500px; overflow: scroll;">';
//echo '<div id="background" class="ui-widget-content" style="background: url(images/console/background/' . $background . ');
// border: 2px black solid; width: ' . $widthBackground . 'px; height: ' . $heightBackground . 'px;">';
echo '<div id="background" class="ui-widget-content" style="
echo '<div id="background" class="" style="
border: 2px black solid; width: ' . $widthBackground . 'px; height: ' . $heightBackground . 'px;">';
//echo "<img style='opacity:.5' id='background_img' src='images/console/background/white_boxed.jpg' width='100%' height='100%' />";
echo "<div id='background_grid' style='position: absolute; display: none; overflow: hidden; background: url(images/console/background/white_boxed.jpg); background-repeat: repeat; width: " . $widthBackground . "px; height: " . $heightBackground . "px;'></div>"; //<img id='background_grid' style='display:none' src='images/console/background/white_boxed.jpg' width='100%' height='100%' /></div>";
echo "<img id='background_img' src='images/console/background/" . $background . "' width='100%' height='100%' />";
echo "<div id='background_grid'
style='position: absolute; display: none; overflow: hidden;
background: url(images/console/background/white_boxed.jpg);
background-repeat: repeat; width: " . $widthBackground . "px; height: " . $heightBackground . "px;'></div>";
foreach ($layoutDatas as $layoutData) {
// Pending delete and disable modules must be ignored
$delete_pending_module = db_get_value ("delete_pending", "tagente_modulo", "id_agente_modulo", $layoutData["id_agente_modulo"]);
$disabled_module = db_get_value ("disabled", "tagente_modulo", "id_agente_modulo", $layoutData["id_agente_modulo"]);
@ -270,6 +300,8 @@ foreach ($layoutDatas as $layoutData) {
html_print_input_hidden('status_'.$layoutData['id'], visual_map_get_status_element($layoutData));
}
echo "<img style='position: absolute; top: 0px; left: 0px;' id='background_img' src='images/console/background/" . $background . "' width='100%' height='100%' />";
echo '</div>';
echo '</div>';
@ -296,16 +328,20 @@ echo '<span style="display: none" id="message_alert_no_module">' . __('No module
echo '<span style="display: none" id="hack_translation_correct_save">' . __('Successfully save the changes.') .'</span>';
echo '<span style="display: none" id="hack_translation_incorrect_save">' . __('Could not be save') .'</span>';
//CSS
ui_require_css_file ('color-picker');
ui_require_css_file ('jquery-ui-1.8.17.custom');
//Javascript
ui_require_jquery_file('jquery-ui-1.8.17.custom.min');
ui_require_jquery_file('ui.core');
ui_require_jquery_file('ui.resizable');
ui_require_jquery_file('colorpicker');
ui_require_jquery_file('ui.draggable');
ui_require_javascript_file('wz_jsgraphics');
ui_require_javascript_file('pandora_visual_console');
ui_require_jquery_file ('autocomplete');
//ui_require_jquery_file ('autocomplete');
ui_require_javascript_file('visual_console_builder.editor', 'godmode/reporting/');
// Javascript file for base 64 encoding of label parameter
ui_require_javascript_file ('encode_decode_base64');
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

View File

@ -26,6 +26,7 @@ enterprise_include_once ('include/functions_metaconsole.php');
// * q
// * id_group
$search_agents = (bool) get_parameter ('search_agents');
$search_agents_2 = (bool) get_parameter ('search_agents_2');
if ($search_agents && ($config['metaconsole'] == 0)) {
@ -115,5 +116,109 @@ elseif ($search_agents && ($config['metaconsole'] == 1)) {
return;
}
if ($search_agents_2 && ($config['metaconsole'] == 0)) {
require_once ('include/functions_agents.php');
$id_agent = (int) get_parameter ('id_agent');
$string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */
$id_group = (int) get_parameter('id_group', -1);
$addedItems = html_entity_decode((string) get_parameter('add'));
$addedItems = json_decode($addedItems);
$all = (string)get_parameter('all', 'all');
if ($addedItems != null) {
foreach ($addedItems as $item) {
echo $item . "|\n";
}
}
$filter = array ();
switch ($config['dbtype']) {
case "mysql":
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
break;
case "postgresql":
$filter[] = '(nombre LIKE \'%'.$string.'%\' OR direccion LIKE \'%'.$string.'%\' OR comentarios LIKE \'%'.$string.'%\')';
break;
case "oracle":
$filter[] = '(UPPER(nombre) LIKE UPPER(\'%'.$string.'%\') OR UPPER(direccion) LIKE UPPER(\'%'.$string.'%\') OR UPPER(comentarios) LIKE UPPER(\'%'.$string.'%\'))';
break;
}
if ($id_group != -1)
$filter['id_grupo'] = $id_group;
switch ($all) {
case 'enabled':
$filter['disabled'] = 0;
break;
}
$agents = agents_get_agents ($filter, array ('id_agente', 'nombre', 'direccion'));
if ($agents === false)
$agents = array();
$data = array();
foreach ($agents as $agent) {
$data[] = array('id' => $agent['id_agente'], 'name' => io_safe_output($agent['nombre']), 'ip' => io_safe_output($agent['direccion']));
}
echo json_encode($data);
return;
}
elseif ($search_agents && ($config['metaconsole'] == 1)) {
$servers = db_get_all_rows_sql ("SELECT * FROM tmetaconsole_setup");
if (!isset($servers)) {
return;
}
foreach ($servers as $server) {
if (!metaconsole_load_external_db ($server)) {
continue;
}
$id_agent = (int) get_parameter ('id_agent');
$string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */
$id_group = (int) get_parameter('id_group');
$addedItems = html_entity_decode((string) get_parameter('add'));
$addedItems = json_decode($addedItems);
if ($addedItems != null) {
foreach ($addedItems as $item) {
echo $item . "|\n";
}
}
$filter = array ();
switch ($config["dbtype"]) {
case "mysql":
case "postgresql":
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
break;
case "oracle":
$filter[] = '(UPPER(nombre) LIKE UPPER(\'%'.$string.'%\') OR UPPER(direccion) LIKE UPPER(\'%'.$string.'%\') OR UPPER(comentarios) LIKE UPPER(\'%'.$string.'%\'))';
break;
}
$filter['id_grupo'] = $id_group;
$agents = agents_get_agents ($filter, array ('id_agente','nombre', 'direccion'));
if ($agents === false)
$agents = array();
$data = array();
foreach ($agents as $agent) {
$data[] = array('id' => $agent['id_agente'],
'name' => io_safe_output($agent['nombre']) . " (" . io_safe_output($server['server_name']) . ") ",
'ip' => io_safe_output($agent['direccion']));
}
//Restore db connection
metaconsole_restore_db();
echo json_encode($data);
}
return;
}
?>

View File

@ -58,6 +58,8 @@ $height_module_graph = get_parameter('height_module_graph', null);
$width_module_graph = get_parameter('width_module_graph', null);
$id_agent_module = get_parameter('id_agent_module', 0);
$process_simple_value = get_parameter('process_simple_value', 0);
$type_percentile = get_parameter('type_percentile', 'percentile');
$value_show = get_parameter('value_show', 'percent');
$get_element_status = get_parameter('get_element_status', 0);
$get_image_path_status = get_parameter('get_image_path_status', 0);
@ -84,13 +86,15 @@ switch ($action) {
echo json_encode($layoutData);
break;
case 'get_module_value':
$unit_text = false;
$layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element));
switch ($layoutData['type']) {
case SIMPLE_VALUE_MAX:
$value = reporting_get_agentmodule_data_max ($layoutData['id_agente_modulo'], 86400, 0);
if ($value === false) {
$returnValue = __('Unknown');
} else {
}
else {
$returnValue = format_numeric ($value);
}
break;
@ -98,7 +102,8 @@ switch ($action) {
$value = reporting_get_agentmodule_data_min ($layoutData['id_agente_modulo'], 86400, 0);
if ($value === false) {
$returnValue = __('Unknown');
} else {
}
else {
$returnValue = format_numeric ($value);
}
break;
@ -106,18 +111,95 @@ switch ($action) {
$value = reporting_get_agentmodule_data_average ($layoutData['id_agente_modulo'], 86400, 0);
if ($value === false) {
$returnValue = __('Unknown');
} else {
}
else {
$returnValue = format_numeric ($value);
}
break;
case PERCENTILE_BAR:
case PERCENTILE_BUBBLE:
default:
$returnValue = db_get_sql ('SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
if (($layoutData['type'] == PERCENTILE_BAR) ||
($layoutData['type'] == PERCENTILE_BUBBLE)) {
if ($value_show == 'value') {
$unit_text_db = db_get_sql ('SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
$unit_text_db = trim(io_safe_output($unit_text_db));
$unit_text = false;
if (!empty($unit_text_db))
$unit_text = $unit_text_db;
}
}
break;
}
// Linked to other layout ?? - Only if not module defined
if ($layoutData['id_layout_linked'] != 0) {
$status = visual_map_get_layout_status ($layoutData['id_layout_linked']);
// Single object
}
elseif (($layoutData["type"] == 0)
|| ($layoutData["type"] == 3)
|| ($layoutData["type"] == 4)) {
// Status for a simple module
if ($layoutData['id_agente_modulo'] != 0) {
$status = modules_get_agentmodule_status ($layoutData['id_agente_modulo']);
$id_agent = db_get_value ("id_agente", "tagente_estado", "id_agente_modulo", $layoutData['id_agente_modulo']);
// Status for a whole agent, if agente_modulo was == 0
}
elseif ($layoutData['id_agent'] != 0) {
$status = agents_get_status ($layoutData["id_agent"]);
if ($status == -1) // agents_get_status return -1 for unknown!
$status = 3;
$id_agent = $layoutData["id_agent"];
}
else {
$status = 3;
$id_agent = 0;
}
}
else {
// If it's a graph, a progress bar or a data tag, ALWAYS report
// status OK (=0) to avoid confussions here.
$status = 0;
}
switch ($status) {
case 1:
//Critical (BAD)
$colorStatus = "#ff0000";
break;
case 4:
//Critical (ALERT)
$colorStatus = "#ff8800";
break;
case 0:
//Normal (OK)
$colorStatus = "#00ff00";
break;
case 2:
//Warning
$colorStatus = "#ffff00";
break;
case 3:
//Unknown
default:
$colorStatus = "#0000ff";
// Default is Grey (Other)
break;
}
$return = array();
$return['value'] = $returnValue;
$return['max_percentile'] = $layoutData['height'];
$return['width_percentile'] = $layoutData['width'];
$return['unit_text'] = $unit_text;
$return['colorRGB'] = implode('|', html_html2rgb($colorStatus));
echo json_encode($return);
break;
@ -151,6 +233,7 @@ switch ($action) {
break;
case 'simple_value':
case 'percentile_bar':
case 'percentile_item':
case 'static_graph':
case 'module_graph':
case 'label':
@ -193,13 +276,30 @@ switch ($action) {
$values['period'] = $period;
}
break;
case 'percentile_item':
case 'percentile_bar':
if ($action == 'update') {
if ($width_percentile !== null) {
$values['width'] = $width_percentile;
}
if ($max_percentile !== null) {
$values['height'] = $max_percentile;
}
$values['type'] = PERCENTILE_BAR;
if ($type_percentile == 'percentile') {
$values['type'] = PERCENTILE_BAR;
}
elseif ($type_percentile == 'bubble') {
$values['type'] = PERCENTILE_BUBBLE;
}
//Check the field's value for back compatibility
$values['image'] = 'percent';
if (($value_show == 'percent') ||
($value_show == 'value'))
$values['image'] = $value_show;
}
break;
case 'icon':
case 'static_graph':
@ -232,6 +332,7 @@ switch ($action) {
echo json_encode($backgroundFields);
break;
case 'percentile_bar':
case 'percentile_item':
case 'static_graph':
case 'module_graph':
case 'simple_value':
@ -252,9 +353,23 @@ switch ($action) {
$elementFields['modules_html'] = '<option value="0">' . __('Any') . '</option>';
}
switch ($type) {
case 'percentile_item':
case 'percentile_bar':
$elementFields['width_percentile'] = $elementFields['width'];
$elementFields['max_percentile'] = $elementFields['height'];
//Check the field's value for back compatibility
$elementFields['value_show'] = 'percent';
if (($elementFields['image'] == 'percent') ||
($elementFields['image'] == 'value'))
$elementFields['value_show'] = $elementFields['image'];
$elementFields['type_percentile'] = 'percentile';
if ($elementFields['type'] == PERCENTILE_BAR) {
$elementFields['type_percentile'] = 'percentile';
}
elseif ($elementFields['type'] == PERCENTILE_BUBBLE) {
$elementFields['type_percentile'] = 'bubble';
}
break;
case 'module_graph':
$elementFields['width_module_graph'] = $elementFields['width'];
@ -306,8 +421,15 @@ switch ($action) {
$values['width'] = $width_module_graph;
$values['period'] = $period;
break;
case 'percentile_item':
case 'percentile_bar':
if ($type_percentile == 'percentile') {
$values['type'] = PERCENTILE_BAR;
}
else {
$values['type'] = PERCENTILE_BUBBLE;
}
$values['image'] = $value_show; //Hack to save it show percent o value.
$values['width'] = $width_percentile;
$values['height'] = $max_percentile;
break;

View File

@ -3314,7 +3314,8 @@ function set_apply_policy($id, $thrash1, $other, $thrash3) {
// We want to return a value
if ($other == "return") {
return -1;
}else{
}
else {
returnError('error_apply_policy', __('Error applying policy.'));
return;
}
@ -3324,7 +3325,8 @@ function set_apply_policy($id, $thrash1, $other, $thrash3) {
// We want to return a value
if ($other == "return") {
return -1;
}else{
}
else {
returnError('error_apply_policy', __('Error applying policy. This policy is already pending to apply.'));
return;
}
@ -3336,7 +3338,8 @@ function set_apply_policy($id, $thrash1, $other, $thrash3) {
// We want to return a value
if ($other == "return") {
return -1;
}else{
}
else {
returnError('error_apply_policy', __('Error applying policy.'));
return;
}
@ -3348,7 +3351,8 @@ function set_apply_policy($id, $thrash1, $other, $thrash3) {
return $id;
else
return -1;
} else {
}
else {
if ($id)
returnData('string', array('type' => 'string', 'data' => $id));
else

View File

@ -18,7 +18,7 @@ include_once($config["homedir"] . "/include/graphs/fgraph.php");
include_once($config["homedir"] . "/include/functions_reporting.php");
include_once($config['homedir'] . "/include/functions_agents.php");
include_once($config['homedir'] . "/include/functions_modules.php");
include_once($config['homedir'] . '/include/functions_users.php');
include_once($config['homedir'] . "/include/functions_users.php");
define("GRAPH_AREA", 0);
define("GRAPH_STACKED_AREA", 1);
@ -934,17 +934,58 @@ function graph_event_module ($width = 300, $height = 200, $id_agent) {
$config['fontpath'], $config['font_size']);
}
function progress_bar($progress, $width, $height, $title = '', $mode = 1) {
function progress_bar($progress, $width, $height, $title = '', $mode = 1, $value_text = false, $color = false) {
global $config;
$out_of_lim_str = __("Out of limits");
$title = "";
if ($value_text === false) {
$value_text = $progress . "%";
}
$colorRGB = '';
if ($color !== false) {
$colorRGB = html_html2rgb($color);
$colorRGB = implode('|', $colorRGB);
}
require_once("include_graph_dependencies.php");
include_graphs_dependencies($config['homedir'].'/');
return "<img title='" . $title . "' alt='" . $title . "' src='include/graphs/fgraph.php?static_graph=1&homeurl=../../&graph_type=progressbar&width=".$width."&height=".$height."&progress=".$progress.
"&mode=" . $mode . "&out_of_lim_str=".$out_of_lim_str."&title=".$title."&font=".$config['fontpath']."' />";
return "<img title='" . $title . "' alt='" . $title . "'" .
" src='include/graphs/fgraph.php?homeurl=../../&graph_type=progressbar" .
"&width=".$width."&height=".$height."&progress=".$progress.
"&mode=" . $mode . "&out_of_lim_str=".$out_of_lim_str .
"&title=".$title."&font=".$config['fontpath']."&value_text=". $value_text .
"&colorRGB=". $colorRGB . "' />";
}
function progress_bubble($progress, $width, $height, $title = '', $mode = 1, $value_text = false, $color = false) {
global $config;
$out_of_lim_str = __("Out of limits");
$title = "";
if ($value_text === false) {
$value_text = $progress . "%";
}
$colorRGB = '';
if ($color !== false) {
$colorRGB = html_html2rgb($color);
$colorRGB = implode('|', $colorRGB);
}
require_once("include_graph_dependencies.php");
include_graphs_dependencies($config['homedir'].'/');
return "<img title='" . $title . "' alt='" . $title . "'" .
" src='include/graphs/fgraph.php?homeurl=../../&graph_type=progressbubble" .
"&width=".$width."&height=".$height."&progress=".$progress.
"&mode=" . $mode . "&out_of_lim_str=".$out_of_lim_str .
"&title=".$title."&font=".$config['fontpath']."&value_text=". $value_text .
"&colorRGB=". $colorRGB . "' />";
}
function graph_sla_slicebar ($id, $period, $sla_min, $sla_max, $date, $daysWeek = null, $time_from = null, $time_to = null, $width, $height, $home_url) {
@ -1838,7 +1879,8 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
if (empty($unit_name)){
$unit = modules_get_unit($agent_module_id);
}else
}
else
$unit = $unit_name;
// Data iterator

View File

@ -810,7 +810,9 @@ function ui_require_css_file ($name, $path = 'include/styles/') {
return true;
if (! file_exists ($filename) && ! file_exists ($config['homedir'].'/'.$filename))
return false;
$config['css'][$name] = $filename;
return true;
}
@ -1008,7 +1010,8 @@ function ui_process_page_head ($string, $bitfield) {
$output .= '<script type="text/javascript">/* <![CDATA[ */'."\n";
$output .= file_get_contents ($config["homedir"]."/".$filename);
$output .= "\n".'/* ]]> */</script>';
} else {
}
else {
$output .= '<script type="text/javascript" src="'.$filename.'"></script>'."\n\t";
}
}
@ -1020,13 +1023,22 @@ function ui_process_page_head ($string, $bitfield) {
}
//Pandora specific jquery should go first
$black_list_pages_old_jquery = array('operation/gis_maps/index');
if (in_array(get_parameter('sec2'), $black_list_pages_old_jquery)) {
$config['jquery'] = array_merge (array ("jquery" => "include/javascript/jquery.js",
"pandora" => "include/javascript/jquery.pandora.js"),
$config['jquery']);
}
else {
$config['jquery'] = array_merge (array ("jquery" => "include/javascript/jquery-1.7.1.min.js",
"pandora" => "include/javascript/jquery.pandora.js"),
$config['jquery']);
}
//Then add each script as necessary
$loaded = array ('');
foreach ($config['jquery'] as $name => $filename) {
if (in_array ($name, $loaded))
continue;
@ -1036,7 +1048,8 @@ function ui_process_page_head ($string, $bitfield) {
$output .= '<script type="text/javascript">/* <![CDATA[ */'."\n";
$output .= file_get_contents ($config["homedir"]."/".$filename);
$output .= "\n".'/* ]]> */</script>';
} else {
}
else {
$output .= '<script type="text/javascript" src="'.$filename.'"></script>'."\n\t";
}
}

View File

@ -98,6 +98,64 @@ function visual_map_print_item($layoutData) {
$text = '<span id="text_' . $id . '" class="text">' . $label . '</span>';
// Linked to other layout ?? - Only if not module defined
if ($layoutData['id_layout_linked'] != 0) {
$status = visual_map_get_layout_status ($layoutData['id_layout_linked']);
// Single object
}
elseif (($layoutData["type"] == 0)
|| ($layoutData["type"] == 3)
|| ($layoutData["type"] == 4)) {
// Status for a simple module
if ($layoutData['id_agente_modulo'] != 0) {
$status = modules_get_agentmodule_status ($layoutData['id_agente_modulo']);
$id_agent = db_get_value ("id_agente", "tagente_estado", "id_agente_modulo", $layoutData['id_agente_modulo']);
// Status for a whole agent, if agente_modulo was == 0
}
elseif ($layoutData['id_agent'] != 0) {
$status = agents_get_status ($layoutData["id_agent"]);
if ($status == -1) // agents_get_status return -1 for unknown!
$status = 3;
$id_agent = $layoutData["id_agent"];
}
else {
$status = 3;
$id_agent = 0;
}
}
else {
// If it's a graph, a progress bar or a data tag, ALWAYS report
// status OK (=0) to avoid confussions here.
$status = 0;
}
switch ($status) {
case 1:
//Critical (BAD)
$colorStatus = "#ff0000";
break;
case 4:
//Critical (ALERT)
$colorStatus = "#ff8800";
break;
case 0:
//Normal (OK)
$colorStatus = "#00ff00";
break;
case 2:
//Warning
$colorStatus = "#ffff00";
break;
case 3:
//Unknown
default:
$colorStatus = "#0000ff";
// Default is Blue (Other)
break;
}
switch ($type) {
case STATIC_GRAPH:
if ($layoutData['image'] != null) {
@ -112,7 +170,7 @@ function visual_map_print_item($layoutData) {
$sizeStyle = 'width: ' . $width . 'px; height: ' . $height . 'px;';
$imageSize = 'width="' . $width . '" height="' . $height . '"';
}
echo '<div id="' . $id . '" class="item static_graph" style="left: 0px; top: 0px; text-align: center; color: ' . $color . '; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
echo '<div id="' . $id . '" class="item static_graph" style="text-align: center; color: ' . $color . '; position: absolute; display: inline-block; ' . $sizeStyle . ' top: ' . $top . 'px; left: ' . $left . 'px;">';
if ($layoutData['image'] != null) {
if (($width != 0) && ($height != 0))
echo html_print_image($img, true, array("class" => "image", "id" => "image_" . $id, "width" => "$width", "height" => "$height", "style" => $borderStyle));
@ -124,16 +182,41 @@ function visual_map_print_item($layoutData) {
echo "</div>";
break;
case PERCENTILE_BAR:
case PERCENTILE_BUBBLE:
$module_value = db_get_sql ('SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $id_module);
$value_text = false;
if ($layoutData['image'] == 'percent') {
$value_text = false;
}
elseif ($layoutData['image'] == 'value') {
$unit_text = db_get_sql ('SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module);
$unit_text = trim(io_safe_output($unit_text));
$value_text = $module_value;
if (!empty($unit_text))
$value_text .= " " . $unit_text;
}
if ( $max_percentile > 0)
$percentile = $module_value / $max_percentile * 100;
else
$percentile = 100;
echo '<div id="' . $id . '" class="item percentile_bar" style="left: 0px; top: 0px; color: ' . $color . '; text-align: center; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
$percentile = round($percentile);
echo '<div id="' . $id . '" class="item percentile_item" style="left: 0px; top: 0px; color: ' . $color . '; text-align: center; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
echo $text . '<br />';
echo progress_bar($percentile, $width, 15);
ob_start();
if ($type == PERCENTILE_BUBBLE) {
echo progress_bubble($percentile, $width, $width, '', 1, $value_text, $colorStatus);
}
else {
echo progress_bar($percentile, $width, 15, '', 1, $value_text, $colorStatus);
}
$img = ob_get_clean();
$img = str_replace('>', 'class="image" id="image_' . $id . '" />', $img);
echo $img;
echo '</div>';
break;
@ -142,7 +225,7 @@ function visual_map_print_item($layoutData) {
$height, '', null, false, 1, false, 0, '', 0, 0, true, true);
$img = str_replace('>', 'class="image" id="image_' . $id . '" />', $img);
echo '<div id="' . $id . '" class="item module_graph" style="left: 0px; top: 0px; color: ' . $color . '; text-align: center; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
echo '<div id="' . $id . '" class="item module_graph" style="left: 0px; top: 0px; color: ' . $color . '; text-align: center; position: absolute; display: inline-block; ' . $sizeStyle . ' top: ' . $top . 'px; left: ' . $left . 'px;">';
echo $text . '<br />';
echo $img;
echo '</div>';
@ -151,7 +234,7 @@ function visual_map_print_item($layoutData) {
case SIMPLE_VALUE_MAX:
case SIMPLE_VALUE_MIN:
case SIMPLE_VALUE_AVG:
echo '<div id="' . $id . '" class="item simple_value" style="left: 0px; top: 0px; color: ' . $color . '; text-align: center; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
echo '<div id="' . $id . '" class="item simple_value" style="left: 0px; top: 0px; color: ' . $color . '; text-align: center; position: absolute; display: inline-block; ' . $sizeStyle . ' top: ' . $top . 'px; left: ' . $left . 'px;">';
echo $text;
switch ($type){
case SIMPLE_VALUE:
@ -188,7 +271,7 @@ function visual_map_print_item($layoutData) {
echo '</div>';
break;
case LABEL:
echo '<div id="' . $id . '" class="item label" style="left: 0px; top: 0px; text-align: center; color: ' . $color . '; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
echo '<div id="' . $id . '" class="item label" style="left: 0px; top: 0px; text-align: center; color: ' . $color . '; position: absolute; display: inline-block; ' . $sizeStyle . ' top: ' . $top . 'px; left: ' . $left . 'px;">';
echo $text;
echo "</div>";
break;
@ -201,7 +284,7 @@ function visual_map_print_item($layoutData) {
$sizeStyle = 'width: ' . $width . 'px; height: ' . $height . 'px;';
$imageSize = 'width="' . $width . '" height="' . $height . '"';
}
echo '<div id="' . $id . '" class="item icon" style="left: 0px; top: 0px; text-align: center; color: ' . $color . '; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
echo '<div id="' . $id . '" class="item icon" style="left: 0px; top: 0px; text-align: center; color: ' . $color . '; position: absolute; display: inline-block; ' . $sizeStyle . ' top: ' . $top . 'px; left: ' . $left . 'px;">';
if ($layoutData['image'] != null) {
// If match with protocol://direction
if (preg_match('/^(http:\/\/)((.)+)$/i', $text)){
@ -453,6 +536,7 @@ function visual_map_get_status_element($layoutData) {
* @param bool $draw_lines
*/
function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_lines = true, $width = null, $height = null) {
//TODO: USE THE SAME CODE THAT THE VISUAL MAP EDITOR
global $config;
$layout = db_get_row ('tlayout', 'id', $id_layout);
@ -522,7 +606,8 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
$status_parent = 3;
}
} else {
}
else {
$id_agent_module_parent = 0;
$status_parent = 3;
}
@ -537,23 +622,30 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
$status = visual_map_get_layout_status ($layout_data['id_layout_linked']);
// Single object
} elseif ($layout_data["type"] == 0) {
}
elseif (($layout_data["type"] == 0)
|| ($layout_data["type"] == 3)
|| ($layout_data["type"] == 9)
|| ($layout_data["type"] == 4)) {
// Status for a simple module
if ($layout_data['id_agente_modulo'] != 0) {
$status = modules_get_agentmodule_status ($layout_data['id_agente_modulo']);
$id_agent = db_get_value ("id_agente", "tagente_estado", "id_agente_modulo", $layout_data['id_agente_modulo']);
// Status for a whole agent, if agente_modulo was == 0
} elseif ($layout_data['id_agent'] != 0) {
}
elseif ($layout_data['id_agent'] != 0) {
$status = agents_get_status ($layout_data["id_agent"]);
if ($status == -1) // agents_get_status return -1 for unknown!
$status = 3;
$id_agent = $layout_data["id_agent"];
} else {
}
else {
$status = 3;
$id_agent = 0;
}
} else {
}
else {
// If it's a graph, a progress bar or a data tag, ALWAYS report
// status OK (=0) to avoid confussions here.
$status = 0;
@ -605,12 +697,14 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
// Link to an agent
echo '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agent.'">';
}
} elseif ($layout_data['id_layout_linked'] > 0) {
}
elseif ($layout_data['id_layout_linked'] > 0) {
// Link to a map
echo '<a href="index.php?sec=visualc&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data["id_layout_linked"].'">';
} else {
}
else {
// A void object
echo '<a href="#">';
}
@ -649,6 +743,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
default:
$img .= ".png";
// Default is Grey (Other)
break;
}
$borderStyle = '';
if(substr($img,0,1) == '4') {
@ -873,6 +968,36 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
// ****************************************************************
// Progress bar
// ****************************************************************
case 9:
// ****************************************************************
// Progress bubble
// ****************************************************************
switch ($status) {
case 1:
//Critical (BAD)
$colorStatus = "#ff0000";
break;
case 4:
//Critical (ALERT)
$colorStatus = "#ff8800";
break;
case 0:
//Normal (OK)
$colorStatus = "#00ff00";
break;
case 2:
//Warning
$colorStatus = "#ffff00";
break;
case 3:
//Unknown
default:
$colorStatus = "#0000ff";
// Default is Grey (Other)
break;
}
if ($resizedMap)
echo '<div style="left: 0px; top: 0px; text-align: center; z-index: 1; color: '.$layout_data['label_color'].'; position: absolute; margin-left: '.((integer)($proportion *$layout_data['pos_x'])).'px; margin-top:'.((integer)($proportion *$layout_data['pos_y'])).'px;" id="layout-data-'.$layout_data['id'].'" class="layout-data">';
else
@ -884,9 +1009,16 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
else
$percentile = 100;
$percentile = round($percentile);
$endTagA = false;
echo $layout_data['label'];
echo "<br>";
if ($show_links) {
if (($id_agent > 0) && ($layout_data['id_layout_linked'] == "" || $layout_data['id_layout_linked'] == 0)) {
//Extract id service if it is a prediction module.
$id_service = db_get_value_filter('custom_integer_1',
'tagente_modulo',
@ -901,23 +1033,49 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
//Link to an service page
echo '<a href="index.php?sec=services&sec2=enterprise/operation/services/services&id_service=' .
$id_service . '&offset=0">';
$endTagA = true;
}
else {
// Link to an agent
echo '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agent.'">';
}
}
elseif ($layout_data['id_layout_linked'] > 0) {
// Link to a map
echo '<a href="index.php?sec=visualc&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data["id_layout_linked"].'">';
$endTagA = true;
}
else {
// A void object
echo '<a href="#">';
}
}
echo $layout_data['label'];
echo "<br>";
$value_text = false;
if ($layout_data['image'] == 'percent') {
$value_text = false;
}
elseif ($layout_data['image'] == 'value') {
$unit_text = db_get_sql ('SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ' . $layout_data['id_agente_modulo']);
$unit_text = trim(io_safe_output($unit_text));
$value_text = $valor;
if (!empty($unit_text))
$value_text .= " " . $unit_text;
}
if ($layout_data['type'] == 9) {
if ($resizedMap)
echo progress_bar($percentile, ((integer)($proportion * $width)), 15);
echo progress_bubble($percentile, ((integer)($proportion * $width)), $width, '', 1, $value_text, $colorStatus);
else
echo progress_bar($percentile, $width, 15);
echo progress_bubble($percentile, $width, $width, '', 1, $value_text, $colorStatus);
}
else {
if ($resizedMap)
echo progress_bar($percentile, ((integer)($proportion * $width)), 15, '', 1, $value_text, $colorStatus);
else
echo progress_bar($percentile, $width, 15, '', 1, $value_text, $colorStatus);
}
if ($endTagA) echo '</a>';

View File

@ -100,7 +100,34 @@ switch($graph_type) {
$mode = get_parameter('mode', 1);
gd_progress_bar ($width, $height, $progress, $title, $font, $out_of_lim_str, $out_of_lim_image, $mode);
$fontsize = get_parameter('fontsize', 10);
$value_text = get_parameter('value_text', '');
$colorRGB = get_parameter('colorRGB', '');
gd_progress_bar ($width, $height, $progress, $title, $font,
$out_of_lim_str, $out_of_lim_image, $mode, $fontsize, $value_text, $colorRGB);
break;
case 'progressbubble':
$width = get_parameter('width');
$height = get_parameter('height');
$progress = get_parameter('progress');
$out_of_lim_str = get_parameter('out_of_lim_str', false);
$out_of_lim_image = get_parameter('out_of_lim_image', false);
$font = get_parameter('font');
$title = get_parameter('title');
$mode = get_parameter('mode', 1);
$fontsize = get_parameter('fontsize', 7);
$value_text = get_parameter('value_text', '');
$colorRGB = get_parameter('colorRGB', '');
gd_progress_bubble ($width, $height, $progress, $title, $font,
$out_of_lim_str, $out_of_lim_image, $mode, $fontsize, $value_text, $colorRGB);
break;
}

View File

@ -67,6 +67,17 @@ if($id_graph && in_array($graph_type, $types)) {
$graph['mode'],
$graph['fontsize']);
break;
case 'progressbubble':
gd_progress_bubble ($graph['width'],
$graph['height'],
$graph['progress'],
$graph['title'],
$graph['font'],
$graph['out_of_lim_str'],
$graph['out_of_lim_image'],
$graph['mode'],
$graph['fontsize']);
break;
}
}
@ -145,10 +156,9 @@ function gd_histogram ($width, $height, $mode, $data, $max_value, $font, $title,
}
// ***************************************************************************
// Draw a dynamic progress bar using GDlib directly
// Draw a dynamic progress bubble using GDlib directly
// ***************************************************************************
function gd_progress_bar ($width, $height, $progress, $title, $font, $out_of_lim_str, $out_of_lim_image, $mode = 1, $fontsize=10) {
function gd_progress_bubble ($width, $height, $progress, $title, $font, $out_of_lim_str, $out_of_lim_image, $mode = 1, $fontsize=10, $value_text = '', $colorRGB = '') {
if($out_of_lim_str === false) {
$out_of_lim_str = "Out of limits";
}
@ -157,11 +167,98 @@ function gd_progress_bar ($width, $height, $progress, $title, $font, $out_of_lim
$out_of_lim_image = "images_graphs/outlimits.png";
}
$color = array();
if (!empty($colorRGB)) {
$color = explode('|', $colorRGB);
}
Header("Content-type: image/png");
switch ($mode)
{
//TODO: Understand the difernets between the modes.
case 0:
case 1:
case 2:
global $config;
global $REMOTE_ADDR;
$ratingWidth = ($progress/100)*$width;
$ratingHeight = ($progress/100)*$height;
$image = imagecreate($width,$height);
//colors
$back = ImageColorAllocate($image,255,255,255);
imagecolortransparent ($image, $back);
$black = ImageColorAllocate($image,0,0,0);
$red = ImageColorAllocate($image,255,60,75);
$green = ImageColorAllocate($image,50,205,50);
$blue = ImageColorAllocate($image,44,81,120);
$soft_green = ImageColorAllocate($image,176, 255, 84);
$soft_yellow = ImageColorAllocate($image,255, 230, 84);
$soft_red = ImageColorAllocate($image,255, 154, 84);
$other_red = ImageColorAllocate($image,238, 0, 0);
if (!empty($color)) {
$defined_color = ImageColorAllocate($image, $color[0], $color[1], $color[2]);
}
if (isset($defined_color)) {
imagefilledellipse($image, $width / 2, $height / 2,
$ratingWidth, $ratingHeight, $defined_color);
}
elseif ($rating > 70) {
imagefilledellipse($image, $width / 2, $height / 2,
$ratingWidth, $ratingHeight, $soft_green);
}
elseif ($rating > 50) {
imagefilledellipse($image, $width / 2, $height / 2,
$ratingWidth, $ratingHeight, $soft_yellow);
}
elseif ($rating > 30) {
imagefilledellipse($image, $width / 2, $height / 2,
$ratingWidth, $ratingHeight, $soft_red);
}
else if($rating > 0) {
imagefilledellipse($image, $width / 2, $height / 2,
$ratingWidth, $ratingHeight, $other_red);
}
//Write the value
$size = imagettfbbox ($fontsize, 0, $font, $value_text);
ImageTTFText($image, $fontsize, 0,
($width/2) - ($size[4] / 2), ($height/2) + ($size[1] / 2), $black, $font, $value_text);
imagePNG($image);
imagedestroy($image);
break;
}
}
// ***************************************************************************
// Draw a dynamic progress bar using GDlib directly
// ***************************************************************************
function gd_progress_bar ($width, $height, $progress, $title, $font, $out_of_lim_str, $out_of_lim_image, $mode = 1, $fontsize=10, $value_text = '', $colorRGB = '') {
if($out_of_lim_str === false) {
$out_of_lim_str = "Out of limits";
}
if($out_of_lim_image === false) {
$out_of_lim_image = "images_graphs/outlimits.png";
}
$color = array();
if (!empty($colorRGB)) {
$color = explode('|', $colorRGB);
}
// Copied from the PHP manual:
// http://us3.php.net/manual/en/function.imagefilledrectangle.php
// With some adds from sdonie at lgc dot com
// Get from official documentation PHP.net website. Thanks guys :-)
function drawRating($rating, $width, $height, $font, $out_of_lim_str, $mode, $fontsize) {
function drawRating($rating, $width, $height, $font, $out_of_lim_str, $mode, $fontsize, $value_text, $color) {
global $config;
global $REMOTE_ADDR;
@ -195,6 +292,9 @@ function gd_progress_bar ($width, $height, $progress, $title, $font, $out_of_lim
$red = ImageColorAllocate($image,255,60,75);
$green = ImageColorAllocate($image,50,205,50);
$blue = ImageColorAllocate($image,44,81,120);
if (!empty($color)) {
$defined_color = ImageColorAllocate($image, $color[0], $color[1], $color[2]);
}
$soft_green = ImageColorAllocate($image,176, 255, 84);
$soft_yellow = ImageColorAllocate($image,255, 230, 84);
@ -211,7 +311,10 @@ function gd_progress_bar ($width, $height, $progress, $title, $font, $out_of_lim
switch ($mode)
{
case 0:
if ($rating > 70)
if (isset($defined_color)) {
ImageRectangleWithRoundedCorners($image, $x1, $y1, $x2, $y2, $radius, $defined_color);
}
elseif ($rating > 70)
ImageRectangleWithRoundedCorners($image, $x1, $y1, $x2, $y2, $radius, $soft_green);
elseif ($rating > 50)
ImageRectangleWithRoundedCorners($image, $x1, $y1, $x2, $y2, $radius, $soft_yellow);
@ -225,7 +328,10 @@ function gd_progress_bar ($width, $height, $progress, $title, $font, $out_of_lim
}
break;
case 1:
if ($rating > 100)
if (isset($defined_color)) {
ImageRectangleWithRoundedCorners($image, $x1, $y1, $x2, $y2, $radius,$defined_color);
}
elseif ($rating > 100)
ImageRectangleWithRoundedCorners($image, $x1, $y1, $x2, $y2, $radius,$red);
elseif ($rating == 100)
ImageRectangleWithRoundedCorners($image, $x1, $y1, $x2, $y2, $radius,$green);
@ -240,12 +346,15 @@ function gd_progress_bar ($width, $height, $progress, $title, $font, $out_of_lim
if ($rating > 100)
ImageTTFText($image, $fontsize, 0, ($width/4), ($height/2)+($height/5), $back, $font, $out_of_lim_str);
else
ImageTTFText($image, $fontsize, 0, ($width/2)-($width/10), ($height/2)+($height/5), $back, $font, $rating."%");
ImageTTFText($image, $fontsize, 0, ($width/2)-($width/10), ($height/2)+($height/5), $back, $font, $value_text);
else
ImageTTFText($image, $fontsize, 0, ($width/2)-($width/10), ($height/2)+($height/5), $text, $font, $rating."%");
ImageTTFText($image, $fontsize, 0, ($width/2)-($width/10), ($height/2)+($height/5), $text, $font, $value_text);
break;
case 2:
if ($rating > 70)
if (isset($defined_color)) {
ImageRectangleWithRoundedCorners($image, $x1, $y1, $x2, $y2, $radius, $defined_color);
}
elseif ($rating > 70)
ImageRectangleWithRoundedCorners($image, $x1, $y1, $x2, $y2, $radius, $other_red);
elseif ($rating > 50)
ImageRectangleWithRoundedCorners($image, $x1, $y1, $x2, $y2, $radius, $soft_red);
@ -297,26 +406,7 @@ function gd_progress_bar ($width, $height, $progress, $title, $font, $out_of_lim
switch ($mode)
{
case 0:
drawRating($progress, $width, $height, $font, $out_of_lim_str, $mode, $fontsize);
/*
if ($mode == 0) {
$engine->background_color = '#E6E6D2';
$engine->show_title = false;
if ($progress > 70)
$color = '#B0FF54';
elseif ($progress > 50)
$color = '#FFE654';
elseif ($progress > 30)
$color = '#FF9A54';
else
$color = '#EE0000';
} else {
$engine->background_color = '#FFFFFF';
$engine->show_title = true;
$engine->title = format_numeric ($progress).' %';
$color = '#2C5196';
}
*/
drawRating($progress, $width, $height, $font, $out_of_lim_str, $mode, $fontsize, $value_text, $color);
break;
case 1:
if ($progress > 100 || $progress < 0) {
@ -328,7 +418,7 @@ if ($mode == 0) {
imagePng($imgPng);
}
else
drawRating($progress, $width, $height, $font, $out_of_lim_str, $mode, 6);
drawRating($progress, $width, $height, $font, $out_of_lim_str, $mode, 6, $value_text, $color);
break;
case 2:
if ($progress > 100 || $progress < 0) {
@ -340,7 +430,7 @@ if ($mode == 0) {
imagePng($imgPng);
}
else
drawRating($progress, $width, $height, $font, $out_of_lim_str, $mode, 6);
drawRating($progress, $width, $height, $font, $out_of_lim_str, $mode, 6, $value_text, $color);
break;
}
}

View File

@ -90,7 +90,10 @@ function hl_bal($t, $do=1, $in='div'){
elseif(isset($cB[$p])){$ok = $eB; unset($cI['del'], $cI['ins']);}
if(isset($cO[$p])){$ok = $ok + $cO[$p];}
if(isset($cN[$p])){$ok = array_diff_assoc($ok, $cN[$p]);}
}else{$ok = $inOk; unset($cI['del'], $cI['ins']);}
}
else {
$ok = $inOk; unset($cI['del'], $cI['ins']);
}
// bad tags, & ele content
if(isset($e) && ($do == 1 or (isset($ok['#pcdata']) && ($do == 3 or $do == 5)))){
$o .= '&lt;'.$s.$e.$a.'&gt;';
@ -101,7 +104,10 @@ function hl_bal($t, $do=1, $in='div'){
foreach(preg_split('`(\x01\x02[^\x01\x02]+\x02\x01)`', $x, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $v){
$o .= (substr($v, 0, 2) == "\x01\x02" ? $v : ($do > 4 ? preg_replace('`\S`', '', $v) : ''));
}
}elseif($do > 4){$o .= preg_replace('`\S`', '', $x);}
}
elseif ($do > 4) {
$o .= preg_replace('`\S`', '', $x);
}
}
// get markup
if(!preg_match('`^(/?)([a-zA-Z1-6]+)([^>]*)>(.*)`sm', $t[$i], $r)){$x = $t[$i]; continue;}
@ -177,7 +183,9 @@ function hl_bal($t, $do=1, $in='div'){
elseif(isset($cB[$p])){$ok = $eB; unset($cI['del'], $cI['ins']);}
if(isset($cO[$p])){$ok = $ok + $cO[$p];}
if(isset($cN[$p])){$ok = array_diff_assoc($ok, $cN[$p]);}
}else{$ok = $inOk; unset($cI['del'], $cI['ins']);}
}
else {
$ok = $inOk; unset($cI['del'], $cI['ins']);}
if(isset($e) && ($do == 1 or (isset($ok['#pcdata']) && ($do == 3 or $do == 5)))){
$o .= '&lt;'.$s.$e.$a.'&gt;';
}
@ -190,7 +198,8 @@ function hl_bal($t, $do=1, $in='div'){
foreach(preg_split('`(\x01\x02[^\x01\x02]+\x02\x01)`', $x, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY) as $v){
$o .= (substr($v, 0, 2) == "\x01\x02" ? $v : ($do > 4 ? preg_replace('`\S`', '', $v) : ''));
}
}elseif($do > 4){$o .= preg_replace('`\S`', '', $x);}
}
elseif($do > 4){$o .= preg_replace('`\S`', '', $x);}
}
while(!empty($q) && ($e = array_pop($q))){$o .= '</'.$e.'>';}
@ -208,7 +217,8 @@ function hl_cmtcd($t){
if(substr(($t = preg_replace('`--+`', '-', substr($t, 4, -3))), -1) != ' '){$t .= ' ';}
$t = $C['comment'] == 2 ? str_replace(array('&', '<', '>'), array('&amp;', '&lt;', '&gt;'), $t) : $t;
$t = "\x01\x02\x04!--$t--\x05\x02\x01";
}else{ // CDATA
}
else { // CDATA
if(!$C['cdata']){return $t;}
if($C['cdata'] == 1){return '';}
$t = substr($t, 1, -1);
@ -383,7 +393,8 @@ $t = str_replace(array("\t", "\r", "\n", ' '), '', preg_replace('/"(?>(`.|[^"])*
break; case 1:
if($a[0] == '='){ // =
$w = 1; $mode = 2; $a = ltrim($a, '= ');
}else{ // No val
}
else { // No val
$w = 1; $mode = 0; $a = ltrim($a);
$aA[$nm] = '';
}
@ -432,7 +443,10 @@ $t = str_replace(array("\t", "\r", "\n", ' '), '', preg_replace('/"(?>(`.|[^"])*
if(!preg_match('`\bnofollow\b`i', $a['rel'])){$a['rel'] .= ' nofollow';}
}elseif(isset($aA['rel'])){
if(!preg_match('`\bnofollow\b`i', $aA['rel'])){$nfr = 1;}
}else{$a['rel'] = 'nofollow';}
}
else{
$a['rel'] = 'nofollow';
}
}
}
}
@ -506,7 +520,8 @@ $t = str_replace(array("\t", "\r", "\n", ' '), '', preg_replace('/"(?>(`.|[^"])*
// unique ID
if($C['unique_ids'] && isset($a['id'])){
if(!preg_match('`^[A-Za-z][A-Za-z0-9_\-.:]*$`', ($id = $a['id'])) or (isset($GLOBALS['hl_Ids'][$id]) && $C['unique_ids'] == 1)){unset($a['id']);
}else{
}
else {
while(isset($GLOBALS['hl_Ids'][$id])){$id = $C['unique_ids']. $id;}
$GLOBALS['hl_Ids'][($a['id'] = $id)] = 1;
}
@ -591,7 +606,9 @@ $t = str_replace(array("\t", "\r", "\n", ' '), '', preg_replace('/"(?>(`.|[^"])*
}elseif(isset($b[$y])){$o .= $f.$e.$r;
}elseif(isset($a[$y])){$o .= $e.$f.ltrim($r);
}elseif(!$y){$o .= $f.$e.$f.ltrim($r);
}else{$o .= $e.$r;}
}
else {
$o .= $e.$r;}
}
$t = preg_replace('`[\n]\s*?[\n]+`', "\n", $o);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -398,44 +398,67 @@ function agent_changed_by_multiple_agents_id (event, id_agent, selected) {
* @param id_agent_module_selector id of the selector for the modules of the agent.
*/
function agent_module_autocomplete (id_agent_name, id_agent_id, id_agent_module_selector, id_server_name, noneValue) {
$(id_agent_name).autocomplete(
"ajax.php",
{
minChars: 2,
scroll:true,
extraParams: {
page: "include/ajax/agent",
search_agents: 1
},
formatItem: function (data, i, total) {
if (total == 0)
$(id_agent_name).css ('background-color', '#cc0000');
else
$(id_agent_name).css ('background-color', '');
if (data == "")
return false;
return data[0]+'<br><span class="ac_extra_field"><?php echo __("IP") ?>: '+data[2]+'</span>';
},
delay: 200
//Check exist the field with id in the var id_agent_name.
if ($(id_agent_name).length == 0)
return;
$(id_agent_name).autocomplete({
minLength: 2,
source: function( request, response ) {
var term = request.term; //Word to search
var data_params = {"page": "include/ajax/agent",
"search_agents_2": 1,
"q": term};
jQuery.ajax ({
data: data_params,
async: false,
type: 'POST',
url: action="ajax.php",
timeout: 10000,
dataType: 'json',
success: function (data) {
response(data);
return;
}
);
// Callback from the autocomplete
$(id_agent_name).result (
function (e, data, formatted) {
$(id_agent_module_selector).attr('disabled', false);
agent_id = data[1];
server_name = data[2];
$(id_server_name).val(server_name);
});
return;
},
select: function( event, ui ) {
var agent_name = ui.item.name;
var agent_id = ui.item.id;
var server_name = ui.item.ip;
//Put the name
$(this).val(agent_name);
//Put the id
if (typeof(id_agent_id) != "undefined") {
$(id_agent_id).val(agent_id);
jQuery.post ('ajax.php',
{"page": "operation/agentes/ver_agente",
}
//Put the server
if (typeof(id_server_name) != "undefined") {
$(id_server_name).val(server_name);
}
//Fill the modules select box
$(id_agent_module_selector).fadeOut ('normal', function () {
$('#module').empty ();
var data_params = {"page": "operation/agentes/ver_agente",
"get_agent_modules_json": 1,
"id_agent": agent_id,
"server_name": server_name,
"filter" : 'disabled=0 AND delete_pending=0',
"fields" : "id_agente_modulo,nombre"
},
function (data) {
"fields" : "id_agente_modulo,nombre"};
jQuery.ajax ({
data: data_params,
type: 'POST',
url: action="ajax.php",
timeout: 10000,
dataType: 'json',
success: function (data) {
$(id_agent_module_selector).empty();
if (typeof(noneValue) != "undefined") {
if (noneValue == true) {
@ -451,11 +474,39 @@ function agent_module_autocomplete (id_agent_name, id_agent_id, id_agent_module_
.html (js_html_entity_decode (value['nombre']));
$(id_agent_module_selector).append (option);
});
},
"json"
);
$(id_agent_module_selector).fadeIn ('normal');
}
);
});
});
return false;
}
})
.data( "autocomplete")._renderItem = function( ul, item ) {
if (item.ip == '') {
text = "<a>" + item.name + "</a>";
}
else {
text = "<a>" + item.name
+ "<br><span style='font-size: 70%; font-style: italic;'>IP:" + item.ip + "</span></a>";
}
return $("<li></li>")
.data("item.autocomplete", item)
.append(text)
.appendTo(ul);
};
//Force the size of autocomplete
$(".ui-autocomplete").css("max-height", "100px");
$(".ui-autocomplete").css("overflow-y", "auto");
/* prevent horizontal scrollbar */
$(".ui-autocomplete").css("overflow-x", "hidden");
/* add padding to account for vertical scrollbar */
$(".ui-autocomplete").css("padding-right", "20px");
//Force to style of items
$(".ui-autocomplete").css("text-align", "left");
}
/**
@ -470,36 +521,77 @@ function agent_module_autocomplete (id_agent_name, id_agent_id, id_agent_module_
* @param id_agent_module_selector id of the selector for the modules of the agent.
*/
function agent_autocomplete (id_agent_name, id_server_name, id_agent_id ) {
$(id_agent_name).autocomplete(
"ajax.php",
{
minChars: 2,
scroll:true,
extraParams: {
page: "include/ajax/agent",
search_agents: 1
},
formatItem: function (data, i, total) {
if (total == 0)
$(id_agent_name).css ('background-color', '#cc0000');
else
$(id_agent_name).css ('background-color', '');
if (data == "")
return false;
return data[0]+'<br><span class="ac_extra_field"><?php echo __("IP") ?>: '+data[2]+'</span>';
},
delay: 200
}
);
//Check exist the field with id in the var id_agent_name.
if ($(id_agent_name).length == 0)
return;
// Callback from the autocomplete
$(id_agent_name).result (
function (e, data, formatted) {
//$(id_agent_module_selector).attr('disabled', false);
agent_id = data[1];
server_name = data[2];
$(id_server_name).val(server_name);
$(id_agent_name).autocomplete({
minLength: 2,
source: function( request, response ) {
var term = request.term; //Word to search
var data_params = {"page": "include/ajax/agent",
"search_agents_2": 1,
"q": term};
jQuery.ajax ({
data: data_params,
async: false,
type: 'POST',
url: action="ajax.php",
timeout: 10000,
dataType: 'json',
success: function (data) {
response(data);
return;
}
});
return;
},
select: function( event, ui ) {
var agent_id = ui.item.id;
var server_name = ui.item.ip;
var agent_name = ui.item.name;
//Put the name
$(this).val(agent_name);
//Put the id
if (typeof(id_agent_id) != "undefined") {
$(id_agent_id).val(agent_id);
}
);
//Put the server
if (typeof(id_server_name) != "undefined") {
$(id_server_name).val(server_name);
}
return false;
}
})
.data( "autocomplete")._renderItem = function( ul, item ) {
if (item.ip == '') {
text = "<a>" + item.name + "</a>";
}
else {
text = "<a>" + item.name
+ "<br><span style='font-size: 70%; font-style: italic;'>IP:" + item.ip + "</span></a>";
}
return $("<li></li>")
.data("item.autocomplete", item)
.append(text)
.appendTo(ul);
};
//Force the size of autocomplete
$(".ui-autocomplete").css("max-height", "100px");
$(".ui-autocomplete").css("overflow-y", "auto");
/* prevent horizontal scrollbar */
$(".ui-autocomplete").css("overflow-x", "hidden");
/* add padding to account for vertical scrollbar */
$(".ui-autocomplete").css("padding-right", "20px");
//Force to style of items
$(".ui-autocomplete").css("text-align", "left");
}

View File

@ -14,8 +14,17 @@
- node_begin Id of the beginning node
- node_end Id of the finishing node
* @param id_div Div to draw the lines in
* @param editor Boolean variable to set other css selector in editor (when true).
*/
function draw_line (line, id_div) {
function draw_line (line, id_div, editor) {
if (typeof(editor) == 'undefined') {
editor = false;
selector = 'margin-';
}
if (editor) {
selector = '';
}
div = document.getElementById (id_div);
brush = new jsGraphics (div);
brush.setStroke (1);
@ -23,23 +32,27 @@ function draw_line (line, id_div) {
if (line['x1']) {
x1 = line['x'];
} else {
x1 = parseInt ($('#'+line['node_begin']).css ('margin-left')) + ($('#'+line['node_begin']).width() / 2);
}
else {
x1 = parseInt ($('#'+line['node_begin']).css (selector + 'left')) + ($('#'+line['node_begin']).width() / 2);
}
if (line['y1']) {
y1 = line['y1'];
} else {
y1 = parseInt ($('#'+line['node_begin']).css ('margin-top')) + ($('#'+line['node_begin']).height() / 2);
}
else {
y1 = parseInt ($('#'+line['node_begin']).css (selector + 'top')) + ($('#'+line['node_begin']).height() / 2);
}
if (line['x2']) {
x2 = line['x2'];
} else {
x2 = parseInt ($('#'+line['node_end']).css ('margin-left')) + ($('#'+line['node_end']).width() / 2);
}
else {
x2 = parseInt ($('#'+line['node_end']).css (selector + 'left')) + ($('#'+line['node_end']).width() / 2);
}
if (line['y2']) {
y2 = line['y2'];
} else {
y2 = parseInt ($('#'+line['node_end']).css ('margin-top')) + ($('#'+line['node_end']).height() / 2);
}
else {
y2 = parseInt ($('#'+line['node_end']).css (selector + 'top')) + ($('#'+line['node_end']).height() / 2);
}
brush.drawLine (x1, y1, x2, y2);
brush.paint ();
@ -50,10 +63,11 @@ function draw_line (line, id_div) {
*
* @param lines Array with lines objects (see draw_line)
* @param id_div Div to draw the lines in
* @param editor Boolean variable to set other css selector in editor (when true).
*/
function draw_lines (lines, id_div) {
function draw_lines (lines, id_div, editor) {
jQuery.each (lines, function () {
draw_line (this, id_div);
draw_line (this, id_div, editor);
});
}
@ -77,8 +91,9 @@ function delete_lines (id_div) {
*
* @param lines Array with lines objects (see draw_line)
* @param id_div Div to draw the lines in
* @param editor Boolean variable to set other css selector in editor (when true).
*/
function refresh_lines (lines, id_div) {
function refresh_lines (lines, id_div, editor) {
delete_lines (id_div);
draw_lines (lines, id_div);
draw_lines (lines, id_div, editor);
}

View File

@ -234,7 +234,8 @@ class PchartGraph extends PandoraGraphAbstract {
$this->dataset->GetDataDescription (), SCALE_START0,
80, 80, 80, $this->show_axis, 0, 50, false,
$this->xaxis_interval);
}else{
}
else {
$this->graph->drawScale ($this->dataset->GetData (),
$this->dataset->GetDataDescription (), SCALE_START0,
80, 80, 80, false, 0, 50, false,

View File

@ -0,0 +1,572 @@
/*
* jQuery UI CSS Framework 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
.ui-helper-clearfix:after { clear: both; }
.ui-helper-clearfix { zoom: 1; }
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/*
* jQuery UI CSS Framework 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
*/
/* Component containers
----------------------------------*/
.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; }
.ui-widget-content a { color: #333333; }
.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
.ui-widget-header a { color: #ffffff; }
/* Interaction states
----------------------------------*/
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover,
.ui-widget-header .ui-state-hover, .ui-state-focus,
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
border: 1px solid #fbcb09;
/*background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x;*/
background: #fdf5ce 50% 50% repeat-x;
font-weight: bold; color: #c77405; }
.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; }
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; }
.ui-widget :active { outline: none; }
/* Interaction Cues
----------------------------------*/
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; }
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); }
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); }
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
/* Overlays */
.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); }
.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/*
* jQuery UI Resizable 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
* jQuery UI Selectable 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Selectable#theming
*/
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
/*
* jQuery UI Accordion 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Accordion#theming
*/
/* IE/Win - Fix animation bug - #4615 */
.ui-accordion { width: 100%; }
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content-active { display: block; }
/*
* jQuery UI Autocomplete 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Autocomplete#theming
*/
.ui-autocomplete { position: absolute; cursor: default; }
/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
/*
* jQuery UI Menu 1.8.17
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Menu#theming
*/
.ui-menu {
list-style:none;
padding: 2px;
margin: 0;
display:block;
float: left;
}
.ui-menu .ui-menu {
margin-top: -3px;
}
.ui-menu .ui-menu-item {
margin:0;
padding: 0;
zoom: 1;
float: left;
clear: left;
width: 100%;
}
.ui-menu .ui-menu-item a {
text-decoration:none;
display:block;
padding:.2em .4em;
line-height:1.5;
zoom:1;
}
.ui-menu .ui-menu-item a.ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-active {
font-weight: normal;
margin: -1px;
}
/*
* jQuery UI Button 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Button#theming
*/
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }
/*button text element */
.ui-button .ui-button-text { display: block; line-height: 1.4; }
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
/* no icon support for input elements, provide padding by default */
input.ui-button { padding: .4em 1em; }
/*button icon element(s) */
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
/*button sets*/
.ui-buttonset { margin-right: 7px; }
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
/*
* jQuery UI Dialog 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog#theming
*/
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
/*
* jQuery UI Slider 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Slider#theming
*/
.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { width: .8em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
* jQuery UI Tabs 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Tabs#theming
*/
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
/*
* jQuery UI Datepicker 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Datepicker#theming
*/
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}/*
* jQuery UI Progressbar 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Progressbar#theming
*/
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }

View File

@ -303,7 +303,7 @@ input.copy, input.add, input.graph, input.percentile, input.binary,
input.camera, input.config, input.cancel {
padding-right: 21px;
}
input.delete_min, input.graph_min, input.percentile_min, input.binary_min,
input.delete_min, input.graph_min, input.percentile_min, input.percentile_item_min, input.binary_min,
input.camera_min, input.config_min, input.label_min, input.icon_min, input.grid_min, input.save {
padding-right: 25px;
}
@ -373,6 +373,12 @@ input.percentile_min {
input.percentile_min[disabled] {
background: #e5e5e5 url(../../images/chart_bar.disabled.png) no-repeat center;
}
input.percentile_item_min {
background: #e5e5e5 url(../../images/percentile_item.png) no-repeat center;
}
input.percentile_item_min[disabled] {
background: #e5e5e5 url(../../images/percentile_item.disabled.png) no-repeat center;
}
input.binary_min {
background: #e5e5e5 url(../../images/binary.png) no-repeat center;
}

View File

@ -17,6 +17,7 @@ global $config;
if (is_ajax ()) {
$search_agents = (bool) get_parameter ('search_agents');
$search_agents_2 = (bool) get_parameter ('search_agents_2');
if ($search_agents) {
@ -68,6 +69,59 @@ if (is_ajax ()) {
return;
}
if ($search_agents_2) {
require_once ('include/functions_agents.php');
$id_agent = (int) get_parameter ('id_agent');
$string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */
$id_group = (int) get_parameter('id_group', -1);
$addedItems = html_entity_decode((string) get_parameter('add'));
$addedItems = json_decode($addedItems);
$all = (string)get_parameter('all', 'all');
if ($addedItems != null) {
foreach ($addedItems as $item) {
echo $item . "|\n";
}
}
$filter = array ();
switch ($config['dbtype']) {
case "mysql":
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%" OR comentarios LIKE "%'.$string.'%")';
break;
case "postgresql":
$filter[] = '(nombre LIKE \'%'.$string.'%\' OR direccion LIKE \'%'.$string.'%\' OR comentarios LIKE \'%'.$string.'%\')';
break;
case "oracle":
$filter[] = '(UPPER(nombre) LIKE UPPER(\'%'.$string.'%\') OR UPPER(direccion) LIKE UPPER(\'%'.$string.'%\') OR UPPER(comentarios) LIKE UPPER(\'%'.$string.'%\'))';
break;
}
if ($id_group != -1)
$filter['id_grupo'] = $id_group;
switch ($all) {
case 'enabled':
$filter['disabled'] = 0;
break;
}
$agents = agents_get_agents ($filter, array ('id_agente', 'nombre', 'direccion'));
if ($agents === false)
$agents = array();
$data = array();
foreach ($agents as $agent) {
$data[] = array('id' => $agent['id_agente'], 'name' => io_safe_output($agent['nombre']), 'ip' => io_safe_output($agent['direccion']));
}
echo json_encode($data);
return;
}
return;
}
@ -226,13 +280,13 @@ if (!empty ($export_btn) && !empty ($module)) {
$arr["agent_id"] = modules_get_agentmodule_agent ($selected);
$arr["utimestamp"] = $end;
array_push ($data, $arr);
} else {
}
else {
$data_single = modules_get_agentmodule_data ($selected, $work_period, $work_end);
if (!empty ($data_single)) {
$data = array_merge ($data, $data_single);
}
}
/*
if ($work_end > $end) {
$work_period = $work_end - $end;
@ -286,10 +340,12 @@ switch ($export_type) {
break;
default:
return;
break;
}
} elseif (!empty ($export_btn) && empty ($module)) {
}
elseif (!empty ($export_btn) && empty ($module)) {
ui_print_error_message (__('No modules specified'));
}
@ -388,7 +444,6 @@ echo '</div></form>';
ui_require_jquery_file ('pandora.controls');
ui_require_jquery_file ('ajaxqueue');
ui_require_jquery_file ('bgiframe');
ui_require_jquery_file ('autocomplete');
?>
<script type="text/javascript">
/* <![CDATA[ */
@ -411,34 +466,68 @@ $(document).ready (function () {
});
if (inputActive) {
$("#text-agent").autocomplete(
"ajax.php",
{
minChars: 2,
scroll:true,
extraParams: {
$("#text-agent").autocomplete({
minLength: 2,
source: function( request, response ) {
var term = request.term; //Word to search
var data_params = {
page: "operation/agentes/exportdata",
search_agents: 1,
id_group: function() { return $("#group").val(); }
},
formatItem: function (data, i, total) {
if (total == 0)
$("#text-agent").css ('background-color', '#cc0000');
else
$("#text-agent").css ('background-color', '');
if (data == "")
return false;
return data[0]+'<br><span class="ac_extra_field"><?php echo __("IP") ?>: '+data[1]+'</span>';
},
delay: 200
}
);
}
search_agents_2: 1,
id_group: function() { return $("#group").val(); },
"q": term};
$("#text-agent").result(function(event, data, formatted) {
this.form.submit();
jQuery.ajax ({
data: data_params,
async: false,
type: "POST",
url: action="ajax.php",
timeout: 10000,
dataType: "json",
success: function (data) {
response(data);
return;
}
});
return;
},
select: function( event, ui ) {
var agent_name = ui.item.name;
//Put the name
$(this).val(agent_name);
this.form.submit();
return false;
}
})
.data( "autocomplete")._renderItem = function( ul, item ) {
if ((item.ip == "") || (typeof(item.ip) == "undefined")) {
text = "<a>" + item.name + "</a>";
}
else {
text = "<a>" + item.name
+ "<br><span style=\"font-size: 70%; font-style: italic;\">IP:" + item.ip + "</span></a>";
}
return $("<li></li>")
.data("item.autocomplete", item)
.append(text)
.appendTo(ul);
};
//Force the size of autocomplete
$(".ui-autocomplete").css("max-height", "100px");
$(".ui-autocomplete").css("overflow-y", "auto");
/* prevent horizontal scrollbar */
$(".ui-autocomplete").css("overflow-x", "hidden");
/* add padding to account for vertical scrollbar */
$(".ui-autocomplete").css("padding-right", "20px");
//Force to style of items
$(".ui-autocomplete").css("text-align", "left");
}
});
/* ]]> */
</script>

View File

@ -366,39 +366,69 @@ else {
}
ui_require_jquery_file ('bgiframe');
ui_require_jquery_file ('autocomplete');
?>
<script language="javascript" type="text/javascript">
/* <![CDATA[ */
$(document).ready( function() {
$("#text_id_agent").autocomplete({
minLength: 2,
source: function( request, response ) {
var term = request.term; //Word to search
$("#text_id_agent").autocomplete(
"ajax.php",
{
minChars: 2,
scroll:true,
extraParams: {
page: "operation/agentes/exportdata",
search_agents: 1,
add: '<?php echo json_encode(array('-1' => "All", '0' => "System"));?>',
id_group: function() { return $("#id_group").val(); }
},
formatItem: function (data, i, total) {
if (total == 0)
$("#text_id_agent").css ('background-color', '#cc0000');
else
$("#text_id_agent").css ('background-color', '');
if (data == "")
return false;
var data_params = {
"page": "godmode/agentes/agent_manager",
"search_parents_2": 1,
"q": term};
return data[0]+'<br><span class="ac_extra_field"><?php echo __("IP") ?>: '+data[1]+'</span>';
},
delay: 200
jQuery.ajax ({
data: data_params,
async: false,
type: "POST",
url: action="ajax.php",
timeout: 10000,
dataType: "json",
success: function (data) {
response(data);
return;
}
);
});
return;
},
select: function( event, ui ) {
var agent_name = ui.item.name;
//Put the name
$(this).val(agent_name);
return false;
}
})
.data( "autocomplete")._renderItem = function( ul, item ) {
if (item.ip == "") {
text = "<a>" + item.name + "</a>";
}
else {
text = "<a>" + item.name
+ "<br><span style=\"font-size: 70%; font-style: italic;\">IP:" + item.ip + "</span></a>";
}
return $("<li></li>")
.data("item.autocomplete", item)
.append(text)
.appendTo(ul);
};
//Force the size of autocomplete
$(".ui-autocomplete").css("max-height", "100px");
$(".ui-autocomplete").css("overflow-y", "auto");
/* prevent horizontal scrollbar */
$(".ui-autocomplete").css("overflow-x", "hidden");
/* add padding to account for vertical scrollbar */
$(".ui-autocomplete").css("padding-right", "20px");
//Force to style of items
$(".ui-autocomplete").css("text-align", "left");
$("input[name=allbox]").change (function() {
$("input[name='eventid[]']").attr('checked', $(this).attr('checked'));

View File

@ -760,7 +760,8 @@ foreach ($result as $event) {
$templateName = db_get_sql($sql);
$data[$i] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$event["id_agente"].'&amp;tab=alert">'.$templateName.'</a>';
} else {
}
else {
$data[$i] = '';
}
$i++;
@ -791,7 +792,8 @@ foreach ($result as $event) {
$data[$i] .= ',';
}
$data[$i] = rtrim($data[$i], ',');
} else {
}
else {
$data[$i] = '';
}
$i++;
@ -1053,7 +1055,8 @@ foreach ($result as $event) {
}
$string = rtrim($string, ',');
$odd = ($odd == '')? 'rowOdd' : '';
} else {
}
else {
$string .= '<i>- ' . __('Empty') . ' -</i>';
$odd = ($odd == '')? 'rowOdd' : '';
}
@ -1229,7 +1232,8 @@ $(document).ready( function() {
$('#filter_name_color').css('color', '#CC0000');
$('#filter_group_color').css('color', '#CC0000');
// If the filter has name insert in database
}else{
}
else {
$('#filter_name_color').css('color', '#000000');
$('#filter_group_color').css('color', '#000000');
// If the filter name is blank show error
@ -1261,7 +1265,8 @@ $(document).ready( function() {
function (data) {
if (data == 'error') {
$('#show_filter_error').html('<h3 class="error"> <?php echo __('Error creating filter'); ?> </h3>');
}else{
}
else {
id_filter_save = data;
$('#show_filter_error').html('<h3 class="suc"> <?php echo __('Filter created'); ?> </h3>');
}
@ -1282,7 +1287,8 @@ $(document).ready( function() {
if (i == id_filter_save){
$('#filter_id').append ($('<option selected="selected"></option>').html (s).attr ("value", i));
} else {
}
else {
$('#filter_id').append ($('<option></option>').html (s).attr ("value", i));
}
});
@ -1327,7 +1333,8 @@ $(document).ready( function() {
function (data) {
if (data == 'ok'){
$('#show_filter_error').html('<h3 class="suc"> <?php echo __('Filter updated'); ?> </h3>');
}else{
}
else {
$('#show_filter_error').html('<h3 class="error"> <?php echo __('Error updating filter'); ?> </h3>');
}
});
@ -1346,7 +1353,8 @@ $(document).ready( function() {
s = js_html_entity_decode(val);
if (i == id_filter_update){
$('#filter_id').append ($('<option selected="selected"></option>').html (s).attr ("value", i));
} else {
}
else {
$('#filter_id').append ($('<option></option>').html (s).attr ("value", i));
}
});
@ -1375,7 +1383,8 @@ $(document).ready( function() {
$("#toggle_arrow").attr('src', data);
}
});
}else{
}
else {
var params = [];
params.push("get_image_path=1");
params.push("img_src=images/go.png");

View File

@ -391,7 +391,8 @@ if ($draw != '') {
// Hide update filter button
if ($("#filter_id").val() == 0) {
$("#submit-update_button").css("visibility", "hidden");
}else{
}
else {
$("#submit-update_button").css("visibility", "");
}
@ -400,7 +401,8 @@ if ($draw != '') {
if ($("#text-name").val() == ""){
$('#filter_name_color').css('color', '#CC0000');
$('#filter_group_color').css('color', '#CC0000');
}else{
}
else {
$('#filter_name_color').css('color', '#000000');
$('#filter_group_color').css('color', '#000000');
}