2011-08-10 Ramon Novoa <rnovoa@artica.es>

* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql: Added
	  a new column to store extended module information.

	* operation/agentes/status_monitor.php,
	  operation/agentes/estado_monitores.php: Added help tips to display
	  extended module information.

	* extras/pandoradb_migrate_v3.2_to_v4.0.sql,
	  godmode/agentes/agent_manager.php,
	  include/styles/tip.css,
	  include/functions_ui.php: Added support for help tips with custom
	  images.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4711 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2011-08-10 16:51:42 +00:00
parent c963f94d27
commit 2f280a1d0d
10 changed files with 34 additions and 5 deletions

View File

@ -1,3 +1,18 @@
2011-08-10 Ramon Novoa <rnovoa@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql: Added
a new column to store extended module information.
* operation/agentes/status_monitor.php,
operation/agentes/estado_monitores.php: Added help tips to display
extended module information.
* extras/pandoradb_migrate_v3.2_to_v4.0.sql,
godmode/agentes/agent_manager.php,
include/styles/tip.css,
include/functions_ui.php: Added support for help tips with custom
images.
2011-08-10 Sancho Lerena <slerena@artica.es>
* pandoradb_data.sql: New sensor as agent type. Updated version.

View File

@ -179,6 +179,7 @@ CREATE TABLE IF NOT EXISTS `ttag_event` (
ALTER TABLE `tagente_modulo` ADD COLUMN (`unit` text DEFAULT '');
ALTER TABLE `tagente_modulo` ADD COLUMN (`str_warning` text DEFAULT '');
ALTER TABLE `tagente_modulo` ADD COLUMN (`str_critical` text DEFAULT '');
ALTER TABLE `tagente_modulo` ADD COLUMN (`extended_info` text DEFAULT '');
ALTER TABLE `tagente_modulo` ADD INDEX module (`id_modulo`);
ALTER TABLE `tagente_modulo` ADD INDEX nombre (`nombre` (255));

View File

@ -143,7 +143,7 @@ $table->data[2][0] = __('Parent');
$src_code = html_print_image('images/lightning.png', true, false, true);
$table->data[2][1] = html_print_input_text_extended ('id_parent', agents_get_name ($id_parent), 'text-id_parent', '', 30, 100, false, '',
array('style' => 'background: url(' . $src_code . ') no-repeat right;'), true)
. '<a href="#" class="tip">&nbsp;<span>' . __("Type at least two characters to search") . '</span></a>';
. ui_print_help_tip (__("Type at least two characters to search"), true);
$table->data[2][1] .= html_print_checkbox ("cascade_protection", 1, $cascade_protection, true).__('Cascade protection'). "&nbsp;" . ui_print_help_icon("cascade_protection", true);

View File

@ -24,6 +24,7 @@ require_once($config['homedir'] . "/include/functions_modules.php");
require_once($config['homedir'] . "/include/functions.php");
require_once ($config['homedir'] . '/include/functions_groups.php');
require_once ($config['homedir'] . '/include/functions_users.php');
require_once ($config['homedir'] . '/include/functions_html.php');
/**
@ -1203,11 +1204,12 @@ function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $ret
*
* @param string Complete text to show in the tip
* @param bool whether to return an output string or echo now
* @param img displayed image
*
* @return string HTML code if return parameter is true.
*/
function ui_print_help_tip ($text, $return = false) {
$output = '<a href="javascript:" class="tip">&nbsp;<span>'.$text.'</span></a>';
function ui_print_help_tip ($text, $return = false, $img = 'images/tip.png') {
$output = '<a href="javascript:" class="tip" >' . html_print_image ($img, true) . '<span>'.$text.'</span></a>';
if ($return)
return $output;

View File

@ -1,7 +1,6 @@
a.tip {
cursor: help;
background: url(../../images/tip.png) no-repeat;
padding: 5px 2px 5px 12px;
padding: 5px 2px 5px 2px;
}
a.help {
cursor: help;

View File

@ -318,6 +318,9 @@ foreach ($modules as $module) {
$data[2] .= '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$id_agente.'&amp;tab=module&amp;id_agent_module='.$module["id_agente_modulo"].'&amp;edit_module='.$module["id_modulo"].'">' . html_print_image("images/config.png", true, array("alt" => '0', "border" => "")) . '</a>';
$data[3] = ui_print_string_substr ($module["nombre"], 30, true);
if ($module["extended_info"] != "") {
$data[3] .= ui_print_help_tip ($module["extended_info"], true, '/images/comments.png');
}
//Adds tag context information
if (tags_get_modules_tag_count($module['id_agente_modulo']) > 0) {

View File

@ -270,6 +270,7 @@ switch ($config["dbtype"]) {
tagente_modulo.min_critical,
tagente_modulo.max_critical,
tagente_modulo.str_critical,
tagente_modulo.extended_info,
tagente_estado.utimestamp AS utimestamp".$sql." LIMIT ".$offset.",".$config["block_size"];
break;
case "postgresql":
@ -292,6 +293,7 @@ switch ($config["dbtype"]) {
tagente_modulo.min_critical,
tagente_modulo.max_critical,
tagente_modulo.str_critical,
tagente_modulo.extended_info,
tagente_estado.utimestamp AS utimestamp".$sql." LIMIT " . $config["block_size"] . " OFFSET " . $offset;
break;
case "oracle":
@ -316,6 +318,7 @@ switch ($config["dbtype"]) {
tagente_modulo.min_critical,
tagente_modulo.max_critical,
tagente_modulo.str_critical,
tagente_modulo.extended_info,
tagente_estado.utimestamp AS utimestamp".$sql;
$sql = oracle_recode_query ($sql, $set);
break;
@ -432,6 +435,9 @@ foreach ($result as $row) {
$data[2] = html_print_image("images/" . modules_show_icon_type ($row["module_type"]), true);
$data[3] = ui_print_truncate_text($row["module_name"],30,false,true,false);
if ($row["extended_info"] != "") {
$data[3] .= ui_print_help_tip ($row["extended_info"], true, '/images/comments.png');
}
$data[4] = ($row['module_interval'] == 0) ? $row['agent_interval'] : $row['module_interval'];

View File

@ -165,6 +165,7 @@ CREATE TABLE tagente_modulo (
id_agente NUMBER(10, 0) default 0 NOT NULL,
id_tipo_modulo NUMBER(10, 0) default 0 NOT NULL,
descripcion CLOB default '',
extended_info CLOB default '',
nombre CLOB default '',
unit VARCHAR2(100) DEFAULT '',
id_policy_module NUMBER(10, 0) default 0 NOT NULL,

View File

@ -151,6 +151,7 @@ CREATE TABLE "tagente_modulo" (
"id_agente" INTEGER NOT NULL default 0,
"id_tipo_modulo" INTEGER NOT NULL default 0,
"descripcion" TEXT NOT NULL default '',
"extended_info" TEXT NOT NULL default '',
"nombre" TEXT NOT NULL default '',
"unit" TEXT default '',
"id_policy_module" INTEGER NOT NULL default 0,

View File

@ -145,6 +145,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
`id_agente` int(10) unsigned NOT NULL default '0',
`id_tipo_modulo` smallint(5) NOT NULL default '0',
`descripcion` TEXT NOT NULL default '',
`extended_info` TEXT NOT NULL default '',
`nombre` text NOT NULL default '',
`unit` text default '',
`id_policy_module` INTEGER unsigned NOT NULL default '0',