From 2f280a1d0dc3a43859759d8f097c3f05216bd3b0 Mon Sep 17 00:00:00 2001 From: ramonn Date: Wed, 10 Aug 2011 16:51:42 +0000 Subject: [PATCH] 2011-08-10 Ramon Novoa * 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 --- pandora_console/ChangeLog | 15 +++++++++++++++ .../extras/pandoradb_migrate_v3.2_to_v4.0.sql | 1 + pandora_console/godmode/agentes/agent_manager.php | 2 +- pandora_console/include/functions_ui.php | 6 ++++-- pandora_console/include/styles/tip.css | 3 +-- .../operation/agentes/estado_monitores.php | 3 +++ .../operation/agentes/status_monitor.php | 6 ++++++ pandora_console/pandoradb.oracle.sql | 1 + pandora_console/pandoradb.postgreSQL.sql | 1 + pandora_console/pandoradb.sql | 1 + 10 files changed, 34 insertions(+), 5 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index bd7713a167..b9d33b0d48 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,18 @@ +2011-08-10 Ramon Novoa + + * 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 * pandoradb_data.sql: New sensor as agent type. Updated version. diff --git a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql index 858f6ae9ba..c9385f1765 100644 --- a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql +++ b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql @@ -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)); diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 77f37a642d..45f6adc96e 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -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) - . ' ' . __("Type at least two characters to search") . ''; + . 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'). " " . ui_print_help_icon("cascade_protection", true); diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 21c96bcb5a..175935597c 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -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 = ' '.$text.''; +function ui_print_help_tip ($text, $return = false, $img = 'images/tip.png') { + $output = '' . html_print_image ($img, true) . ''.$text.''; if ($return) return $output; diff --git a/pandora_console/include/styles/tip.css b/pandora_console/include/styles/tip.css index 767a1c4156..d6444e6d98 100644 --- a/pandora_console/include/styles/tip.css +++ b/pandora_console/include/styles/tip.css @@ -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; diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 3e04ebf8b9..66b91db5d5 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -318,6 +318,9 @@ foreach ($modules as $module) { $data[2] .= '' . html_print_image("images/config.png", true, array("alt" => '0', "border" => "")) . ''; $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) { diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 0aae73515f..e9b4c61118 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -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']; diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index a1fdf1330e..d1e9b25c36 100644 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -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, diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index 1791de2797..787c52e647 100644 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -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, diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 105d8797d3..09a1f4aec9 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -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',