Add title when open visual data in treeview and status monitor, tiquet: #2077

This commit is contained in:
m-lopez-f 2015-04-20 10:40:42 +02:00
parent 744f082841
commit ebe95af69e
5 changed files with 25 additions and 20 deletions

View File

@ -127,7 +127,10 @@ if ($get_module_detail) {
'style="margin-right: 15px;"', true) . __("Choose a time from now"); '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][1] = html_print_select ($periods, 'period', $period, '', '', 0, true, false, false);
$formtable->data[0][2] = ''; $formtable->data[0][2] = '';
$formtable->data[0][3] = "<a href='javascript: show_module_detail_dialog(" . $module_id .", ". $agentId.", \"" . $server_name . "\", 0, -1)'>". html_print_image ("images/refresh.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . "</a>"; $formtable->data[0][3] = "<a href='javascript: show_module_detail_dialog(" . $module_id .", ". $agentId.", \"" . $server_name .
"\", 0, -1,\"" . modules_get_agentmodule_name( $module_id ) . "\")'>" .
html_print_image ("images/refresh.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) .
"</a>";
$formtable->rowspan[0][3] = 2; $formtable->rowspan[0][3] = 2;
$formtable->cellstyle[0][3] = 'vertical-align: middle;'; $formtable->cellstyle[0][3] = 'vertical-align: middle;';
@ -1012,7 +1015,7 @@ if ($list_modules) {
$id_agente . ", " . $id_agente . ", " .
"\"" . $server_name . "\", " . "\"" . $server_name . "\", " .
0 . ", " . 0 . ", " .
SECONDS_1DAY . ")'>". html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . "</a>"; SECONDS_1DAY . ', "' . $module["module_name"] . ")'>". html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . "</a>";
} }
if ($module['estado'] == 3) { if ($module['estado'] == 3) {

View File

@ -390,7 +390,7 @@ TreeController = {
try { try {
var serverName = element.serverName.length > 0 ? element.serverName : ''; var serverName = element.serverName.length > 0 ? element.serverName : '';
if ($("#module_details_window").length > 0) 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("&#x20;", " ") );
} }
catch (error) { catch (error) {
// console.log(error); // console.log(error);

View File

@ -331,7 +331,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
}); });
// Show the modal window of an module // 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 server_name = '';
var extra_parameters = ''; 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; extra_parameters = '&selection_mode=' + selection_mode + '&date_from=' + date_from + '&date_to=' + date_to + '&time_from=' + time_from + '&time_to=' + time_to;
} }
title = <?php echo "\"" . __("Module: ") . "\"" ?>;
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>", url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
@ -361,6 +361,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: true, modal: true,
title: title + module_name,
overlay: { overlay: {
opacity: 0.5, opacity: 0.5,
background: "black" background: "black"
@ -369,7 +370,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
height: 500 height: 500
}) })
.show (); .show ();
refresh_pagination_callback (module_id, id_agent, ""); refresh_pagination_callback (module_id, id_agent, "",module_name);
datetime_picker_callback(); datetime_picker_callback();
forced_title_callback(); forced_title_callback();
} }
@ -394,7 +395,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
} }
datetime_picker_callback(); 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() { $(".binary_dialog").click( function() {
var classes = $(this).attr('class'); var classes = $(this).attr('class');
@ -405,7 +406,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
var period = $('#period').val(); 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; return false;
}); });
} }

View File

@ -1223,7 +1223,7 @@ foreach ($result as $row) {
"show_module_detail_dialog(" . "show_module_detail_dialog(" .
$row["id_agente_modulo"] . ", ". $row["id_agente_modulo"] . ", ".
$row['id_agent'] . ", \"" . $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, html_print_image ("images/binary.png", true,
array ("border" => "0", "alt" => "")) . "</a>"; array ("border" => "0", "alt" => "")) . "</a>";
@ -1388,7 +1388,7 @@ ui_require_javascript_file('pandora_modules');
} }
// Show the modal window of an module // 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 == -1) {
if ($("#period").length == 1) { if ($("#period").length == 1) {
period = $('#period').val(); period = $('#period').val();
@ -1397,8 +1397,7 @@ ui_require_javascript_file('pandora_modules');
period = <?php echo SECONDS_1DAY; ?>; period = <?php echo SECONDS_1DAY; ?>;
} }
} }
valor = $("hidden_name_module_"+module_id); title = <?php echo "\"" . __("Module: ") . "\"" ?>;
console.log(valor);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>", url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
@ -1412,6 +1411,7 @@ ui_require_javascript_file('pandora_modules');
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: true, modal: true,
title: title + module_name,
overlay: { overlay: {
opacity: 0.5, opacity: 0.5,
background: "black" background: "black"
@ -1421,12 +1421,12 @@ ui_require_javascript_file('pandora_modules');
}) })
.show (); .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() { $(".binary_dialog").click( function() {
var classes = $(this).attr('class'); var classes = $(this).attr('class');
@ -1437,7 +1437,7 @@ ui_require_javascript_file('pandora_modules');
var period = $('#period').val(); 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; return false;
}); });

View File

@ -327,7 +327,7 @@ enterprise_hook('close_meta_frame');
.prop("id", "module_details_window") .prop("id", "module_details_window")
.appendTo('body'); .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 params = {};
var f = new Date(); var f = new Date();
period = $('#period').val(); period = $('#period').val();
@ -350,7 +350,7 @@ enterprise_hook('close_meta_frame');
params.id_module = module_id; params.id_module = module_id;
params.offset = offset; params.offset = offset;
params.period = period; params.period = period;
title = <?php echo "'" . __("Module: ") . "'" ?> ;
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>", url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
@ -364,6 +364,7 @@ enterprise_hook('close_meta_frame');
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: true, modal: true,
title: title + module_name,
overlay: { overlay: {
opacity: 0.5, opacity: 0.5,
background: "black" background: "black"
@ -372,7 +373,7 @@ enterprise_hook('close_meta_frame');
height: 500 height: 500
}) })
.show (); .show ();
refresh_pagination_callback(module_id, id_agent, server_name); refresh_pagination_callback(module_id, id_agent, server_name, module_name);
datetime_picker_callback(); datetime_picker_callback();
forced_title_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() { $(".binary_dialog").click( function() {
@ -408,7 +409,7 @@ enterprise_hook('close_meta_frame');
var period = $('#period').val(); 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; return false;
}); });
} }