2009-01-21 Esteban Sanchez <estebans@artica.es>
* pandoradb.sql, pandoradb_migrate_20_to_21.sql: Added id_agent field to tlayout_data. It's needed to give support to nodes in visual console that represents a whole agent which turns red if any module is down. * operation/visual_console/render_view.php: Removed refresh countdown and selection because it's now done in the page header. * include/functions_visual_map.php: Some fixes to support id_agent field in tlayout_data. Also fixed the SQL to check if any module on an agent is down. * godmode/reporting/map_builder.php: Update and insert id_agent when managing a node element. * include/styles/pandora.css: Added a style to input image elements. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1378 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
a93de2c1e8
commit
91048ace89
|
@ -1,3 +1,22 @@
|
|||
2009-01-21 Esteban Sanchez <estebans@artica.es>
|
||||
|
||||
* pandoradb.sql, pandoradb_migrate_20_to_21.sql: Added id_agent field
|
||||
to tlayout_data. It's needed to give support to nodes in visual
|
||||
console that represents a whole agent which turns red if any module is
|
||||
down.
|
||||
|
||||
* operation/visual_console/render_view.php: Removed refresh countdown
|
||||
and selection because it's now done in the page header.
|
||||
|
||||
* include/functions_visual_map.php: Some fixes to support id_agent
|
||||
field in tlayout_data. Also fixed the SQL to check if any module on an
|
||||
agent is down.
|
||||
|
||||
* godmode/reporting/map_builder.php: Update and insert id_agent when
|
||||
managing a node element.
|
||||
|
||||
* include/styles/pandora.css: Added a style to input image elements.
|
||||
|
||||
2009-01-21 Esteban Sanchez <estebans@artica.es>
|
||||
|
||||
* godmode/agentes/alert_manager.php: Added the hability to delete
|
||||
|
|
|
@ -139,6 +139,7 @@ if ($create_layout_data) {
|
|||
$layout_data_type = (string) get_parameter ("type");
|
||||
$layout_data_label = (string) get_parameter ("label");
|
||||
$layout_data_image = (string) get_parameter ("image");
|
||||
$layout_data_id_agent = (int) get_parameter ("agent");
|
||||
$layout_data_id_agent_module = (int) get_parameter ("module");
|
||||
$layout_data_label_color = (string) get_parameter ("label_color");
|
||||
$layout_data_parent_item = (int) get_parameter ("parent_item");
|
||||
|
@ -153,6 +154,7 @@ if ($create_layout_data) {
|
|||
'label_color' => $layout_data_label_color,
|
||||
'image' => $layout_data_image,
|
||||
'type' => $layout_data_type,
|
||||
'id_agent' => $layout_data_id_agent,
|
||||
'id_agente_modulo' => $layout_data_id_agent_module,
|
||||
'parent_item' => $layout_data_parent_item,
|
||||
'period' => $layout_data_period * 3600,
|
||||
|
@ -209,6 +211,7 @@ if ($update_layout_data) {
|
|||
$layout_data_type = (int) get_parameter ("type");
|
||||
$layout_data_label = (string) get_parameter ("label");
|
||||
$layout_data_image = (string) get_parameter ("image");
|
||||
$layout_data_id_agent = (int) get_parameter ("agent");
|
||||
$layout_data_id_agent_module = (int) get_parameter ("module");
|
||||
$layout_data_label_color = (string) get_parameter ("label_color");
|
||||
$layout_data_parent_item = (int) get_parameter ("parent_item");
|
||||
|
@ -220,6 +223,7 @@ if ($update_layout_data) {
|
|||
$sql = sprintf ('UPDATE tlayout_data SET
|
||||
image = "%s", label = "%s",
|
||||
label_color = "%s",
|
||||
id_agent = %d,
|
||||
id_agente_modulo = %d,
|
||||
type = %d, parent_item = %d,
|
||||
period = %d, id_layout_linked = %d,
|
||||
|
@ -227,6 +231,7 @@ if ($update_layout_data) {
|
|||
WHERE id = %d',
|
||||
$layout_data_image, $layout_data_label,
|
||||
$layout_data_label_color,
|
||||
$layout_data_id_agent,
|
||||
$layout_data_id_agent_module,
|
||||
$layout_data_type, $layout_data_parent_item,
|
||||
$layout_data_period * 3600,
|
||||
|
@ -343,7 +348,7 @@ if (! $edit_layout && ! $id_layout) {
|
|||
/* Layout data trash */
|
||||
echo '<form id="form_layout_data_trash" action="" method="post">';
|
||||
echo '<div id="layout_trash_drop">';
|
||||
echo '<h1>'.__('Map element trash').'</h1>';
|
||||
echo '<h1>'.__('Map element trash').'</h1>';
|
||||
echo __('Drag an element here to delete from the map');
|
||||
echo '<span id="elements"> </span>';
|
||||
print_input_hidden ('delete_layout_data', 1);
|
||||
|
|
|
@ -39,8 +39,8 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines =
|
|||
if ($layout_data['id_layout_linked'] != 0) {
|
||||
$status = return_status_layout ($layout_data['id_layout_linked']);
|
||||
} else {
|
||||
$id_agent = get_db_value ("id_agente", "tagente_estado", "id_agente_modulo", $layout_data['id_agente_modulo']);
|
||||
if ($layout_data['id_agente_modulo'] != 0) {
|
||||
$id_agent = get_db_value ("id_agente", "tagente_estado", "id_agente_modulo", $layout_data['id_agente_modulo']);
|
||||
$id_agent_module_parent = get_db_value ("id_agente_modulo", "tlayout_data", "id", $layout_data["parent_item"]);
|
||||
// Item value
|
||||
$status = return_status_agent_module ($layout_data['id_agente_modulo']);
|
||||
|
@ -49,16 +49,19 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines =
|
|||
else
|
||||
$status_parent = return_status_agent_module ($id_agent_module_parent);
|
||||
} else {
|
||||
$interval = get_agent_interval ($id_agent);
|
||||
$id_agent = $layout_data['id_agent'];
|
||||
$agent_interval = get_agent_interval ($id_agent);
|
||||
$sql = sprintf ('SELECT COUNT(*)
|
||||
FROM tagente_estado, tagente_modulo
|
||||
WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
||||
AND tagente_modulo.disabled = 0
|
||||
AND tagente_modulo.id_agente = %d
|
||||
AND (utimestamp >= UNIX_TIMESTAMP() - module_interval * 2
|
||||
AND ((module_interval > 0
|
||||
AND utimestamp >= UNIX_TIMESTAMP() - module_interval * 2)
|
||||
OR (module_interval = 0
|
||||
AND utimestamp >= UNIX_TIMESTAMP() - %d))',
|
||||
$id_agent, $interval * 2);
|
||||
$id_agent, $agent_interval * 2);
|
||||
|
||||
$status = get_db_sql ($sql);
|
||||
$status_parent = $status;
|
||||
}
|
||||
|
|
|
@ -225,9 +225,6 @@ label {
|
|||
th > label {
|
||||
padding-top: 7px;
|
||||
}
|
||||
input:hover {
|
||||
background-color: #d4dccd;
|
||||
}
|
||||
input.chk {margin-right: 0px;
|
||||
border: 0px none;
|
||||
height: 14px;
|
||||
|
@ -750,3 +747,6 @@ select#template, select#action {
|
|||
#label-checkbox-matches_value {
|
||||
display: inline;
|
||||
}
|
||||
input[type=image] {
|
||||
border:0px;
|
||||
}
|
||||
|
|
|
@ -72,31 +72,6 @@ echo '</h1>';
|
|||
|
||||
print_pandora_visual_map ($id_layout);
|
||||
|
||||
$refresh_values = array ();
|
||||
$refresh_values[5] = "5 ". __('Seconds');
|
||||
$refresh_values[30] = "30 ". __('Seconds');
|
||||
$refresh_values[60] = "1 ". __('minutes');
|
||||
$refresh_values[120] = "2 ". __('minutes');
|
||||
$refresh_values[300] = "5 ". __('minutes');
|
||||
$refresh_values[600] = "10 ". __('minutes');
|
||||
$refresh_values[1800] = "30 ". __('minutes');
|
||||
|
||||
$table->width = '500px';
|
||||
$table->data = array ();
|
||||
$table->data[0][0] = __('Autorefresh time');
|
||||
$table->data[0][1] = print_select ($refresh_values, 'refr', $refr, '', 'N/A', 0, true);
|
||||
$table->data[0][2] = print_submit_button (__('Refresh'), '', false, 'class="sub next"', true);
|
||||
|
||||
echo "<div style='height:30px'>";
|
||||
echo "</div>";
|
||||
|
||||
if ($refr) {
|
||||
echo '<div id="countdown">';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo "<div style='height:30px'>";
|
||||
echo "</div>";
|
||||
|
||||
echo '<form method="post" action="index.php?sec=visualc&sec2=operation/visual_console/render_view">';
|
||||
print_input_hidden ('pure', $config["pure"]);
|
||||
|
@ -105,18 +80,9 @@ print_table ($table);
|
|||
echo "</form>";
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="include/styles/countdown.css" type="text/css" />
|
||||
<script type="text/javascript" src="include/javascript/jquery.countdown.js"></script>
|
||||
<script type="text/javascript" src="include/languages/countdown_<?php echo $config['language']?>.js"></script>
|
||||
<script type="text/javascript" src="include/javascript/pandora_visual_console.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
<?php if ($refr) : ?>
|
||||
t = new Date();
|
||||
t.setTime (t.getTime() + <?php echo $refr * 1000; ?>);
|
||||
$.countdown.setDefaults($.countdown.regional["<?php echo $config['language']; ?>"]);
|
||||
$("#countdown").countdown({until: t, format: 'MS', description: '<?php echo __('Until refresh'); ?>'});
|
||||
<?php endif; ?>
|
||||
draw_lines (lines, 'layout_map');
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -692,6 +692,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_data` (
|
|||
`type` tinyint(1) UNSIGNED NOT NULL default 0,
|
||||
`period` INTEGER UNSIGNED NOT NULL default 3600,
|
||||
`id_agente_modulo` mediumint(8) unsigned NOT NULL default '0',
|
||||
`id_agent` int(10) unsigned NOT NULL default 0,
|
||||
`id_layout_linked` INTEGER unsigned NOT NULL default '0',
|
||||
`parent_item` INTEGER UNSIGNED NOT NULL default 0,
|
||||
`label_color` varchar(20) DEFAULT "",
|
||||
|
|
|
@ -29,6 +29,8 @@ ALTER TABLE `tagente_modulo` DROP PRIMARY KEY , ADD PRIMARY KEY
|
|||
|
||||
ALTER TABLE `tagent_access` DROP `timestamp`;
|
||||
|
||||
ALTER TABLE `tlayout_data` ADD `id_agent` int(10) unsigned NOT NULL default 0;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `talert_commands` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`name` varchar(100) NOT NULL default '',
|
||||
|
|
Loading…
Reference in New Issue