From 283be8f63265883ffb2629aaa5f7bd2194983bfe Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Tue, 7 May 2019 16:07:07 +0200 Subject: [PATCH] New menu module graph - #3617 --- pandora_console/include/ajax/module.php | 4 +- pandora_console/include/styles/pandora.css | 63 +++++++++ .../operation/agentes/stat_win.php | 120 ++++++++---------- 3 files changed, 117 insertions(+), 70 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 7ce37005ea..7b11249f18 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -1120,11 +1120,11 @@ if (check_login()) { $draw_events = 0; } - $link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module['id_agente_modulo'].'&'.'label='.rawurlencode( + $link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module['id_agente_modulo'].'&'.'label='.rawurlencode( urlencode( base64_encode($module['nombre']) ) - ).'&'.'refresh='.SECONDS_10MINUTES.'&'."draw_events=$draw_events', 'day_".$win_handle."')"; + ).'&'.'refresh='.SECONDS_10MINUTES.'&'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 650)"; if (!is_snapshot_data($module['datos'])) { $data[8] .= ''.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'   '; } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index bd0001b769..a897c26247 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -5438,3 +5438,66 @@ table.info_table.policy_sub_table { margin-top: 0px; align-items: flex-start; } + +/* mergear esto antes */ + +table.events_show_more_table tr:nth-child(odd) td { + background-color: #ffffff; +} +table.events_show_more_table tr:nth-child(even) td { + background-color: #f5f5f5; + border-top: 1px solid #cacaca; + border-bottom: 1px solid #cacaca; +} + +table.events_show_more_table tr td { + height: 22px; + padding: 4px; +} + +table.events_show_more_table tr td:first-child { + width: 35%; + font-weight: bold; + padding-left: 20px; +} + +/* nuevassss */ +.module_graph_menu_dropdown { + padding-top: 20px; + padding-bottom: 20px; + position: absolute; + top: 10px; + width: 100%; + z-index: 1; +} + +.module_graph_menu_content, +.module_graph_menu_header { + width: 92%; + border: 1px solid #e2e2e2; + margin: 0 auto; + box-sizing: border-box; + background-color: #fff; +} + +.module_graph_menu_content { + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + padding: 15px; + border-top: none; +} + +.module_graph_menu_header { + border-top-left-radius: 4px; + border-top-right-radius: 4px; + padding: 6px 10px; + cursor: pointer; + display: flex; + justify-content: space-between; + align-items: center; +} + +.module_graph_menu_header span > img { + vertical-align: middle; + padding-left: 5px; +} diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 78cd56cfcc..767bc3de2a 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -89,7 +89,7 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); }; - + "; @@ -175,8 +175,28 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); $unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id); - echo '
'; + + // MENU + $menu_form = "
".html_print_input_hidden('id', $id, true).html_print_input_hidden('label', $label, true); + + if (!empty($server_id)) { + $menu_form .= html_print_input_hidden('server', $server_id, true); + } + + if (isset($_GET['type'])) { + $type = get_parameter_get('type'); + $menu_form .= html_print_input_hidden('type', $type, true); + } + + echo $menu_form; + + echo ''; + + echo '
'; + + + echo '
'; $width = '90%'; $height = '450'; @@ -228,39 +248,16 @@ $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); echo '
'; - // - // SIDE MENU - // - $params = []; - // TOP TEXT - // Use the no_meta parameter because this image is only in the base console - $params['top_text'] = "
".html_print_image('images/wrench_blanco.png', true, ['width' => '16px'], false, false, true).' '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_w.png', true).'
'; - $params['body_text'] = "'; - unset($table); - $table = new stdClass(); - $table->id = 'stat_win_form'; - $table->width = '100%'; - $table->cellspacing = 2; - $table->cellpadding = 2; - $table->class = 'databox'; - $data = []; - $data[0] = html_print_div( - [ - 'id' => 'field_list', - 'content' => $form_table, - 'style' => 'overflow: auto; height: 220px', - ], - true - ); - $table->data[] = $data; - $table->rowclass[] = ''; - - $params['body_text'] .= html_print_table($table, true); - $params['body_text'] .= ''; - $params['body_text'] .= '
'; - // outer - // ICONS - $params['icon_closed'] = '/images/graphmenu_arrow_hide.png'; - $params['icon_open'] = '/images/graphmenu_arrow.png'; - - // SIZE - $params['width'] = 500; - - // POSITION - $params['position'] = 'left'; - - html_print_side_layer($params); + echo '
+
+ show/hide + '.__('Graph configuration menu').ui_print_help_icon('graphs', true, $config['homeurl'], 'images/help_g.png', true).' + Manage +
+ +
'; // Hidden div to forced title html_print_div( @@ -491,11 +462,24 @@ ui_include_time_picker(true); $.datepicker.setDefaults($.datepicker.regional[""]); - $(window).ready(function() { - $("#field_list").css('height', ($(window).height() - 160) + 'px'); +//$(window).ready(function() { + $('.print_menu').append($('.module_graph_menu_dropdown')); +//}); + + + $('#module_graph_menu_header').on('click', function(){ + if( $('.module_graph_menu_content').hasClass('module_graph_menu_content_closed')){ + $('.module_graph_menu_content').show(); + $('.module_graph_menu_content').removeClass('module_graph_menu_content_closed'); + $('#module_graph_menu_header .imagen').attr('src',$('#module_graph_menu_header .imagen').attr('src').replace('arrow_down_green','arrow_up_green')) + } + else{ + $('.module_graph_menu_content').hide(); + $('.module_graph_menu_content').addClass('module_graph_menu_content_closed'); + $('#module_graph_menu_header .imagen').attr('src',$('#module_graph_menu_header .imagen').attr('src').replace('arrow_up_green','arrow_down_green')) + } + + }); - $(window).resize(function() { - $("#field_list").css('height', ($(document).height() - 160) + 'px'); - });