From cef5c478e961c57abc00900e1a8af0d9a1de1474 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 2 Mar 2023 17:17:10 +0100 Subject: [PATCH] Graph viewer and graph template item editor visual --- .../operation/reporting/graph_viewer.php | 131 ++++++++++++------ 1 file changed, 89 insertions(+), 42 deletions(-) diff --git a/pandora_console/operation/reporting/graph_viewer.php b/pandora_console/operation/reporting/graph_viewer.php index c77d02245e..e4e7a7ce48 100644 --- a/pandora_console/operation/reporting/graph_viewer.php +++ b/pandora_console/operation/reporting/graph_viewer.php @@ -312,31 +312,43 @@ if ($view_graph) { } $period_label = human_time_description_raw($period); - echo '
'; - echo ""; - echo ''; + $searchForm = ''; + $searchForm .= "
"; + $searchForm .= ''; - echo ''; - - echo ''; - - echo ''; - - echo "'; - - echo "'; - - echo "'; + $searchForm .= "'; + $searchForm .= ''; + $searchForm .= "'; + $searchForm .= html_print_label_input_block(__('Type'), html_print_select($stackeds, 'stacked', $stacked, '', '', -1, true, false, true, '', false, 'width:100%')); + $searchForm .= ''; + $searchForm .= "'; - echo "'; - - echo "'; + $searchForm .= html_print_label_input_block(__('Zoom'), html_print_select($zooms, 'zoom', $zoom, '', '', 0, true, false, true, '', false, 'width:100%')); + $searchForm .= ''; - echo "'; + $searchForm .= ''; + $searchForm .= '
'; - echo ''.__('Date').''; - echo ''; - echo html_print_input_text('date', $date, '', 12, 10, true).' '; - echo ''; - echo html_print_input_text('time', $time, '', 7, 7, true).' '; - echo '"; - echo ''.__('Time range').''; - echo '"; - echo html_print_extended_select_for_time('period', $period, '', '', '0', 10, true); - echo '"; + $searchForm .= ''; + $searchForm .= html_print_label_input_block( + __('Date'), + html_print_input_text( + 'date', + $date, + '', + '', + 10, + true + ) + ); + $searchForm .= ''; + $searchForm .= html_print_label_input_block( + __('Time'), + html_print_input_text( + 'time', + $time, + '', + '', + 7, + true + ) + ); + $searchForm .= '"; + $searchForm .= html_print_label_input_block( + __('Time range'), + html_print_extended_select_for_time('period', $period, '', '', '0', 10, true, 'width:100%') + ); + $searchForm .= '
"; $stackeds = []; $stackeds[0] = __('Graph defined'); $stackeds[CUSTOM_GRAPH_AREA] = __('Area'); @@ -348,32 +360,67 @@ if ($view_graph) { $stackeds[CUSTOM_GRAPH_HBARS] = __('Horizontal Bars'); $stackeds[CUSTOM_GRAPH_VBARS] = __('Vertical Bars'); $stackeds[CUSTOM_GRAPH_PIE] = __('Pie'); - html_print_select($stackeds, 'stacked', $stacked, '', '', -1, false, false); - echo '"; + $searchForm .= html_print_label_input_block( + __('Equalize maxiddmum thresholds').ui_print_help_tip( + __('If an option is selected, all graphs will have the highest value from all modules included in the graph as a maximum threshold'), + true + ), + html_print_checkbox( + 'threshold', + CUSTOM_GRAPH_BULLET_CHART_THRESHOLD, + $check, + true, + false, + '', + false + ) + ); + $searchForm .= ''; + $searchForm .= '"; - echo "
  ".__('Equalize maxiddmum thresholds').''.ui_print_help_tip(__('If an option is selected, all graphs will have the highest value from all modules included in the graph as a maximum threshold'), true); - - html_print_checkbox('threshold', CUSTOM_GRAPH_BULLET_CHART_THRESHOLD, $check, false, false, '', false); - echo '
'; - echo '
"; + $searchForm .= ""; $zooms = []; $zooms[0] = __('Graph defined'); $zooms[1] = __('Zoom x1'); $zooms[2] = __('Zoom x2'); $zooms[3] = __('Zoom x3'); - html_print_select($zooms, 'zoom', $zoom, '', '', 0); - echo '"; - echo ""; - echo '
'; + $searchForm .= html_print_div( + [ + 'class' => 'action-buttons', + 'content' => html_print_submit_button( + __('Filter'), + 'submit-refresh', + false, + [ + 'mode' => 'mini', + 'icon' => 'search', + ], + true + ), + ], + true + ); + $searchForm .= '
'; - echo ''; - echo ''; - echo ''; + ui_toggle( + $searchForm, + ''.__('Filters').'', + 'filter_form', + '', + true, + false, + '', + 'white-box-content', + 'box-flat white_table_graph fixed_filter_bar' + ); if ($graph_return) { echo "";