From 008823c88f01b133551a15b1eff367bb361156d0 Mon Sep 17 00:00:00 2001 From: vgilc <noreply@pandorafms.org> Date: Fri, 15 Mar 2013 12:06:49 +0000 Subject: [PATCH] 2013-03-15 Vanessa Gil <vanessa.gil@artica.es> * include/functions_ui.php operation/agentes/status_monitor: Added popup with data module, remove column 'tags' and changed font size to column 'timestamp'. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7855 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 ++ pandora_console/include/functions_ui.php | 2 +- .../operation/agentes/status_monitor.php | 69 +++++++++++++++++-- 3 files changed, 72 insertions(+), 6 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index abb23ecaaf..aaafa8e652 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2013-03-15 Vanessa Gil <vanessa.gil@artica.es> + + * include/functions_ui.php + operation/agentes/status_monitor: Added popup with data + module, remove column 'tags' and changed font size to + column 'timestamp'. + 2013-03-15 Vanessa Gil <vanessa.gil@artica.es> * include/functions_treeview.php diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 3ed7a177fb..ff7a27803f 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -429,7 +429,7 @@ function ui_print_timestamp ($unixtime, $return = false, $option = array ()) { default: //Usually tags have title attributes, so by default we add, //then fall through to add attributes and data - $output .= ' title="'.$title.'">'.$data.'</'.$tag.'>'; + $output .= ' title="'.$title.'" '.$style.'>'.$data.'</'.$tag.'>'; break; case "h1": case "h2": diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 70e7d53169..652744c63b 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -783,7 +783,9 @@ if (! defined ('METACONSOLE')) { '<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . '&sort_field=module_name&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleNameDown, "alt" => "down")) . '</a>'; } +/* $table->head[4] = __('Tags'); +*/ $table->head[5] = __('Interval'); if (! defined ('METACONSOLE')) { @@ -911,8 +913,13 @@ foreach ($result as $row) { if ($row["extended_info"] != "") { $data[3] .= ui_print_help_tip ($row["extended_info"], true, '/images/comments.png'); } + if ($row["tags"] != "") { + $data[3] .= ui_print_help_tip ($row["tags"], true, '/images/tip.png'); + } +/* $data[4] = ui_print_truncate_text($row['tags'], 'agent_small', false, true, true, '[…]', 'font-size:7pt;'); +*/ $data[5] = ($row['module_interval'] == 0) ? human_time_description_raw($row['agent_interval']) : human_time_description_raw($row['module_interval']); @@ -973,12 +980,13 @@ foreach ($result as $row) { $data[7] = '<a href="javascript:'.$link.'">' . html_print_image("images/chart_curve.png", true, array("border" => '0', "alt" => "")) . '</a>'; if (defined('METACONSOLE')) - $data[7] .= " <a href='" . $row['server_url'] . "index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$row["id_agent"]."&tab=data_view&period=86400&loginhash=auto&loginhash_data=" . $row["hashdata"] . "&loginhash_user=" . $row["user"] . "&id=".$row["id_agente_modulo"]."'>" . html_print_image('images/binary.png', true, array("style" => '0', "alt" => '')) . "</a>"; + //$data[7] .= " <a href='" . $row['server_url'] . "index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$row["id_agent"]."&tab=data_view&period=86400&loginhash=auto&loginhash_data=" . $row["hashdata"] . "&loginhash_user=" . $row["user"] . "&id=".$row["id_agente_modulo"]."'>" . html_print_image('images/binary.png', true, array("style" => '0', "alt" => '')) . "</a>"; + $data[7] .= "<a href='javascript: show_module_detail_dialog(" . $row["id_agente_modulo"] . ", ". $row['id_agent'].", \"" . $row['server_name'] . "\", 0, 86400)'>". html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . "</a>"; else $data[7] .= " <a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$row["id_agent"]."&tab=data_view&period=86400&id=".$row["id_agente_modulo"]."'>" . html_print_image('images/binary.png', true, array("style" => '0', "alt" => '')) . "</a>"; } - + $data[8] = ui_print_module_warn_value($row['max_warning'], $row['min_warning'], $row['str_warning'], $row['max_critical'], $row['min_critical'], $row['str_critical']); if (is_numeric($row["datos"])) { @@ -1052,10 +1060,10 @@ foreach ($result as $row) { $interval = $row["agent_interval"]; if ($row['estado'] == 3) { - $option = array ("html_attr" => 'class="redb"'); + $option = array ("html_attr" => 'class="redb"',"style" => 'font-size:7pt;'); } else { - $option = array (); + $option = array ("style" => 'font-size:7pt;'); } $data[10] = ui_print_timestamp ($row["utimestamp"], true, $option); @@ -1067,6 +1075,10 @@ if (!empty ($table->data)) { else { echo "<div class='nf'>".__('This group doesn\'t have any monitor')."</div>"; } + +echo "<div id='monitor_details_window'></div>"; +ui_require_javascript_file('pandora_modules'); + ?> <script type="text/javascript"> function toggle_full_value(id) { @@ -1077,4 +1089,51 @@ else { $("#value_module_text_" + id).html(text); } -</script> \ No newline at end of file + + // Show the modal window of an module + function show_module_detail_dialog(module_id, id_agent, server_name, offset, period) { + if (period == -1) { + period = $('#period').val(); + } + $.ajax({ + type: "POST", + url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>", + data: "page=include/ajax/module&get_module_detail=1&server_name="+server_name+"&id_agent="+id_agent+"&id_module=" + module_id+"&offset="+offset+"&period="+period, + dataType: "html", + success: function(data){ + $("#monitor_details_window").hide () + .empty () + .append (data) + .dialog ({ + resizable: true, + draggable: true, + modal: true, + overlay: { + opacity: 0.5, + background: "black" + }, + width: 620, + height: 500 + }) + .show (); + refresh_pagination_callback (module_id, id_agent, server_name); + + } + }); + } + + function refresh_pagination_callback (module_id, id_agent, server_name) { + $(".pagination").click( function() { + var classes = $(this).attr('class'); + classes = classes.split(' '); + var offset_class = classes[1]; + offset_class = offset_class.split('_'); + var offset = offset_class[1]; + + var period = $('#period').val(); + + show_module_detail_dialog(module_id, id_agent, server_name, offset, period); + return false; + }); + } +</script>