From e8744b5d1228bb6b89acf4a54089148c0f73fd2a Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Tue, 21 Mar 2023 13:31:11 +0100 Subject: [PATCH 1/2] 10712-New login --- pandora_console/general/login_page.php | 69 +++++++---- .../godmode/setup/setup_visuals.php | 4 +- pandora_console/include/functions_config.php | 12 +- pandora_console/include/styles/login.css | 117 ++++++++++++++---- .../include/styles/pandora_black.css | 8 +- 5 files changed, 145 insertions(+), 65 deletions(-) diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 4bcce4142b..37421f655d 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -27,6 +27,22 @@ require_once __DIR__.'/../include/functions_ui.php'; require_once __DIR__.'/../include/functions.php'; require_once __DIR__.'/../include/functions_html.php'; +echo ''; if ($config['visual_animation']) { // form#login_form, div.login_data { @@ -121,7 +137,13 @@ if (empty($config['background_opacity']) === false) { $opacity = 30; } -$login_body_style = 'style="'.$background_100.'background: linear-gradient(rgba(0,0,0,.'.$opacity.'), rgba(0,0,0,.'.$opacity.")), url('".$background_url."');\""; +if ($config['style'] === 'pandora') { + $opacity_color = '255, 255, 255, .'; +} else { + $opacity_color = '0, 0, 0, .'; +} + +$login_body_style = 'style="'.$background_100.'background: linear-gradient(rgba('.$opacity_color.$opacity.'), rgba('.$opacity_color.$opacity.")), url('".$background_url."');\""; // Get alternative custom in case of db fail. $custom_fields = [ @@ -148,7 +170,7 @@ foreach ($custom_fields as $field) { $docs_logo = ui_get_docs_logo(); $support_logo = ui_get_support_logo(); echo '
'; -echo '
'; +echo '
'; echo '
    '; @@ -298,7 +320,7 @@ switch ($login_screen) { ); echo '
'; } else { - echo ''; echo '
'; diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 29df51b114..e6dd22eb2d 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -431,7 +431,7 @@ $table_styles->data[$row][] = html_print_label_input_block( $config['login_background'], '', __('Default'), - 'background_pandora_console_keys.jpg', + '', true, false, true, @@ -571,7 +571,7 @@ if (enterprise_installed() === true) { $config['custom_splash_login'], '', __('Default'), - 'default.svg', + 'default', true, false, true, diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 057572a863..47a6cce1de 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2561,7 +2561,7 @@ function config_process_config() } if (!isset($config['custom_splash_login'])) { - config_update_value('custom_splash_login', 'default'); + config_update_value('custom_splash_login', 'none.png'); } if (!isset($config['custom_docs_logo'])) { @@ -2597,11 +2597,11 @@ function config_process_config() } if (!isset($config['custom_title1_login'])) { - config_update_value('custom_title1_login', __('PANDORA FMS')); + config_update_value('custom_title1_login', __('ONE TOOL TO MONITOR THEM ALL')); } if (!isset($config['custom_title2_login'])) { - config_update_value('custom_title2_login', __('ONE TOOL TO MONITOR THEM ALL')); + config_update_value('custom_title2_login', ''); } if (!isset($config['custom_docs_url'])) { @@ -2649,11 +2649,11 @@ function config_process_config() } if (!isset($config['meta_custom_title1_login'])) { - config_update_value('meta_custom_title1_login', __('PANDORA FMS NEXT GENERATION')); + config_update_value('meta_custom_title1_login', __('ONE TOOL TO MONITOR THEM ALL')); } if (!isset($config['meta_custom_title2_login'])) { - config_update_value('meta_custom_title2_login', __('METACONSOLE')); + config_update_value('meta_custom_title2_login', __('COMMAND CENTER')); } if (!isset($config['vc_favourite_view'])) { @@ -3482,7 +3482,7 @@ function config_process_config() } if (!isset($config['random_background'])) { - config_update_value('random_background', ''); + config_update_value('random_background', 1); } if (!isset($config['meta_random_background'])) { diff --git a/pandora_console/include/styles/login.css b/pandora_console/include/styles/login.css index d0a47c53b4..fdba06937a 100644 --- a/pandora_console/include/styles/login.css +++ b/pandora_console/include/styles/login.css @@ -26,7 +26,7 @@ div#error_buttons a { /* Set rules to fill background */ /* background-color:#000 !important; */ min-height: 100%; - min-width: 1200px; + /* min-width: 1200px; */ width: 100%; position: absolute; background-repeat: repeat; @@ -68,7 +68,7 @@ div#login_f { #ver_num { width: 100%; - color: #878787; + color: #dddddd; text-align: center; font-weight: 350; font-size: 10px; @@ -105,7 +105,7 @@ div#list_icon_docs_support ul { div#list_icon_docs_support ul li { display: inline-block; - color: white; + color: #fff; vertical-align: middle; margin-right: 5px; font-size: 10pt; @@ -140,7 +140,9 @@ li#li_margin_support { } div.login_page { - background-color: rgba(0, 0, 0, 0.8); + /* background-color: rgba(0, 0, 0, 0.8); */ + /* background-color: rgba(255, 255, 255, 0.2); */ + background-color: var(--login-background-color); width: 40vw; min-width: 300px; height: 100vh; @@ -164,7 +166,8 @@ div.login_logo_icon { div.login_logo_icon img { margin: 0 auto; - width: 300px; + max-height: 185px; + max-width: 300px; } div.login_double_auth_code, @@ -174,7 +177,6 @@ div.login_pass { width: 300px; height: 40px; margin-bottom: 20px; - box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); border-radius: 3px; } @@ -195,8 +197,8 @@ div.login_pass input { box-sizing: border-box; } -div.login_pass > input#pass { - background-image: url(../../images/enable.svg); +input { + background-color: transparent; } input:not([type="image"]):focus, @@ -335,23 +337,26 @@ div.login_data { div.text_banner_login { width: 100%; - color: white; + color: #fff; margin-top: 40px; + display: flex; + flex-direction: column; } span.span1 { - font-size: 38px; - letter-spacing: -0.38px; + display: block; + max-width: 700px; + font-size: 80pt; + line-height: 80pt; font-family: "lato-bolder"; - color: white; - line-height: 49pt; + color: #fff; } span.span2 { display: block; - width: 700px; - font-size: 80pt; - line-height: 80pt; + max-width: 700px; + font-size: 30pt; + line-height: 30pt; font-family: "lato-bolder"; color: #fff; } @@ -377,16 +382,18 @@ div.img_banner_login img { @media all and (max-width: 1266px) { span.span1 { - font-size: 38px; - letter-spacing: -0.38px; - font-weight: bold; - color: white; - line-height: 49pt; - } - span.span2 { - width: 550px; + display: block; + max-width: 500px; font-size: 60pt; line-height: 60pt; + font-weight: bold; + color: #fff; + } + span.span2 { + display: block; + max-width: 500px; + font-size: 20pt; + line-height: 20pt; font-family: "lato-bolder"; color: #fff; } @@ -682,7 +689,7 @@ div.button_message_alert_form input { bottom: 10px; /* background: transparent; */ background: #f1f1f1; - border: solid white 10px; + border: solid #fff 10px; border-radius: 50%; } @@ -715,6 +722,7 @@ div.login_pass input:-webkit-autofill:active { background-size: 27px; background-position: right 10px bottom 50%; box-sizing: border-box; + -webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0) inset !important; } div.login_pass input:-webkit-autofill, @@ -796,3 +804,62 @@ button.submitButton > span { font-size: 9pt; top: -10px; } + +div.login_nick.white-theme input, +div.login_pass.white-theme input { + background-color: #f6f7fb; + border: 0px; + color: #343434; + border-radius: 3px; + width: 100%; + height: 40px; + font-size: 10pt; + padding: 0px 0px 0px 8%; + background-repeat: no-repeat; + background-size: 27px; + background-position: right 10px bottom 50%; + box-sizing: border-box; +} + +div.white-theme > .placeholder { + color: #8b8b8b; + left: 24px; +} + +div.white-theme > .input:not(:placeholder-shown) ~ .placeholder { + top: 15px; + color: transparent; +} + +div.white-theme > .input:focus ~ .placeholder { + top: 15px; + color: transparent; +} + +div.white-theme input:-webkit-autofill, +div.white-theme input:-webkit-autofill:hover, +div.white-theme input:-webkit-autofill:focus, +div.white-theme input:-webkit-autofill:active { + -webkit-text-fill-color: #343434; + border: 0px; + border-bottom: 0px; + border-radius: 3px; + width: 100%; + height: 40px; + font-size: 12pt; + background-repeat: no-repeat; + background-size: 27px; + background-position: right 10px bottom 50%; + box-sizing: border-box; + -webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0) inset !important; +} + +div.white-theme input:not([type="image"]):focus, +textarea:focus, +select:focus { + border: 2px solid #8a96a6; +} + +div#header_login.white-theme { + background-color: rgba(0, 0, 0, 0.5); +} diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index bf44c58a4b..37166788a4 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -31,7 +31,7 @@ ul.subsubmenu li, input.search_input, .filters input, input#text-id_parent.ac_input, -input, +input:not(div.login_pass > input):not(div.login_nick > input), textarea, select, .edit_user_comments #textarea_comments, @@ -466,12 +466,6 @@ ul.tree-group filter: invert(100%); } -/* login.css */ -div.login_nick input, -div.login_pass input { - background-color: #111 !important; -} - /* user edit */ .edit_user_info_right input { border-bottom: 1px solid #5f5f5f; From 64fc4bcd4625a2c54baf3839aa15e08b5e45a735 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 21 Mar 2023 14:06:28 +0100 Subject: [PATCH 2/2] fixed styles --- .../godmode/alerts/alert_list.list.php | 6 +- .../include/class/SatelliteAgent.class.php | 4 +- .../include/functions_reporting_html.php | 57 ++++--------------- pandora_console/include/functions_ui.php | 48 ++++++---------- pandora_console/include/styles/pandora.css | 13 +++++ .../update_manager_client/views/register.php | 4 +- 6 files changed, 47 insertions(+), 85 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index a2b0f242da..c11e3631a7 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -679,7 +679,7 @@ foreach ($simple_alerts as $alert) { true, [ 'id' => 'template-details-'.$alert['id_alert_template'], - 'class' => 'img_help action_button_img invert_filter', + 'class' => 'img_help main_menu_icon invert_filter', ] ); $data[2] .= ' '; @@ -757,7 +757,7 @@ foreach ($simple_alerts as $alert) { true, [ 'title' => __('Delete action'), - 'class' => 'action_button_img invert_filter', + 'class' => 'main_menu_icon invert_filter', ] ); $data[3] .= html_print_input_hidden('delete_action', 1, true); @@ -772,7 +772,7 @@ foreach ($simple_alerts as $alert) { true, [ 'title' => __('Update action'), - 'class' => 'action_button_img invert_filter', + 'class' => 'main_menu_icon invert_filter', 'onclick' => 'show_display_update_action(\''.$action['id'].'\',\''.$alert['id'].'\',\''.$alert['id_agent_module'].'\',\''.$action_id.'\',\''.$alert['id_agent_module'].'\')', ] ); diff --git a/pandora_console/include/class/SatelliteAgent.class.php b/pandora_console/include/class/SatelliteAgent.class.php index 18a4806bb5..07acb23c6c 100644 --- a/pandora_console/include/class/SatelliteAgent.class.php +++ b/pandora_console/include/class/SatelliteAgent.class.php @@ -393,7 +393,7 @@ class SatelliteAgent extends HTML true, [ 'border' => '0', - 'class' => 'action_button_img mrgn_lft_05em invert_filter', + 'class' => 'main_menu_icon mrgn_lft_05em invert_filter', 'onclick' => 'disable_agent(\''.$tmp->address.'\',\''.strip_tags($tmp->name).'\',\''.(int) $disable.'\',\''.$id_agente.'\')', ] ); @@ -405,7 +405,7 @@ class SatelliteAgent extends HTML true, [ 'border' => '0', - 'class' => 'action_button_img mrgn_lft_05em invert_filter', + 'class' => 'main_menu_icon mrgn_lft_05em invert_filter', 'onclick' => 'delete_agent(\''.$tmp->address.'\',\''.strip_tags($tmp->name).'\',\''.(int) $delete.'\',\''.$id_agente.'\')', ] ); diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index a43f852945..8b5cb3d917 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -6002,6 +6002,7 @@ function reporting_get_last_activity() $table = new stdClass(); $table->width = '100%'; $table->data = []; + $table->class = 'info_table'; $table->size = []; $table->size[2] = '150px'; $table->size[3] = '130px'; @@ -6015,37 +6016,13 @@ function reporting_get_last_activity() $table->head[5] = __('Comments'); $table->title = ''.__('Last activity in %s console', get_product_name()).''; - switch ($config['dbtype']) { - case 'mysql': - $sql = sprintf( - 'SELECT id_usuario,accion,fecha,ip_origen,descripcion,utimestamp - FROM tsesion - WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.") - AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 5", - $config['id_user'] - ); - break; - - case 'postgresql': - $sql = sprintf( - "SELECT \"id_usuario\", accion, fecha, \"ip_origen\", descripcion, utimestamp - FROM tsesion - WHERE (\"utimestamp\" > ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_1WEEK.") - AND \"id_usuario\" = '%s' ORDER BY \"utimestamp\" DESC LIMIT 5", - $config['id_user'] - ); - break; - - case 'oracle': - $sql = sprintf( - "SELECT id_usuario, accion, fecha, ip_origen, descripcion, utimestamp - FROM tsesion - WHERE ((utimestamp > ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_1WEEK.") - AND id_usuario = '%s') AND rownum <= 10 ORDER BY utimestamp DESC", - $config['id_user'] - ); - break; - } + $sql = sprintf( + 'SELECT id_usuario,accion,fecha,ip_origen,descripcion,utimestamp + FROM tsesion + WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.") + AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 5", + $config['id_user'] + ); $sessions = db_get_all_rows_sql($sql); @@ -6056,18 +6033,8 @@ function reporting_get_last_activity() foreach ($sessions as $session) { $data = []; - switch ($config['dbtype']) { - case 'mysql': - case 'oracle': - $session_id_usuario = $session['id_usuario']; - $session_ip_origen = $session['ip_origen']; - break; - - case 'postgresql': - $session_id_usuario = $session['id_usuario']; - $session_ip_origen = $session['ip_origen']; - break; - } + $session_id_usuario = $session['id_usuario']; + $session_ip_origen = $session['ip_origen']; $data[0] = ''.$session_id_usuario.''; $data[1] = ui_print_session_action_icon($session['accion'], true); @@ -6079,10 +6046,6 @@ function reporting_get_last_activity() array_push($table->data, $data); } - if (defined('METACONSOLE')) { - $table->class = 'databox_tactical'; - } - return html_print_table($table, true); } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index ce111ea249..8f62bc4ce0 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -5020,30 +5020,22 @@ function ui_print_standard_header( $applyBreadcrumbs, true ); - // Create the header. - // if (is_metaconsole() === true) { - // $output = ui_meta_print_header( - // $title, - // false, - // $options - // ); - // } else { - $output = ui_print_page_header( - $title, - $icon, - true, - $help, - $godmode, - $options, - false, - '', - GENERIC_SIZE_TEXT, - '', - $headerInformation->printHeader(true), - false, - $fav_menu_config - ); - // } + + $output = ui_print_page_header( + $title, + $icon, + true, + $help, + $godmode, + $options, + false, + '', + GENERIC_SIZE_TEXT, + '', + $headerInformation->printHeader(true), + false, + $fav_menu_config + ); if ($return !== true) { echo $output; } else { @@ -7327,9 +7319,6 @@ function ui_get_inventory_module_add_form( $table->rowstyle = []; $table->rowstyle['hidden-custom-field-row'] = 'display: none;'; $table->rowstyle['custom-fields-button'] = 'display: none;'; - // $table->colspan = []; - // $table->colspan['custom-fields-row'] = []; - // $table->colspan['custom-fields-row']['custom-fields-column'] = 2; $table->data = []; $row = []; @@ -7593,13 +7582,10 @@ function ui_get_inventory_module_add_form( ob_start(); - echo '
'; + echo ''; echo html_print_table($table); - echo '
'; echo $form_buttons; - echo '
'; echo '
'; - ?>