From 97b249d5a5152c3d718551e65ef016dcd2101218 Mon Sep 17 00:00:00 2001 From: "jose.gonzalez@pandorafms.com" Date: Fri, 28 Oct 2022 10:54:30 +0200 Subject: [PATCH] Improved color picker --- .../godmode/setup/setup_visuals.php | 127 +++--------------- .../include/styles/js/color-picker.css | 3 +- pandora_console/include/styles/pandora.css | 13 ++ 3 files changed, 31 insertions(+), 112 deletions(-) diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 3e0e5cc817..be9d8faaa6 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -102,7 +102,6 @@ $table_behaviour->data[$row][0] = __('Display text when proc modules have state $table_behaviour->data[$row][1] = html_print_input_text('render_proc_fail', $config['render_proc_fail'], '', 25, 25, true); $row++; -// Daniel maya 02/06/2016 Display menu with click --INI $table_behaviour->data[$row][0] = __('Click to display lateral menus'); $table_behaviour->data[$row][1] = html_print_checkbox_switch( 'click_display', @@ -111,8 +110,8 @@ $table_behaviour->data[$row][1] = html_print_checkbox_switch( true ); $row++; -// Daniel maya 02/06/2016 Display menu with click --END -if (enterprise_installed()) { + +if (enterprise_installed() === true) { $table_behaviour->data[$row][0] = __('Service label font size'); $table_behaviour->data[$row][1] = html_print_input_text('service_label_font_size', $config['service_label_font_size'], '', 5, 5, true); $row++; @@ -853,118 +852,24 @@ $table_chars = new stdClass(); $table_chars->width = '100%'; $table_chars->class = 'databox filters'; $table_chars->style[0] = 'font-weight: bold;'; +$table_chars->style[1] = 'display: flex;'; $table_chars->size[0] = '50%'; $table_chars->data = []; -$table_chars->data[$row][0] = __('Graph color #1'); -$table_chars->data[$row][1] = html_print_input_text( - 'graph_color1', - $config['graph_color1'], - '', - 8, - 8, - true -); -$row++; +$graphColorAmount = 10; -$table_chars->data[$row][0] = __('Graph color #2'); -$table_chars->data[$row][1] = html_print_input_text( - 'graph_color2', - $config['graph_color2'], - '', - 8, - 8, - true -); -$row++; - -$table_chars->data[$row][0] = __('Graph color #3'); -$table_chars->data[$row][1] = html_print_input_text( - 'graph_color3', - $config['graph_color3'], - '', - 8, - 8, - true -); -$row++; - -$table_chars->data[$row][0] = __('Graph color #4'); -$table_chars->data[$row][1] = html_print_input_text( - 'graph_color4', - $config['graph_color4'], - '', - 8, - 8, - true -); -$row++; - -$table_chars->data[$row][0] = __('Graph color #5'); -$table_chars->data[$row][1] = html_print_input_text( - 'graph_color5', - $config['graph_color5'], - '', - 8, - 8, - true -); -$row++; - -$table_chars->data[$row][0] = __('Graph color #6'); -$table_chars->data[$row][1] = html_print_input_text( - 'graph_color6', - $config['graph_color6'], - '', - 8, - 8, - true -); -$row++; - -$table_chars->data[$row][0] = __('Graph color #7'); -$table_chars->data[$row][1] = html_print_input_text( - 'graph_color7', - $config['graph_color7'], - '', - 8, - 8, - true -); -$row++; - -$table_chars->data[$row][0] = __('Graph color #8'); -$table_chars->data[$row][1] = html_print_input_text( - 'graph_color8', - $config['graph_color8'], - '', - 8, - 8, - true -); -$row++; - -$table_chars->data[$row][0] = __('Graph color #9'); -$table_chars->data[$row][1] = html_print_input_text( - 'graph_color9', - $config['graph_color9'], - '', - 8, - 8, - true -); -$row++; - -$table_chars->data[$row][0] = __('Graph color #10'); -$table_chars->data[$row][1] = html_print_input_text( - 'graph_color10', - $config['graph_color10'], - '', - 8, - 8, - true -); -$row++; +for ($i = 1; $i <= $graphColorAmount; $i++) { + $table_chars->data[$row][0] = __('Graph color #'.$i); + $table_chars->data[$row][1] = html_print_input_text( + 'graph_color'.$i, + $config['graph_color'.$i], + '', + 10, + 8, + true + ); + $row++; +} $table_chars->data[$row][0] = __('Value to interface graphics'); $table_chars->data[$row][1] = html_print_input_text( diff --git a/pandora_console/include/styles/js/color-picker.css b/pandora_console/include/styles/js/color-picker.css index cdc2da0785..2ed2110740 100644 --- a/pandora_console/include/styles/js/color-picker.css +++ b/pandora_console/include/styles/js/color-picker.css @@ -13,7 +13,7 @@ #ColorPickerDiv td.color label { cursor: pointer; } - +/* .ColorPickerDivSample { margin: 0px 0px 0px 4px; border: solid 1px #000; @@ -21,3 +21,4 @@ position: relative; cursor: pointer; } +*/ diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 028a002765..2ef81f2955 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -9312,6 +9312,19 @@ button.ui-button.ui-widget.submit-cancel:active { align-items: center; } +.hasColorPicker { + z-index: 10; +} + +span.ColorPickerDivSample { + margin-left: -10px; + padding: 0px 10px; + position: relative; + cursor: pointer; + width: 10px; + border-radius: 8px; + border: 1px solid #c0ccdc; +} /* FINISH */ /* select */