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");
$formtable->data[0][1] = html_print_select ($periods, 'period', $period, '', '', 0, true, false, false);
$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->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" => "")) . "</a>";
SECONDS_1DAY . ', "' . $module["module_name"] . ")'>". html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . "</a>";
}
if ($module['estado'] == 3) {

View File

@ -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("&#x20;", " ") );
}
catch (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
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 = <?php echo "\"" . __("Module: ") . "\"" ?>;
$.ajax({
type: "POST",
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,
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;
});
}

View File

@ -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" => "")) . "</a>";
@ -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 = <?php echo SECONDS_1DAY; ?>;
}
}
valor = $("hidden_name_module_"+module_id);
console.log(valor);
title = <?php echo "\"" . __("Module: ") . "\"" ?>;
$.ajax({
type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
@ -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;
});

View File

@ -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 = <?php echo "'" . __("Module: ") . "'" ?> ;
$.ajax({
type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
@ -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;
});
}