From ba9cdf029dc39b6e55e9f05765ec0a3d3c069438 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Tue, 11 Apr 2023 12:26:28 +0200 Subject: [PATCH 01/13] 9555-Login --- .../javascript/jquery.mobile-1.5.0-rc1.js | 8 +- pandora_console/mobile/include/style/main.css | 114 ++++++++++++- pandora_console/mobile/include/ui.class.php | 27 ++- pandora_console/mobile/include/user.class.php | 160 +++++++++++++----- 4 files changed, 260 insertions(+), 49 deletions(-) diff --git a/pandora_console/mobile/include/javascript/jquery.mobile-1.5.0-rc1.js b/pandora_console/mobile/include/javascript/jquery.mobile-1.5.0-rc1.js index a8cf0da798..2d75309d4b 100644 --- a/pandora_console/mobile/include/javascript/jquery.mobile-1.5.0-rc1.js +++ b/pandora_console/mobile/include/javascript/jquery.mobile-1.5.0-rc1.js @@ -13338,7 +13338,7 @@ $.widget( "mobile.textinput", { }, _handleBlur: function() { - this._removeClass( this._outer, null, "ui-focus" ); + // this._removeClass( this._outer, null, "ui-focus" ); if ( this.options.preventFocusZoom ) { $.mobile.zoom.enable( true ); } @@ -13351,7 +13351,7 @@ $.widget( "mobile.textinput", { if ( this.options.preventFocusZoom ) { $.mobile.zoom.disable( true ); } - this._addClass( this._outer, null, "ui-focus" ); + // this._addClass( this._outer, null, "ui-focus" ); }, _setOptions: function( options ) { @@ -15410,10 +15410,10 @@ var selectmenu = $.widget( "mobile.selectmenu", [ { that.button.addClass( "ui-button-active" ); } ) .bind( "focus", function() { - that.button.addClass( "ui-focus" ); + // that.button.addClass( "ui-focus" ); } ) .bind( "blur", function() { - that.button.removeClass( "ui-focus" ); + // that.button.removeClass( "ui-focus" ); } ) .bind( "focus vmouseover", function() { that.button.trigger( "vmouseover" ); diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index f6b3f17874..410b39c581 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -1076,9 +1076,8 @@ li.ui-btn { } .login_logo img { - width: 220px; + width: 80%; margin-bottom: 10px; - padding-top: 5%; } .untiny { @@ -1126,7 +1125,6 @@ li.ui-btn { .login_logo img { width: 300px; margin-bottom: 20px; - padding-top: 5%; } .tiny { @@ -1135,7 +1133,7 @@ li.ui-btn { } #login_container { - width: 60%; + width: 80%; margin: 0 auto; max-width: 300px; padding-top: 5%; @@ -1535,14 +1533,118 @@ img.os-big-icon[src$=".svg"] { height: 100px; } -div.noresizevc.graph.adapted_sparse +div.noresizevc.graph div.flot-x-axis.flot-x1-axis.xAxis.x1Axis > div.flot-tick-label.tickLabel:nth-child(odd) { visibility: hidden !important; } -div.noresizevc.graph.adapted_sparse +div.noresizevc.graph div.flot-x-axis.flot-x1-axis.xAxis.x1Axis > div.flot-tick-label.tickLabel:first-child { visibility: visible !important; } + +.relative { + position: relative; +} + +.container-div-input-password input { + width: 100%; +} + +.show-hide-pass { + position: absolute; + right: 0px; + top: 4px; + border: 0; + outline: none; + margin: 0; + height: 30px; + width: 35px; + cursor: pointer; + display: inline-block; +} + +div.relative.container-div-input-password > div > input { + background-repeat: no-repeat !important; + background-size: 25px !important; + background-position: right 5px bottom 50% !important; + padding-right: 42px; +} + +input[name="login_btn"], +input[name="auth_code_btn"] { + height: 50px; + font-family: Arial, Helvetica, sans-serif; + line-height: 24px; + /* box-shadow: 0px 3px 6px #c7c7c7 !important; */ + color: #fff !important; + border: 0px; + border-radius: 15px !important; + font-weight: bold; + background: linear-gradient(90deg, #81b82f 0%, #1d7873 100%); +} + +body.login-background { + /* background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2)), */ + background: linear-gradient(rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.1)), + url("../../../images/backgrounds/random_backgrounds/CGI_nodes.jpg") !important; + background-size: cover !important; + background-position: center !important; +} + +body.login-background #text-user, +body.login-background #text-password, +body.login-background #text-auth_code { + background-color: #f6f7fb; + border: 0px; + color: #343434; + border-radius: 3px; + width: 100%; + height: 40px; + box-sizing: border-box; +} + +body.login-background div#user-container input:-webkit-autofill, +body.login-background div#user-container input:-webkit-autofill:hover, +body.login-background div#user-container input:-webkit-autofill:focus, +body.login-background div#user-container input:-webkit-autofill:active, +body.login-background div#password-container input:-webkit-autofill, +body.login-background div#password-container input:-webkit-autofill:hover, +body.login-background div#password-container input:-webkit-autofill:focus, +body.login-background div#password-container input:-webkit-autofill:active, +body.login-background div#auth_code-container input:-webkit-autofill, +body.login-background div#auth_code-container input:-webkit-autofill:hover, +body.login-background div#auth_code-container input:-webkit-autofill:focus, +body.login-background div#auth_code-container input:-webkit-autofill:active { + transition: background-color 10000s ease-in-out 0s; + -webkit-box-shadow: 0 0 0px 0px transparent inset; + -webkit-text-fill-color: #343434; + border: 0px; + width: 89%; +} + +div#ver_num { + color: #fff; + margin-top: 15px; + text-shadow: none; + font-size: smaller; +} + +body.login-background a.ui-button[data-icon="ui-icon-back"] { + background-color: var(--secondary-color) !important; + border: 2px solid var(--primary-color) !important; + color: var(--primary-color) !important; + display: flex; + flex-direction: row-reverse; + align-items: center; + margin-top: 2px !important; + padding: 3px 5px !important; +} + +body.login-background + a.ui-button[data-icon="ui-icon-back"] + > span.ui-button-icon-space { + width: 5px; +} diff --git a/pandora_console/mobile/include/ui.class.php b/pandora_console/mobile/include/ui.class.php index 3d330994cf..38c2a7e566 100755 --- a/pandora_console/mobile/include/ui.class.php +++ b/pandora_console/mobile/include/ui.class.php @@ -511,9 +511,14 @@ class Ui $html .= "\n"; } - // Erase other options and only for the input + // Erase other options and only for the input. unset($options['label']); + if ($options['type'] === 'password') { + $html .= '
'; + $options['style'] .= 'background-image: url("'.ui_get_full_url('/').'/images/enable.svg");'; + } + $html .= ' $value) { $html .= ' '.$option."='".$value."' "; @@ -521,6 +526,26 @@ class Ui $html .= ">\n"; + if ($options['type'] === 'password') { + $html .= '
'; + $html .= '
'; + $html .= ' + '; + } + $html .= "\n"; $html .= "\n"; diff --git a/pandora_console/mobile/include/user.class.php b/pandora_console/mobile/include/user.class.php index 6e932366c8..31d559bd87 100644 --- a/pandora_console/mobile/include/user.class.php +++ b/pandora_console/mobile/include/user.class.php @@ -366,6 +366,53 @@ class User $ui->showFooter(false); $ui->beginContent(); + $ui->contentAddHtml( + ' + + + ' + ); + $logo_image = html_print_image( ui_get_mobile_login_icon(), true, @@ -389,14 +436,15 @@ class User 'name' => 'user', 'value' => $this->user, 'placeholder' => __('user'), - 'label' => __('User'), + // 'autofocus' => 'autofocus', + // 'label' => __('User'), ]; $ui->formAddInputText($options); $options = [ 'name' => 'password', 'value' => '', 'placeholder' => __('password'), - 'label' => __('Password'), + // 'label' => __('Password'), 'required' => 'required', ]; $ui->formAddInputPassword($options); @@ -431,6 +479,7 @@ class User } $ui->contentAddHtml(''); + $ui->contentAddHtml('
'.$pandora_version.'
'); $ui->endContent(); $ui->showPage(); @@ -465,43 +514,78 @@ class User $ui->createHeader('', $left_button); $ui->showFooter(false); $ui->beginContent(); - $ui->contentAddHtml( - '' - ); - $ui->contentAddHtml('
'); - $ui->beginForm(); - $ui->formAddHtml(html_print_input_hidden('action', 'double_auth', true)); - $options = [ - 'name' => 'auth_code', - 'value' => '', - 'placeholder' => __('Authenticator code'), - 'label' => __('Authenticator code'), - ]; - $ui->formAddInputPassword($options); - $options = [ - 'value' => __('Check code'), - 'icon' => 'arrow-r', - 'icon_pos' => 'right', - 'name' => 'auth_code_btn', - ]; - $ui->formAddSubmitButton($options); - $ui->endForm(); - $ui->contentAddHtml('
'); - $ui->endContent(); - $ui->showPage(); - $this->errorDoubleAuth = false; + $ui->contentAddHtml( + ' + + + ' + ); + + $ui->contentAddHtml( + '' + ); + $ui->contentAddHtml('
'); + $ui->beginForm(); + $ui->formAddHtml(html_print_input_hidden('action', 'double_auth', true)); + $options = [ + 'name' => 'auth_code', + 'value' => '', + 'placeholder' => __('Authenticator code'), + 'autofocus' => 'autofocus', + // 'label' => __('Authenticator code'), + ]; + $ui->formAddInputPassword($options); + $options = [ + 'value' => __('Check code'), + 'icon' => 'arrow-r', + 'icon_pos' => 'right', + 'name' => 'auth_code_btn', + ]; + $ui->formAddSubmitButton($options); + $ui->endForm(); + $ui->contentAddHtml('
'); + $ui->contentAddHtml('
'.$pandora_version.'
'); + $ui->endContent(); + $ui->showPage(); + + $this->errorDoubleAuth = false; } From 4deec005c1c04e8ecefc5e9d4a641facdae961d0 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 12 Apr 2023 14:48:19 +0200 Subject: [PATCH 02/13] 9555-Server status --- pandora_console/include/functions_servers.php | 10 +- pandora_console/mobile/include/style/main.css | 86 ++- pandora_console/mobile/include/user.class.php | 18 + pandora_console/mobile/index.php | 11 + pandora_console/mobile/operation/home.php | 7 + .../mobile/operation/server_status.php | 534 ++++++++++++++++++ 6 files changed, 664 insertions(+), 2 deletions(-) create mode 100644 pandora_console/mobile/operation/server_status.php diff --git a/pandora_console/include/functions_servers.php b/pandora_console/include/functions_servers.php index 28daa277e7..cb48c0ea6e 100644 --- a/pandora_console/include/functions_servers.php +++ b/pandora_console/include/functions_servers.php @@ -522,7 +522,7 @@ function servers_get_rate($avg_interval, $num_modules) * * @return mixed False in case the server doesn't exist or an array with info. */ -function servers_get_info($id_server=-1) +function servers_get_info($id_server=-1, $sql_limit=-1) { global $config; @@ -538,6 +538,14 @@ function servers_get_info($id_server=-1) SELECT * FROM tserver '.$select_id.' ORDER BY server_type'; + + if ($sql_limit !== -1) { + $sql = ' + SELECT * + FROM tserver '.$select_id.' + ORDER BY server_type'.$sql_limit; + } + $result = db_get_all_rows_sql($sql); $time = get_system_time(); diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index 410b39c581..23321ed8cb 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -571,7 +571,8 @@ table.event_details td.cell_event_name { #list_Modules td:hover, #list_agent_Modules td:hover, #list_visualmaps td:hover, -#last_agent_events td:hover { +#last_agent_events td:hover, +#list_servers_status td:hover { cursor: pointer; } @@ -866,6 +867,31 @@ table.event_details td.cell_event_name { #list_Modules .module_name { font-size: 12px !important; } + + table#list_servers tr { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + align-items: center; + } + + table#list_servers b.ui-table-cell-label { + display: none; + } + + table#list_servers tr td.cell_0 { + width: 10%; + } + table#list_servers tr td.cell_1 { + width: 10%; + } + table#list_servers tr td.cell_2 { + width: 80%; + } +} + +table#list_servers tr td.cell_0 { + border-top: 0px; } #list_Modules .cell_5 a { @@ -1648,3 +1674,61 @@ body.login-background > span.ui-button-icon-space { width: 5px; } + +/* ==== Spinner ==== */ +.spinner { + width: 100px; + height: 100px; + border-radius: 100%; + background: linear-gradient(#82b92e, #c1ccdc); + animation: animate 1.2s linear infinite; + margin: auto; + margin-bottom: 40px; +} +.spinner span { + position: absolute; + width: 100%; + height: 100%; + border-radius: 100%; + background: linear-gradient(#82b92e, #c1ccdc); +} +.spinner span:nth-child(1) { + filter: blur(4px); +} +.spinner span:nth-child(2) { + filter: blur(8px); +} +.spinner span:nth-child(3) { + filter: blur(12px); +} +.spinner span:nth-child(4) { + filter: blur(16px); +} +.spinner:after { + content: ""; + position: absolute; + top: 10px; + left: 10px; + right: 10px; + bottom: 10px; + /* background: transparent; */ + background: #f1f1f1; + border: solid #fff 10px; + border-radius: 50%; +} + +@keyframes animate { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + +.status_small_squares, +.status_balls { + width: 12px; + height: 12px; + display: inline-block; +} diff --git a/pandora_console/mobile/include/user.class.php b/pandora_console/mobile/include/user.class.php index 31d559bd87..00a7e605d1 100644 --- a/pandora_console/mobile/include/user.class.php +++ b/pandora_console/mobile/include/user.class.php @@ -408,6 +408,13 @@ class User $(".ui-overlay-a").addClass("login-background"); $(".ui-overlay-a").removeClass("ui-overlay-a"); $(".ui-page-theme-a").css({"background-color":"transparent !important"}); + + $("#text-login_btn").click(function (e) { + $("#user-container").hide(); + $("#password-container").hide(); + $("#text-login_btn").hide(); + $("#spinner-login").show(); + }); }); ' @@ -448,6 +455,17 @@ class User 'required' => 'required', ]; $ui->formAddInputPassword($options); + + $spinner = ' + + '; + $ui->formAddHtml($spinner); + $options = [ 'value' => __('Login'), 'icon' => 'arrow-r', diff --git a/pandora_console/mobile/index.php b/pandora_console/mobile/index.php index dc79e07c04..dfad2dbebd 100644 --- a/pandora_console/mobile/index.php +++ b/pandora_console/mobile/index.php @@ -43,6 +43,7 @@ require_once 'operation/module_graph.php'; require_once 'operation/agent.php'; require_once 'operation/visualmaps.php'; require_once 'operation/visualmap.php'; +require_once 'operation/server_status.php'; $enterpriseHook = enterprise_include('mobile/include/enterprise.class.php'); $enterpriseHook = enterprise_include('mobile/operation/home.php'); @@ -177,6 +178,11 @@ switch ($action) { $tactical->ajax($parameter2); break; + case 'server_status': + $server_status = new ServerStatus(); + $server_status->ajax($parameter2); + break; + default: if (class_exists('Enterprise')) { $enterprise->enterpriseAjax($parameter1, $parameter2); @@ -407,6 +413,11 @@ switch ($action) { $vc = new Visualmap(); $vc->show(); break; + + case 'server_status': + $server_status = new ServerStatus(); + $server_status->show(); + break; } break; } diff --git a/pandora_console/mobile/operation/home.php b/pandora_console/mobile/operation/home.php index f6ea3e60f1..c0743941bd 100644 --- a/pandora_console/mobile/operation/home.php +++ b/pandora_console/mobile/operation/home.php @@ -91,6 +91,13 @@ class Home 'icon' => 'ui-icon-modules ui-widget-icon-floatbeginning', ]; + $items['server_status'] = [ + 'name' => __('Server status'), + 'filename' => 'server_status.php', + 'menu_item' => true, + 'icon' => 'ui-icon- ui-widget-icon-floatbeginning', + ]; + // Not in home. $items['agent'] = [ 'name' => __('Agent'), diff --git a/pandora_console/mobile/operation/server_status.php b/pandora_console/mobile/operation/server_status.php new file mode 100644 index 0000000000..eeae698929 --- /dev/null +++ b/pandora_console/mobile/operation/server_status.php @@ -0,0 +1,534 @@ +checkACL($this->acl)) { + $this->correct_acl = true; + } else { + $this->correct_acl = false; + } + + if ($system->getConfig('metaconsole') === 0) { + $this->all_servers = true; + } + } + + + public function ajax($parameter2=false) + { + $system = System::getInstance(); + + if (!$this->correct_acl) { + return; + } else { + switch ($parameter2) { + case 'get_server_status': + $this->getFilters(); + $page = $system->getRequest('page', 0); + $server_status = []; + $end = 1; + + $listServers = $this->getListServers($page, true); + + if (!empty($listServers['servers'])) { + $end = 0; + $servers = $listServers['servers']; + } + + hd(json_encode(['end' => $end, 'servers' => $servers]), true); + echo json_encode(['end' => $end, 'servers' => $servers]); + break; + } + } + } + + + public function setFilters($filters) + { + if (isset($filters['id_agent'])) { + $this->id_agent = $filters['id_agent']; + } + + if (isset($filters['all_servers'])) { + $this->all_servers = $filters['all_servers']; + } + + if (isset($filters['status'])) { + $this->status = (int) $filters['status']; + } + + if (isset($filters['name'])) { + $this->name = $filters['name']; + } + } + + + public function disabledColumns($columns=null) + { + if (!empty($columns)) { + foreach ($columns as $column) { + $this->columns[$column] = 0; + } + } + } + + + private function getFilters() + { + $system = System::getInstance(); + $user = User::getInstance(); + + $this->default_filters['module_group'] = true; + $this->default_filters['group'] = true; + $this->default_filters['status'] = true; + $this->default_filters['free_search'] = true; + $this->default_filters['tag'] = true; + + $this->free_search = $system->getRequest('free_search', ''); + if ($this->free_search != '') { + $this->default = false; + $this->default_filters['free_search'] = false; + } + + $this->status = $system->getRequest('status', __('Status')); + if (($this->status === __('Status')) || ((int) $this->status === AGENT_MODULE_STATUS_ALL)) { + $this->status = AGENT_MODULE_STATUS_ALL; + } else { + $this->default = false; + $this->default_filters['status'] = false; + } + + $this->group = (int) $system->getRequest('group', __('Group')); + if (!$user->isInGroup($this->acl, $this->group)) { + $this->group = 0; + } + + if (($this->group === __('Group')) || ($this->group == 0)) { + $this->group = 0; + } else { + $this->default = false; + $this->default_filters['group'] = false; + } + + $this->module_group = (int) $system->getRequest('module_group', __('Module group')); + if (($this->module_group === __('Module group')) || ($this->module_group === -1) + || ($this->module_group == 0) + ) { + $this->module_group = -1; + } else { + $this->default = false; + $this->module_group = (int) $this->module_group; + $this->default_filters['module_group'] = false; + } + + $this->tag = (int) $system->getRequest('tag', __('Tag')); + if (($this->tag === __('Tag')) || ($this->tag == 0)) { + $this->tag = 0; + } else { + $this->default = false; + $this->default_filters['tag'] = false; + } + } + + + public function show() + { + if (!$this->correct_acl) { + $this->show_fail_acl(); + } else { + $this->getFilters(); + $this->show_servers(); + } + } + + + private function show_fail_acl() + { + $error['type'] = 'onStart'; + $error['title_text'] = __('You don\'t have access to this page'); + $error['content_text'] = System::getDefaultACLFailText(); + if (class_exists('HomeEnterprise')) { + $home = new HomeEnterprise(); + } else { + $home = new Home(); + } + + $home->show($error); + } + + + private function show_servers() + { + $ui = Ui::getInstance(); + + $ui->createPage(); + $ui->createDefaultHeader( + __('Server status'), + $ui->createHeaderButton( + [ + 'icon' => 'ui-icon-back', + 'pos' => 'left', + 'text' => __('Back'), + 'href' => 'index.php?page=home', + 'class' => 'header-button-left', + ] + ) + ); + $ui->showFooter(false); + $ui->beginContent(); + $this->listServersHtml(); + $ui->endContent(); + $ui->showPage(); + } + + + private function getListServers($page=0, $ajax=false) + { + global $config; + $system = System::getInstance(); + $user = User::getInstance(); + + $total = 0; + $servers = []; + $servers_db = []; + + if ($this->all_servers === true) { + $sql_limit = ' LIMIT '.(int) ($page * $system->getPageSize()).','.(int) $system->getPageSize(); + } + + if ($system->getConfig('metaconsole')) { + $servers_info = servers_get_info(); + $total = (int) count(servers_get_info()); + + foreach ($servers_info as $server_value) { + $image_status = ui_print_status_image(STATUS_SERVER_OK, '', true); + if ($server_value['status'] == -1) { + $image_status = ui_print_status_image( + STATUS_SERVER_CRASH, + __('Server has crashed.'), + true + ); + } else if ($server_value['status'] == 0) { + $image_status = ui_print_status_image( + STATUS_SERVER_DOWN, + __('Server is stopped.'), + true + ); + } + + // $row[__('Status')] = ''.$server_value['status'].''; + $row[__('Status')] = ''.$image_status.''; + $row[__('Image')] = ''.$server_value['img'].''; + $row[__('Name')] = ''.$server_value['name'].''; + + $servers[$server_value['id_server'].'-'.$server_value['name']] = $row; + } + + $meta_servers = metaconsole_get_servers(); + + if ($meta_servers === false) { + $meta_servers = []; + } + + foreach ($meta_servers as $server) { + if (metaconsole_connect($server) != NOERR) { + continue; + } + + $servers_info = servers_get_info(); + $total += (int) count(servers_get_info()); + + foreach ($servers_info as $server_value) { + $image_status = ui_print_status_image(STATUS_SERVER_OK, '', true); + if ($server_value['status'] == -1) { + $image_status = ui_print_status_image( + STATUS_SERVER_CRASH, + __('Server has crashed.'), + true + ); + } else if ($server_value['status'] == 0) { + $image_status = ui_print_status_image( + STATUS_SERVER_DOWN, + __('Server is stopped.'), + true + ); + } + + // $row[__('Status')] = ''.$server_value['status'].''; + $row[__('Status')] = ''.$image_status.''; + $row[__('Image')] = ''.$server_value['img'].''; + $row[__('Name')] = ''.$server_value['name'].''; + + $servers[$server_value['id_server']] = $row; + } + + metaconsole_restore_db(); + } + } else { + $servers_info = servers_get_info(-1, $sql_limit); + $total = count(servers_get_info()); + + foreach ($servers_info as $server_value) { + echo ''; + $image_status = ui_print_status_image(STATUS_SERVER_OK, '', true); + if ($server_value['status'] == -1) { + $image_status = ui_print_status_image( + STATUS_SERVER_CRASH, + __('Server has crashed.'), + true + ); + } else if ($server_value['status'] == 0) { + $image_status = ui_print_status_image( + STATUS_SERVER_DOWN, + __('Server is stopped.'), + true + ); + } + + // $row[__('Status')] = ''.$server_value['status'].''; + $row[__('Status')] = ''.$image_status.''; + $row[__('Image')] = ''.$server_value['img'].''; + $row[__('Name')] = ''.$server_value['name'].''; + + $servers[$server_value['id_server']] = $row; + } + } + + return [ + 'servers' => $servers, + 'total' => $total, + ]; + } + + + public function listServersHtml($page=0, $return=false) + { + $system = System::getInstance(); + $ui = Ui::getInstance(); + + $listServers = $this->getListServers($page); + if ($listServers['total'] == 0) { + $html = '

'.__('No servers').'

'; + if (!$return) { + $ui->contentAddHtml($html); + } else { + return $html; + } + } else { + if (!$return) { + $table = new Table(); + $table->id = 'list_servers'; + $table->importFromHash($listServers['servers']); + + $ui->contentAddHtml($table->getHTML()); + } else { + $table = new Table(); + $table->id = 'list_servers_status'; + + $table->importFromHash($listServers['servers']); + + $html = $table->getHTML(); + + return $html; + } + + if ($this->all_servers === true) { + if ($system->getPageSize() < $listServers['total']) { + $ui->contentAddHtml( + '
'.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'
' + ); + + $this->addJavascriptAddBottom(); + } + } + } + + $ui->contentAddLinkListener('list_servers'); + } + + + private function addJavascriptAddBottom() + { + $ui = Ui::getInstance(); + + $ui->contentAddHtml( + "' + ); + } + + + private function filterServersGetString() + { + if ($this->default) { + return __('(Default)'); + } else { + $filters_to_serialize = []; + + if (!$this->default_filters['group']) { + $filters_to_serialize[] = sprintf( + __('Group: %s'), + groups_get_name($this->group, true) + ); + } + + if (!$this->default_filters['module_group']) { + $module_group = db_get_value( + 'name', + 'tmodule_group', + 'id_mg', + $this->module_group + ); + $module_group = io_safe_output($module_group); + + $filters_to_serialize[] = sprintf( + __('Module group: %s'), + $module_group + ); + } + + if (!$this->default_filters['status']) { + $filters_to_serialize[] = sprintf( + __('Status: %s'), + $this->list_status[$this->status] + ); + } + + if (!$this->default_filters['free_search']) { + $filters_to_serialize[] = sprintf( + __('Free Search: %s'), + $this->free_search + ); + } + + if (!$this->default_filters['tag']) { + $tag_name = tags_get_name($this->tag); + $filters_to_serialize[] = sprintf( + __('Tag: %s'), + $tag_name + ); + } + + $string = '('.implode(' - ', $filters_to_serialize).')'; + + return $string; + } + } + + +} From 7b5760714954b8f48a9dd66fef69e812f900baea Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 12 Apr 2023 16:55:58 +0200 Subject: [PATCH 03/13] 9555-Server status fix --- .../mobile/operation/server_status.php | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_console/mobile/operation/server_status.php b/pandora_console/mobile/operation/server_status.php index eeae698929..b3760f9772 100644 --- a/pandora_console/mobile/operation/server_status.php +++ b/pandora_console/mobile/operation/server_status.php @@ -87,7 +87,7 @@ class ServerStatus case 'get_server_status': $this->getFilters(); $page = $system->getRequest('page', 0); - $server_status = []; + $servers = []; $end = 1; $listServers = $this->getListServers($page, true); @@ -97,7 +97,6 @@ class ServerStatus $servers = $listServers['servers']; } - hd(json_encode(['end' => $end, 'servers' => $servers]), true); echo json_encode(['end' => $end, 'servers' => $servers]); break; } @@ -331,7 +330,6 @@ class ServerStatus $total = count(servers_get_info()); foreach ($servers_info as $server_value) { - echo ''; $image_status = ui_print_status_image(STATUS_SERVER_OK, '', true); if ($server_value['status'] == -1) { $image_status = ui_print_status_image( @@ -422,8 +420,7 @@ class ServerStatus if (load_more_rows) { if ($(this).scrollTop() + $(this).height() >= ($(document).height() - 100)) { - - load_more_rows = 0; + load_more_rows = 0; postvars = {}; postvars[\"action\"] = \"ajax\"; @@ -432,21 +429,21 @@ class ServerStatus postvars[\"page\"] = page; page++; - $.post(\"index.php\", - postvars, - function (data) { - if (data.end) { - $(\"#loading_rows\").hide(); - } - else { - $.each(data.server_status, function(key, server) { - console.log(1); - $(\"table#list_servers tbody\").append(\"\" + - \"".__('Status')."\" + server['Status'] + \"\" + - \"".__('Image')."\" + server['Image'] + \"\" + - \"".__('Name').'" + server["Name"] + "" + - ""); - }); + $.post( + \"index.php\", + postvars, + function (data) { + if (data.end) { + $(\"#loading_rows\").hide(); + } + else { + $.each(data.servers, function(key, server) {; + $(\"table#list_servers tbody\").append(\"\" + + \"".__('Status')."\" + server['Status'] + \"\" + + \"".__('Image')."\" + server['Image'] + \"\" + + \"".__('Name')."\" + server['Name'] + \"\" + + \"\"); + }); load_more_rows = 1; refresh_link_listener_list_servers() @@ -454,21 +451,24 @@ class ServerStatus }, - "json"); + \"json\"); + + } } } $(document).ready(function() { - $(window).bind("scroll", function () { + + $(window).bind(\"scroll\", function () { custom_scroll(); }); - $(window).on("touchmove", function(event) { + $(window).on(\"touchmove\", function(event) { custom_scroll(); }); }); - ' + " ); } From d144d7712845dba4cd0aa5ad6f62ef2a2108e5fa Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 13 Apr 2023 09:38:52 +0200 Subject: [PATCH 04/13] 9555-Groups, agents counters --- pandora_console/include/functions_html.php | 2 +- pandora_console/mobile/include/style/main.css | 44 ++++++++ pandora_console/mobile/operation/groups.php | 101 ++++++++++++------ .../mobile/operation/server_status.php | 6 ++ 4 files changed, 121 insertions(+), 32 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 37054a3e86..caccbbb2be 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -77,7 +77,7 @@ function html_debug_print($var, $file='', $oneline=false) fprintf($f, '%s', $output); fclose($f); } else { - echo '
'.date('Y/m/d H:i:s').' ('.gettype($var).') '.$more_info."\n";
+        echo '
'.date('Y/m/d H:i:s').' ('.gettype($var).') '.$more_info."\n";
         print_r($var);
         echo '
'; } diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index 23321ed8cb..e2d6c868ab 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -510,6 +510,30 @@ table.event_details td.cell_event_name { font-weight: bold; } +.color-red { + color: #c00 !important; +} + +.color-green { + color: #5a8629 !important; +} + +.color-orange { + color: #fd7304 !important; +} + +.color-yellow { + color: #f3c500 !important; +} + +.color-grey { + color: #808080 !important; +} + +.color-blue { + color: #4a83f3 !important; +} + .green, .orange, .yellow, @@ -1732,3 +1756,23 @@ body.login-background height: 12px; display: inline-block; } + +table#list_servers span.data a { + pointer-events: none; + color: inherit; + text-decoration: inherit; + font-weight: inherit; +} + +.zindex10000 { + z-index: 10000; +} + +.relative-mobile { + position: relative !important; +} + +span.agents-counter { + float: right; + margin-right: 15px; +} diff --git a/pandora_console/mobile/operation/groups.php b/pandora_console/mobile/operation/groups.php index 3c7088fd4e..10ecd2568e 100644 --- a/pandora_console/mobile/operation/groups.php +++ b/pandora_console/mobile/operation/groups.php @@ -121,6 +121,45 @@ class Groups $status_image = ui_print_status_image('agent_no_data_ball.png', '', true); } + // Show agent counter by states. + $agents_counter = '['.$group['_total_agents_']; + + if ($group['_monitors_alerts_fired_'] > 0) { + $agents_counter .= ':'; + $agents_counter .= ''.$group['_monitors_alerts_fired_'].''; + } + + if ($group['_monitors_critical_'] > 0) { + $agents_counter .= ':'; + $agents_counter .= ''.$group['_monitors_critical_'].''; + } + + if ($group['_agents_warning_'] > 0) { + $agents_counter .= ':'; + $agents_counter .= ''.$group['_agents_warning_'].''; + } + + if ($group['_agents_unknown_'] > 0) { + $agents_counter .= ':'; + $agents_counter .= ''.$group['_agents_unknown_'].''; + } + + if ($group['_agents_not_init_'] > 0) { + $agents_counter .= ':'; + $agents_counter .= ''.$group['_agents_not_init_'].''; + } + + if ($group['_agents_ok_'] > 0) { + $agents_counter .= ':'; + $agents_counter .= ''.$group['_agents_ok_'].''; + } + + $agents_counter .= ']'; + + if ($group['_iconImg_'] !== null) { + $img_group = html_print_image('images/'.$group['_iconImg_'], true, false, false, false, false, true); + } + $group['_iconImg_'] = ($group['_iconImg_'] == '') ? 'world.png' : $group['_iconImg_']; $ui->contentAddHtml( ' @@ -138,45 +177,45 @@ class Groups ' ); $ui->contentAddHtml( - '
' + '
' ); - $ui->contentAddHtml('

'.$group['_name_'].'

'); + $ui->contentAddHtml('

'.$img_group.' '.$group['_name_'].''.$agents_counter.'

'); $ui->contentAddHtml(''); - $ui->contentAddHtml('
'); + $ui->contentAddHtml( + '
  • '.html_print_image('images/agent_critical.png', true, false, false, false, false, true).__('Agents critical').''.$group['_agents_critical_'].'
  • ' + ); + $ui->contentAddHtml( + '
  • '.html_print_image('images/agent_unknown.png', true, false, false, false, false, true).__('Agents unknown').''.$group['_agents_unknown_'].'
  • ' + ); + $ui->contentAddHtml( + '
  • '.html_print_image('images/module_unknown.png', true, false, false, false, false, true).__('Unknown modules').''.$group['_monitors_unknown_'].'
  • ' + ); + $ui->contentAddHtml( + '
  • '.html_print_image('images/module_notinit.png', true, false, false, false, false, true).__('Not init modules').''.$group['_monitors_not_init_'].'
  • ' + ); + $ui->contentAddHtml( + '
  • '.html_print_image('images/module_ok.png', true, false, false, false, false, true).__('Normal modules').''.$group['_monitors_ok_'].'
  • ' + ); + $ui->contentAddHtml( + '
  • '.html_print_image('images/module_warning.png', true, false, false, false, false, true).__('Warning modules').''.$group['_monitors_warning_'].'
  • ' + ); + $ui->contentAddHtml( + '
  • '.html_print_image('images/module_critical.png', true, false, false, false, false, true).__('Critical modules').''.$group['_monitors_critical_'].'
  • ' + ); + $ui->contentAddHtml( + '
  • '.html_print_image('images/bell_error.png', true, false, false, false, false, true).__('Alerts fired').''.$group['_monitors_alerts_fired_'].'
  • ' + ); + $ui->contentAddHtml(''); + $ui->contentAddHtml('
    '); - $count++; + $count++; } $ui->contentAddHtml(''); diff --git a/pandora_console/mobile/operation/server_status.php b/pandora_console/mobile/operation/server_status.php index b3760f9772..7435ea41ea 100644 --- a/pandora_console/mobile/operation/server_status.php +++ b/pandora_console/mobile/operation/server_status.php @@ -354,6 +354,12 @@ class ServerStatus } } + echo ""; + return [ 'servers' => $servers, 'total' => $total, From 3a80923de906a4851df901d438169f09b51f858d Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 13 Apr 2023 16:27:13 +0200 Subject: [PATCH 05/13] 9555-New view: Services --- pandora_console/include/constants.php | 1 + pandora_console/mobile/include/style/main.css | 69 ++- .../mobile/include/system.class.php | 25 + pandora_console/mobile/index.php | 11 + pandora_console/mobile/operation/home.php | 13 +- pandora_console/mobile/operation/services.php | 536 ++++++++++++++++++ 6 files changed, 650 insertions(+), 5 deletions(-) create mode 100644 pandora_console/mobile/operation/services.php diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 1d11aad151..54325f28e0 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -813,6 +813,7 @@ define('AUDIT_LOG_SERVICE_MANAGEMENT', 'Service management'); define('AUDIT_LOG_INCIDENT_MANAGEMENT', 'Incident management'); define('AUDIT_LOG_UMC', 'Warp Manager'); define('AUDIT_LOG_NMS_VIOLATION', 'NMS Violation'); +define('AUDIT_LOG_ENTERPRISE_VIOLATION', 'Enterprise Violation'); // MIMEs. define( diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index e2d6c868ab..c373aa8d22 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -892,14 +892,16 @@ table.event_details td.cell_event_name { font-size: 12px !important; } - table#list_servers tr { + table#list_servers tr, + table[id^="service-table-"] tr { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; } - table#list_servers b.ui-table-cell-label { + table#list_servers b.ui-table-cell-label, + table[id^="service-table-"] b.ui-table-cell-label { display: none; } @@ -912,9 +914,20 @@ table.event_details td.cell_event_name { table#list_servers tr td.cell_2 { width: 80%; } + + table[id^="service-table-"] tr td.cell_0 { + width: 10%; + } + table[id^="service-table-"] tr td.cell_1 { + width: 80%; + } + table[id^="service-table-"] tr td.cell_2 { + width: 10%; + } } -table#list_servers tr td.cell_0 { +table#list_servers tr td.cell_0, +table[id^="service-table-"] td.cell_0 { border-top: 0px; } @@ -1286,12 +1299,26 @@ table.tactical_bars { background-size: 18px 18px !important; } +.ui-icon-server-status { + background-image: url(../../../images/server-status.menu.png) !important; + background-color: #333 !important; + background-size: 18px 18px !important; +} + +.ui-icon-services { + background-image: url(../../../images/services.menu.png) !important; + background-color: #333 !important; + background-size: 18px 18px !important; +} + .ui-icon-tactical_view, .ui-icon-events, .ui-icon-groups, .ui-icon-alerts, .ui-icon-agents, .ui-icon-modules, +.ui-icon-server-status, +.ui-icon-services, .ui-icon-network_maps, .ui-icon-visual_console, .ui-icon-dashboard { @@ -1323,6 +1350,8 @@ table.tactical_bars { .ui-icon-alerts, .ui-icon-agents, .ui-icon-modules, + .ui-icon-server-status, + .ui-icon-services, .ui-icon-network_maps, .ui-icon-visual_console, .ui-icon-dashboard { @@ -1339,6 +1368,8 @@ table.tactical_bars { .ui-icon-alerts, .ui-icon-agents, .ui-icon-modules, + .ui-icon-server-status, + .ui-icon-services, .ui-icon-network_maps, .ui-icon-visual_console, .ui-icon-dashboard { @@ -1776,3 +1807,35 @@ span.agents-counter { float: right; margin-right: 15px; } + +span.agents-counter span { + padding-left: 1px; + padding-right: 1px; +} + +div.border-collapsible + > h4.ui-collapsible-heading + + div.ui-collapsible-content { + border-width: 1px !important; + border-top: 0px !important; + border-left: 1px solid #ddd; + border-right: 1px solid #ddd; + border-bottom: 1px solid #ddd; +} + +table[id^="service-table-"] { + width: 100%; +} + +table[id^="service-table-"] > tbody > tr:nth-child(even) { + background-color: #ebebeb; +} + +table[id^="service-table-"] a strong { + color: #000 !important; +} + +.mt15px { + margin-top: 15px; + margin-bottom: 15px; +} diff --git a/pandora_console/mobile/include/system.class.php b/pandora_console/mobile/include/system.class.php index b8a21d60b1..253885659f 100644 --- a/pandora_console/mobile/include/system.class.php +++ b/pandora_console/mobile/include/system.class.php @@ -151,10 +151,35 @@ class System } + public function checkEnterprise($page='') + { + if ((int) $this->getConfig('enterprise_installed', false) === 1) { + return true; + } else { + if (empty($this->getRequest('page', false)) === false && $page === '') { + $page = $this->getRequest('page', false); + } + + db_pandora_audit( + AUDIT_LOG_ENTERPRISE_VIOLATION, + 'Trying to access to Mobile Page: '.$page + ); + + return false; + } + } + + public static function getDefaultACLFailText() { return __('Access to this page is restricted to authorized users only, please contact your system administrator if you should need help.').'

    '.__('Please remember that any attempts to access this page will be recorded on the %s System Database.', get_product_name()); } + public static function getDefaultLicenseFailText() + { + return __('Invalid license, please contact your system administrator if you should need help.').'

    '.__('Please remember that any attempts to access this page will be recorded on the %s System Database.', get_product_name()); + } + + } diff --git a/pandora_console/mobile/index.php b/pandora_console/mobile/index.php index dfad2dbebd..401f96ae11 100644 --- a/pandora_console/mobile/index.php +++ b/pandora_console/mobile/index.php @@ -44,6 +44,7 @@ require_once 'operation/agent.php'; require_once 'operation/visualmaps.php'; require_once 'operation/visualmap.php'; require_once 'operation/server_status.php'; +require_once 'operation/services.php'; $enterpriseHook = enterprise_include('mobile/include/enterprise.class.php'); $enterpriseHook = enterprise_include('mobile/operation/home.php'); @@ -183,6 +184,11 @@ switch ($action) { $server_status->ajax($parameter2); break; + case 'services': + $services = new Services(); + $services->ajax($parameter2); + break; + default: if (class_exists('Enterprise')) { $enterprise->enterpriseAjax($parameter1, $parameter2); @@ -418,6 +424,11 @@ switch ($action) { $server_status = new ServerStatus(); $server_status->show(); break; + + case 'services': + $services = new Services(); + $services->show(); + break; } break; } diff --git a/pandora_console/mobile/operation/home.php b/pandora_console/mobile/operation/home.php index c0743941bd..06797a1d1b 100644 --- a/pandora_console/mobile/operation/home.php +++ b/pandora_console/mobile/operation/home.php @@ -40,7 +40,7 @@ class Home $items = []; - // In home + // In home. $items['tactical'] = [ 'name' => __('Tactical view'), 'filename' => 'tactical.php', @@ -95,9 +95,18 @@ class Home 'name' => __('Server status'), 'filename' => 'server_status.php', 'menu_item' => true, - 'icon' => 'ui-icon- ui-widget-icon-floatbeginning', + 'icon' => 'ui-icon-server-status ui-widget-icon-floatbeginning', ]; + if ((int) $system->getConfig('enterprise_installed', false) === 1) { + $items['services'] = [ + 'name' => __('Services'), + 'filename' => 'services.php', + 'menu_item' => true, + 'icon' => 'ui-icon-services ui-widget-icon-floatbeginning', + ]; + } + // Not in home. $items['agent'] = [ 'name' => __('Agent'), diff --git a/pandora_console/mobile/operation/services.php b/pandora_console/mobile/operation/services.php new file mode 100644 index 0000000000..b0fae9d354 --- /dev/null +++ b/pandora_console/mobile/operation/services.php @@ -0,0 +1,536 @@ +checkACL($this->acl)) { + $this->correct_acl = true; + + $this->services = enterprise_hook('services_get_services'); + } else { + $this->correct_acl = false; + } + + if ($system->checkEnterprise() === false) { + $this->show_fail_enterprise(); + } + } + + + public function show() + { + if (!$this->correct_acl) { + $this->show_fail_acl(); + } else { + $this->show_services(); + } + } + + + private function show_fail_acl() + { + $error['type'] = 'onStart'; + $error['title_text'] = __('You don\'t have access to this page'); + $error['content_text'] = System::getDefaultACLFailText(); + if (class_exists('HomeEnterprise')) { + $home = new HomeEnterprise(); + } else { + $home = new Home(); + } + + $home->show($error); + } + + + private function show_fail_enterprise() + { + $error['type'] = 'onStart'; + $error['title_text'] = __('You don\'t have access to this page'); + $error['content_text'] = System::getDefaultLicenseFailText(); + if (class_exists('HomeEnterprise')) { + $home = new HomeEnterprise(); + } else { + $home = new Home(); + } + + $home->show($error); + } + + + public function ajax($parameter2=false) + { + $system = System::getInstance(); + + if (!$this->correct_acl) { + return; + } else { + switch ($parameter2) { + case 'get_services': + $this->serviceId = $system->getRequest('service_id', 0); + $rows = $this->getListServices(); + + $this->rows = $rows; + $table = $this->getTable(); + + echo $table; + break; + } + } + } + + + private function show_services() + { + $ui = Ui::getInstance(); + + $ui->createPage(); + $ui->createDefaultHeader( + __('Services'), + $ui->createHeaderButton( + [ + 'icon' => 'ui-icon-back', + 'pos' => 'left', + 'text' => __('Back'), + 'href' => 'index.php?page=home', + 'class' => 'header-button-left', + ] + ) + ); + $ui->showFooter(false); + $ui->beginContent(); + + $ui->contentAddHtml('
    '); + $count = 0; + $url_agent = 'index.php?page=agents&group=%s&status=%s'; + $url_modules = 'index.php?page=modules&group=%s&status=%s'; + + foreach ($this->services as $service) { + switch ($service['status']) { + case SERVICE_STATUS_NORMAL: + $color = COL_NORMAL; + break; + + case SERVICE_STATUS_CRITICAL: + $color = COL_CRITICAL; + break; + + case SERVICE_STATUS_WARNING: + $color = COL_WARNING; + break; + + case SERVICE_STATUS_UNKNOWN: + default: + $color = COL_UNKNOWN; + break; + } + + $group_icon = ui_print_group_icon($service['id_group'], true, '../images/groups_small_white', '', false); + + $ui->contentAddHtml( + ' + + ' + ); + $ui->contentAddHtml('
    '); + $ui->contentAddHtml('

    '.$group_icon.' '.$service['description'].'

    '); + + $spinner = ' +
    + + + + +
    + '; + + $ui->contentAddHtml($spinner); + $ui->contentAddHtml('
    '); + + $count++; + } + + $ui->contentAddHtml('
    '); + $this->addJavascriptAddBottom(); + + $ui->endContent(); + $ui->showPage(); + } + + + public function getListServices() + { + $ui = Ui::getInstance(); + $this->idTable = 'service-table-'.$this->serviceId; + $rows = []; + + $elements_list = new Service($this->serviceId); + $elements = $elements_list->getElements(true); + + if (empty($elements) === false) { + foreach ($elements as $item) { + $name = ''; + // Icon. + switch ($item->type()) { + case SERVICE_ELEMENT_AGENT: + $element_icon = html_print_image( + 'images/agents@svg.svg', + true, + [ + 'title' => __('Agent'), + 'class' => 'main_menu_icon', + ] + ); + + if ($item->exists() !== true) { + $name .= ''.__('Nonexistent. This element should be deleted').''; + } else { + $url = ui_get_full_url( + 'index.php?sec=eventos&sec2=operation/events/events&event_view_hr=8&severity=4&id_agent='.$item->agent()->id_agente() + ); + $name = ''; + if (((bool) $item->agent()->disabled()) === true) { + $disabled_element = true; + if (is_metaconsole() === true) { + $name .= ''; + } else { + $name .= ''; + } + } + + $name .= ''; + if (is_metaconsole() + && ((int) $item->id_server_meta()) !== 0 + ) { + $name .= $item->nodeName().' » '; + } + + $name .= $item->agent()->alias(); + $name .= ''; + $name .= ''; + + if (((bool) $item->agent()->disabled()) === true) { + $name .= ui_print_help_tip( + __('This element does not affect service weigth because is disabled.'), + true + ).''; + } + } + break; + + case SERVICE_ELEMENT_SERVICE: + $element_icon = html_print_image( + 'images/item-service.svg', + true, + [ + 'title' => __('Service'), + 'class' => 'main_menu_icon', + ] + ); + if ($item->exists() !== true) { + $name .= ''.__('Nonexistent. This element should be deleted').''; + } else { + if (is_metaconsole() + && (((int) $item->id_server_meta()) !== 0 ) + ) { + $server = db_get_row( + 'tmetaconsole_setup', + 'id', + $item->id_server_meta() + ); + + $url = ui_meta_get_url_console_child( + $server, + 'estado', + 'enterprise/operation/services/services', + [ + 'tab' => 'service', + 'action' => 'view', + 'id_service' => $item->id_service_child(), + ] + ); + } else { + $url = ui_get_full_url( + 'index.php?sec=network&sec2=enterprise/operation/services/services&tab=service&action=view&id_service='.$item->id_service_child() + ); + } + + $name = ''; + if (((bool) $item->service()->disabled()) === true) { + $disabled_element = true; + if (is_metaconsole() === true) { + $name .= ''; + } else { + $name .= ''; + } + } + + $name .= ''; + if (is_metaconsole() + && ((int) $item->id_server_meta()) !== 0 + ) { + $name .= $item->nodeName().' » '; + } + + $name .= $item->service()->name(); + $name .= ''; + $name .= ''; + + if (((bool) $item->service()->disabled()) === true) { + $name .= ui_print_help_tip( + __('This element does not affect service weigth because is disabled.'), + true + ).''; + } + } + break; + + case SERVICE_ELEMENT_MODULE: + $element_icon = html_print_image( + 'images/modules@svg.svg', + true, + [ + 'title' => __('Module'), + 'class' => 'main_menu_icon', + ] + ); + + if ($item->exists() !== true) { + $name .= ''.__('Nonexistent. This element should be deleted').''; + } else { + $url = ui_get_full_url( + 'index.php?sec=eventos&sec2=operation/events/events&event_view_hr=8&severity=4&id_agent='.$item->module()->id_agente().'&id_agent_module='.$item->id_agente_modulo() + ); + $name = ''; + $name .= ''; + + if (((bool) $item->module()->disabled()) === true) { + $disabled_element = true; + if (is_metaconsole()) { + $name .= ''; + } else { + $name .= ''; + } + } + + if (is_metaconsole() + && ((int) $item->id_server_meta()) !== 0 + ) { + $name .= $item->nodeName().' » '; + } + + $name .= $item->module()->agent()->alias(); + $name .= ' » '.$item->module()->nombre(); + + if (((bool) $item->module()->disabled()) === true) { + $name .= ui_print_help_tip( + __('This element does not affect service weigth because is disabled.'), + true + ).''; + } + + $name .= ''; + $name .= ''; + } + break; + + case SERVICE_ELEMENT_DYNAMIC: + $element_icon = html_print_image( + 'images/modules-group@svg.svg', + true, + [ + 'title' => __('Dynamic element'), + 'class' => 'main_menu_icon', + ] + ); + + try { + if (empty($item->getMatches(true)) === true) { + ui_print_warning_message( + __( + 'Dynamic element (%d) \'%s\' does not match any target', + $item->id(), + $item->description() + ) + ); + } + } catch (Exception $e) { + ui_print_warning_message( + __( + 'Dynamic element (%d) \'%s\' causes an error: %s', + $item->id(), + $item->description(), + $e->getMessage() + ) + ); + } + + if ($item->rules()->dynamic_type === 'agent') { + $name = ''.__( + 'agents like "%s"', + $item->rules()->agent_name + ).''; + } else if ($item->rules()->dynamic_type === 'module') { + $name = ''.__( + 'modules like "%s"', + $item->rules()->module_name + ).''; + } + break; + + default: + $element_icon = ''; + break; + } + + // Status. + switch ($item->lastStatus(true)) { + case SERVICE_STATUS_NORMAL: + case AGENT_STATUS_NORMAL: + case AGENT_MODULE_STATUS_NORMAL: + $status_element = STATUS_MODULE_OK; + $title_element = __('NORMAL'); + break; + + case SERVICE_STATUS_CRITICAL: + case AGENT_MODULE_STATUS_CRITICAL_ALERT: + case AGENT_MODULE_STATUS_CRITICAL_BAD: + case AGENT_STATUS_CRITICAL: + $status_element = STATUS_MODULE_CRITICAL; + $title_element = __('CRITICAL'); + break; + + case SERVICE_STATUS_WARNING: + case AGENT_MODULE_STATUS_WARNING: + case AGENT_MODULE_STATUS_WARNING_ALERT: + case AGENT_STATUS_WARNING: + $status_element = STATUS_MODULE_WARNING; + $title_element = __('WARNING'); + break; + + case SERVICE_STATUS_ALERT: + case AGENT_MODULE_STATUS_NOT_INIT: + case AGENT_STATUS_NOT_INIT: + $status_element = STATUS_MODULE_NO_DATA; + $title_element = __('NOT INITIALIZED'); + break; + + case AGENT_MODULE_STATUS_UNKNOWN: + case SERVICE_STATUS_UNKNOWN: + case AGENT_STATUS_UNKNOWN: + default: + $status_element = STATUS_MODULE_UNKNOWN; + $title_element = __('UNKNOWN'); + break; + } + + $row = []; + $row[0] = $element_icon; + $row[1] = $name; + $row[2] = ui_print_status_image($status_element, $title_element, true); + + array_push($rows, $row); + } + } + + return $rows; + } + + + public function getTable() + { + $html = ''; + + $html = "serviceId."' data-mode='reflow' class='ui-responsive table-stroke'>"; + + // $html .= ''; + // $html .= ''; + // $html .= ''; + // $html .= ''; + // $html .= ''; + // $html .= ''; + // $html .= ''; + $html .= ''; + foreach ($this->rows as $key => $row) { + $html .= ""; + + foreach ($row as $key_cell => $cell) { + $html .= "'; + } + + $html .= ''; + } + + $html .= ''; + $html .= '
    '.__('Type').''.__('Name').''.__('Status').'
    ".$cell.'
    '; + + return $html; + } + + + private function addJavascriptAddBottom() + { + $ui = Ui::getInstance(); + + $ui->contentAddHtml( + "" + ); + } + + +} From 6cb74f18cd9aed6d3300bc683afb2b8acf38a3e3 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 17 Apr 2023 15:14:51 +0200 Subject: [PATCH 06/13] 9555-Features and styles fixes --- .../include/functions_reporting.php | 24 ++-- pandora_console/mobile/include/style/main.css | 50 +++++-- pandora_console/mobile/include/ui.class.php | 4 + pandora_console/mobile/operation/agent.php | 7 +- pandora_console/mobile/operation/agents.php | 12 +- pandora_console/mobile/operation/alerts.php | 2 +- pandora_console/mobile/operation/events.php | 34 ++--- pandora_console/mobile/operation/modules.php | 131 ++++++++++++++---- 8 files changed, 183 insertions(+), 81 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 9c99d47a2a..9606544c89 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -13302,32 +13302,32 @@ function reporting_tiny_stats( if ($modern === true) { $out .= '
    '; if (isset($fired_count) && $fired_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$fired_count.'
    '; } if (isset($critical_count) && $critical_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$critical_count.'
    '; } if (isset($warning_count) && $warning_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$warning_count.'
    '; } if (isset($unknown_count) && $unknown_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$unknown_count.'
    '; } if (isset($not_init_count) && $not_init_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$not_init_count.'
    '; } if (isset($normal_count) && $normal_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$normal_count.'
    '; } @@ -13336,27 +13336,27 @@ function reporting_tiny_stats( // Classic ones. $out .= ''.$total_count.''; if (isset($fired_count) && $fired_count > 0) { - $out .= ' '.$separator.' '.$fired_count.''; + $out .= ' '.$separator.' '.$fired_count.''; } if (isset($critical_count) && $critical_count > 0) { - $out .= ' '.$separator.' '.$critical_count.''; + $out .= ' '.$separator.' '.$critical_count.''; } if (isset($warning_count) && $warning_count > 0) { - $out .= ' '.$separator.' '.$warning_count.''; + $out .= ' '.$separator.' '.$warning_count.''; } if (isset($unknown_count) && $unknown_count > 0) { - $out .= ' '.$separator.' '.$unknown_count.''; + $out .= ' '.$separator.' '.$unknown_count.''; } if (isset($not_init_count) && $not_init_count > 0) { - $out .= ' '.$separator.' '.$not_init_count.''; + $out .= ' '.$separator.' '.$not_init_count.''; } if (isset($normal_count) && $normal_count > 0) { - $out .= ' '.$separator.' '.$normal_count.''; + $out .= ' '.$separator.' '.$normal_count.''; } $out .= ''; diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index c373aa8d22..91a2cf23ca 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -66,6 +66,18 @@ body { display: none; } +.flex { + display: flex; +} + +.align-items-center { + align-items: center; +} + +.space-between { + justify-content: space-between; +} + .ui-header .ui-title { font-size: 14px !important; min-height: 1.1em; @@ -534,7 +546,7 @@ table.event_details td.cell_event_name { color: #4a83f3 !important; } -.green, +/* .green, .orange, .yellow, .red, @@ -544,11 +556,11 @@ table.event_details td.cell_event_name { color: white !important; padding: 1px 3px; border-radius: 2px; -} +} */ -.agents_tiny_stats span { +/* .agents_tiny_stats span { background: #222; -} +} */ .agent_details { padding: 10px 0px 10px 0px; @@ -677,7 +689,8 @@ table.event_details td.cell_event_name { #list_agents .cell_1, #list_agents .cell_2, #list_agents .cell_3, - #list_agents .cell_4 { + #list_agents .cell_4, + #list_agents .cell_7 { display: none !important; } @@ -942,8 +955,8 @@ table[id^="service-table-"] td.cell_0 { #list_Modules td, #list_agent_Modules td { - height: 35px; - padding-top: 20px; + height: 25px; + vertical-align: middle; } #list_agent_Modules td.cell_0 > span.tiny { @@ -952,6 +965,7 @@ table[id^="service-table-"] td.cell_0 { #list_Modules .cell_5 img { float: left; + margin-left: 5px; } #user_logged { @@ -1012,10 +1026,10 @@ li.ui-btn { border-bottom: 0px solid white !important; } -.cell_0 { +/* .cell_0 { border-top: solid 1px #666; margin-top: 0px; -} +} */ #list_events .cell_0 { border: 0px; @@ -1423,9 +1437,9 @@ span.nobold * { } .status_rounded_rectangles.forced_title { - width: 1em; - height: 1em; - border-radius: 50%; + width: 30px; + height: 15px; + border-radius: 4px; } .status_small_rectangles { @@ -1827,8 +1841,9 @@ table[id^="service-table-"] { width: 100%; } +table > tbody > tr:nth-child(even), table[id^="service-table-"] > tbody > tr:nth-child(even) { - background-color: #ebebeb; + background-color: #e5e9ed; } table[id^="service-table-"] a strong { @@ -1839,3 +1854,12 @@ table[id^="service-table-"] a strong { margin-top: 15px; margin-bottom: 15px; } + +.ml5px { + margin-left: 5px; +} + +.close-button-dialog { + padding: 2px 7px !important; + margin-right: 5px !important; +} diff --git a/pandora_console/mobile/include/ui.class.php b/pandora_console/mobile/include/ui.class.php index 38c2a7e566..04bda0f942 100755 --- a/pandora_console/mobile/include/ui.class.php +++ b/pandora_console/mobile/include/ui.class.php @@ -782,6 +782,10 @@ class Ui $dialogHtml .= "
    \n"; $dialogHtml .= "
    \n"; + if ($options['return_html_dialog'] === true) { + return $dialogHtml; + } + $this->dialogs[$type][] = $dialogHtml; } diff --git a/pandora_console/mobile/operation/agent.php b/pandora_console/mobile/operation/agent.php index 4ab3f7a234..5bd28c3350 100644 --- a/pandora_console/mobile/operation/agent.php +++ b/pandora_console/mobile/operation/agent.php @@ -191,10 +191,7 @@ class Agent $address = $this->agent['direccion']; $ip .= (empty($address) === true) ? ''.__('N/A').'' : $address; $last_contact = ''.__('Last contact').': '; - $last_contact .= ui_print_timestamp( - $this->agent['ultimo_contacto'], - true - ); + $last_contact .= human_time_comparation($this->agent['ultimo_contacto'], 'tiny'); if (empty($agent['comentarios']) === true) { $description .= ''.__('N/A').''; @@ -213,7 +210,7 @@ class Agent false, false, false, - ['class' => 'invert_filter os-big-icon'], + ['class' => 'invert_filter main_menu_icon'], false ).'
    '; $html .= '
    '; diff --git a/pandora_console/mobile/operation/agents.php b/pandora_console/mobile/operation/agents.php index 1a6b0061e2..37320a52e2 100644 --- a/pandora_console/mobile/operation/agents.php +++ b/pandora_console/mobile/operation/agents.php @@ -97,6 +97,7 @@ class Agents $agent[6] = ''.__('Status').''.$agent[6]; $agent[7] = ''.__('Alerts').''.$agent[7]; $agent[8] = ''.__('Last contact').''.$agent[8]; + $agent[9] = ''.__('Last status change').''.$agent[9]; $agents[$key] = $agent; } @@ -406,12 +407,12 @@ class Agents $row[5] = $row[__('Status')] = ''.__('S.').' '.$img_status; $row[6] = $row[__('Alerts')] = '  '.__('A.').' '.$img_alert; - $row[7] = $row[__('Modules')] = ''.__('Modules').' '.''.reporting_tiny_stats($agent, true, 'agent', ' ').' '; + $row[7] = $row[__('Modules')] = ''.reporting_tiny_stats($agent, true, 'agent', ':').' '; $last_time = time_w_fixed_tz($agent['ultimo_contacto']); $now = get_system_time(); $diferencia = ($now - $last_time); - $time = ui_print_timestamp($last_time, true, ['style' => 'font-size: 12px; margin-left: 20px;', 'units' => 'tiny']); + $time = human_time_comparation($agent['ultimo_contacto'], 'tiny'); $style = ''; if ($diferencia > ($agent['intervalo'] * 2)) { $row[8] = $row[__('Last contact')] = ''.$time.''; @@ -419,7 +420,10 @@ class Agents $row[8] = $row[__('Last contact')] = $time; } - $row[8] = $row[__('Last contact')] = ''.__('Last contact').' '.''.$row[__('Last contact')].''; + $row[8] = $row[__('Last contact')] = ''.$row[__('Last contact')].''; + + $last_status_change = human_time_comparation(agents_get_last_status_change($agent['id_agente']), 'tiny'); + $row[9] = $row[__('Last status change')] = ''.$last_status_change.''; if (!$ajax) { unset($row[0]); @@ -431,6 +435,7 @@ class Agents unset($row[6]); unset($row[7]); unset($row[8]); + unset($row[9]); } $agents[$agent['id_agente']] = $row; @@ -513,6 +518,7 @@ class Agents \"\" + agent[6] + \"\" + \"\" + agent[7] + \"\" + \"\" + agent[8] + \"\" + + \"\" + agent[9] + \"\" + \"\"); }); diff --git a/pandora_console/mobile/operation/alerts.php b/pandora_console/mobile/operation/alerts.php index 65971a52ea..43c6482264 100644 --- a/pandora_console/mobile/operation/alerts.php +++ b/pandora_console/mobile/operation/alerts.php @@ -345,7 +345,7 @@ class Alerts ); $row[__('Last Fired')] = sprintf( $disabled_style, - ui_print_timestamp($alert['last_fired'], true) + human_time_comparation($alert['last_fired'], 'tiny') ); $row[__('Status')] = ui_print_status_image($status, $title, true); diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index 50e9aab8ba..16212053d2 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -326,10 +326,7 @@ class Events $event['clean_tags'] = events_clean_tags( $event['tags'] ); - $event['timestamp'] = date( - $system->getConfig('date_format'), - $event['utimestamp'] - ); + $event['timestamp'] = human_time_comparation($event['utimestamp'], 'tiny'); if (empty($event['owner_user']) === true) { $event['owner_user'] = ''.__('N/A').''; } else { @@ -380,30 +377,30 @@ class Events switch ($event['criticity']) { default: case 0: - $img_sev = 'images/status_sets/default/severity_maintenance.png'; + $img_sev = 'images/status_sets/default/severity_maintenance_rounded.png'; break; case 1: - $img_sev = 'images/status_sets/default/severity_informational.png'; + $img_sev = 'images/status_sets/default/severity_informational_rounded.png'; break; case 2: - $img_sev = 'images/status_sets/default/severity_normal.png'; + $img_sev = 'images/status_sets/default/severity_normal_rounded.png'; break; case 3: - $img_sev = 'images/status_sets/default/severity_warning.png'; + $img_sev = 'images/status_sets/default/severity_warning_rounded.png'; break; case 4: - $img_sev = 'images/status_sets/default/severity_critical.png'; + $img_sev = 'images/status_sets/default/severity_critical_rounded.png'; break; case 5: - $img_sev = 'images/status_sets/default/severity_minor.png'; + $img_sev = 'images/status_sets/default/severity_minor_rounded.png'; break; case 6: - $img_sev = 'images/status_sets/default/severity_major.png'; + $img_sev = 'images/status_sets/default/severity_major_rounded.png'; break; } @@ -412,9 +409,8 @@ class Events $img_sev, true, [ - 'class' => 'image_status', - 'width' => 12, - 'height' => 12, + 'width' => 30, + 'height' => 15, 'title' => $event_criticity, ], false, @@ -879,7 +875,7 @@ class Events $options['content_text'] .= ''; - $options['button_close'] = false; + $options['button_close'] = true; return $options; } @@ -1209,8 +1205,6 @@ class Events if (data.correct) { event = data.event; //Fill the dialog - $("#detail_event_dialog h1.dialog_title") - .html(event["evento"]); $("#detail_event_dialog .cell_event_name") .html(event["evento"]); $("#detail_event_dialog .cell_event_id") @@ -1256,6 +1250,12 @@ class Events $("#validate_button_correct").hide(); $.mobile.loading( "hide" ); $("#detail_event_dialog_hook").click(); + + $("#detail_event_dialog-button_close").html("X"); + $("#detail_event_dialog-button_close").addClass("close-button-dialog"); + $(".dialog_title").addClass("ml5px"); + $(".dialog_title").parent().addClass("flex align-items-center space-between"); + $(".dialog_title").parent().append($("#detail_event_dialog-button_close")); } else { $.mobile.loading( "hide" ); diff --git a/pandora_console/mobile/operation/modules.php b/pandora_console/mobile/operation/modules.php index d610c5a13a..89f39912f0 100644 --- a/pandora_console/mobile/operation/modules.php +++ b/pandora_console/mobile/operation/modules.php @@ -591,7 +591,18 @@ class Modules } } - $row[0] = $row[__('Module name')] = ''.$image_status.''.''.ui_print_truncate_text($module['module_name'], 30, false).''; + $script = ''; + if ($system->getRequest('page') === 'modules') { + if ($system->getConfig('metaconsole')) { + $script = 'onclick="openDialog('.$module['id_agente_modulo'].', '.$this->id_agent.' ,'.$module['server_id'].');"'; + } else { + $script = 'onclick="openDialog('.$module['id_agente_modulo'].', '.$this->id_agent.', \'node\');"'; + } + + $row[0] = $row[__('Module name')] = ''.$image_status.''.''.ui_print_truncate_text($module['module_name'], 30, false).''; + } else { + $row[0] = $row[__('Module name')] = ''.$image_status.''.''.ui_print_truncate_text($module['module_name'], 30, false).''; + } if ($this->columns['agent']) { $row[1] = $row[__('Agent name')] = ''.ui_print_truncate_text($module['agent_alias'], 50, false).''; @@ -658,7 +669,7 @@ class Modules $row[4] = $row[__('Interval')] = ''.$row[__('Interval')].''; - $row[6] = $row[__('Timestamp')] = ''.ui_print_timestamp($module['utimestamp'], true, ['units' => 'tiny']).''; + $row[6] = $row[__('Timestamp')] = ''.human_time_comparation($module['utimestamp'], 'tiny').''; if (is_numeric($module['datos'])) { $output = format_numeric($module['datos']); @@ -712,29 +723,50 @@ class Modules ); // Row 7. - $row[__('Data')] = ui_get_snapshot_image($link, $is_snapshot).'  '; + $row[7] = $row[__('Data')] = ui_get_snapshot_image($link, $is_snapshot).'  '; } else { - if ($system->getConfig('metaconsole')) { - $row[__('Data')] = ''; - $row[__('Data')] .= ''; - $row[__('Data')] .= 'id_agent.'">'; - $row[__('Data')] .= $output.''; - // Row 7. - $row[__('Data')]; + if ($system->getRequest('page') === 'modules') { + if ($system->getConfig('metaconsole')) { + $row[7] = $row[__('Data')] = ''; + $row[7] = $row[__('Data')] .= ''; + $row[7] = $row[__('Data')] .= ''; + // Row 7. + $row[7] = $row[__('Data')]; + } else { + // Row 7. + $row[7] = $row[__('Data')] = ''; + $row[7] = $row[__('Data')] .= ''; + $row[7] = $row[__('Data')] .= ''; + } } else { - // Row 7. - $row[__('Data')] = ''; - $row[__('Data')] .= ''; - $row[__('Data')] .= 'id_agent.'">'; - $row[__('Data')] .= $output.''; + if ($system->getConfig('metaconsole')) { + $row[__('Data')] = ''; + $row[__('Data')] .= ''; + $row[__('Data')] .= 'id_agent.'">'; + $row[__('Data')] .= $output.''; + // Row 7. + $row[__('Data')]; + } else { + // Row 7. + $row[__('Data')] = ''; + $row[__('Data')] .= ''; + $row[__('Data')] .= 'id_agent.'">'; + $row[__('Data')] .= $output.''; + } } } @@ -804,6 +836,30 @@ class Modules } } + $ui->contentAddHtml( + ' + + +
    +
    +

    '.__('Choose option').'

    +
    + + +
    ' + ); + $ui->contentAddLinkListener('list_Modules'); } @@ -850,8 +906,8 @@ class Modules \"".__('Status')."\" + module[5] + \"\" + \"".__('Interval')."\" + module[4] + \"\" + \"".__('Timestamp')."\" + module[6] + \"\" + - \"".__('Data').'" + module[7] + "" + - ""); + \"".__('Data')."\" + module[7] + \"\" + + \"\"); }); load_more_rows = 1; @@ -860,21 +916,36 @@ class Modules }, - "json"); + \"json\"); } } } + + function openDialog(moduleId, agentId, serverId) { + console.log(1); + var graph = ''; + var historical = ''; + if (serverId === 'node') { + graph = 'index.php?page=module_graph&id='+moduleId+'&id_agent='+agentId; + } else { + graph = 'index.php?page=module_graph&id='+moduleId+'&id_agent='+agentId+'&server_id='+serverId; + } + + $('#graph-option').attr('href', graph); + + $('#module-dialog-button').click(); + } $(document).ready(function() { - $(window).bind("scroll", function () { + $(window).bind(\"scroll\", function () { custom_scroll(); }); - $(window).on("touchmove", function(event) { + $(window).on(\"touchmove\", function(event) { custom_scroll(); }); - }); - ' + }); + " ); } From bfd00726bf687424bc93910ec2cadbe51aefb7ec Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 17 Apr 2023 20:02:16 +0200 Subject: [PATCH 07/13] 9555-Header and tactical view --- pandora_console/images/arrow-d-mobile.svg | 17 ++ pandora_console/images/arrow-u-mobile.svg | 17 ++ pandora_console/images/go-back-mobile.svg | 19 ++ pandora_console/images/home-mobile.svg | 19 ++ .../include/functions_reporting.php | 88 ++++++- pandora_console/mobile/include/style/main.css | 237 +++++++++++++++++- pandora_console/mobile/operation/tactical.php | 18 +- 7 files changed, 387 insertions(+), 28 deletions(-) create mode 100644 pandora_console/images/arrow-d-mobile.svg create mode 100644 pandora_console/images/arrow-u-mobile.svg create mode 100644 pandora_console/images/go-back-mobile.svg create mode 100644 pandora_console/images/home-mobile.svg diff --git a/pandora_console/images/arrow-d-mobile.svg b/pandora_console/images/arrow-d-mobile.svg new file mode 100644 index 0000000000..6c0ea7b1a1 --- /dev/null +++ b/pandora_console/images/arrow-d-mobile.svg @@ -0,0 +1,17 @@ + + + + E5134209-ED99-4D42-AFFC-E210CA7C75CA@svg + Created with sketchtool. + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/arrow-u-mobile.svg b/pandora_console/images/arrow-u-mobile.svg new file mode 100644 index 0000000000..8dfb133adf --- /dev/null +++ b/pandora_console/images/arrow-u-mobile.svg @@ -0,0 +1,17 @@ + + + + 468CE642-FF47-4D9D-8D01-9137E4A42791@svg + Created with sketchtool. + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/go-back-mobile.svg b/pandora_console/images/go-back-mobile.svg new file mode 100644 index 0000000000..6760932b50 --- /dev/null +++ b/pandora_console/images/go-back-mobile.svg @@ -0,0 +1,19 @@ + + + + 27D252CA-B4D5-442E-ACDD-238B8E51751E@svg + Created with sketchtool. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/home-mobile.svg b/pandora_console/images/home-mobile.svg new file mode 100644 index 0000000000..2e83a72cdc --- /dev/null +++ b/pandora_console/images/home-mobile.svg @@ -0,0 +1,19 @@ + + + + 13ED062F-1DD5-4B18-B16F-64D609ACA6F7@svg + Created with sketchtool. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 9606544c89..a459dd5af2 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -12121,6 +12121,70 @@ function reporting_get_stats_indicators($data, $width=280, $height=20, $html=tru } +function reporting_get_stats_indicators_mobile($data, $width=280, $height=20, $html=true) +{ + $table_ind = html_get_predefined_table(); + + $servers = []; + $servers['all'] = (int) db_get_value('COUNT(id_server)', 'tserver'); + $servers['up'] = (int) servers_check_status(); + $servers['down'] = ($servers['all'] - $servers['up']); + if ($servers['all'] == 0) { + $servers['health'] = 0; + } else { + $servers['health'] = ($servers['up'] / ($servers['all'] / 100)); + } + + $return = []; + + $color = get_color_progress_mobile($servers['health']); + $return['server_health'] = [ + 'title' => __('Server health'), + 'graph' => ui_progress($servers['health'], '90%', '.8', $color, true, ' ', false), + ]; + + $color = get_color_progress_mobile($data['monitor_health']); + $return['monitor_health'] = [ + 'title' => __('Monitor health'), + 'graph' => ui_progress($data['monitor_health'], '90%', '.8', $color, true, ' ', false), + ]; + + $color = get_color_progress_mobile($data['module_sanity']); + $return['module_sanity'] = [ + 'title' => __('Module sanity'), + 'graph' => ui_progress($data['module_sanity'], '90%', '.8', $color, true, ' ', false), + ]; + + $color = get_color_progress_mobile($data['alert_level']); + $return['alert_level'] = [ + 'title' => __('Alert level'), + 'graph' => ui_progress($data['alert_level'], '90%', '.8', $color, true, ' ', false), + ]; + + return $return; +} + + +function get_color_progress_mobile($value) +{ + $color = ''; + + if ((int) $value > 66) { + $color = '#82B92E'; + } + + if ((int) $value < 66) { + $color = '#FCAB10'; + } + + if ((int) $value < 33) { + $color = '#ED474A'; + } + + return $color; +} + + function reporting_get_stats_alerts($data, $links=false) { global $config; @@ -13302,32 +13366,32 @@ function reporting_tiny_stats( if ($modern === true) { $out .= '
    '; if (isset($fired_count) && $fired_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$fired_count.'
    '; } if (isset($critical_count) && $critical_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$critical_count.'
    '; } if (isset($warning_count) && $warning_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$warning_count.'
    '; } if (isset($unknown_count) && $unknown_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$unknown_count.'
    '; } if (isset($not_init_count) && $not_init_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$not_init_count.'
    '; } if (isset($normal_count) && $normal_count > 0) { - $out .= '
    '; + $out .= '
    '; $out .= ''.$normal_count.'
    '; } @@ -13336,27 +13400,27 @@ function reporting_tiny_stats( // Classic ones. $out .= ''.$total_count.''; if (isset($fired_count) && $fired_count > 0) { - $out .= ' '.$separator.' '.$fired_count.''; + $out .= ' '.$separator.' '.$fired_count.''; } if (isset($critical_count) && $critical_count > 0) { - $out .= ' '.$separator.' '.$critical_count.''; + $out .= ' '.$separator.' '.$critical_count.''; } if (isset($warning_count) && $warning_count > 0) { - $out .= ' '.$separator.' '.$warning_count.''; + $out .= ' '.$separator.' '.$warning_count.''; } if (isset($unknown_count) && $unknown_count > 0) { - $out .= ' '.$separator.' '.$unknown_count.''; + $out .= ' '.$separator.' '.$unknown_count.''; } if (isset($not_init_count) && $not_init_count > 0) { - $out .= ' '.$separator.' '.$not_init_count.''; + $out .= ' '.$separator.' '.$not_init_count.''; } if (isset($normal_count) && $normal_count > 0) { - $out .= ' '.$separator.' '.$normal_count.''; + $out .= ' '.$separator.' '.$normal_count.''; } $out .= ''; diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index 91a2cf23ca..aec356b6ba 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -28,7 +28,8 @@ :root { --primary-color: #14524f; --secondary-color: #ffffff; - --input-border: #c0ccdc; + --body-color: #f6f7fb; + --border-color: #e5e9ed; } @font-face { @@ -51,7 +52,7 @@ body { text-align: left; vertical-align: top; font-weight: 400; - font-family: "Lato"; + font-family: "Lato" !important; } .small { @@ -89,6 +90,7 @@ body { overflow: hidden; white-space: nowrap; outline: 0 !important; + line-height: 25px; } .ui-btn-inner { @@ -116,11 +118,6 @@ td.flex-center { padding-top: 10px; } -#tactical1 *, -#tactical2 * { - font-weight: bold; -} - #tactical1 a, #tactical2 a { font-weight: bold; @@ -1850,6 +1847,12 @@ table[id^="service-table-"] a strong { color: #000 !important; } +table#last-activity > tbody > tr, +table.tactical_bars > tbody > tr, +.tactical_set > table > tbody > tr { + background-color: var(--secondary-color) !important; +} + .mt15px { margin-top: 15px; margin-bottom: 15px; @@ -1863,3 +1866,223 @@ table[id^="service-table-"] a strong { padding: 2px 7px !important; margin-right: 5px !important; } + +div#main_page { + background-color: var(--body-color) !important; +} + +.ui-header.ui-bar-inherit.ui-header-fixed.slidedown { + height: 45px; + background-color: var(--secondary-color); +} + +.ui-page.ui-page-theme-a.ui-page-active { + padding-top: 45px !important; +} + +.header-button-right.ui-button.ui-shadow.ui-corner-all.ui-widget.ui-button-inherit { + color: var(--secondary-color); + background-color: var(--primary-color); + border-radius: 8px; + border-color: var(--secondary-color); + box-shadow: var(--secondary-color); + -webkit-box-shadow: #fff; + text-shadow: none; + margin-top: 5px !important; + display: flex; + align-items: center; +} + +.header-button-left.ui-button.ui-shadow.ui-corner-all.ui-widget.ui-button-inherit { + color: #95a3bf; + background-color: transparent; + border-color: var(--secondary-color); + box-shadow: var(--secondary-color); + -webkit-box-shadow: #fff; + text-shadow: none; + margin-top: 7px !important; + display: flex; + align-items: center; +} + +.ui-grid-a.ui-responsive { + background-color: var(--secondary-color); + border-radius: 8px; + border: 1px solid var(--border-color); +} + +.ui-button-icon-space { + margin-left: 2px; + margin-right: 2px; +} + +.ui-icon-back { + background-image: url(../../../images/go-back-mobile.svg) !important; +} + +.ui-icon-home { + background-image: url(../../../images/home-mobile.svg) !important; +} + +.ui-icon-arrow-d { + background-image: url(../../../images/arrow-d-mobile.svg) !important; +} + +.ui-icon-arrow-u { + background-image: url(../../../images/arrow-u-mobile.svg) !important; +} + +.ui-icon { + background-color: transparent !important; +} + +.ui-body.ui-body-d { + padding: 5px 0px; + margin: 0px; +} + +div.hr { + border-bottom: 1px solid var(--border-color); + width: 100%; + margin: 10px 0px; +} + +table, +fieldset { + padding: 0px 5px !important; +} + +table.tactical_bars tbody tr { + height: 20px; +} + +.progress_main { + height: 2.5em; + border: 2px solid #82b92e; + position: relative; + width: 100%; + display: inline-block; + display: flex; + border-radius: 4px; + line-height: 9pt; + font-size: 9pt; + border: 1px solid var(--border-color) !important; + background-color: var(--body-color); + margin-right: 40px !important; +} + +.progress_main_noborder { + height: 2.5em; + position: relative; + width: 100%; + display: inline-block; + display: flex; +} + +.progress_main:before { + content: attr(data-label); + position: absolute; + text-align: center; + left: 0; + right: 0; + margin-top: 0.2em; +} + +.progress { + width: 0%; + background: #82b92e; + height: 100%; + float: left; + border-radius: 4px; +} + +.tiny.tactical_bar { + width: 50%; +} + +.tactical_set > table { + width: 60% !important; +} + +.tactical_set > table > tbody > tr > td { + text-align: left !important; +} + +.tactical_set > table > tbody > tr > #table1-0-0, +.tactical_set > table > tbody > tr > #table1-0-3, +.tactical_set > table > tbody > tr > #table2-0-0, +.tactical_set > table > tbody > tr > #table2-0-3 { + width: 15% !important; +} + +.tactical_set > table > tbody > tr > #table1-0-1, +.tactical_set > table > tbody > tr > #table2-0-1 { + width: 40% !important; +} + +.tactical_set > table > tbody > tr > #table2-0-3 > div.alert_background_state { + margin: 0px !important; +} + +div#tactical2 .tactical_set > table { + width: 100% !important; +} + +.ui-collapsible.ui-collapsible-inset.ui-corner-all.ui-collapsible-themed-content, +.ui-collapsible.ui-collapsible-inset.ui-corner-all.ui-collapsible-themed-content.ui-collapsible-collapsed { + border: 1px solid var(--border-color); + border-radius: 8px; +} + +.ui-collapsible-heading-toggle.ui-button.ui-button-a.ui-mini, +.ui-collapsible-heading.ui-collapsible-heading-collapsed { + background-color: var(--secondary-color) !important; + border: 0px !important; + font-weight: 400; +} + +.ui-collapsible-content.ui-body-c { + padding: 0px; + margin: 0px; +} + +.ui-listview-item.ui-listview-item-static.ui-body-inherit.ui-first-child.ui-last-child { + padding: 0px; +} + +table#last-activity > tbody > tr:not(:last-child) { + border-bottom: 1px solid var(--border-color) !important; +} + +table#last-activity > tbody > tr { + display: flex; + flex-direction: row; + flex-wrap: wrap; +} + +table#last-activity > tbody > tr > td.cell_0 { + width: 10%; + padding-bottom: 2px !important; +} +table#last-activity > tbody > tr > td.cell_1 { + width: 75%; + max-width: 75%; + padding-bottom: 2px !important; +} +table#last-activity > tbody > tr > td.cell_2 { + width: 15%; + padding-bottom: 2px !important; +} +table#last-activity > tbody > tr > td.cell_3 { + width: 10%; + margin-left: 10%; + padding-top: 2px !important; +} + +table#last-activity > tbody > tr > td > b { + display: none; +} + +.muted { + color: #8a96a6 !important; +} diff --git a/pandora_console/mobile/operation/tactical.php b/pandora_console/mobile/operation/tactical.php index 3651187833..f12bb56120 100755 --- a/pandora_console/mobile/operation/tactical.php +++ b/pandora_console/mobile/operation/tactical.php @@ -164,8 +164,8 @@ class Tactical $data['mobile'] = true; - $formatted_data = reporting_get_stats_indicators($data, 100, 10, false); - $formatted_data_untiny = reporting_get_stats_indicators($data, 140, 15, false); + $formatted_data = reporting_get_stats_indicators_mobile($data, 100, 10, false); + $formatted_data_untiny = reporting_get_stats_indicators_mobile($data, 140, 15, false); $overview = ' @@ -193,8 +193,8 @@ class Tactical $agents_monitors = reporting_get_stats_agents_monitors($data); $alerts_stats = reporting_get_stats_alerts($data); - $overview .= "
    \n".$agents_monitors; - $overview .= "
    \n".$alerts_stats; + $overview .= "
    \n".$agents_monitors; + $overview .= "
    \n".$alerts_stats; $ui->contentGridAddCell($overview, 'tactical1'); @@ -216,6 +216,7 @@ class Tactical $ui->contentBeginCollapsible(__('Last activity')); $table = new Table(); + $table->id = 'last-activity'; $table->importFromHash($this->getLastActivity()); $ui->contentCollapsibleAddItem($table->getHTML()); $ui->contentEndCollapsible(); @@ -236,7 +237,7 @@ class Tactical } function ajax_load_status_pie() { - $('#status_pie').html('
    ".__('Loading...')."
    '); + $('#status_pie').html('
    ".__('Loading...')."
    '); var pie_width = $('#tactical2').width() * 0.9; @@ -346,10 +347,9 @@ class Tactical } $data[__('Action')] = ui_print_session_action_icon($session['accion'], true); - $data[__('User')] = $session_id_usuario; - $data[__('Date')] = human_time_comparation($session['utimestamp'], 'tiny'); - $data[__('Source IP')] = $session_ip_origen; - $data[__('Description')] = io_safe_output($session['descripcion']); + $data[__('User')] = $session_id_usuario.' - '.ui_print_truncate_text(io_safe_output($session['descripcion']), 40, false); + $data[__('Date')] = ''.human_time_comparation($session['utimestamp'], 'tiny').''; + $data[__('Source IP')] = ''.$session_ip_origen.''; $return[] = $data; } From 49d82698b1dfe4039ffeb6b542e7ee317dfd7d3e Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Tue, 18 Apr 2023 10:21:17 +0200 Subject: [PATCH 08/13] 9555-Events style & fix scroll pagination --- pandora_console/images/star-dark.svg | 25 ++++++ .../style/jquery.mobile-1.5.0-rc1.min.css | 74 ------------------ pandora_console/mobile/include/style/main.css | 76 ++++++++++++++++--- pandora_console/mobile/include/user.class.php | 1 + pandora_console/mobile/operation/events.php | 25 +++--- 5 files changed, 105 insertions(+), 96 deletions(-) create mode 100644 pandora_console/images/star-dark.svg diff --git a/pandora_console/images/star-dark.svg b/pandora_console/images/star-dark.svg new file mode 100644 index 0000000000..3345d2790a --- /dev/null +++ b/pandora_console/images/star-dark.svg @@ -0,0 +1,25 @@ + + + + 8FDB48E7-691D-43C7-B7AD-DC381E7FA74C@svg + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/mobile/include/style/jquery.mobile-1.5.0-rc1.min.css b/pandora_console/mobile/include/style/jquery.mobile-1.5.0-rc1.min.css index e543176676..2775545860 100644 --- a/pandora_console/mobile/include/style/jquery.mobile-1.5.0-rc1.min.css +++ b/pandora_console/mobile/include/style/jquery.mobile-1.5.0-rc1.min.css @@ -918,27 +918,8 @@ html .ui-body-a .ui-accordion-content { html .ui-bar-a a, html .ui-body-a a, html body .ui-group-theme-a a { - color: #38c; font-weight: 700; } -.ui-page-theme-a a:visited, -html .ui-bar-a a:visited, -html .ui-body-a a:visited, -html body .ui-group-theme-a a:visited { - color: #38c; -} -.ui-page-theme-a a:hover, -html .ui-bar-a a:hover, -html .ui-body-a a:hover, -html body .ui-group-theme-a a:hover { - color: #059; -} -.ui-page-theme-a a:active, -html .ui-bar-a a:active, -html .ui-body-a a:active, -html body .ui-group-theme-a a:active { - color: #059; -} .ui-page-theme-a .ui-button, html .ui-bar-a .ui-button, html .ui-body-a .ui-button, @@ -1015,25 +996,7 @@ html body div.ui-slider-track.ui-body-a .ui-button-active, .ui-page-theme-a .ui-accordion-header.ui-state-active, html .ui-body-a .ui-accordion-header-active, html .ui-body-a .ui-accordion-header.ui-state-active { - background-color: #38c; - border-color: #38c; color: #fff; - text-shadow: 0 1px 0 #059; -} -.ui-page-theme-a .ui-button:focus, -html .ui-bar-a .ui-button:focus, -html .ui-body-a .ui-button:focus, -html body .ui-group-theme-a .ui-button:focus, -html head + body .ui-button.ui-button-a:focus, -.ui-page-theme-a .ui-focus, -html .ui-bar-a .ui-focus, -html .ui-body-a .ui-focus, -html body .ui-group-theme-a .ui-focus, -html head + body .ui-button-a.ui-focus, -html head + body .ui-body-a.ui-focus { - -webkit-box-shadow: 0 0 12px #38c; - -moz-box-shadow: 0 0 12px #38c; - box-shadow: 0 0 12px #38c; } .ui-bar-b, .ui-page-theme-b .ui-bar-inherit, @@ -1078,27 +1041,8 @@ html .ui-body-b .ui-accordion-content { html .ui-bar-b a, html .ui-body-b a, html body .ui-group-theme-b a { - color: #2ad; font-weight: 700; } -.ui-page-theme-b a:visited, -html .ui-bar-b a:visited, -html .ui-body-b a:visited, -html body .ui-group-theme-b a:visited { - color: #2ad; -} -.ui-page-theme-b a:hover, -html .ui-bar-b a:hover, -html .ui-body-b a:hover, -html body .ui-group-theme-b a:hover { - color: #08b; -} -.ui-page-theme-b a:active, -html .ui-bar-b a:active, -html .ui-body-b a:active, -html body .ui-group-theme-b a:active { - color: #08b; -} .ui-page-theme-b .ui-button, html .ui-bar-b .ui-button, html .ui-body-b .ui-button, @@ -1175,25 +1119,7 @@ html body div.ui-slider-track.ui-body-b .ui-button-active, .ui-page-theme-b .ui-accordion-header.ui-state-active, html .ui-body-b .ui-accordion-header-active, html .ui-body-b .ui-accordion-header.ui-state-active { - background-color: #2ad; - border-color: #2ad; color: #fff; - text-shadow: 0 1px 0 #08b; -} -.ui-page-theme-b .ui-button:focus, -html .ui-bar-b .ui-button:focus, -html .ui-body-b .ui-button:focus, -html body .ui-group-theme-b .ui-button:focus, -html head + body .ui-button.ui-button-b:focus, -.ui-page-theme-b .ui-focus, -html .ui-bar-b .ui-focus, -html .ui-body-b .ui-focus, -html body .ui-group-theme-b .ui-focus, -html head + body .ui-button-b.ui-focus, -html head + body .ui-body-b.ui-focus { - -webkit-box-shadow: 0 0 12px #2ad; - -moz-box-shadow: 0 0 12px #2ad; - box-shadow: 0 0 12px #2ad; } .ui-disabled, .ui-state-disabled, diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index aec356b6ba..1bba3990b9 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -30,6 +30,7 @@ --secondary-color: #ffffff; --body-color: #f6f7fb; --border-color: #e5e9ed; + --muted-color: #8a96a6; } @font-face { @@ -80,7 +81,7 @@ body { } .ui-header .ui-title { - font-size: 14px !important; + font-size: 12pt !important; min-height: 1.1em; text-align: center; display: block; @@ -90,7 +91,7 @@ body { overflow: hidden; white-space: nowrap; outline: 0 !important; - line-height: 25px; + line-height: 18pt; } .ui-btn-inner { @@ -362,7 +363,7 @@ tr.group_view_data, .datos_green a, .datos_greenf9 a { background-color: #52a000; - color: #ffffff !important; + color: #000000 !important; text-shadow: none !important; } .datos_red, @@ -370,7 +371,7 @@ tr.group_view_data, .datos_red a, .datos_redf9 a { background-color: #ff3e41; - color: #ffffff !important; + color: #000000 !important; text-shadow: none !important; } @@ -416,7 +417,7 @@ tr.group_view_data, } tr.events { - border-bottom: 6px solid #f7f7f7 !important; + border-bottom: 6px solid var(--secondary-color) !important; font-size: 12px !important; } @@ -1868,7 +1869,7 @@ table.tactical_bars > tbody > tr, } div#main_page { - background-color: var(--body-color) !important; + background-color: var(--body-color); } .ui-header.ui-bar-inherit.ui-header-fixed.slidedown { @@ -1905,10 +1906,18 @@ div#main_page { align-items: center; } +span#user_logged { + padding-right: 0px; + right: 20px; + line-height: 30px; + font-size: 10pt !important; +} + .ui-grid-a.ui-responsive { background-color: var(--secondary-color); border-radius: 8px; border: 1px solid var(--border-color); + margin-bottom: 10px; } .ui-button-icon-space { @@ -1947,6 +1956,12 @@ div.hr { margin: 10px 0px; } +div.hr-full { + border-bottom: 1px solid var(--border-color); + width: 200%; + margin: 10px -100px; +} + table, fieldset { padding: 0px 5px !important; @@ -2032,6 +2047,8 @@ div#tactical2 .tactical_set > table { .ui-collapsible.ui-collapsible-inset.ui-corner-all.ui-collapsible-themed-content.ui-collapsible-collapsed { border: 1px solid var(--border-color); border-radius: 8px; + margin-top: 0px; + margin-bottom: 10px; } .ui-collapsible-heading-toggle.ui-button.ui-button-a.ui-mini, @@ -2065,13 +2082,15 @@ table#last-activity > tbody > tr > td.cell_0 { padding-bottom: 2px !important; } table#last-activity > tbody > tr > td.cell_1 { - width: 75%; + width: 70%; max-width: 75%; padding-bottom: 2px !important; } table#last-activity > tbody > tr > td.cell_2 { - width: 15%; + width: 20%; padding-bottom: 2px !important; + padding-left: 0px !important; + padding-right: 0px !important; } table#last-activity > tbody > tr > td.cell_3 { width: 10%; @@ -2084,5 +2103,44 @@ table#last-activity > tbody > tr > td > b { } .muted { - color: #8a96a6 !important; + color: var(--muted-color) !important; +} + +.white-card { + background-color: var(--secondary-color); + padding: 10px; + border: 1px solid var(--border-color); + border-radius: 8px; +} + +/* Events table */ +table#list_events > tbody > tr.events > td.cell_0 { + border-top-left-radius: 8px !important; + border-top-right-radius: 8px !important; +} + +table#list_events > tbody > tr.events > td.vertical_middle { + border-bottom-left-radius: 8px !important; + border-bottom-right-radius: 8px !important; + color: #4a4a4a; +} + +table#list_events > tbody > tr.events { + background-color: var(--secondary-color) !important; +} + +table#list_events > tbody > tr.events.datos_green > td { + background-color: #81b92e40; +} +table#list_events > tbody > tr.events.datos_red > td { + background-color: #ed474a40; +} +table#list_events > tbody > tr.events.datos_yellow > td { + background-color: #fcab1040; +} +table#list_events > tbody > tr.events.datos_blue > td { + background-color: #25a8ff40; +} +table#list_events > tbody > tr.events.datos_grey > td { + background-color: #adadad40; } diff --git a/pandora_console/mobile/include/user.class.php b/pandora_console/mobile/include/user.class.php index 00a7e605d1..200a3faba8 100644 --- a/pandora_console/mobile/include/user.class.php +++ b/pandora_console/mobile/include/user.class.php @@ -560,6 +560,7 @@ class User $(".ui-overlay-a").addClass("login-background"); $(".ui-overlay-a").removeClass("ui-overlay-a"); $(".ui-page-theme-a").css({"background-color":"transparent !important"}); + $("div.ui-page.ui-page-theme-a.ui-page-active#main_page").css({"background-color":"transparent !important"}); }); ' diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index 16212053d2..1021bd862c 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -195,15 +195,15 @@ class Events switch ($event['estado']) { case 0: - $img_st = 'images/star_white.png'; + $img_st = 'images/star-dark.svg'; break; case 1: - $img_st = 'images/tick_white.png'; + $img_st = 'images/validate.svg'; break; case 2: - $img_st = 'images/hourglass_white.png'; + $img_st = 'images/clock.svg'; break; default: @@ -221,7 +221,7 @@ class Events $status_icon = html_print_image( $img_st, true, - false, + ['class' => 'main_menu_icon'], false, false, false, @@ -264,11 +264,7 @@ class Events $row_1 = ''.$agent_name.''; $row_1 .= ''; - $row_1 .= ui_print_timestamp( - $event['timestamp_last'], - true, - ['units' => 'tiny'] - ); + $row_1 .= human_time_comparation($event['timestamp_last'], 'tiny'); $row_1 .= $status_icon; $row_1 .= ''; @@ -1008,7 +1004,10 @@ class Events $html = $ui->getEndForm(); $ui->contentCollapsibleAddItem($html); $ui->contentEndCollapsible(); + $ui->contentAddHtml('
    '); + $ui->contentAddHtml('
    '); $this->listEventsHtml(); + $ui->contentAddHtml('
    '); $ui->endContent(); $ui->showPage(); } @@ -1351,14 +1350,14 @@ class Events $(\"table#\"+table_id+\" tbody\").append(new_rows); - load_more_rows = 0; + // load_more_rows = 0; refresh_link_listener_list_events(); } } function ajax_load_rows() { - if (load_more_rows) { - load_more_rows = 0; + if (load_more_rows) { + // load_more_rows = 0; postvars = {}; postvars[\"action\"] = \"ajax\"; postvars[\"parameter1\"] = \"events\"; @@ -1383,7 +1382,7 @@ class Events //Check if the end of the event list tables is in the client limits var table_end = $('#list_events').offset().top + $('#list_events').height(); if (table_end < document.documentElement.clientHeight) { - ajax_load_rows(); + // ajax_load_rows(); } } From 2362fe81463148fe20f48f607788228a844b8651 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Tue, 18 Apr 2023 17:05:08 +0200 Subject: [PATCH 09/13] 9555-Modules hitorical & styles --- pandora_console/mobile/include/style/main.css | 55 +++ pandora_console/mobile/index.php | 11 + pandora_console/mobile/operation/agent.php | 6 + pandora_console/mobile/operation/events.php | 2 +- .../mobile/operation/module_data.php | 354 ++++++++++++++++++ pandora_console/mobile/operation/modules.php | 5 +- .../mobile/operation/server_status.php | 37 +- pandora_console/mobile/operation/services.php | 17 +- 8 files changed, 458 insertions(+), 29 deletions(-) create mode 100644 pandora_console/mobile/operation/module_data.php diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index 1bba3990b9..3c63b13a82 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -56,10 +56,20 @@ body { font-family: "Lato" !important; } +a { + text-decoration: underline !important; + text-decoration-color: var(--muted-color) !important; + color: var(--primary-color); +} + .small { font-size: 10px !important; } +.font-10pt { + font-size: 10pt !important; +} + .center { text-align: center; } @@ -488,6 +498,7 @@ table.event_details td.cell_event_name { @media screen and (max-width: 35em) { /* Hide the title of event name */ + #last_agent_events tbody tr.events td.cell_0 b.ui-table-cell-label, #list_events tbody tr.events td.cell_0 b.ui-table-cell-label { display: none; } @@ -520,26 +531,36 @@ table.event_details td.cell_event_name { font-weight: bold; } +.agents_tiny_stats span { + background-color: transparent !important; +} + +.agents_tiny_stats .red, .color-red { color: #c00 !important; } +.agents_tiny_stats .green, .color-green { color: #5a8629 !important; } +.agents_tiny_stats .orange, .color-orange { color: #fd7304 !important; } +.agents_tiny_stats .yellow, .color-yellow { color: #f3c500 !important; } +.agents_tiny_stats .grey, .color-grey { color: #808080 !important; } +.agents_tiny_stats .blue, .color-blue { color: #4a83f3 !important; } @@ -903,6 +924,7 @@ table.event_details td.cell_event_name { font-size: 12px !important; } + table#list_module_data tr, table#list_servers tr, table[id^="service-table-"] tr { display: flex; @@ -911,6 +933,7 @@ table.event_details td.cell_event_name { align-items: center; } + table#list_module_data b.ui-table-cell-label, table#list_servers b.ui-table-cell-label, table[id^="service-table-"] b.ui-table-cell-label { display: none; @@ -2114,33 +2137,65 @@ table#last-activity > tbody > tr > td > b { } /* Events table */ +table#last_agent_events > tbody > tr.events > td.cell_0, table#list_events > tbody > tr.events > td.cell_0 { border-top-left-radius: 8px !important; border-top-right-radius: 8px !important; } +table#last_agent_events > tbody > tr.events > td.vertical_middle, table#list_events > tbody > tr.events > td.vertical_middle { border-bottom-left-radius: 8px !important; border-bottom-right-radius: 8px !important; color: #4a4a4a; } +table#last_agent_events > tbody > tr.events, table#list_events > tbody > tr.events { background-color: var(--secondary-color) !important; } +table#last_agent_events > tbody > tr.events.datos_green > td, table#list_events > tbody > tr.events.datos_green > td { background-color: #81b92e40; } +table#last_agent_events > tbody > tr.events.datos_red > td, table#list_events > tbody > tr.events.datos_red > td { background-color: #ed474a40; } +table#last_agent_events > tbody > tr.events.datos_yellow > td, table#list_events > tbody > tr.events.datos_yellow > td { background-color: #fcab1040; } +table#last_agent_events > tbody > tr.events.datos_blue > td, table#list_events > tbody > tr.events.datos_blue > td { background-color: #25a8ff40; } +table#last_agent_events > tbody > tr.events.datos_grey > td, table#list_events > tbody > tr.events.datos_grey > td { background-color: #adadad40; } + +table#list_module_data > thead > tr > th { + display: initial; +} + +h4[id^="service-"].ui-collapsible-heading + > a + > span.ui-icon.ui-collapsible-icon-right { + margin-top: 2px !important; +} + +h4[id^="service-"].ui-collapsible-heading + > a.ui-collapsible-heading-toggle.ui-button.ui-button-a { + padding-left: 10px !important; +} + +table[id^="service-table-"] { + padding: 0px !important; +} + +table[id^="service-table-"] > tbody > tr { + padding: 0px 5px !important; + height: 48px !important; +} diff --git a/pandora_console/mobile/index.php b/pandora_console/mobile/index.php index 401f96ae11..fe0eb231d8 100644 --- a/pandora_console/mobile/index.php +++ b/pandora_console/mobile/index.php @@ -45,6 +45,7 @@ require_once 'operation/visualmaps.php'; require_once 'operation/visualmap.php'; require_once 'operation/server_status.php'; require_once 'operation/services.php'; +require_once 'operation/module_data.php'; $enterpriseHook = enterprise_include('mobile/include/enterprise.class.php'); $enterpriseHook = enterprise_include('mobile/operation/home.php'); @@ -189,6 +190,11 @@ switch ($action) { $services->ajax($parameter2); break; + case 'module_data': + $module_data = new ModuleData(); + $module_data->ajax($parameter2); + break; + default: if (class_exists('Enterprise')) { $enterprise->enterpriseAjax($parameter1, $parameter2); @@ -429,6 +435,11 @@ switch ($action) { $services = new Services(); $services->show(); break; + + case 'module_data': + $module_data = new ModuleData(); + $module_data->show(); + break; } break; } diff --git a/pandora_console/mobile/operation/agent.php b/pandora_console/mobile/operation/agent.php index 5bd28c3350..f1ff032862 100644 --- a/pandora_console/mobile/operation/agent.php +++ b/pandora_console/mobile/operation/agent.php @@ -27,6 +27,8 @@ * ============================================================================ */ +use PandoraFMS\Event; + // Begin. require_once '../include/functions_users.php'; @@ -130,9 +132,13 @@ class Agent { $ui = Ui::getInstance(); $system = System::getInstance(); + $eventObj = new Events; $ui->createPage(); + $options = $eventObj->getEventDialogOptions(); + $ui->addDialog($options); + if ($this->id != 0) { $agent_alias = (string) $this->agent['alias']; diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index 1021bd862c..9b08557d7d 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -1201,7 +1201,7 @@ class Events data: postvars, success: function (data) { - if (data.correct) { + if (data.correct) { event = data.event; //Fill the dialog $("#detail_event_dialog .cell_event_name") diff --git a/pandora_console/mobile/operation/module_data.php b/pandora_console/mobile/operation/module_data.php new file mode 100644 index 0000000000..101397de47 --- /dev/null +++ b/pandora_console/mobile/operation/module_data.php @@ -0,0 +1,354 @@ +checkACL($this->acl)) { + $this->correct_acl = true; + } else { + $this->correct_acl = false; + } + + $this->moduleId = $system->getRequest('module_id'); + } + + + public function ajax($parameter2=false) + { + $system = System::getInstance(); + + if (!$this->correct_acl) { + return; + } else { + switch ($parameter2) { + case 'get_module_data': + $this->getFilters(); + $page = $system->getRequest('page', 0); + $module_id = $system->getRequest('module_id'); + $servers = []; + $end = 1; + + $listData = $this->getListData($page, true); + + if (!empty($listData['data'])) { + $end = 0; + $servers = $listData['data']; + } + + echo json_encode(['end' => $end, 'servers' => $servers]); + break; + } + } + } + + + public function show() + { + if (!$this->correct_acl) { + $this->show_fail_acl(); + } else { + $this->show_module_data(); + } + } + + + private function show_fail_acl() + { + $error['type'] = 'onStart'; + $error['title_text'] = __('You don\'t have access to this page'); + $error['content_text'] = System::getDefaultACLFailText(); + if (class_exists('HomeEnterprise')) { + $home = new HomeEnterprise(); + } else { + $home = new Home(); + } + + $home->show($error); + } + + + private function show_module_data() + { + $ui = Ui::getInstance(); + + $ui->createPage(); + $ui->createDefaultHeader( + __('Module data'), + $ui->createHeaderButton( + [ + 'icon' => 'ui-icon-back', + 'pos' => 'left', + 'text' => __('Back'), + 'href' => 'index.php?page=modules', + 'class' => 'header-button-left', + ] + ) + ); + $ui->showFooter(false); + $ui->beginContent(); + $this->listDataHtml(); + $ui->endContent(); + $ui->showPage(); + } + + + private function getListData($page=0, $ajax=false) + { + global $config; + $system = System::getInstance(); + + $total = 0; + $data = []; + + $module_data = modules_get_agentmodule_data( + $this->moduleId, + 604800, + 0, + false, + false, + 'DESC' + ); + + $total = (int) count($module_data); + + foreach ($module_data as $module) { + $row[__('Data')] = ''.$module['data'].''; + $row[__('Timestamp')] = ''.human_time_comparation($module['utimestamp'], 'tiny').''; + + array_push($data, $row); + } + + return [ + 'data' => $data, + 'total' => $total, + ]; + } + + + public function listDataHtml($page=0, $return=false) + { + $system = System::getInstance(); + $ui = Ui::getInstance(); + + $listData = $this->getListData($page); + if ($listData['total'] == 0) { + $html = '

    '.__('No data').'

    '; + if (!$return) { + $ui->contentAddHtml($html); + } else { + return $html; + } + } else { + if (!$return) { + $table = new Table(); + $table->id = 'list_module_data'; + $table->importFromHash($listData['data']); + + $ui->contentAddHtml('
    '); + + $agent_id = agents_get_agent_id_by_module_id($this->moduleId); + $agent_name = agents_get_name($agent_id); + $module_name = modules_get_agentmodule_name($this->moduleId); + $ui->contentAddHtml('

    '.$module_name.'

    '); + $ui->contentAddHtml('

    '.$agent_name.'

    '); + + $ui->contentAddHtml($table->getHTML()); + + $ui->contentAddHtml('
    '); + } else { + $table = new Table(); + $table->id = 'list_module_data'; + + $table->importFromHash($listData['data']); + + $html = $table->getHTML(); + + return $html; + } + + // if ($system->getPageSize() < $listData['total']) { + // $ui->contentAddHtml( + // '
    '.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'
    ' + // ); + // $this->addJavascriptAddBottom(); + // } + } + + $ui->contentAddLinkListener('list_servers'); + } + + + private function addJavascriptAddBottom() + { + $ui = Ui::getInstance(); + + $ui->contentAddHtml( + "" + ); + } + + + private function filterServersGetString() + { + if ($this->default) { + return __('(Default)'); + } else { + $filters_to_serialize = []; + + if (!$this->default_filters['group']) { + $filters_to_serialize[] = sprintf( + __('Group: %s'), + groups_get_name($this->group, true) + ); + } + + if (!$this->default_filters['module_group']) { + $module_group = db_get_value( + 'name', + 'tmodule_group', + 'id_mg', + $this->module_group + ); + $module_group = io_safe_output($module_group); + + $filters_to_serialize[] = sprintf( + __('Module group: %s'), + $module_group + ); + } + + if (!$this->default_filters['status']) { + $filters_to_serialize[] = sprintf( + __('Status: %s'), + $this->list_status[$this->status] + ); + } + + if (!$this->default_filters['free_search']) { + $filters_to_serialize[] = sprintf( + __('Free Search: %s'), + $this->free_search + ); + } + + if (!$this->default_filters['tag']) { + $tag_name = tags_get_name($this->tag); + $filters_to_serialize[] = sprintf( + __('Tag: %s'), + $tag_name + ); + } + + $string = '('.implode(' - ', $filters_to_serialize).')'; + + return $string; + } + } + + +} diff --git a/pandora_console/mobile/operation/modules.php b/pandora_console/mobile/operation/modules.php index 89f39912f0..ba558e5726 100644 --- a/pandora_console/mobile/operation/modules.php +++ b/pandora_console/mobile/operation/modules.php @@ -853,7 +853,7 @@ class Modules '.__('Graph').' - + '.__('Historical data').' @@ -927,11 +927,14 @@ class Modules var historical = ''; if (serverId === 'node') { graph = 'index.php?page=module_graph&id='+moduleId+'&id_agent='+agentId; + historical = 'index.php?page=module_data&module_id='+moduleId; } else { graph = 'index.php?page=module_graph&id='+moduleId+'&id_agent='+agentId+'&server_id='+serverId; + historical = 'index.php?page=module_data&module_id='+moduleId; } $('#graph-option').attr('href', graph); + $('#historical-option').attr('href', historical); $('#module-dialog-button').click(); } diff --git a/pandora_console/mobile/operation/server_status.php b/pandora_console/mobile/operation/server_status.php index 7435ea41ea..d3bba4656b 100644 --- a/pandora_console/mobile/operation/server_status.php +++ b/pandora_console/mobile/operation/server_status.php @@ -354,12 +354,6 @@ class ServerStatus } } - echo ""; - return [ 'servers' => $servers, 'total' => $total, @@ -386,7 +380,20 @@ class ServerStatus $table->id = 'list_servers'; $table->importFromHash($listServers['servers']); + $ui->contentAddHtml('
    '); $ui->contentAddHtml($table->getHTML()); + + if ($this->all_servers === true) { + if ($system->getPageSize() < $listServers['total']) { + $ui->contentAddHtml( + '
    '.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'
    ' + ); + + $this->addJavascriptAddBottom(); + } + } + + $ui->contentAddHtml('
    '); } else { $table = new Table(); $table->id = 'list_servers_status'; @@ -397,16 +404,6 @@ class ServerStatus return $html; } - - if ($this->all_servers === true) { - if ($system->getPageSize() < $listServers['total']) { - $ui->contentAddHtml( - '
    '.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'
    ' - ); - - $this->addJavascriptAddBottom(); - } - } } $ui->contentAddLinkListener('list_servers'); @@ -454,12 +451,8 @@ class ServerStatus load_more_rows = 1; refresh_link_listener_list_servers() } - - }, \"json\"); - - } } } @@ -473,6 +466,10 @@ class ServerStatus $(window).on(\"touchmove\", function(event) { custom_scroll(); }); + + window.addEventListener('DOMContentLoaded', (event) => { + document.querySelector('table#list_servers span.data a').href = '#'; + }); }); " ); diff --git a/pandora_console/mobile/operation/services.php b/pandora_console/mobile/operation/services.php index b0fae9d354..346f7716d3 100644 --- a/pandora_console/mobile/operation/services.php +++ b/pandora_console/mobile/operation/services.php @@ -171,7 +171,8 @@ class Services ' ); $ui->contentAddHtml('
    '); - $ui->contentAddHtml('

    '.$group_icon.' '.$service['description'].'

    '); + $arrow = ''; + $ui->contentAddHtml('

    '.$arrow.$group_icon.' '.$service['description'].'

    '); $spinner = '
    @@ -236,7 +237,6 @@ class Services } } - $name .= ''; if (is_metaconsole() && ((int) $item->id_server_meta()) !== 0 ) { @@ -244,7 +244,6 @@ class Services } $name .= $item->agent()->alias(); - $name .= ''; $name .= ''; if (((bool) $item->agent()->disabled()) === true) { @@ -303,7 +302,6 @@ class Services } } - $name .= ''; if (is_metaconsole() && ((int) $item->id_server_meta()) !== 0 ) { @@ -311,7 +309,6 @@ class Services } $name .= $item->service()->name(); - $name .= ''; $name .= ''; if (((bool) $item->service()->disabled()) === true) { @@ -340,7 +337,6 @@ class Services 'index.php?sec=eventos&sec2=operation/events/events&event_view_hr=8&severity=4&id_agent='.$item->module()->id_agente().'&id_agent_module='.$item->id_agente_modulo() ); $name = ''; - $name .= ''; if (((bool) $item->module()->disabled()) === true) { $disabled_element = true; @@ -367,7 +363,6 @@ class Services ).''; } - $name .= ''; $name .= ''; } break; @@ -527,6 +522,14 @@ class Services $('h4#service-'+id+' + div.ui-collapsible-content').html(data); }, \"html\"); + + var arrow = document.querySelector('h4#service-'+id+' > a > span.ui-icon.ui-icon-arrow-d'); + + if (arrow.style.transform == 'rotate(180deg)') { + arrow.style.transform = ''; + } else { + arrow.style.transform = 'rotate(180deg)'; + } } " ); From 24b652a8a73900f4ebfb70c6e74f2f355d7524b7 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 19 Apr 2023 18:00:48 +0200 Subject: [PATCH 10/13] 9555-Styles & fixes --- pandora_console/mobile/include/style/main.css | 406 +++++++++++++++++- pandora_console/mobile/include/ui.class.php | 5 +- pandora_console/mobile/operation/agents.php | 10 +- pandora_console/mobile/operation/alerts.php | 18 +- .../mobile/operation/module_data.php | 2 +- pandora_console/mobile/operation/modules.php | 52 +-- pandora_console/mobile/operation/services.php | 8 +- 7 files changed, 442 insertions(+), 59 deletions(-) diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index 3c63b13a82..f3e895e718 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -27,9 +27,11 @@ */ :root { --primary-color: #14524f; + --primary-color-hover: #104240; --secondary-color: #ffffff; --body-color: #f6f7fb; --border-color: #e5e9ed; + --border-dark-color: #c0ccdc; --muted-color: #8a96a6; } @@ -56,10 +58,12 @@ body { font-family: "Lato" !important; } -a { +a.ui-link, +/* a:not(> div.event_name), */ +a:not(.ui-button) { text-decoration: underline !important; text-decoration-color: var(--muted-color) !important; - color: var(--primary-color); + color: var(--primary-color) !important; } .small { @@ -86,6 +90,10 @@ a { align-items: center; } +.flex-column { + flex-direction: column; +} + .space-between { justify-content: space-between; } @@ -615,11 +623,6 @@ table.event_details td.cell_event_name { font-size: 14px; } -#list_agents .cell_0 img { - float: left; - margin-right: 3px; -} - #list_agents td:hover, #list_networkmaps td:hover, #list_events td:hover, @@ -643,7 +646,7 @@ table.event_details td.cell_event_name { } @media screen and (max-width: 34.99em) { - #list_agents td { + /* #list_agents td { height: 35px; padding-top: 7px; display: table-cell; @@ -652,9 +655,9 @@ table.event_details td.cell_event_name { padding-left: 0px !important; padding-right: 0px !important; width: auto !important; - } + } */ - #list_agents td.cell_0 { + /* #list_agents td.cell_0 { border-top: 0px none; } #list_agents td.cell_0 > span.tiny > img { @@ -723,7 +726,7 @@ table.event_details td.cell_event_name { .agents_tiny_stats * { font-size: 12px !important; - } + } */ #list_agent_Modules td { padding-top: 7px !important; @@ -748,15 +751,6 @@ table.event_details td.cell_event_name { } /*END-----------Agents styles-----------------------------------------*/ -/*INIT-----------Alerts styles---------------------------------------*/ - -#list_alerts td { - height: 35px; - padding-top: 20px; -} - -/*END-----------Alerts styles---------------------------------------*/ - /*INIT-----------Network maps styles---------------------------------------*/ #list_networkmaps td { @@ -924,6 +918,9 @@ table.event_details td.cell_event_name { font-size: 12px !important; } + table#list_agents tr, + table#list_Modules tr, + table#list_alerts tr, table#list_module_data tr, table#list_servers tr, table[id^="service-table-"] tr { @@ -933,6 +930,8 @@ table.event_details td.cell_event_name { align-items: center; } + table#list_agents b.ui-table-cell-label, + table#list_alerts b.ui-table-cell-label, table#list_module_data b.ui-table-cell-label, table#list_servers b.ui-table-cell-label, table[id^="service-table-"] b.ui-table-cell-label { @@ -1859,12 +1858,13 @@ div.border-collapsible } table[id^="service-table-"] { - width: 100%; + margin-left: -14px; + width: calc(100% + 28px); } table > tbody > tr:nth-child(even), table[id^="service-table-"] > tbody > tr:nth-child(even) { - background-color: #e5e9ed; + background-color: var(--border-color); } table[id^="service-table-"] a strong { @@ -1956,14 +1956,24 @@ span#user_logged { background-image: url(../../../images/home-mobile.svg) !important; } +.ui-icon-caret-d, .ui-icon-arrow-d { background-image: url(../../../images/arrow-d-mobile.svg) !important; } +.ui-icon-caret-u, .ui-icon-arrow-u { background-image: url(../../../images/arrow-u-mobile.svg) !important; } +.ui-icon-delete { + background-image: url(../../../images/close@svg.svg) !important; +} + +.ui-icon-search { + background-image: url(../../../images/details.svg) !important; +} + .ui-icon { background-color: transparent !important; } @@ -2136,6 +2146,11 @@ table#last-activity > tbody > tr > td > b { border-radius: 8px; } +.white-card.p-lr-0px { + padding-left: 0px; + padding-right: 0px; +} + /* Events table */ table#last_agent_events > tbody > tr.events > td.cell_0, table#list_events > tbody > tr.events > td.cell_0 { @@ -2175,9 +2190,21 @@ table#last_agent_events > tbody > tr.events.datos_grey > td, table#list_events > tbody > tr.events.datos_grey > td { background-color: #adadad40; } +table#last_agent_events > tbody > tr.events.datos_pink > td, +table#list_events > tbody > tr.events.datos_pink > td { + background-color: #ef6dfb40; +} +table#last_agent_events > tbody > tr.events.datos_brown > td, +table#list_events > tbody > tr.events.datos_brown > td { + background-color: #a52e0040; +} +table#list_agents > thead > tr > th, +table#list_Modules > thead > tr > th, +table#list_alerts > thead > tr > th, table#list_module_data > thead > tr > th { display: initial; + text-align: center; } h4[id^="service-"].ui-collapsible-heading @@ -2199,3 +2226,338 @@ table[id^="service-table-"] > tbody > tr { padding: 0px 5px !important; height: 48px !important; } + +table#list_events td { + width: calc(100vw - 44px) !important; +} + +.white-card.p-lr-0px table#list_alerts, +.white-card.p-lr-0px table#list_alerts thead, +.white-card.p-lr-0px table#list_alerts tbody, +.white-card.p-lr-0px table#list_alerts tr, +.white-card.p-lr-0px table#list_agents, +.white-card.p-lr-0px table#list_agents thead, +.white-card.p-lr-0px table#list_agents tbody, +.white-card.p-lr-0px table#list_agents tr, +.white-card.p-lr-0px table#list_Modules, +.white-card.p-lr-0px table#list_Modules thead, +.white-card.p-lr-0px table#list_Modules tbody, +.white-card.p-lr-0px table#list_Modules tr { + width: calc(100vw - 26px) !important; +} + +table#list_alerts > thead > tr > th[data-colstart="1"], +table#list_alerts > tbody > tr > td.cell_0 { + width: 7%; + padding-right: 5px; +} +table#list_alerts > thead > tr > th[data-colstart="2"], +table#list_alerts > tbody > tr > td.cell_1 { + width: 50%; +} +table#list_alerts > tbody > tr > td.cell_1 > div > span { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +table#list_alerts > thead > tr > th[data-colstart="3"], +table#list_alerts > tbody > tr > td.cell_2 { + width: 25%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +table#list_alerts > thead > tr > th[data-colstart="4"], +table#list_alerts > tbody > tr > td.cell_3 { + width: 18%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +table#list_alerts > thead > tr > th[data-colstart="1"] { + color: transparent; + text-shadow: none; +} + +table#list_alerts > tbody > tr > td.cell_1 { + padding: 0px !important; +} + +table#list_agents span.agents_last_contact { + margin-left: 5px; +} + +table#list_agents td.cell_0 > span.agent-status { + margin-right: 5px; +} + +table#list_agents td.cell_0 > a { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +table#list_agents td.cell_5 { + display: flex; + flex-direction: row; + justify-content: center; + white-space: nowrap; +} + +table#list_agents td.cell_6 span.agents_last_contact { + white-space: nowrap; + margin-right: 5px; +} + +table#list_agents.ui-table-reflow thead tr th { + display: initial; +} + +table#list_agents > tbody > tr > td.cell_1, +table#list_agents > tbody > tr > td.cell_2, +table#list_agents > tbody > tr > td.cell_3, +table#list_agents > tbody > tr > td.cell_4, +table#list_agents > tbody > tr > td.cell_7, +table#list_agents > thead > tr > th[data-colstart="2"], +table#list_agents > thead > tr > th[data-colstart="3"], +table#list_agents > thead > tr > th[data-colstart="4"], +table#list_agents > thead > tr > th[data-colstart="5"], +table#list_agents > thead > tr > th[data-colstart="8"], +table#list_Modules > thead > tr > th[data-colstart="2"], +table#list_Modules > thead > tr > th[data-colstart="3"], +table#list_Modules > thead > tr > th[data-colstart="4"] { + display: none; +} + +table#list_Modules > thead > tr > th[data-colstart="1"], +table#list_Modules > tbody > tr > td.cell_0 { + width: 50%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-left: 5px; +} +table#list_Modules > thead > tr > th[data-colstart="5"], +table#list_Modules > tbody > tr > td.cell_4 { + width: 25%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; +} +table#list_Modules > thead > tr > th[data-colstart="6"], +table#list_Modules > tbody > tr > td.cell_5 { + width: 25%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; + margin-right: 5px; +} + +table#list_alerts > tbody > tr, +table#list_agents > tbody > tr, +table#list_Modules > tbody > tr { + height: 48px !important; +} + +table#list_alerts tbody td .status_rounded_rectangles, +table#list_Modules tbody td .status_rounded_rectangles, +table#list_agents tbody td .status_rounded_rectangles { + line-height: 20px; + width: 5px; + height: 20px; +} + +table#list_alerts tbody td.cell_4 div.status_rounded_rectangles { +} + +table#list_Modules td.cell_0 span.module-status { + margin-right: 5px; +} + +table#list_agents thead tr { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + align-items: center; +} + +table#list_agents tr th { + text-align: center; +} + +table#list_Modules tr td, +table#list_agents tr td { + padding: 0px !important; + line-height: 25px; +} + +table#list_agents > thead > tr > th[data-colstart="1"], +table#list_agents > tbody > tr > td.cell_0 { + width: 50%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-left: 5px; +} +table#list_agents > thead > tr > th[data-colstart="6"], +table#list_agents > tbody > tr > td.cell_5 { + width: 25%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; +} +table#list_agents > thead > tr > th[data-colstart="7"], +table#list_agents > tbody > tr > td.cell_6 { + width: 25%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; + margin-right: 5px; +} + +table#list_events td a div.event_name { + word-wrap: break-word; +} + +div#module-dialog-popup { + width: 280px; + height: 200px; + max-width: 100vw !important; +} + +div#module-dialog { + height: 100%; +} + +a#close-dialog-btn { + padding: 0px; + height: 25px; + width: 25px; + line-height: 25px; + margin-right: 5px; +} + +a#graph-option, +a#historical-option { + line-height: 40px; +} + +div[data-role="fieldcontain"] > fieldset > label[for^="select-"] { + margin-top: 10px; + font-size: 10pt !important; + font-weight: 600; +} + +div[data-role="fieldcontain"] + > fieldset + > div.ui-selectmenu + > a[id^="select-"] { + box-shadow: unset; + text-align: left; + color: var(--muted-color); + font-weight: 500; + border: 1px solid var(--border-dark-color) !important; + border-radius: 8px !important; +} + +li > a.ui-listview-item-button.ui-button.ui-button-active { + color: #000; +} + +div.ui-toolbar-header.ui-bar-inherit { + height: 40px; + line-height: 22px; + font-size: 10pt; +} + +div.ui-toolbar-header.ui-bar-inherit + > .ui-page-dialog-close-button.ui-button.ui-corner-all.ui-button-icon-only.ui-toolbar-header-button-left { + background-color: transparent; + border: 0px; +} + +div#free_search-container + > fieldset.ui-controlgroup.ui-controlgroup-vertical.ui-group-theme-inherit + > div.ui-textinput.ui-corner-all.ui-shadow-inset.ui-textinput-search.ui-body-inherit.ui-textinput-has-clear-button { + box-shadow: unset; + border: 1px solid var(--border-dark-color) !important; + border-radius: 8px !important; +} + +input[name="free_search"] { + height: 48px; + margin-left: 15px !important; +} + +input[name="free_search"]::placeholder { + font-style: italic; +} + +div#free_search-container + span.ui-textinput-search-icon.ui-icon.ui-alt-icon.ui-icon-search { + height: 30px; + width: 25px; + margin-top: -15px !important; + margin-left: 5px; +} + +a.ui-textinput-clear-button.ui-button-icon-only.ui-button-right.ui-widget.ui-button-inherit.ui-button.ui-shadow.ui-controlgroup-item { + height: 40px; + padding: 0px; + width: 40px; + margin-top: -20px !important; + box-shadow: unset; +} + +fieldset[data-role="controlgroup"] > input[type="submit"] { + height: 48px; + border-radius: 8px; + background-color: var(--primary-color); + text-shadow: none; + color: var(--body-color); + font-size: 11pt !important; +} + +fieldset[data-role="controlgroup"] > input[type="submit"]:active, +fieldset[data-role="controlgroup"] > input[type="submit"]:hover { + background-color: var(--primary-color-hover); + text-shadow: none; + color: var(--body-color); +} + +div.filter-collapsible.ui-collapsible.ui-collapsible-inset.ui-corner-all.ui-collapsible-themed-content + > h4 + > a { + height: 48px; + padding-top: 0px; + padding-left: 0px; + line-height: 55px; + font-size: 11pt; +} + +div.filter-collapsible.ui-collapsible.ui-collapsible-inset.ui-corner-all.ui-collapsible-themed-content + > h4 + > a + > span.ui-icon.ui-icon-arrow-u, +div.filter-collapsible.ui-collapsible.ui-collapsible-inset.ui-corner-all.ui-collapsible-themed-content + > h4 + > a + > span.ui-icon.ui-icon-arrow-d { + margin-left: 5px; +} + +div.filter-collapsible.ui-collapsible.ui-collapsible-inset.ui-corner-all.ui-collapsible-themed-content + > h4 + > a, +div.filter-collapsible.ui-collapsible.ui-collapsible-inset.ui-corner-all.ui-collapsible-themed-content + > div + > ul + > li { + text-shadow: none !important; + background-color: var(--border-color) !important; +} diff --git a/pandora_console/mobile/include/ui.class.php b/pandora_console/mobile/include/ui.class.php index 04bda0f942..87d20647a4 100755 --- a/pandora_console/mobile/include/ui.class.php +++ b/pandora_console/mobile/include/ui.class.php @@ -413,12 +413,13 @@ class Ui } - public function contentBeginCollapsible($title=' ') + public function contentBeginCollapsible($title=' ', $class='') { $this->endCollapsible = false; $this->collapsible = []; $this->collapsible['items'] = []; $this->collapsible['title'] = $title; + $this->collapsible['class'] = $class; } @@ -432,7 +433,7 @@ class Ui { $this->endCollapsible = true; - $html = "
    \n"; + $html = "
    \n"; $html .= '

    '.$this->collapsible['title']."

    \n"; $html .= "
      \n"; diff --git a/pandora_console/mobile/operation/agents.php b/pandora_console/mobile/operation/agents.php index 37320a52e2..a53afc40d3 100644 --- a/pandora_console/mobile/operation/agents.php +++ b/pandora_console/mobile/operation/agents.php @@ -401,7 +401,7 @@ class Agents $serialized_filters_q_param = empty($this->serializedFilters) ? '' : '&agents_filter='.$this->serializedFilters; - $row[0] = $row[__('Agent')] = ''.$img_status.''.''.ui_print_truncate_text($agent['alias'], 30, false).''; + $row[0] = $row[__('Agent')] = ''.$img_status.''.''.ui_print_truncate_text($agent['alias'], 30, false).''; $row[2] = $row[__('OS')] = ui_print_os_icon($agent['id_os'], false, true); $row[3] = $row[__('Group')] = ui_print_group_icon($agent['id_grupo'], true, 'groups_small', '', false); $row[5] = $row[__('Status')] = ''.__('S.').' '.$img_status; @@ -461,15 +461,19 @@ class Agents $table = new Table(); $table->id = 'list_agents'; $table->importFromHash($listAgents['agents']); + + $ui->contentAddHtml('
      '); $ui->contentAddHtml($table->getHTML()); if ($system->getPageSize() < $listAgents['total']) { $ui->contentAddHtml( - '
      '.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'
      ' + '
      '.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'
      ' ); $this->addJavascriptAddBottom(); } + + $ui->contentAddHtml('
      '); } $ui->contentAddLinkListener('list_agents'); @@ -528,7 +532,7 @@ class Agents }, \"json\"); // Clean - $('#loading_rows').remove(); + // $('#loading_rows').remove(); } } } diff --git a/pandora_console/mobile/operation/alerts.php b/pandora_console/mobile/operation/alerts.php index 43c6482264..c1d17caac3 100644 --- a/pandora_console/mobile/operation/alerts.php +++ b/pandora_console/mobile/operation/alerts.php @@ -331,14 +331,21 @@ class Alerts } $row = []; - if (isset($this->columns['agent']) && $this->columns['agent']) { - $row[__('Agent')] = sprintf($disabled_style, io_safe_output($alert['agent_alias'])); - } + $row[__('Status')] = ui_print_status_image($status, $title, true); - $row[__('Module')] = sprintf( + $row[__('Module/Agent')] = '
      '; + $row[__('Module/Agent')] .= sprintf( $disabled_style, io_safe_output($alert['module_name']) ); + + $row[__('Module/Agent')] .= ''; + if (isset($this->columns['agent']) && $this->columns['agent']) { + $row[__('Module/Agent')] .= sprintf($disabled_style, io_safe_output($alert['agent_alias'])); + } + + $row[__('Module/Agent')] .= '
      '; + $row[__('Template')] = sprintf( $disabled_style, io_safe_output($alert['template_name']) @@ -347,7 +354,6 @@ class Alerts $disabled_style, human_time_comparation($alert['last_fired'], 'tiny') ); - $row[__('Status')] = ui_print_status_image($status, $title, true); $table[] = $row; } @@ -365,7 +371,9 @@ class Alerts $tableHTML->id = 'list_alerts'; $tableHTML->importFromHash($table); if (!$return) { + $ui->contentAddHtml('
      '); $ui->contentAddHtml($tableHTML->getHTML()); + $ui->contentAddHtml('
      '); } else { return $tableHTML->getHTML(); } diff --git a/pandora_console/mobile/operation/module_data.php b/pandora_console/mobile/operation/module_data.php index 101397de47..c958a07ddc 100644 --- a/pandora_console/mobile/operation/module_data.php +++ b/pandora_console/mobile/operation/module_data.php @@ -199,7 +199,7 @@ class ModuleData $agent_name = agents_get_name($agent_id); $module_name = modules_get_agentmodule_name($this->moduleId); $ui->contentAddHtml('

      '.$module_name.'

      '); - $ui->contentAddHtml('

      '.$agent_name.'

      '); + $ui->contentAddHtml('

      '.$agent_name.'

      '); $ui->contentAddHtml($table->getHTML()); diff --git a/pandora_console/mobile/operation/modules.php b/pandora_console/mobile/operation/modules.php index ba558e5726..f097d61791 100644 --- a/pandora_console/mobile/operation/modules.php +++ b/pandora_console/mobile/operation/modules.php @@ -250,7 +250,7 @@ class Modules __('Filter Modules by %s'), $this->filterEventsGetString() ); - $ui->contentBeginCollapsible($filter_title); + $ui->contentBeginCollapsible($filter_title, 'filter-collapsible'); $ui->beginForm('index.php?page=modules'); $system = System::getInstance(); $groups = users_get_groups_for_select( @@ -599,9 +599,9 @@ class Modules $script = 'onclick="openDialog('.$module['id_agente_modulo'].', '.$this->id_agent.', \'node\');"'; } - $row[0] = $row[__('Module name')] = ''.$image_status.''.''.ui_print_truncate_text($module['module_name'], 30, false).''; + $row[0] = $row[__('Module name')] = ''.$image_status.''.''.ui_print_truncate_text($module['module_name'], 30, false).''; } else { - $row[0] = $row[__('Module name')] = ''.$image_status.''.''.ui_print_truncate_text($module['module_name'], 30, false).''; + $row[0] = $row[__('Module name')] = ''.$image_status.''.''.ui_print_truncate_text($module['module_name'], 30, false).''; } if ($this->columns['agent']) { @@ -730,9 +730,9 @@ class Modules $row[7] = $row[__('Data')] = ''; $row[7] = $row[__('Data')] .= ''; - $row[7] = $row[__('Data')] .= ''; + $row[7] = $row[__('Data')] .= $output.''; // Row 7. $row[7] = $row[__('Data')]; } else { @@ -740,9 +740,9 @@ class Modules $row[7] = $row[__('Data')] = ''; $row[7] = $row[__('Data')] .= ''; - $row[7] = $row[__('Data')] .= ''; + $row[7] = $row[__('Data')] .= $output.''; } } else { if ($system->getConfig('metaconsole')) { @@ -813,7 +813,20 @@ class Modules $table->id = 'list_Modules'; $table->importFromHash($listModules['modules']); + $ui->contentAddHtml('
      '); $ui->contentAddHtml($table->getHTML()); + + if (!$this->all_modules) { + if ($system->getPageSize() < $listModules['total']) { + $ui->contentAddHtml( + '
      '.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'
      ' + ); + + $this->addJavascriptAddBottom(); + } + } + + $ui->contentAddHtml('
      '); } else { $table = new Table(); $table->id = 'list_agent_Modules'; @@ -824,16 +837,6 @@ class Modules return $html; } - - if (!$this->all_modules) { - if ($system->getPageSize() < $listModules['total']) { - $ui->contentAddHtml( - '
      '.html_print_image('images/spinner.gif', true, false, false, false, false, true).' '.__('Loading...').'
      ' - ); - - $this->addJavascriptAddBottom(); - } - } } $ui->contentAddHtml( @@ -841,19 +844,18 @@ class Modules data-transition="pop" class="ui-btn ui-corner-all ui-btn-inline ui-icon-delete ui-btn-icon-left ui-btn-b">
      -
      -
      -

      '.__('Choose option').'

      +
      +
      +

      '.__('Choose option').'

      + X
      -
      - '.__('Cancel').' - - + diff --git a/pandora_console/mobile/operation/services.php b/pandora_console/mobile/operation/services.php index 346f7716d3..addd30d76b 100644 --- a/pandora_console/mobile/operation/services.php +++ b/pandora_console/mobile/operation/services.php @@ -134,6 +134,12 @@ class Services $ui->showFooter(false); $ui->beginContent(); + if (empty($this->services)) { + $ui->contentAddHtml( + ''.__('No services found').'' + ); + } + $ui->contentAddHtml('
      '); $count = 0; $url_agent = 'index.php?page=agents&group=%s&status=%s'; @@ -331,7 +337,7 @@ class Services ); if ($item->exists() !== true) { - $name .= ''.__('Nonexistent. This element should be deleted').''; + $name .= ''.__('Nonexistent. This element should be deleted').''; } else { $url = ui_get_full_url( 'index.php?sec=eventos&sec2=operation/events/events&event_view_hr=8&severity=4&id_agent='.$item->module()->id_agente().'&id_agent_module='.$item->id_agente_modulo() From 6f6a4f6e2e93bc08410ed8304f874267325b930f Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 20 Apr 2023 17:20:08 +0200 Subject: [PATCH 11/13] 9555-Styles --- pandora_console/images/agent_ms.menu.svg | 15 + pandora_console/images/brick.menu.svg | 15 + pandora_console/images/checkbox.svg | 8 + pandora_console/images/close-grey.svg | 18 + pandora_console/images/group.menu.svg | 15 + pandora_console/images/logout-red.svg | 13 + pandora_console/images/op_alerts.menu.svg | 15 + pandora_console/images/op_events.menu.svg | 17 + pandora_console/images/op_monitoring.menu.svg | 15 + pandora_console/images/search-mobile.svg | 15 + pandora_console/images/server-status.menu.svg | 15 + pandora_console/images/services.menu.svg | 13 + .../images/visual_console.menu.svg | 15 + pandora_console/mobile/include/style/main.css | 758 ++++++++++++++---- pandora_console/mobile/include/ui.class.php | 4 +- pandora_console/mobile/operation/agents.php | 3 +- pandora_console/mobile/operation/alerts.php | 3 +- pandora_console/mobile/operation/events.php | 123 ++- pandora_console/mobile/operation/home.php | 27 +- .../mobile/operation/module_data.php | 2 +- .../mobile/operation/module_graph.php | 2 +- pandora_console/mobile/operation/modules.php | 3 +- .../mobile/operation/visualmaps.php | 10 +- 23 files changed, 923 insertions(+), 201 deletions(-) create mode 100644 pandora_console/images/agent_ms.menu.svg create mode 100644 pandora_console/images/brick.menu.svg create mode 100644 pandora_console/images/checkbox.svg create mode 100644 pandora_console/images/close-grey.svg create mode 100644 pandora_console/images/group.menu.svg create mode 100644 pandora_console/images/logout-red.svg create mode 100644 pandora_console/images/op_alerts.menu.svg create mode 100644 pandora_console/images/op_events.menu.svg create mode 100644 pandora_console/images/op_monitoring.menu.svg create mode 100644 pandora_console/images/search-mobile.svg create mode 100644 pandora_console/images/server-status.menu.svg create mode 100644 pandora_console/images/services.menu.svg create mode 100644 pandora_console/images/visual_console.menu.svg diff --git a/pandora_console/images/agent_ms.menu.svg b/pandora_console/images/agent_ms.menu.svg new file mode 100644 index 0000000000..5c0a1fb057 --- /dev/null +++ b/pandora_console/images/agent_ms.menu.svg @@ -0,0 +1,15 @@ + + + 96007EC9-FBFB-4CDC-A8D3-39F8126F7269 + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/brick.menu.svg b/pandora_console/images/brick.menu.svg new file mode 100644 index 0000000000..1f3a6a89e9 --- /dev/null +++ b/pandora_console/images/brick.menu.svg @@ -0,0 +1,15 @@ + + + 788260CF-3DE6-4D64-8B30-B9B35413937B + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/checkbox.svg b/pandora_console/images/checkbox.svg new file mode 100644 index 0000000000..77cac9e5da --- /dev/null +++ b/pandora_console/images/checkbox.svg @@ -0,0 +1,8 @@ + + + Icons/Dark/20/checkbox-on@svg + + + + + \ No newline at end of file diff --git a/pandora_console/images/close-grey.svg b/pandora_console/images/close-grey.svg new file mode 100644 index 0000000000..d022a4472b --- /dev/null +++ b/pandora_console/images/close-grey.svg @@ -0,0 +1,18 @@ + + + + 43B3919E-8FE7-441D-8427-E2652997A80E@svg + Created with sketchtool. + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/group.menu.svg b/pandora_console/images/group.menu.svg new file mode 100644 index 0000000000..e7ad7b639c --- /dev/null +++ b/pandora_console/images/group.menu.svg @@ -0,0 +1,15 @@ + + + B6EE5BBF-2CE4-4EFF-9E46-50036986C7F3 + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/logout-red.svg b/pandora_console/images/logout-red.svg new file mode 100644 index 0000000000..44b96c468e --- /dev/null +++ b/pandora_console/images/logout-red.svg @@ -0,0 +1,13 @@ + + + C79B9248-AD28-44E6-97FA-8E8BEC5C229D + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/op_alerts.menu.svg b/pandora_console/images/op_alerts.menu.svg new file mode 100644 index 0000000000..f611f3672e --- /dev/null +++ b/pandora_console/images/op_alerts.menu.svg @@ -0,0 +1,15 @@ + + + 1823C61D-1174-471F-8BAD-A0B8CB687967 + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/op_events.menu.svg b/pandora_console/images/op_events.menu.svg new file mode 100644 index 0000000000..d275e66942 --- /dev/null +++ b/pandora_console/images/op_events.menu.svg @@ -0,0 +1,17 @@ + + + DD299FDE-0DC6-4356-92DC-926BFF90D985 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/op_monitoring.menu.svg b/pandora_console/images/op_monitoring.menu.svg new file mode 100644 index 0000000000..e2980972c5 --- /dev/null +++ b/pandora_console/images/op_monitoring.menu.svg @@ -0,0 +1,15 @@ + + + 2CF74761-33EB-44F4-9088-CC2767F8DD95 + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/search-mobile.svg b/pandora_console/images/search-mobile.svg new file mode 100644 index 0000000000..579d03b5a4 --- /dev/null +++ b/pandora_console/images/search-mobile.svg @@ -0,0 +1,15 @@ + + + B4F9F258-05E7-4180-8981-655BFA2BA77E@svg + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/server-status.menu.svg b/pandora_console/images/server-status.menu.svg new file mode 100644 index 0000000000..544ac117d8 --- /dev/null +++ b/pandora_console/images/server-status.menu.svg @@ -0,0 +1,15 @@ + + + 5DF60C72-9560-434D-8EEE-2966DF14C3C5 + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/services.menu.svg b/pandora_console/images/services.menu.svg new file mode 100644 index 0000000000..960bce25fc --- /dev/null +++ b/pandora_console/images/services.menu.svg @@ -0,0 +1,13 @@ + + + 7A93DEF5-4FEF-40B6-99B7-F2F36D7D47A0 + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/visual_console.menu.svg b/pandora_console/images/visual_console.menu.svg new file mode 100644 index 0000000000..84077fdfad --- /dev/null +++ b/pandora_console/images/visual_console.menu.svg @@ -0,0 +1,15 @@ + + + 51F33933-7E26-4D16-9D45-F3415926FFF6 + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index f3e895e718..df323a742c 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -59,8 +59,9 @@ body { } a.ui-link, -/* a:not(> div.event_name), */ +a > span.name_count, a:not(.ui-button) { + font-weight: normal; text-decoration: underline !important; text-decoration-color: var(--muted-color) !important; color: var(--primary-color) !important; @@ -153,7 +154,7 @@ legend { } /* For mobiles */ -@media screen and (max-width: 750px) { +@media screen and (max-width: 480px) { #tactical1 *, #tactical2 * { font-size: 12px; @@ -164,7 +165,7 @@ legend { } } /* For tablets */ -@media screen and (min-width: 750px) { +@media screen and (min-width: 480px) { #tactical1 a, #tactical2 a { font-size: 25px !important; @@ -361,13 +362,13 @@ tr.group_view_data, } /* For mobiles */ -@media screen and (max-width: 750px) { +@media screen and (max-width: 480px) { .list_groups .name_count img { margin-top: 0px; } } /* For tablets */ -@media screen and (min-width: 750px) { +@media screen and (min-width: 480px) { .list_groups .name_count img { margin-top: 0px; } @@ -504,7 +505,7 @@ table.event_details td.cell_event_name { height: 40px; } -@media screen and (max-width: 35em) { +@media screen and (max-width: 480px) { /* Hide the title of event name */ #last_agent_events tbody tr.events td.cell_0 b.ui-table-cell-label, #list_events tbody tr.events td.cell_0 b.ui-table-cell-label { @@ -645,89 +646,7 @@ table.event_details td.cell_event_name { width: 100%; } -@media screen and (max-width: 34.99em) { - /* #list_agents td { - height: 35px; - padding-top: 7px; - display: table-cell; - clear: none; - float: none; - padding-left: 0px !important; - padding-right: 0px !important; - width: auto !important; - } */ - - /* #list_agents td.cell_0 { - border-top: 0px none; - } - #list_agents td.cell_0 > span.tiny > img { - width: 5px; - height: 30px; - margin-top: -6px; - margin-left: 0px; - } - - #list_agents .cell_2 .ui-table-cell-label, - #list_agents .cell_3 .ui-table-cell-label, - #list_agents .cell_6 .ui-table-cell-label, - #list_agents .cell_4 .ui-table-cell-label, - #list_agents .cell_5 .ui-table-cell-label, - #list_agents .cell_8 .ui-table-cell-label { - min-width: auto !important; - } - - #list_agents .cell_3 .ui-table-cell-label, - #list_agents .cell_6 .ui-table-cell-label, - #list_agents .cell_7 .ui-table-cell-label { - padding-left: 10px; - } - - #list_agents .cell_2, - #list_agents .cell_3, - #list_agents .cell_7 { - display: inline !important; - float: none !important; - } - - #list_agents .cell_4, - #list_agents .cell_8 { - display: inline !important; - float: none !important; - } - - #list_agents .cell_8 { - display: inline !important; - float: none !important; - } - - #list_agents b.ui-table-cell-label { - display: none; - } - - #list_agents .show_collapside { - display: none !important; - } - - #list_agents .cell_1, - #list_agents .cell_2, - #list_agents .cell_3, - #list_agents .cell_4, - #list_agents .cell_7 { - display: none !important; - } - - #list_agents .cell_0 .ui-link { - font-size: 12px; - } - - #list_agents .cell_6 .show_collapside { - display: none !important; - } - - .agents_tiny_stats * { - font-size: 12px !important; - } */ - +@media screen and (max-width: 480px) { #list_agent_Modules td { padding-top: 7px !important; } @@ -737,18 +656,6 @@ table.event_details td.cell_event_name { } } -/* For mobiles */ -@media screen and (max-width: 750px) { - .agents_tiny_stats * { - font-size: 12px !important; - } -} -/* For tablets */ -@media screen and (min-width: 750px) { - .agents_tiny_stats * { - font-size: 17px !important; - } -} /*END-----------Agents styles-----------------------------------------*/ /*INIT-----------Network maps styles---------------------------------------*/ @@ -777,20 +684,7 @@ table.event_details td.cell_event_name { } /* For mobiles */ -@media screen and (max-width: 750px) { - #rendered_visual_map div { - font-size: 6pt !important; - } -} -/* For tablets */ -@media screen and (min-width: 750px) { - #rendered_visual_map div { - font-size: 8pt !important; - } -} - -/* For mobiles */ -@media screen and (max-width: 750px) { +@media screen and (max-width: 480px) { .resize_visual_font_size_4pt * { font-size: 2pt !important; } @@ -814,7 +708,7 @@ table.event_details td.cell_event_name { } } /* For tablets */ -@media screen and (min-width: 750px) { +@media screen and (min-width: 480px) { .resize_visual_font_size_4pt * { font-size: 2pt !important; } @@ -841,7 +735,7 @@ table.event_details td.cell_event_name { /*END-----------Visual maps styles---------------------------------------*/ /*INIT-----------Modules styles---------------------------------------*/ -@media screen and (max-width: 34.99em) { +@media screen and (max-width: 480px) { #list_Modules .cell_1 .ui-table-cell-label, #list_Modules .cell_5 .ui-table-cell-label, #list_Modules .cell_6 .ui-table-cell-label { @@ -918,6 +812,7 @@ table.event_details td.cell_event_name { font-size: 12px !important; } + table#list_agent_Modules tr, table#list_agents tr, table#list_Modules tr, table#list_alerts tr, @@ -989,16 +884,19 @@ table[id^="service-table-"] td.cell_0 { } #user_logged { + color: var(--muted-color); + font-weight: 600; position: absolute; font-size: 11px !important; right: 10px; top: 8px; - background: url(../../../images/header_user.png) no-repeat right; + /* background: url(../../../images/user.svg) no-repeat right !important; */ padding-right: 20px; line-height: 20px; + background-size: 17px !important; } -@media screen and (max-width: 34.99em) { +@media screen and (max-width: 480px) { #list_agent_Modules .ui-table-cell-label, #list_agent_Modules .cell_2, #list_agent_Modules .cell_3 { @@ -1060,7 +958,7 @@ li.ui-btn { float: left; } -@media screen and (max-width: 34.99em) { +@media screen and (max-width: 480px) { .ui-table th, .ui-table td { padding: 8px !important; @@ -1102,7 +1000,7 @@ li.ui-btn { height: 28px !important; } -@media screen and (max-width: 35em) { +@media screen and (max-width: 480px) { .events .status_row { display: none; } @@ -1121,7 +1019,7 @@ li.ui-btn { } } -@media screen and (min-width: 35em) { +@media screen and (min-width: 480px) { .events .cell_0 .event_link { display: none; } @@ -1154,7 +1052,7 @@ li.ui-btn { } /* For mobiles */ -@media screen and (max-width: 750px) { +@media screen and (max-width: 480px) { .ui-content > .ui-btn { margin: 10px 7px; height: 30px; @@ -1182,7 +1080,7 @@ li.ui-btn { } } /* For tablets */ -@media screen and (min-width: 750px) { +@media screen and (min-width: 480px) { .ui-content > .ui-btn { display: inline-block; margin: 8px 5px; @@ -1345,6 +1243,41 @@ table.tactical_bars { background-size: 18px 18px !important; } +/* New */ +.ui-icon-menu-services { + background-image: url(../../../images/services.menu.svg) !important; +} +.ui-icon-menu-server-status { + background-image: url(../../../images/server-status.menu.svg) !important; +} +.ui-icon-menu-brick { + background-image: url(../../../images/brick.menu.svg) !important; +} +.ui-icon-menu-agent_ms { + background-image: url(../../../images/agent_ms.menu.svg) !important; +} +.ui-icon-menu-op_alerts { + background-image: url(../../../images/op_alerts.menu.svg) !important; +} +.ui-icon-menu-visual_console { + background-image: url(../../../images/visual_console.menu.svg) !important; +} +.ui-icon-menu-group { + background-image: url(../../../images/group.menu.svg) !important; +} +.ui-icon-menu-op_events { + background-image: url(../../../images/op_events.menu.svg) !important; +} +.ui-icon-menu-op_monitoring { + background-image: url(../../../images/op_monitoring.menu.svg) !important; +} + +.ui-icon-menu-square { + border-radius: 0% !important; + width: 30px !important; + height: 30px !important; +} + .ui-icon-tactical_view, .ui-icon-events, .ui-icon-groups, @@ -1376,42 +1309,6 @@ table.tactical_bars { -webkit-border-radius: 15px !important; } -/* For mobiles */ -@media screen and (max-width: 750px) { - .ui-icon-tactical_view, - .ui-icon-events, - .ui-icon-groups, - .ui-icon-alerts, - .ui-icon-agents, - .ui-icon-modules, - .ui-icon-server-status, - .ui-icon-services, - .ui-icon-network_maps, - .ui-icon-visual_console, - .ui-icon-dashboard { - height: 18px !important; - width: 18px !important; - margin-top: 0px !important; - } -} -/* For tablets */ -@media screen and (min-width: 750px) { - .ui-icon-tactical_view, - .ui-icon-events, - .ui-icon-groups, - .ui-icon-alerts, - .ui-icon-agents, - .ui-icon-modules, - .ui-icon-server-status, - .ui-icon-services, - .ui-icon-network_maps, - .ui-icon-visual_console, - .ui-icon-dashboard { - height: 18px !important; - width: 18px !important; - } -} - /*END-----------Network maps styles---------------------------------------*/ #logout_dialog-button_close { @@ -1967,11 +1864,19 @@ span#user_logged { } .ui-icon-delete { - background-image: url(../../../images/close@svg.svg) !important; + background-image: url(../../../images/close-grey.svg) !important; } .ui-icon-search { - background-image: url(../../../images/details.svg) !important; + background-image: url(../../../images/search-mobile.svg) !important; +} + +.ui-checkboxradio-icon { + background-image: url(../../../images/checkbox.svg) !important; +} + +.ui-icon-logout { + background-image: url(../../../images/logout-red.svg) !important; } .ui-icon { @@ -2151,17 +2056,22 @@ table#last-activity > tbody > tr > td > b { padding-right: 0px; } +.white-card.p-tb-0px { + padding-top: 0px; + padding-bottom: 0px; +} + /* Events table */ table#last_agent_events > tbody > tr.events > td.cell_0, table#list_events > tbody > tr.events > td.cell_0 { - border-top-left-radius: 8px !important; - border-top-right-radius: 8px !important; + border-top-left-radius: 8px; + border-top-right-radius: 8px; } table#last_agent_events > tbody > tr.events > td.vertical_middle, table#list_events > tbody > tr.events > td.vertical_middle { - border-bottom-left-radius: 8px !important; - border-bottom-right-radius: 8px !important; + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; color: #4a4a4a; } @@ -2432,6 +2342,7 @@ div#module-dialog-popup { div#module-dialog { height: 100%; + border-radius: 8px; } a#close-dialog-btn { @@ -2447,6 +2358,8 @@ a#historical-option { line-height: 40px; } +fieldset.ui-controlgroup.ui-controlgroup-vertical.ui-group-theme-inherit + > label, div[data-role="fieldcontain"] > fieldset > label[for^="select-"] { margin-top: 10px; font-size: 10pt !important; @@ -2459,26 +2372,62 @@ div[data-role="fieldcontain"] > a[id^="select-"] { box-shadow: unset; text-align: left; - color: var(--muted-color); - font-weight: 500; + font-weight: 400; border: 1px solid var(--border-dark-color) !important; border-radius: 8px !important; } -li > a.ui-listview-item-button.ui-button.ui-button-active { - color: #000; +ul.ui-selectmenu-custom-list.ui-listview + > li + > a.ui-listview-item-button.ui-button.ui-button-active { + background-color: var(--primary-color); +} + +ul.ui-selectmenu-custom-list.ui-listview + > li + > a.ui-listview-item-button.ui-button { + font-weight: 400; +} + +div.ui-page-dialog-contain.ui-overlay-shadow.ui-corner-all.ui-body-a + > div.ui-content { + padding: 0px; +} + +div.ui-popup.ui-corner-all.ui-overlay-shadow.ui-selectmenu-custom.ui-body-inherit + > ul.ui-selectmenu-custom-list.ui-listview { + margin-left: -1px; + margin-right: -1px; +} + +div.ui-popup.ui-corner-all.ui-overlay-shadow.ui-selectmenu-custom.ui-body-inherit, +div.ui-page-dialog-contain.ui-overlay-shadow.ui-corner-all.ui-body-a { + border-radius: 8px; } div.ui-toolbar-header.ui-bar-inherit { height: 40px; line-height: 22px; font-size: 10pt; + background-color: var(--secondary-color) !important; + height: 48px; + border-bottom: 1px solid var(--border-color); +} + +div.ui-toolbar-header.ui-bar-inherit h1.ui-toolbar-title { + font-size: 11pt; + text-align: left; + margin-left: 10px; + line-height: 28px; } div.ui-toolbar-header.ui-bar-inherit > .ui-page-dialog-close-button.ui-button.ui-corner-all.ui-button-icon-only.ui-toolbar-header-button-left { background-color: transparent; border: 0px; + right: 10px; + left: unset; + top: 10px; } div#free_search-container @@ -2492,10 +2441,12 @@ div#free_search-container input[name="free_search"] { height: 48px; margin-left: 15px !important; + padding-left: 30px !important; } input[name="free_search"]::placeholder { font-style: italic; + color: var(--muted-color); } div#free_search-container @@ -2514,15 +2465,45 @@ a.ui-textinput-clear-button.ui-button-icon-only.ui-button-right.ui-widget.ui-but box-shadow: unset; } +div#logout_dialog a#logout_dialog-button_close, +div#detail_event_dialog > div > div a#validate_button, +div#detail_event_dialog > div > div a#process_button, fieldset[data-role="controlgroup"] > input[type="submit"] { height: 48px; border-radius: 8px; background-color: var(--primary-color); text-shadow: none; - color: var(--body-color); + color: var(--secondary-color); font-size: 11pt !important; } +div#detail_event_dialog > div > div a#validate_button, +div#detail_event_dialog > div > div a#process_button { + margin-right: 10px; + margin-left: 10px; +} + +div#detail_event_dialog > div > div a#process_button { + background-color: var(--secondary-color); + color: var(--primary-color); + height: 22px; +} + +div#logout_dialog h1.dialog_title { + font-size: 11pt; +} + +div#logout_dialog + div.ui-page-dialog-contain.ui-overlay-shadow.ui-corner-all.ui-body-a { + padding: 10px; +} + +div#logout_dialog a#logout_dialog-button_close { + height: 30px; +} + +div#detail_event_dialog > div > div a#validate_button:active, +div#detail_event_dialog > div > div a#validate_button:hover, fieldset[data-role="controlgroup"] > input[type="submit"]:active, fieldset[data-role="controlgroup"] > input[type="submit"]:hover { background-color: var(--primary-color-hover); @@ -2530,6 +2511,43 @@ fieldset[data-role="controlgroup"] > input[type="submit"]:hover { color: var(--body-color); } +fieldset[data-role="controlgroup"] > div.ui-slider > input[type="number"] { + border: 1px solid var(--border-dark-color) !important; + border-radius: 8px; + text-shadow: none; + box-shadow: unset; + font-weight: 400; + height: 32px; +} + +fieldset[data-role="controlgroup"] + > div.ui-slider + > div.ui-slider-track.ui-shadow-inset.ui-corner-all.ui-body-inherit { + background-color: var(--border-dark-color); + border: 0px; + box-shadow: unset; + border-radius: 8px; + height: 10px; + margin-top: 10px; +} + +fieldset[data-role="controlgroup"] + > div.ui-slider + > div.ui-slider-track.ui-shadow-inset.ui-corner-all.ui-body-inherit + > a { + line-height: 28px; + border-radius: 50%; + background-color: var(--secondary-color); +} + +fieldset[data-role="controlgroup"] + > div.ui-slider + > div.ui-slider-track.ui-shadow-inset.ui-corner-all.ui-body-inherit + > a::before { + color: var(--muted-color); + content: "< >"; +} + div.filter-collapsible.ui-collapsible.ui-collapsible-inset.ui-corner-all.ui-collapsible-themed-content > h4 > a { @@ -2561,3 +2579,401 @@ div.filter-collapsible.ui-collapsible.ui-collapsible-inset.ui-corner-all.ui-coll text-shadow: none !important; background-color: var(--border-color) !important; } + +div.list_groups.ui-collapsible-set + div.ui-collapsible.ui-collapsible-inset.ui-corner-all.ui-collapsible-themed-content + h4 + a { + background-color: var(--secondary-color) !important; +} + +div.list_groups.ui-collapsible-set div.ui-collapsible-content.ui-body-d { + padding: 0px; +} + +div.list_groups.ui-collapsible-set + div.ui-collapsible-content.ui-body-d + li.ui-listview-item { + height: 28px; +} + +div.list_groups.ui-collapsible-set + div.ui-collapsible-content.ui-body-d + li.ui-listview-item + a { + font-weight: 400px; + height: 28px; + line-height: 33px; + padding-top: 0px; + padding-bottom: 0px; +} + +div.list_groups.ui-collapsible-set + div.ui-collapsible.ui-collapsible-inset + h4 + a + span.ui-icon.ui-collapsible-icon-right { + margin-top: 2px; +} + +div.list_groups.ui-collapsible-set + div.ui-collapsible.ui-collapsible-inset + h4 + a + span.agents-counter { + margin-top: 4px; +} + +div.list_groups.ui-collapsible-set + div.ui-collapsible.ui-collapsible-inset + h4 + a + img { + margin-bottom: -4px; +} + +a > span.number_count { + font-weight: normal; +} + +.close-button-dialog, +div#detail_event_dialog > div .close-button-dialog { + background-image: url(../../../images/close-grey.svg) !important; + background-repeat: no-repeat; + background-position: center; + margin: 0px; + margin-right: 10px !important; + width: 25px; + height: 25px; + background-color: transparent !important; + border: unset !important; + box-shadow: none !important; +} + +div#detail_event_dialog > div h1.dialog_title { + font-size: 11pt; + margin-left: 10px; +} + +div#detail_event_dialog tr.event_name { + display: none; +} + +div#detail_event_dialog table.pandora_responsive.event_details * { + font-size: 10pt; +} + +div#detail_event_dialog + table.pandora_responsive.event_details + > tbody + > tr:nth-child(even), +div#detail_event_dialog table.pandora_responsive.event_details th, +div#detail_event_dialog table.pandora_responsive.event_details td { + background-color: var(--secondary-color); +} + +a.big_data { + text-decoration: none !important; + color: initial !important; +} + +div#module-dialog > div.ui-content > a { + box-shadow: none; + background-color: var(--border-color); + text-shadow: none; + border-radius: 8px; +} + +div#agent_graphs, +div#agent_details { + padding-left: 10px; + padding-right: 10px; +} + +a.ui-collapsible-heading-toggle.ui-button.ui-button-a.ui-mini { + height: 38px; + line-height: 40px; + font-weight: 400; + font-size: 11pt; +} + +div#filter-modules-container + div.ui-textinput.ui-corner-all.ui-shadow-inset.ui-textinput-text.ui-body-inherit { + box-shadow: unset; + border: 1px solid var(--border-dark-color); + border-radius: 8px; + background-color: var(--border-color); +} + +div#filter-modules-container input#filter-modules { + height: 38px; +} + +table#list_agent_Modules, +table#list_agent_Modules thead, +table#list_agent_Modules tbody, +table#list_agent_Modules tr { + width: calc(100vw - 48px) !important; +} + +table#list_agent_Modules tr { + height: 38px; +} + +table#list_agent_Modules thead th { + display: initial; +} + +table#list_agent_Modules > thead > tr > th[data-colstart="3"], +table#list_agent_Modules > thead > tr > th[data-colstart="4"] { + display: none; +} + +table#list_agent_Modules > thead > tr > th[data-colstart="1"], +table#list_agent_Modules > tbody > tr > td.cell_0 { + width: 60%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: left; +} +table#list_agent_Modules > thead > tr > th[data-colstart="2"], +table#list_agent_Modules > tbody > tr > td.cell_1 { + width: 15%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; +} +table#list_agent_Modules > thead > tr > th[data-colstart="5"], +table#list_agent_Modules > tbody > tr > td.cell_4 { + width: 25%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; +} + +.truncate { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; +} + +div#start_date-container + div.ui-textinput.ui-corner-all.ui-shadow-inset.ui-textinput-text.ui-body-inherit, +div#unknown_graph-container label, +div#time_compare_overlapped-container label, +div#time_compare_separated-container label, +div#draw_events-container label, +div#draw_alerts-container label { + border: 1px solid var(--border-dark-color); + border-radius: 8px; + height: 48px; + line-height: 30px; + font-weight: 400; +} + +div#start_date-container + div.ui-textinput.ui-corner-all.ui-shadow-inset.ui-textinput-text.ui-body-inherit { + background-color: #f6f6f6; + border: 1px solid var(--border-dark-color); + border-radius: 8px; + height: 44px; + box-shadow: none; + line-height: 30px; + font-weight: 400; +} + +div#start_date-container + div.ui-textinput.ui-corner-all.ui-shadow-inset.ui-textinput-text.ui-body-inherit + input { + margin-top: 10px; +} + +div#graph_content > div.parent_graph { + width: 100% !important; + display: flex; + flex-direction: column; + flex-wrap: nowrap; + align-items: center; +} + +.logout-text { + color: #ed474a !important; +} + +div.menu-buttons { + display: flex; + flex-direction: column; + flex-wrap: nowrap; + align-items: stretch; +} + +div.menu-buttons > a[data-role="button"] { + margin-top: 0px; + margin-bottom: -1px; + box-shadow: unset; + background-color: var(--secondary-color) !important; + border-radius: 0px; + line-height: 28px; + text-align: left; +} + +div.menu-buttons > a[data-role="button"]:first-child { + border-top-left-radius: 8px; + border-top-right-radius: 8px; +} +div.menu-buttons > a[data-role="button"]:last-child { + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; +} + +div.search-home { + margin-left: -5px; + margin-right: -5px; +} + +.no-data { + color: #ed474a !important; + text-align: center !important; + font-size: 10pt !important; +} + +a.visual-console-button { + text-shadow: none !important; + box-shadow: unset !important; + background-color: var(--border-color) !important; +} + +table#list_visualmaps tr td { + background-color: var(--secondary-color); + border-bottom: 1px solid var(--border-color); + height: 48px; +} + +table#list_visualmaps tr td a { + font-size: 10pt; + font-weight: 400; +} + +table#list_visualmaps tr:first-child td { + border-top-left-radius: 8px; + border-top-right-radius: 8px; +} + +table#list_visualmaps tr:last-child td { + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + border-bottom: 0px; +} +/* =============================================================== */ +/* ========================= For tablets ========================= */ +/* =============================================================== */ +@media screen and (min-width: 480px) { + table#last-activity > tbody > tr { + display: table-row; + } + table#last-activity > thead > tr > th[data-colstart="1"], + table#last-activity > tbody > tr > td.cell_0 { + width: 10%; + } + table#last-activity > thead > tr > th[data-colstart="2"], + table#last-activity > tbody > tr > td.cell_1 { + width: 50%; + } + table#last-activity > thead > tr > th[data-colstart="3"], + table#last-activity > tbody > tr > td.cell_2 { + width: 20%; + } + table#last-activity > thead > tr > th[data-colstart="4"], + table#last-activity > tbody > tr > td.cell_3 { + width: 20%; + } + + table#list_events > tbody > tr { + display: table-row; + } + table#list_events > tbody > tr > td.cell_0 { + width: 70% !important; + line-height: 34px; + border-top-right-radius: 0px !important; + border-top-left-radius: 8px !important; + border-bottom-left-radius: 8px !important; + } + table#list_events > tbody > tr > td.vertical_middle { + width: 30% !important; + line-height: 34px; + border-bottom-left-radius: 0px !important; + border-top-right-radius: 8px !important; + border-bottom-right-radius: 8px !important; + } + table#list_events > tbody > tr > td.vertical_middle .events_timestamp { + margin-top: 10px; + } + + table#list_agents > thead > tr > th { + display: unset !important; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + text-align: left; + padding-left: 0px; + padding-right: 0px; + } + table#list_agents > tbody > tr > td { + display: initial !important; + white-space: nowrap; + line-height: 48px; + height: 48px; + } + table#list_agents > tbody > tr > td span.align-none-10p { + display: none; + } + table#list_agents > tbody > tr > td .status_rounded_rectangles { + width: 30px; + } + table#list_agents > tbody > tr > td > img { + margin-top: 15px; + } + table#list_agents > tbody > tr { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + } + table#list_agents > thead > tr > th[data-colstart="1"], + table#list_agents > tbody > tr > td.cell_0 { + width: 40%; + } + table#list_agents > thead > tr > th[data-colstart="2"], + table#list_agents > tbody > tr > td.cell_1 { + width: 7%; + } + table#list_agents > thead > tr > th[data-colstart="3"], + table#list_agents > tbody > tr > td.cell_2 { + width: 7%; + } + table#list_agents > thead > tr > th[data-colstart="4"], + table#list_agents > tbody > tr > td.cell_3 { + width: 7%; + } + table#list_agents > thead > tr > th[data-colstart="5"], + table#list_agents > tbody > tr > td.cell_4 { + width: 7%; + } + table#list_agents > thead > tr > th[data-colstart="6"], + table#list_agents > tbody > tr > td.cell_5 { + width: 12%; + } + table#list_agents > thead > tr > th[data-colstart="7"], + table#list_agents > tbody > tr > td.cell_6 { + width: 10%; + margin-right: 0px; + } + table#list_agents > thead > tr > th[data-colstart="8"], + table#list_agents > tbody > tr > td.cell_7 { + width: 10%; + margin-right: 5px; + } +} diff --git a/pandora_console/mobile/include/ui.class.php b/pandora_console/mobile/include/ui.class.php index 87d20647a4..c2ab2d76d3 100755 --- a/pandora_console/mobile/include/ui.class.php +++ b/pandora_console/mobile/include/ui.class.php @@ -220,11 +220,11 @@ class Ui if ($left_button === false) { $left_button = $this->createHeaderButton( [ - 'icon' => 'ui-icon-back', + 'icon' => 'ui-icon-logout', 'pos' => 'left', 'text' => __('Logout'), 'href' => 'index.php?action=logout', - 'class' => 'header-button-left', + 'class' => 'header-button-left logout-text', ] ); } diff --git a/pandora_console/mobile/operation/agents.php b/pandora_console/mobile/operation/agents.php index a53afc40d3..f1c61ef322 100644 --- a/pandora_console/mobile/operation/agents.php +++ b/pandora_console/mobile/operation/agents.php @@ -219,7 +219,7 @@ class Agents __('Filter Agents by %s'), $this->filterEventsGetString() ); - $ui->contentBeginCollapsible($filter_title); + $ui->contentBeginCollapsible($filter_title, 'filter-collapsible'); $ui->beginForm('index.php?page=agents'); $system = System::getInstance(); $groups = users_get_groups_for_select( @@ -462,6 +462,7 @@ class Agents $table->id = 'list_agents'; $table->importFromHash($listAgents['agents']); + $ui->contentAddHtml('
      '); $ui->contentAddHtml('
      '); $ui->contentAddHtml($table->getHTML()); diff --git a/pandora_console/mobile/operation/alerts.php b/pandora_console/mobile/operation/alerts.php index c1d17caac3..53648ce5a5 100644 --- a/pandora_console/mobile/operation/alerts.php +++ b/pandora_console/mobile/operation/alerts.php @@ -208,7 +208,7 @@ class Alerts __('Filter Alerts by %s'), $this->filterAlertsGetString() ); - $ui->contentBeginCollapsible($filter_title); + $ui->contentBeginCollapsible($filter_title, 'filter-collapsible'); $ui->beginForm(); $options = [ 'name' => 'page', @@ -371,6 +371,7 @@ class Alerts $tableHTML->id = 'list_alerts'; $tableHTML->importFromHash($table); if (!$return) { + $ui->contentAddHtml('
      '); $ui->contentAddHtml('
      '); $ui->contentAddHtml($tableHTML->getHTML()); $ui->contentAddHtml('
      '); diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index 9b08557d7d..45522da678 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -438,17 +438,17 @@ class Events // Get Status. switch ($event['estado']) { case 0: - $img_st = 'images/star_dark.png'; + $img_st = 'images/star-dark.svg'; $title_st = __('New event'); break; case 1: - $img_st = 'images/tick.png'; + $img_st = 'images/validate.svg'; $title_st = __('Event validated'); break; case 2: - $img_st = 'images/hourglass.png'; + $img_st = 'images/clock.svg'; $title_st = __('Event in process'); break; @@ -584,6 +584,43 @@ class Events } break; + case 'process_event': + $system = System::getInstance(); + + $id_event = $system->getRequest('id_event', 0); + $server_id = $system->getRequest('server_id', 0); + + try { + if (is_metaconsole() === true + && $server_id > 0 + ) { + $node = new Node($server_id); + $node->connect(); + } + + if (events_change_status($id_event, EVENT_PROCESS) === true) { + echo json_encode(['correct' => 1]); + } else { + echo json_encode(['correct' => 0]); + } + } catch (\Exception $e) { + // Unexistent agent. + if (is_metaconsole() === true + && $server_id > 0 + ) { + $node->disconnect(); + } + + echo json_encode(['correct' => 0]); + } finally { + if (is_metaconsole() === true + && $server_id > 0 + ) { + $node->disconnect(); + } + } + break; + default: // Not possible. break; @@ -783,7 +820,7 @@ class Events // Content. ob_start(); ?> -
    +
    @@ -852,6 +889,14 @@ class Events 'href' => 'javascript: validateEvent();', ]; $options['content_text'] .= $ui->createButton($options_button); + + $options_button = [ + 'text' => __('In process'), + 'id' => 'process_button', + 'href' => 'javascript: processEvent();', + ]; + $options['content_text'] .= $ui->createButton($options_button); + $options_hidden = [ 'id' => 'event_id', 'value' => 0, @@ -871,6 +916,13 @@ class Events $options['content_text'] .= ''; + $options['content_text'] .= ''; + $options['content_text'] .= ''; + $options['content_text'] .= ''; + $options['button_close'] = true; return $options; @@ -914,7 +966,7 @@ class Events $ui->contentAddHtml(""); $filter_title = sprintf(__('Filter Events by %s'), $this->filterEventsGetString()); - $ui->contentBeginCollapsible($filter_title); + $ui->contentBeginCollapsible($filter_title, 'filter-collapsible'); $ui->beginForm('index.php?page=events'); $items = db_get_all_rows_in_table('tevent_filter'); $items[] = [ @@ -1202,9 +1254,9 @@ class Events success: function (data) { if (data.correct) { - event = data.event; + event = data.event; //Fill the dialog - $("#detail_event_dialog .cell_event_name") + $("#detail_event_dialog h1.dialog_title") .html(event["evento"]); $("#detail_event_dialog .cell_event_id") .html(id_event); @@ -1220,6 +1272,8 @@ class Events .html(event["criticity"]); $("#detail_event_dialog .cell_event_status") .html(event["status"]); + $("#detail_event_dialog .cell_event_status img") + .addClass("main_menu_icon"); $("#detail_event_dialog .cell_event_acknowledged_by") .html(event["acknowledged_by"]); $("#detail_event_dialog .cell_event_group") @@ -1244,15 +1298,19 @@ class Events //The event is validated. $("#validate_button").hide(); } + + if (event["status"].indexOf("clock") >= 0) { + $("#process_button").hide(); + } + $("#validate_button_loading").hide(); $("#validate_button_fail").hide(); $("#validate_button_correct").hide(); $.mobile.loading( "hide" ); $("#detail_event_dialog_hook").click(); - $("#detail_event_dialog-button_close").html("X"); + $("#detail_event_dialog-button_close").html(""); $("#detail_event_dialog-button_close").addClass("close-button-dialog"); - $(".dialog_title").addClass("ml5px"); $(".dialog_title").parent().addClass("flex align-items-center space-between"); $(".dialog_title").parent().append($("#detail_event_dialog-button_close")); } @@ -1315,6 +1373,53 @@ class Events } }); } + + function processEvent() { + id_event = $("#event_id").val(); + server_id = $("#server_id").val(); + + $("#process_button").hide(); + $("#process_button_loading").show(); + + //Hide the button to close + $("#detail_event_dialog div.ui-header a.ui-btn-right") + .hide(); + + postvars = {}; + postvars["action"] = "ajax"; + postvars["parameter1"] = "events"; + postvars["parameter2"] = "process_event"; + postvars["id_event"] = id_event; + postvars["server_id"] = server_id; + + $.ajax ({ + type: "POST", + url: "index.php", + dataType: "json", + data: postvars, + success: + function (data) { + $("#process_button_loading").hide(); + + if (data.correct) { + $("#process_button_correct").show(); + } + else { + $("#process_button_fail").show(); + } + + $("#detail_event_dialog div.ui-header a.ui-btn-right") + .show(); + }, + error: + function (jqXHR, textStatus, errorThrown) { + $("#process_button_loading").hide(); + $("#process_button_fail").show(); + $("#detail_event_dialog div.ui-header a.ui-btn-right") + .show(); + } + }); + } ' ); } diff --git a/pandora_console/mobile/operation/home.php b/pandora_console/mobile/operation/home.php index 06797a1d1b..d7e3700cc7 100644 --- a/pandora_console/mobile/operation/home.php +++ b/pandora_console/mobile/operation/home.php @@ -45,19 +45,19 @@ class Home 'name' => __('Tactical view'), 'filename' => 'tactical.php', 'menu_item' => true, - 'icon' => 'ui-icon-tactical_view ui-widget-icon-floatbeginning', + 'icon' => 'ui-icon-menu-op_monitoring ui-widget-icon-floatbeginning ui-icon-menu-square', ]; $items['events'] = [ 'name' => __('Events'), 'filename' => 'events.php', 'menu_item' => true, - 'icon' => 'ui-icon-events ui-widget-icon-floatbeginning', + 'icon' => 'ui-icon-menu-op_events ui-widget-icon-floatbeginning ui-icon-menu-square', ]; $items['groups'] = [ 'name' => __('Groups'), 'filename' => 'groups.php', 'menu_item' => true, - 'icon' => 'ui-icon-groups ui-widget-icon-floatbeginning', + 'icon' => 'ui-icon-menu-group ui-widget-icon-floatbeginning ui-icon-menu-square', ]; if ((bool) $system->getConfig('legacy_vc', false) === false) { @@ -66,7 +66,7 @@ class Home 'name' => __('Visual consoles'), 'filename' => 'visualmaps.php', 'menu_item' => true, - 'icon' => 'ui-icon-visual_console ui-widget-icon-floatbeginning', + 'icon' => 'ui-icon-menu-visual_console ui-widget-icon-floatbeginning ui-icon-menu-square', ]; } @@ -74,28 +74,28 @@ class Home 'name' => __('Alerts'), 'filename' => 'alerts.php', 'menu_item' => true, - 'icon' => 'ui-icon-alerts ui-widget-icon-floatbeginning', + 'icon' => 'ui-icon-menu-op_alerts ui-widget-icon-floatbeginning ui-icon-menu-square', ]; $items['agents'] = [ 'name' => __('Agents'), 'filename' => 'agents.php', 'menu_item' => true, - 'icon' => 'ui-icon-agents ui-widget-icon-floatbeginning', + 'icon' => 'ui-icon-menu-agent_ms ui-widget-icon-floatbeginning ui-icon-menu-square', ]; $items['modules'] = [ 'name' => __('Modules'), 'filename' => 'modules.php', 'menu_item' => true, - 'icon' => 'ui-icon-modules ui-widget-icon-floatbeginning', + 'icon' => 'ui-icon-menu-brick ui-widget-icon-floatbeginning ui-icon-menu-square', ]; $items['server_status'] = [ 'name' => __('Server status'), 'filename' => 'server_status.php', 'menu_item' => true, - 'icon' => 'ui-icon-server-status ui-widget-icon-floatbeginning', + 'icon' => 'ui-icon-menu-server-status ui-widget-icon-floatbeginning ui-icon-menu-square', ]; if ((int) $system->getConfig('enterprise_installed', false) === 1) { @@ -103,7 +103,7 @@ class Home 'name' => __('Services'), 'filename' => 'services.php', 'menu_item' => true, - 'icon' => 'ui-icon-services ui-widget-icon-floatbeginning', + 'icon' => 'ui-icon-menu-services ui-widget-icon-floatbeginning ui-icon-menu-square', ]; } @@ -131,6 +131,7 @@ class Home $this->loadPagesItems(); } + $ui->contentAddHtml(''); } @@ -159,11 +162,11 @@ class Home } else { $left_button = $ui->createHeaderButton( [ - 'icon' => 'ui-icon-back', + 'icon' => 'ui-icon-logout', 'pos' => 'left', 'text' => __('Logout'), 'href' => 'index.php?action=logout', - 'class' => 'header-button-left', + 'class' => 'header-button-left logout-text', ] ); } @@ -177,6 +180,7 @@ class Home $ui->createHeader(__('Home'), $left_button, $user_logged); $ui->showFooter(false); $ui->beginContent(); + $ui->contentAddHtml('
    '); $ui->beginForm('index.php?page=agents'); $options = [ 'name' => 'free_search', @@ -185,6 +189,7 @@ class Home ]; $ui->formAddInputSearch($options); $ui->endForm(); + $ui->contentAddHtml('
    '); // List of buttons $this->loadButtons($ui); diff --git a/pandora_console/mobile/operation/module_data.php b/pandora_console/mobile/operation/module_data.php index c958a07ddc..6af43f7e23 100644 --- a/pandora_console/mobile/operation/module_data.php +++ b/pandora_console/mobile/operation/module_data.php @@ -199,7 +199,7 @@ class ModuleData $agent_name = agents_get_name($agent_id); $module_name = modules_get_agentmodule_name($this->moduleId); $ui->contentAddHtml('

    '.$module_name.'

    '); - $ui->contentAddHtml('

    '.$agent_name.'

    '); + $ui->contentAddHtml('

    '.$agent_name.'

    '); $ui->contentAddHtml($table->getHTML()); diff --git a/pandora_console/mobile/operation/module_graph.php b/pandora_console/mobile/operation/module_graph.php index f8fb4da297..4c7be64b4d 100644 --- a/pandora_console/mobile/operation/module_graph.php +++ b/pandora_console/mobile/operation/module_graph.php @@ -404,7 +404,7 @@ class ModuleGraph ) ); $title = sprintf(__('Options for %s : %s'), $agent_alias, $this->module['nombre']); - $ui->contentBeginCollapsible($title); + $ui->contentBeginCollapsible($title, 'filter-collapsible'); $ui->beginForm('index.php?page=module_graph&id='.$this->id.'&server_id='.$this->server_id); $options = [ 'name' => 'draw_alerts', diff --git a/pandora_console/mobile/operation/modules.php b/pandora_console/mobile/operation/modules.php index f097d61791..259be06544 100644 --- a/pandora_console/mobile/operation/modules.php +++ b/pandora_console/mobile/operation/modules.php @@ -813,6 +813,7 @@ class Modules $table->id = 'list_Modules'; $table->importFromHash($listModules['modules']); + $ui->contentAddHtml('
    '); $ui->contentAddHtml('
    '); $ui->contentAddHtml($table->getHTML()); @@ -847,7 +848,7 @@ class Modules

    '.__('Choose option').'

    - X +
    diff --git a/pandora_console/mobile/operation/visualmaps.php b/pandora_console/mobile/operation/visualmaps.php index 258c1bd94a..07869726ad 100644 --- a/pandora_console/mobile/operation/visualmaps.php +++ b/pandora_console/mobile/operation/visualmaps.php @@ -241,7 +241,7 @@ class Visualmaps 'pos' => 'right', 'text' => __('All visual consoles'), 'href' => 'index.php?page=visualmaps&favourite=0', - 'class' => '', + 'class' => 'visual-console-button', ] ) ); @@ -253,14 +253,16 @@ class Visualmaps 'pos' => 'right', 'text' => __('Favourite visual consoles'), 'href' => 'index.php?page=visualmaps&favourite=1', - 'class' => '', + 'class' => 'visual-console-button', ] ) ); } + $ui->contentAddHtml('
    '); + if (empty($visualmaps) === true) { - $ui->contentAddHtml('

    '.__('No maps defined').'

    '); + $ui->contentAddHtml('

    '.__('There are no favorite maps to show').'

    '); } else { $table = new Table(); // Without header jquery.mobile crashes. @@ -282,7 +284,9 @@ class Visualmaps $table->addRow([ $map['id'].' flex-center' => $row]); } + $ui->contentAddHtml('
    '); $ui->contentAddHtml($table->getHTML()); + $ui->contentAddHtml('
    '); $ui->contentAddLinkListener('list_visualmaps'); } } From 4e1c158879b3d2b1385addfc09f19f912832b285 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Fri, 21 Apr 2023 11:28:47 +0200 Subject: [PATCH 12/13] 9555-Tablet --- pandora_console/mobile/include/style/main.css | 296 ++++++++++++++++++ pandora_console/mobile/operation/agent.php | 6 +- pandora_console/mobile/operation/agents.php | 2 +- pandora_console/mobile/operation/alerts.php | 2 +- pandora_console/mobile/operation/events.php | 6 +- pandora_console/mobile/operation/home.php | 1 + .../mobile/operation/module_data.php | 2 +- pandora_console/mobile/operation/modules.php | 3 +- .../mobile/operation/server_status.php | 2 +- pandora_console/mobile/operation/services.php | 8 +- 10 files changed, 313 insertions(+), 15 deletions(-) diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index df323a742c..d25a70eafa 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -1311,6 +1311,7 @@ table.tactical_bars { /*END-----------Network maps styles---------------------------------------*/ +#error-dialog-button_close, #logout_dialog-button_close { display: flex; margin: 0 auto; @@ -1909,6 +1910,10 @@ table.tactical_bars tbody tr { height: 20px; } +table.tactical_bars * { + font-size: 16px; +} + .progress_main { height: 2.5em; border: 2px solid #82b92e; @@ -2023,6 +2028,9 @@ table#last-activity > tbody > tr > td.cell_1 { width: 70%; max-width: 75%; padding-bottom: 2px !important; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; } table#last-activity > tbody > tr > td.cell_2 { width: 20%; @@ -2465,6 +2473,7 @@ a.ui-textinput-clear-button.ui-button-icon-only.ui-button-right.ui-widget.ui-but box-shadow: unset; } +div#error-dialog a#error-dialog-button_close, div#logout_dialog a#logout_dialog-button_close, div#detail_event_dialog > div > div a#validate_button, div#detail_event_dialog > div > div a#process_button, @@ -2489,15 +2498,19 @@ div#detail_event_dialog > div > div a#process_button { height: 22px; } +div#error-dialog h1.dialog_title, div#logout_dialog h1.dialog_title { font-size: 11pt; } +div#error-dialog + div.ui-page-dialog-contain.ui-overlay-shadow.ui-corner-all.ui-body-a, div#logout_dialog div.ui-page-dialog-contain.ui-overlay-shadow.ui-corner-all.ui-body-a { padding: 10px; } +div#error-dialog a#error-dialog-button_close, div#logout_dialog a#logout_dialog-button_close { height: 30px; } @@ -2868,6 +2881,32 @@ table#list_visualmaps tr:last-child td { border-bottom-right-radius: 8px; border-bottom: 0px; } + +table[id^="service-table-"] { + margin-top: -8px; +} + +table[id^="service-table-"] tbody tr:nth-child(odd) { + background-color: var(--secondary-color) !important; +} + +div.list_services h4 > a { + background-color: var(--secondary-color) !important; +} + +div.agent-last-events ul li.ui-last-child { + border-top: 0px; + padding: 0px; +} + +table#list_servers tbody td .status_small_squares { + margin-top: 5px; +} +table#list_servers tbody td span.data a { + text-decoration: none !important; + color: unset !important; +} + /* =============================================================== */ /* ========================= For tablets ========================= */ /* =============================================================== */ @@ -2976,4 +3015,261 @@ table#list_visualmaps tr:last-child td { width: 10%; margin-right: 5px; } + + table#list_Modules > thead > tr { + display: flex; + } + table#list_Modules > thead > tr > th { + display: initial !important; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + text-align: center; + padding-left: 0px; + padding-right: 0px; + font-size: 10pt; + } + table#list_Modules > tbody > tr > td { + display: initial !important; + white-space: nowrap; + line-height: 48px; + height: 48px; + text-align: center; + } + table#list_Modules > tbody > tr > td * { + font-size: 10pt !important; + } + table#list_Modules > tbody > tr > td span.align-none-10p { + display: none; + } + table#list_Modules > tbody > tr > td .status_rounded_rectangles { + width: 30px; + } + table#list_Modules > tbody > tr { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + } + table#list_Modules > thead > tr > th[data-colstart="1"], + table#list_Modules > tbody > tr > td.cell_0 { + width: 30%; + text-align: left; + } + table#list_Modules > thead > tr > th[data-colstart="2"], + table#list_Modules > tbody > tr > td.cell_1 { + width: 30%; + } + table#list_Modules > thead > tr > th[data-colstart="3"], + table#list_Modules > tbody > tr > td.cell_2 { + width: 10%; + } + table#list_Modules > thead > tr > th[data-colstart="4"], + table#list_Modules > tbody > tr > td.cell_3 { + width: 10%; + } + table#list_Modules > thead > tr > th[data-colstart="5"], + table#list_Modules > tbody > tr > td.cell_4 { + width: 10%; + } + table#list_Modules > thead > tr > th[data-colstart="6"], + table#list_Modules > tbody > tr > td.cell_5 { + width: 10%; + } + + table#list_alerts > thead > tr { + display: flex; + } + table#list_alerts > thead > tr > th { + display: initial !important; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + text-align: center; + padding-left: 0px; + padding-right: 0px; + font-size: 10pt; + } + table#list_alerts > tbody > tr > td { + display: initial !important; + white-space: nowrap; + line-height: 48px; + height: 48px; + text-align: center; + } + table#list_alerts > tbody > tr > td * { + font-size: 10pt !important; + } + table#list_alerts > tbody > tr > td span.align-none-10p { + display: none; + } + table#list_alerts > tbody > tr > td .status_rounded_rectangles { + width: 30px; + margin-top: 10px; + } + table#list_alerts > tbody > tr { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + } + table#list_alerts > thead > tr > th[data-colstart="1"], + table#list_alerts > tbody > tr > td.cell_0 { + width: 10%; + text-align: left; + } + table#list_alerts > thead > tr > th[data-colstart="2"], + table#list_alerts > tbody > tr > td.cell_1 { + width: 60%; + } + table#list_alerts > thead > tr > th[data-colstart="3"], + table#list_alerts > tbody > tr > td.cell_2 { + width: 15%; + } + table#list_alerts > thead > tr > th[data-colstart="4"], + table#list_alerts > tbody > tr > td.cell_3 { + width: 15%; + } + table#list_alerts > tbody > tr > td.cell_1 > div { + flex-direction: row; + } + table#list_alerts > tbody > tr > td.cell_1 > div > span:first-child { + margin-right: 10px; + } + + table#list_agent_Modules > tbody > tr, + table#list_agent_Modules > thead > tr { + display: flex; + } + table#list_agent_Modules > thead > tr > th { + display: initial !important; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + text-align: center; + padding-left: 0px; + padding-right: 0px; + font-size: 10pt; + } + table#list_agent_Modules > tbody > tr > td { + display: initial !important; + white-space: nowrap; + line-height: 38px; + height: 48px; + text-align: center; + } + table#list_agent_Modules > tbody > tr > td * { + font-size: 10pt !important; + } + table#list_agent_Modules > tbody > tr > td span.align-none-10p { + display: none; + } + table#list_agent_Modules > tbody > tr > td .status_rounded_rectangles { + width: 30px; + margin-top: 12px; + } + table#list_agent_Modules > thead > tr > th[data-colstart="1"], + table#list_agent_Modules > tbody > tr > td.cell_0 { + width: 40%; + text-align: left; + } + table#list_agent_Modules > thead > tr > th[data-colstart="2"], + table#list_agent_Modules > tbody > tr > td.cell_1 { + width: 10%; + } + table#list_agent_Modules > thead > tr > th[data-colstart="3"], + table#list_agent_Modules > tbody > tr > td.cell_2 { + width: 15%; + } + table#list_agent_Modules > thead > tr > th[data-colstart="4"], + table#list_agent_Modules > tbody > tr > td.cell_3 { + width: 15%; + } + table#list_agent_Modules > thead > tr > th[data-colstart="5"], + table#list_agent_Modules > tbody > tr > td.cell_4 { + width: 20%; + } + table#list_agent_Modules > tbody > tr > td.cell_1 > div { + flex-direction: row; + } + + div#module-dialog-popup { + height: 225px; + } + div#module-dialog div[role="main"] { + display: flex; + flex-direction: column; + } + + table#list_module_data > thead > tr { + display: flex; + } + table#list_module_data > thead > tr > th { + display: initial !important; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + text-align: left; + padding-left: 0px; + padding-right: 0px; + font-size: 10pt; + } + table#list_module_data > tbody > tr > td { + display: initial !important; + white-space: nowrap; + } + table#list_module_data > tbody > tr > td * { + font-size: 10pt !important; + } + table#list_module_data > tbody > tr > td span.align-none-10p { + display: none; + } + table#list_module_data > tbody > tr > td .status_rounded_rectangles { + width: 30px; + } + table#list_module_data > tbody > tr { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + } + table#list_module_data > thead > tr > th[data-colstart="1"], + table#list_module_data > tbody > tr > td.cell_0 { + width: 50%; + } + table#list_module_data > thead > tr > th[data-colstart="2"], + table#list_module_data > tbody > tr > td.cell_1 { + width: 50%; + } + + table#list_servers tbody td .status_small_squares { + margin-top: 5px; + } + table#list_servers tbody td span.data a { + text-decoration: none !important; + color: unset !important; + } + + table[id^="service-table-"] { + border-collapse: collapse; + } + table[id^="service-table-"] tbody td { + padding: 0px; + /* border: 0px !important; */ + } + table[id^="service-table-"] tbody td:first-child { + padding-left: 10px; + border-left: 1px solid var(--border-color); + } + table[id^="service-table-"] tbody td:last-child { + border-right: 1px solid var(--border-color); + } + + table#list_visualmaps tbody td { + padding: 0px 10px; + } + table#list_visualmaps thead th { + display: none; + } + + input[name="login_btn"] { + line-height: 38px; + } } diff --git a/pandora_console/mobile/operation/agent.php b/pandora_console/mobile/operation/agent.php index f1ff032862..cb55b07259 100644 --- a/pandora_console/mobile/operation/agent.php +++ b/pandora_console/mobile/operation/agent.php @@ -165,7 +165,7 @@ class Agent $ui->beginContent(); if (empty($this->agent)) { $ui->contentAddHtml( - ''.__('No agent found').'' + ''.__('No agent found').'' ); } else { $ui->contentBeginGrid(); @@ -369,7 +369,7 @@ class Agent $ui->contentAddHtml(""); $ui->contentAddHtml(""); - $ui->contentBeginCollapsible(sprintf(__('Last %s Events'), $system->getPageSize())); + $ui->contentBeginCollapsible(sprintf(__('Last %s Events'), $system->getPageSize()), 'agent-last-events'); $tabledata = $events->listEventsHtml(0, true, 'last_agent_events'); $ui->contentCollapsibleAddItem($tabledata['table']); $ui->contentCollapsibleAddItem($events->putEventsTableJS($this->id)); @@ -441,7 +441,7 @@ class Agent $.mobile.loading('hide'); var className = $('#list_agent_Modules').attr('class'); if (document.getElementById('list_agent_Modules') == null) { - $($('p.empty_advice')[0]).parent().html(r); + $($('p.no-data')[0]).parent().html(r); className = 'ui-responsive table-stroke ui-table ui-table-reflow'; } else { $('#list_agent_Modules').parent().html(r); diff --git a/pandora_console/mobile/operation/agents.php b/pandora_console/mobile/operation/agents.php index f1c61ef322..0c773d040e 100644 --- a/pandora_console/mobile/operation/agents.php +++ b/pandora_console/mobile/operation/agents.php @@ -456,7 +456,7 @@ class Agents $listAgents = $this->getListAgents($page); if ($listAgents['total'] == 0) { - $ui->contentAddHtml('

    '.__('No agents').'

    '); + $ui->contentAddHtml('

    '.__('No agents').'

    '); } else { $table = new Table(); $table->id = 'list_agents'; diff --git a/pandora_console/mobile/operation/alerts.php b/pandora_console/mobile/operation/alerts.php index 53648ce5a5..47cdb8012f 100644 --- a/pandora_console/mobile/operation/alerts.php +++ b/pandora_console/mobile/operation/alerts.php @@ -360,7 +360,7 @@ class Alerts $ui = UI::getInstance(); if (empty($table)) { - $html = '

    '.__('No alerts').'

    '; + $html = '

    '.__('No alerts').'

    '; if (!$return) { $ui->contentAddHtml($html); } else { diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index 45522da678..07dfafe69b 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -1188,7 +1188,7 @@ class Events $table = new Table(); $table->id = $id_table; - $no_events = ''; + $no_events = ''; if (!$return) { $ui->contentAddHtml($table->getHTML()); @@ -1515,7 +1515,9 @@ class Events if (data.events.length == 0) { $('#last_agent_events').css('visibility', 'hidden'); $('#empty_advice_events').show(); - } + } else { + $('#empty_advice_events').hide(); + } }, \"json\"); } diff --git a/pandora_console/mobile/operation/home.php b/pandora_console/mobile/operation/home.php index d7e3700cc7..47a96d6433 100644 --- a/pandora_console/mobile/operation/home.php +++ b/pandora_console/mobile/operation/home.php @@ -195,6 +195,7 @@ class Home $this->loadButtons($ui); if (!empty($error)) { + $error['dialog_id'] = 'error-dialog'; $ui->addDialog($error); } diff --git a/pandora_console/mobile/operation/module_data.php b/pandora_console/mobile/operation/module_data.php index 6af43f7e23..5672f0233d 100644 --- a/pandora_console/mobile/operation/module_data.php +++ b/pandora_console/mobile/operation/module_data.php @@ -181,7 +181,7 @@ class ModuleData $listData = $this->getListData($page); if ($listData['total'] == 0) { - $html = '

    '.__('No data').'

    '; + $html = '

    '.__('No data').'

    '; if (!$return) { $ui->contentAddHtml($html); } else { diff --git a/pandora_console/mobile/operation/modules.php b/pandora_console/mobile/operation/modules.php index 259be06544..b6f4690065 100644 --- a/pandora_console/mobile/operation/modules.php +++ b/pandora_console/mobile/operation/modules.php @@ -801,7 +801,7 @@ class Modules $listModules = $this->getListModules($page); if ($listModules['total'] == 0) { - $html = '

    '.__('No modules').'

    '; + $html = '

    '.__('No modules').'

    '; if (!$return) { $ui->contentAddHtml($html); } else { @@ -925,7 +925,6 @@ class Modules } function openDialog(moduleId, agentId, serverId) { - console.log(1); var graph = ''; var historical = ''; if (serverId === 'node') { diff --git a/pandora_console/mobile/operation/server_status.php b/pandora_console/mobile/operation/server_status.php index d3bba4656b..ca9fb2708d 100644 --- a/pandora_console/mobile/operation/server_status.php +++ b/pandora_console/mobile/operation/server_status.php @@ -368,7 +368,7 @@ class ServerStatus $listServers = $this->getListServers($page); if ($listServers['total'] == 0) { - $html = '

    '.__('No servers').'

    '; + $html = '

    '.__('No servers').'

    '; if (!$return) { $ui->contentAddHtml($html); } else { diff --git a/pandora_console/mobile/operation/services.php b/pandora_console/mobile/operation/services.php index addd30d76b..8f7aee2c93 100644 --- a/pandora_console/mobile/operation/services.php +++ b/pandora_console/mobile/operation/services.php @@ -136,7 +136,7 @@ class Services if (empty($this->services)) { $ui->contentAddHtml( - ''.__('No services found').'' + ''.__('No services found').'' ); } @@ -228,7 +228,7 @@ class Services ); if ($item->exists() !== true) { - $name .= ''.__('Nonexistent. This element should be deleted').''; + $name .= ''.__('Nonexistent. This element should be deleted').''; } else { $url = ui_get_full_url( 'index.php?sec=eventos&sec2=operation/events/events&event_view_hr=8&severity=4&id_agent='.$item->agent()->id_agente() @@ -271,7 +271,7 @@ class Services ] ); if ($item->exists() !== true) { - $name .= ''.__('Nonexistent. This element should be deleted').''; + $name .= ''.__('Nonexistent. This element should be deleted').''; } else { if (is_metaconsole() && (((int) $item->id_server_meta()) !== 0 ) @@ -337,7 +337,7 @@ class Services ); if ($item->exists() !== true) { - $name .= ''.__('Nonexistent. This element should be deleted').''; + $name .= ''.__('Nonexistent. This element should be deleted').''; } else { $url = ui_get_full_url( 'index.php?sec=eventos&sec2=operation/events/events&event_view_hr=8&severity=4&id_agent='.$item->module()->id_agente().'&id_agent_module='.$item->id_agente_modulo() From d8f4a7a078efb7f3e13c2a82267394684596b63d Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 24 Apr 2023 08:27:14 +0200 Subject: [PATCH 13/13] 9555-First load, more than 10 elements & Services redirecs agent --- pandora_console/mobile/operation/events.php | 39 ++++++++++++++----- pandora_console/mobile/operation/modules.php | 36 +++++++++++++---- .../mobile/operation/server_status.php | 19 +++++++++ pandora_console/mobile/operation/services.php | 10 ++--- 4 files changed, 79 insertions(+), 25 deletions(-) diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index 07dfafe69b..82180a40f4 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -1522,21 +1522,40 @@ class Events \"json\"); } + let intervalId; + let count = 0; + function getFreeSpace() { + let headerHeight = $('div[data-role=\"header\"].ui-header').outerHeight(); + let contentHeight = $('div[data-role=\"content\"].ui-content').outerHeight(); + let windowHeight = $(window).height(); + + let freeSpace = windowHeight - (headerHeight + contentHeight); + + if (freeSpace > 0 && count < 50) { + custom_scroll(); + } else { + clearInterval(intervalId); + } + + count++; + } + $(document).ready(function() { - ajax_load_rows(); - $(window).bind(\"scroll\", function () { - custom_scroll(); - }); - $(window).on(\"touchmove\", function(event) { - custom_scroll(); - }); + intervalId = setInterval(getFreeSpace, 500); + ajax_load_rows(); + $(window).bind(\"scroll\", function () { + custom_scroll(); + }); + $(window).on(\"touchmove\", function(event) { + custom_scroll(); + }); }); function custom_scroll() { if ($(this).scrollTop() + $(this).height() - >= ($(document).height() - 100)) { - ajax_load_rows(); - } + >= ($(document).height() - 100)) { + ajax_load_rows(); + } } " ); diff --git a/pandora_console/mobile/operation/modules.php b/pandora_console/mobile/operation/modules.php index b6f4690065..9fa379426e 100644 --- a/pandora_console/mobile/operation/modules.php +++ b/pandora_console/mobile/operation/modules.php @@ -592,16 +592,16 @@ class Modules } $script = ''; - if ($system->getRequest('page') === 'modules') { - if ($system->getConfig('metaconsole')) { - $script = 'onclick="openDialog('.$module['id_agente_modulo'].', '.$this->id_agent.' ,'.$module['server_id'].');"'; - } else { - $script = 'onclick="openDialog('.$module['id_agente_modulo'].', '.$this->id_agent.', \'node\');"'; - } + if ($system->getConfig('metaconsole')) { + $script = 'onclick="openDialog('.$module['id_agente_modulo'].', '.$this->id_agent.' ,'.$module['server_id'].');"'; + } else { + $script = 'onclick="openDialog('.$module['id_agente_modulo'].', '.$this->id_agent.', \'node\');"'; + } + if ($system->getRequest('page') === 'modules') { $row[0] = $row[__('Module name')] = ''.$image_status.''.''.ui_print_truncate_text($module['module_name'], 30, false).''; } else { - $row[0] = $row[__('Module name')] = ''.$image_status.''.''.ui_print_truncate_text($module['module_name'], 30, false).''; + $row[0] = $row[__('Module name')] = ''.$image_status.''.''.ui_print_truncate_text($module['module_name'], 30, false).''; } if ($this->columns['agent']) { @@ -940,8 +940,28 @@ class Modules $('#module-dialog-button').click(); } - + + let intervalId; + let count = 0; + function getFreeSpace() { + let headerHeight = $('div[data-role=\"header\"].ui-header').outerHeight(); + let contentHeight = $('div[data-role=\"content\"].ui-content').outerHeight(); + let windowHeight = $(window).height(); + + let freeSpace = windowHeight - (headerHeight + contentHeight); + + if (freeSpace > 0 && count < 50) { + custom_scroll(); + } else { + clearInterval(intervalId); + } + + count++; + } + $(document).ready(function() { + intervalId = setInterval(getFreeSpace, 500); + $(window).bind(\"scroll\", function () { custom_scroll(); }); diff --git a/pandora_console/mobile/operation/server_status.php b/pandora_console/mobile/operation/server_status.php index ca9fb2708d..eb21825f72 100644 --- a/pandora_console/mobile/operation/server_status.php +++ b/pandora_console/mobile/operation/server_status.php @@ -456,8 +456,27 @@ class ServerStatus } } } + + let intervalId; + let count = 0; + function getFreeSpace() { + let headerHeight = $('div[data-role=\"header\"].ui-header').outerHeight(); + let contentHeight = $('div[data-role=\"content\"].ui-content').outerHeight(); + let windowHeight = $(window).height(); + + let freeSpace = windowHeight - (headerHeight + contentHeight); + + if (freeSpace > 0 && count < 50) { + custom_scroll(); + } else { + clearInterval(intervalId); + } + + count++; + } $(document).ready(function() { + intervalId = setInterval(getFreeSpace, 500); $(window).bind(\"scroll\", function () { custom_scroll(); diff --git a/pandora_console/mobile/operation/services.php b/pandora_console/mobile/operation/services.php index 8f7aee2c93..fd1fba0dce 100644 --- a/pandora_console/mobile/operation/services.php +++ b/pandora_console/mobile/operation/services.php @@ -178,7 +178,7 @@ class Services ); $ui->contentAddHtml('
    '); $arrow = ''; - $ui->contentAddHtml('

    '.$arrow.$group_icon.' '.$service['description'].'

    '); + $ui->contentAddHtml('

    '.$arrow.$group_icon.' '.$service['name'].'

    '); $spinner = '
    @@ -230,9 +230,7 @@ class Services if ($item->exists() !== true) { $name .= ''.__('Nonexistent. This element should be deleted').''; } else { - $url = ui_get_full_url( - 'index.php?sec=eventos&sec2=operation/events/events&event_view_hr=8&severity=4&id_agent='.$item->agent()->id_agente() - ); + $url = ui_get_full_url('mobile/index.php?page=agent&id='.$item->agent()->id_agente()); $name = ''; if (((bool) $item->agent()->disabled()) === true) { $disabled_element = true; @@ -339,9 +337,7 @@ class Services if ($item->exists() !== true) { $name .= ''.__('Nonexistent. This element should be deleted').''; } else { - $url = ui_get_full_url( - 'index.php?sec=eventos&sec2=operation/events/events&event_view_hr=8&severity=4&id_agent='.$item->module()->id_agente().'&id_agent_module='.$item->id_agente_modulo() - ); + $url = ui_get_full_url('mobile/index.php?page=agent&id='.$item->agent()->id_agente()); $name = ''; if (((bool) $item->module()->disabled()) === true) {