2014-04-23 Vanessa Gil <vanessa.gil@artica.es>
* include/functions_ui.php include/ajax/module.php operation/tree.php operation/agentes/estado_monitores.php operation/agentes/status_monitor.php: Changed data view of modules to popup. * include/styles/menu.css: Changed style of menu. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9800 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
19bfd25643
commit
b7a208da82
|
@ -1,3 +1,14 @@
|
|||
2014-04-23 Vanessa Gil <vanessa.gil@artica.es>
|
||||
|
||||
* include/functions_ui.php
|
||||
include/ajax/module.php
|
||||
operation/tree.php
|
||||
operation/agentes/estado_monitores.php
|
||||
operation/agentes/status_monitor.php: Changed
|
||||
data view of modules to popup.
|
||||
|
||||
* include/styles/menu.css: Changed style of menu.
|
||||
|
||||
2014-04-22 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* pandoradb.postgreSQL.sql
|
||||
|
|
|
@ -331,7 +331,7 @@ if ($get_module_detail) {
|
|||
ui_print_error_message(__('No available data to show'));
|
||||
}
|
||||
else {
|
||||
ui_pagination($count, false, $offset);
|
||||
ui_pagination ($count, false, $offset, 0, false, 'offset', true, 'binary_dialog');
|
||||
html_print_table($table);
|
||||
}
|
||||
|
||||
|
|
|
@ -1487,7 +1487,7 @@ function ui_process_page_body ($string, $bitfield) {
|
|||
*
|
||||
* @return string The pagination div or nothing if no pagination needs to be done
|
||||
*/
|
||||
function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $return = false, $offset_name = 'offset', $print_total_items = true) {
|
||||
function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $return = false, $offset_name = 'offset', $print_total_items = true, $other_class = '') {
|
||||
global $config;
|
||||
|
||||
if (empty ($pagination)) {
|
||||
|
@ -1517,7 +1517,7 @@ function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $ret
|
|||
if ($count <= $pagination) {
|
||||
|
||||
if ($print_total_items) {
|
||||
$output = '<div class="pagination">';
|
||||
$output = "<div class='pagination $other_class'>";
|
||||
//Show the count of items
|
||||
$output .= sprintf(__('Total items: %s'), $count);
|
||||
// End div and layout
|
||||
|
@ -1559,7 +1559,7 @@ function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $ret
|
|||
else
|
||||
$inicio_pag = 0;
|
||||
|
||||
$output = '<div class="pagination">';
|
||||
$output = "<div class='pagination $other_class'>";
|
||||
|
||||
//Show the count of items
|
||||
if ($print_total_items) {
|
||||
|
@ -1568,13 +1568,23 @@ function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $ret
|
|||
}
|
||||
|
||||
// Show GOTO FIRST button
|
||||
if ($other_class == '') {
|
||||
$output .= '<a class="pagination go_first" href="'.$url.'&'.$offset_name.'=0">'.html_print_image ("images/go_first.png", true, array ("class" => "bot")).'</a> ';
|
||||
} else {
|
||||
$output .= "<a class='pagination $other_class go_first' href='$url.&$offset_name=0'>".html_print_image ("images/go_first.png", true, array ("class" => "bot"))."</a> ";
|
||||
}
|
||||
|
||||
// Show PREVIOUS button
|
||||
if ($index_page > 0) {
|
||||
$index_page_prev = ($index_page - (floor ($block_limit / 2))) * $pagination;
|
||||
if ($index_page_prev < 0)
|
||||
$index_page_prev = 0;
|
||||
|
||||
if ($other_class == '') {
|
||||
$output .= '<a class="pagination go_rewind" href="'.$url.'&'.$offset_name.'='.$index_page_prev.'">'.html_print_image ("images/go_previous.png", true, array ("class" => "bot")).'</a>';
|
||||
} else {
|
||||
$output .= "<a class='pagination $other_class go_rewind' href='$url &$offset_name = $index_page_prev'>".html_print_image ("images/go_previous.png", true, array ("class" => "bot"))."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
// Draw blocks markers
|
||||
|
@ -1598,7 +1608,11 @@ function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $ret
|
|||
// it must be shown if not round to block limit)
|
||||
$link_offset = $config['block_size'] * $i;
|
||||
|
||||
if ($other_class == '') {
|
||||
$output .= '<a class="pagination offset_' . $link_offset . '" href="'.$url.'&'.$offset_name.'='.$inicio_bloque.'">';
|
||||
} else {
|
||||
$output .= "<a class='pagination $other_class offset_$link_offset' href='$url &$offset_name=$inicio_bloque'>";
|
||||
}
|
||||
$output .= "[ $i ]";
|
||||
|
||||
$output .= '</a></span>';
|
||||
|
@ -1610,7 +1624,12 @@ function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $ret
|
|||
$prox_bloque = ($i + ceil ($block_limit / 2)) * $pagination;
|
||||
if ($prox_bloque > $count)
|
||||
$prox_bloque = ($count -1) - $pagination;
|
||||
|
||||
if ($other_class == '') {
|
||||
$output .= '<a class="pagination go_fastforward" href="'.$url.'&'.$offset_name.'='.$prox_bloque.'">'.html_print_image ("images/go_next.png", true, array ("class" => "bot")).'</a>';
|
||||
} else {
|
||||
$output .= "<a class='pagination $other_class go_fastforward' href='$url&$offset_name=$prox_bloque'>".html_print_image ("images/go_next.png", true, array ("class" => "bot"))."</a>";
|
||||
}
|
||||
$i = $index_counter;
|
||||
}
|
||||
// if exists more registers than i can put in a page (defined by $block_size config parameter)
|
||||
|
@ -1619,7 +1638,12 @@ function ui_pagination ($count, $url = false, $offset = 0, $pagination = 0, $ret
|
|||
// as painted in last block (last integer block).
|
||||
if (($count - $pagination) > 0) {
|
||||
$myoffset = floor (($count - 1) / $pagination) * $pagination;
|
||||
|
||||
if ($other_class == '') {
|
||||
$output .= '<a class="pagination go_last" href="'.$url.'&'.$offset_name.'='.$myoffset.'">'.html_print_image ("images/go_last.png", true, array ("class" => "bot")).'</a>';
|
||||
} else {
|
||||
$output .= "<a class='pagination $other_class go_last' href='$url&$offset_name=$myoffset'>".html_print_image ("images/go_last.png", true, array ("class" => "bot"))."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
// End div and layout
|
||||
|
|
|
@ -111,8 +111,7 @@
|
|||
margin: -20px 0px 0 0; /* Positions it back where it should be */
|
||||
border-left: 1px;
|
||||
}
|
||||
.menu li.has_submenu.selected > img.toggle,
|
||||
.menu li:hover.has_submenu > img.toggle {
|
||||
.menu li.has_submenu > img.toggle{
|
||||
visibility: visible;
|
||||
z-index: 1; /* Positions it on top of the rest */
|
||||
}
|
||||
|
|
|
@ -627,7 +627,8 @@ foreach ($modules as $module) {
|
|||
$link ="winopeng('operation/agentes/stat_win.php?type=$graph_type&period=86400&id=".$module["id_agente_modulo"]."&label=".base64_encode($module["nombre"])."&refresh=600','day_".$win_handle."')";
|
||||
|
||||
$data[8] .= '<a href="javascript:'.$link.'">' . html_print_image("images/chart_curve.png", true, array("border" => '0', "alt" => "")) . '</a> ';
|
||||
$data[8] .= "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data_view&period=86400&id=".$module["id_agente_modulo"]."'>" . html_print_image('images/binary.png', true, array("border" => '0', "alt" => "")) . "</a>";
|
||||
$server_name = '';
|
||||
$data[8] .= "<a href='javascript: show_module_detail_dialog(" . $module["id_agente_modulo"] . ", ". $id_agente.", \"" . $server_name . "\", 0, 86400)'>". html_print_image ("images/binary.png", true, array ("border" => "0", "alt" => "")) . "</a>";
|
||||
}
|
||||
|
||||
if ($module['estado'] == 3) {
|
||||
|
@ -689,6 +690,13 @@ unset ($table_data);
|
|||
|
||||
ui_require_css_file ('cluetip');
|
||||
ui_require_jquery_file ('cluetip');
|
||||
|
||||
echo "<div id='module_details_dialog'></div>";
|
||||
ui_require_jquery_file ("ui-timepicker-addon");
|
||||
|
||||
// This script is included manually to be included after jquery and avoid error
|
||||
echo '<script type="text/javascript" src="' . ui_get_full_url('include/javascript/i18n/jquery-ui-timepicker-' . get_user_language() . '.js', false, false, false) . '"></script>';
|
||||
ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascript/i18n/");
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
@ -709,6 +717,86 @@ ui_require_jquery_file ('cluetip');
|
|||
mouseOutClose: 'both',
|
||||
closeText: '<?php html_print_image("images/cancel.png") ?>'
|
||||
});
|
||||
|
||||
// Show the modal window of an module
|
||||
function show_module_detail_dialog(module_id, id_agent, server_name, offset, period) {
|
||||
|
||||
var server_name = '';
|
||||
var extra_parameters = '';
|
||||
if (period == -1) {
|
||||
|
||||
period = $('#period').val();
|
||||
|
||||
var selection_mode = $('input[name=selection_mode]:checked').val();
|
||||
var date_from = $('#text-date_from').val();
|
||||
var time_from = $('#text-time_from').val();
|
||||
var date_to = $('#text-date_to').val();
|
||||
var time_to = $('#text-time_to').val();
|
||||
|
||||
extra_parameters = '&selection_mode=' + selection_mode + '&date_from=' + date_from + '&date_to=' + date_to + '&time_from=' + time_from + '&time_to=' + time_to;
|
||||
}
|
||||
|
||||
$.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 + extra_parameters,
|
||||
dataType: "html",
|
||||
success: function(data) {
|
||||
$("#module_details_dialog").hide ()
|
||||
.empty ()
|
||||
.append (data)
|
||||
.dialog ({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
width: 650,
|
||||
height: 500
|
||||
})
|
||||
.show ();
|
||||
refresh_pagination_callback (module_id, id_agent, "");
|
||||
datetime_picker_callback();
|
||||
forced_title_callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
function datetime_picker_callback() {
|
||||
|
||||
$("#text-time_from, #text-time_to").timepicker({
|
||||
showSecond: true,
|
||||
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
||||
timeOnlyTitle: '<?php echo __('Choose time');?>',
|
||||
timeText: '<?php echo __('Time');?>',
|
||||
hourText: '<?php echo __('Hour');?>',
|
||||
minuteText: '<?php echo __('Minute');?>',
|
||||
secondText: '<?php echo __('Second');?>',
|
||||
currentText: '<?php echo __('Now');?>',
|
||||
closeText: '<?php echo __('Close');?>'});
|
||||
|
||||
$("#text-date_from, #text-date_to").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
|
||||
|
||||
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
|
||||
}
|
||||
datetime_picker_callback();
|
||||
|
||||
function refresh_pagination_callback (module_id, id_agent, server_name) {
|
||||
$(".binary_dialog").click( function() {
|
||||
|
||||
var classes = $(this).attr('class');
|
||||
classes = classes.split(' ');
|
||||
var offset_class = classes[2];
|
||||
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>
|
||||
<?php
|
||||
|
|
|
@ -1292,10 +1292,11 @@ ui_require_javascript_file('pandora_modules');
|
|||
}
|
||||
|
||||
function refresh_pagination_callback (module_id, id_agent, server_name) {
|
||||
$(".pagination").click( function() {
|
||||
|
||||
$(".binary_dialog").click( function() {
|
||||
var classes = $(this).attr('class');
|
||||
classes = classes.split(' ');
|
||||
var offset_class = classes[1];
|
||||
var offset_class = classes[2];
|
||||
offset_class = offset_class.split('_');
|
||||
var offset = offset_class[1];
|
||||
|
||||
|
|
|
@ -903,10 +903,12 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
|
|||
datetime_picker_callback();
|
||||
|
||||
function refresh_pagination_callback (module_id, id_agent, server_name) {
|
||||
$(".pagination").click( function() {
|
||||
|
||||
$(".binary_dialog").click( function() {
|
||||
|
||||
var classes = $(this).attr('class');
|
||||
classes = classes.split(' ');
|
||||
var offset_class = classes[1];
|
||||
var offset_class = classes[2];
|
||||
offset_class = offset_class.split('_');
|
||||
var offset = offset_class[1];
|
||||
|
||||
|
|
Loading…
Reference in New Issue