From ebe95af69ed2a83fb9b04824299e883ccde9f45c Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 20 Apr 2015 10:40:42 +0200 Subject: [PATCH] Add title when open visual data in treeview and status monitor, tiquet: #2077 --- pandora_console/include/ajax/module.php | 7 +++++-- .../include/javascript/tree/TreeController.js | 2 +- .../operation/agentes/estado_monitores.php | 11 ++++++----- .../operation/agentes/status_monitor.php | 14 +++++++------- pandora_console/operation/tree.php | 11 ++++++----- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index b878439a2b..faec4b0753 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -127,7 +127,10 @@ if ($get_module_detail) { 'style="margin-right: 15px;"', true) . __("Choose a time from now"); $formtable->data[0][1] = html_print_select ($periods, 'period', $period, '', '', 0, true, false, false); $formtable->data[0][2] = ''; - $formtable->data[0][3] = "". html_print_image ("images/refresh.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . ""; + $formtable->data[0][3] = "" . + html_print_image ("images/refresh.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . + ""; $formtable->rowspan[0][3] = 2; $formtable->cellstyle[0][3] = 'vertical-align: middle;'; @@ -1012,7 +1015,7 @@ if ($list_modules) { $id_agente . ", " . "\"" . $server_name . "\", " . 0 . ", " . - SECONDS_1DAY . ")'>". html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . ""; + SECONDS_1DAY . ', "' . $module["module_name"] . ")'>". html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . ""; } if ($module['estado'] == 3) { diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 27fd11c91c..8151b9cdac 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -390,7 +390,7 @@ TreeController = { try { var serverName = element.serverName.length > 0 ? element.serverName : ''; if ($("#module_details_window").length > 0) - show_module_detail_dialog(element.id, '', serverName, 0, 86400); + show_module_detail_dialog(element.id, '', serverName, 0, 86400, element.name.replace(" ", " ") ); } catch (error) { // console.log(error); diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index a35480d001..7ed66d8a0e 100755 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -331,7 +331,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri }); // Show the modal window of an module - function show_module_detail_dialog(module_id, id_agent, server_name, offset, period) { + function show_module_detail_dialog(module_id, id_agent, server_name, offset, period,module_name) { var server_name = ''; var extra_parameters = ''; @@ -347,7 +347,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri extra_parameters = '&selection_mode=' + selection_mode + '&date_from=' + date_from + '&date_to=' + date_to + '&time_from=' + time_from + '&time_to=' + time_to; } - + title = ; $.ajax({ type: "POST", url: "", @@ -361,6 +361,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri resizable: true, draggable: true, modal: true, + title: title + module_name, overlay: { opacity: 0.5, background: "black" @@ -369,7 +370,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri height: 500 }) .show (); - refresh_pagination_callback (module_id, id_agent, ""); + refresh_pagination_callback (module_id, id_agent, "",module_name); datetime_picker_callback(); forced_title_callback(); } @@ -394,7 +395,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri } datetime_picker_callback(); - function refresh_pagination_callback (module_id, id_agent, server_name) { + function refresh_pagination_callback (module_id, id_agent, server_name,module_name) { $(".binary_dialog").click( function() { var classes = $(this).attr('class'); @@ -405,7 +406,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri var period = $('#period').val(); - show_module_detail_dialog(module_id, id_agent, server_name, offset, period); + show_module_detail_dialog(module_id, id_agent, server_name, offset, period,module_name); return false; }); } diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index e35450d2b5..dca6cf120d 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1223,7 +1223,7 @@ foreach ($result as $row) { "show_module_detail_dialog(" . $row["id_agente_modulo"] . ", ". $row['id_agent'] . ", \"" . - $row['server_name'] . "\", 0, " . SECONDS_1DAY . ")'>" . + $row['server_name'] . "\", 0, " . SECONDS_1DAY . ', "' . $row["module_name"] . "\")'>" . html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . ""; @@ -1388,7 +1388,7 @@ ui_require_javascript_file('pandora_modules'); } // Show the modal window of an module - function show_module_detail_dialog(module_id, id_agent, server_name, offset, period) { + function show_module_detail_dialog(module_id, id_agent, server_name, offset, period, module_name) { if (period == -1) { if ($("#period").length == 1) { period = $('#period').val(); @@ -1397,8 +1397,7 @@ ui_require_javascript_file('pandora_modules'); period = ; } } - valor = $("hidden_name_module_"+module_id); - console.log(valor); + title = ; $.ajax({ type: "POST", url: "", @@ -1412,6 +1411,7 @@ ui_require_javascript_file('pandora_modules'); resizable: true, draggable: true, modal: true, + title: title + module_name, overlay: { opacity: 0.5, background: "black" @@ -1421,12 +1421,12 @@ ui_require_javascript_file('pandora_modules'); }) .show (); - refresh_pagination_callback (module_id, id_agent, server_name); + refresh_pagination_callback (module_id, id_agent, server_name,module_name); } }); } - function refresh_pagination_callback (module_id, id_agent, server_name) { + function refresh_pagination_callback (module_id, id_agent, server_name,module_name) { $(".binary_dialog").click( function() { var classes = $(this).attr('class'); @@ -1437,7 +1437,7 @@ ui_require_javascript_file('pandora_modules'); var period = $('#period').val(); - show_module_detail_dialog(module_id, id_agent, server_name, offset, period); + show_module_detail_dialog(module_id, id_agent, server_name, offset, period,module_name); return false; }); diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index a26cf387bb..0d1a0c4ebf 100755 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -327,7 +327,7 @@ enterprise_hook('close_meta_frame'); .prop("id", "module_details_window") .appendTo('body'); - function show_module_detail_dialog(module_id, id_agent, server_name, offset, period) { + function show_module_detail_dialog(module_id, id_agent, server_name, offset, period, module_name) { var params = {}; var f = new Date(); period = $('#period').val(); @@ -350,7 +350,7 @@ enterprise_hook('close_meta_frame'); params.id_module = module_id; params.offset = offset; params.period = period; - + title = ; $.ajax({ type: "POST", url: "", @@ -364,6 +364,7 @@ enterprise_hook('close_meta_frame'); resizable: true, draggable: true, modal: true, + title: title + module_name, overlay: { opacity: 0.5, background: "black" @@ -372,7 +373,7 @@ enterprise_hook('close_meta_frame'); height: 500 }) .show (); - refresh_pagination_callback(module_id, id_agent, server_name); + refresh_pagination_callback(module_id, id_agent, server_name, module_name); datetime_picker_callback(); forced_title_callback(); } @@ -396,7 +397,7 @@ enterprise_hook('close_meta_frame'); } - function refresh_pagination_callback (module_id, id_agent, server_name) { + function refresh_pagination_callback (module_id, id_agent, server_name,module_name) { $(".binary_dialog").click( function() { @@ -408,7 +409,7 @@ enterprise_hook('close_meta_frame'); var period = $('#period').val(); - show_module_detail_dialog(module_id, id_agent, server_name, offset, period); + show_module_detail_dialog(module_id, id_agent, server_name, offset, period,module_name); return false; }); }