diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index 5bf3d18ab5..e540a163a1 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -259,6 +259,15 @@ function agents_modules_load_js() return results[1]; } } + + function select_selected () { + $('#id_agents2 option').each(function(){ + if($(this).attr('selected') === 'selected'){ + $(this).prop('selected', true); + } + }); + + } $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" class="w100p">'; + $show_filters = '
'; $show_filters .= ''; $show_filters .= ''; $show_filters .= ''; @@ -666,8 +675,9 @@ function mainAgentsModules() 'srcbutton', false, [ - 'icon' => 'search', - 'mode' => 'mini', + 'icon' => 'search', + 'mode' => 'mini', + 'onclick' => 'select_selected()', ], true ), @@ -729,7 +739,7 @@ function mainAgentsModules() if (isset($modules_selected[0]) === true && $modules_selected[0]) { $all_modules = []; foreach ($modules_selected as $key => $value) { - if (is_int($value)) { + if ((int) $value > 0) { $name = modules_get_agentmodule_name($value); $sql = "SELECT id_agente_modulo FROM tagente_modulo diff --git a/pandora_console/godmode/agentes/inventory_manager.php b/pandora_console/godmode/agentes/inventory_manager.php index 59a7a869a5..4b6a53df47 100644 --- a/pandora_console/godmode/agentes/inventory_manager.php +++ b/pandora_console/godmode/agentes/inventory_manager.php @@ -267,7 +267,7 @@ if (db_get_num_rows($sql) == 0) { $data[5] .= '  '; // Force refresh module $data[5] .= ''; - $data[5] .= html_print_image('images/change-active.svg', true, ['border' => '0', 'title' => __('Force'), 'class' => 'main_menu_icon invert_filter']).''; + $data[5] .= html_print_image('images/force@svg.svg', true, ['border' => '0', 'title' => __('Force'), 'class' => 'main_menu_icon invert_filter']).''; array_push($table->data, $data); } diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 27f81b1f43..0a45a18342 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -776,7 +776,7 @@ if ($agents !== false) { } if ((bool) $agent['disabled'] === true) { - $additionalDataAgentName[] = ui_print_help_tip(__('Disabled')); + $additionalDataAgentName[] = ui_print_help_tip(__('Disabled'), true); } if ((bool) $agent['quiet'] === true) { @@ -903,12 +903,12 @@ if ($agents !== false) { if ((bool) $agent['disabled'] === true) { $agentDisableEnableTitle = __('Enable agent'); - $agentDisableEnableAction = 'enable_agent'; + $agentDisableEnableAction = 'enable'; $agentDisableEnableCaption = __('You are going to enable a cluster agent. Are you sure?'); $agentDisableEnableIcon = 'change-active.svg'; } else { $agentDisableEnableTitle = __('Disable agent'); - $agentDisableEnableAction = 'disable_agent'; + $agentDisableEnableAction = 'disable'; $agentDisableEnableCaption = __('You are going to disable a cluster agent. Are you sure?'); $agentDisableEnableIcon = 'change-pause.svg'; } @@ -1001,7 +1001,7 @@ if ($agents !== false) { true, 'offset', false, - 'dataTables_paginate paging_simple_numbers' + 'paging_simple_numbers' ); /* diff --git a/pandora_console/godmode/agentes/status_monitor_custom_fields.php b/pandora_console/godmode/agentes/status_monitor_custom_fields.php index a960c32bf2..2dfb79185d 100644 --- a/pandora_console/godmode/agentes/status_monitor_custom_fields.php +++ b/pandora_console/godmode/agentes/status_monitor_custom_fields.php @@ -30,6 +30,26 @@ if (! check_acl($config['id_user'], 0, 'AR') $update = get_parameter('upd_button', ''); $default = (int) get_parameter('default', 0); +// Header. +ui_print_standard_header( + __('Monitor detail').$subpage, + 'images/agent.png', + false, + '', + true, + $buttons, + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Views'), + ], + ], + (empty($fav_menu) === true) ? [] : $fav_menu +); if ($default != 0) { $fields_selected = explode(',', $config['status_monitor_fields']); @@ -161,11 +181,11 @@ foreach ($fields_available as $key => $available) { // General title. $generalTitleContent = []; -$generalTitleContent[] = html_print_div([ 'style' => 'width: 10px; flex: 0 0 auto; margin-right: 5px;}', 'class' => 'section_table_title_line' ], true); +// $generalTitleContent[] = html_print_div([ 'style' => 'width: 10px; flex: 0 0 auto; margin-right: 5px;}', 'class' => 'section_table_title_line' ], true); $generalTitleContent[] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Show monitor detail fields')], true); $titledata[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $generalTitleContent) ], true); $table->data['general_title'] = $titledata; -$table->data[0][0] = ''.__('Fields available').''; +$table->data[0][0] = ''.__('Fields available').''; $table->data[1][0] = html_print_select($fields_available, 'fields_available[]', true, '', '', 0, true, true, false, '', false, 'width: 300px'); $table->data[1][1] = ''.html_print_image( 'images/darrowright.png', @@ -187,7 +207,7 @@ $table->data[1][1] .= '



'.html_print_image( ).''; $table->data[0][1] = ''; -$table->data[0][2] = ''.__('Fields selected').''; +$table->data[0][2] = ''.__('Fields selected').''; $table->data[1][2] = html_print_select( $result_selected, 'fields_selected[]', @@ -203,7 +223,7 @@ $table->data[1][2] = html_print_select( 'width: 300px' ); -echo ''; +echo ''; html_print_table($table); html_print_action_buttons( diff --git a/pandora_console/godmode/consoles/consoles.php b/pandora_console/godmode/consoles/consoles.php index 02bbe981aa..0158dfe14c 100644 --- a/pandora_console/godmode/consoles/consoles.php +++ b/pandora_console/godmode/consoles/consoles.php @@ -54,12 +54,6 @@ $results = db_get_all_rows_in_table('tconsole'); $message = ''; -if ($results === false) { - $message = ui_print_info_message( - __('If you want to have your consoles registered, you must define them by editing config.php in each individual console and wait for cron to run in order to be registered.') - ); -} - View::render( 'consoles/list', [ @@ -67,3 +61,9 @@ View::render( 'message' => $message, ] ); + +if ($results === false) { + $message = ui_print_info_message( + __('If you want to have your consoles registered, you must define them by editing config.php in each individual console and wait for cron to run in order to be registered.') + ); +} diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index a010e5d26a..57569ac956 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -208,7 +208,7 @@ foreach ($servers as $server) { if ($server['type'] === 'data') { $data[8] .= ''; $data[8] .= html_print_image( - 'images/change-active.svg', + 'images/force@svg.svg', true, [ 'title' => __('Reset module status and fired alert counts'), @@ -219,7 +219,7 @@ foreach ($servers as $server) { } else if ($server['type'] === 'enterprise snmp') { $data[8] .= ''; $data[8] .= html_print_image( - 'images/change-active.svg', + 'images/force@svg.svg', true, [ 'title' => __('Claim back SNMP modules'), diff --git a/pandora_console/godmode/users/user_management.php b/pandora_console/godmode/users/user_management.php index 43e41745de..9e648a7a03 100644 --- a/pandora_console/godmode/users/user_management.php +++ b/pandora_console/godmode/users/user_management.php @@ -764,10 +764,9 @@ html_print_table($userManagementTable); $vcard_data = []; $vcard_data['version'] = '3.0'; -$vcard_data['firstName'] = $user_info['firstname']; -$vcard_data['lastName'] = $user_info['lastname']; -$vcard_data['middleName'] = ($user_info['middlename'] === '1') ? '' : $user_info['middlename']; -$vcard_data['nickname'] = $user_info['fullname']; +$vcard_data['firstName'] = $user_info['fullname']; +$vcard_data['lastName'] = ''; +$vcard_data['middleName'] = ''; $vcard_data['workPhone'] = $user_info['phone']; $vcard_data['email'] = $user_info['email']; $vcard_data['organization'] = io_safe_output(get_product_name()); diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 120eeda293..12e557de87 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -673,7 +673,7 @@ class DiscoveryTaskList extends HTML $data[0] .= ');" >'; $data[0] .= html_print_image( - 'images/change-active.svg', + 'images/force@svg.svg', true, [ 'title' => __('Force'), diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index 2f7c5cd692..a2836b0d72 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -810,10 +810,7 @@ class HostDevices extends Wizard 'name' => 'interval_manual_defined', 'return' => true, ], - 'extra' => '
'.ui_print_help_tip( - __('The minimum recomended interval for Recon Task is 5 minutes'), - true - ).html_print_extended_select_for_time( + 'extra' => '
'.html_print_extended_select_for_time( 'interval', $this->task['interval_sweep'], '', diff --git a/pandora_console/include/ajax/audit_log.php b/pandora_console/include/ajax/audit_log.php index 4d92704852..dbb842047c 100644 --- a/pandora_console/include/ajax/audit_log.php +++ b/pandora_console/include/ajax/audit_log.php @@ -160,7 +160,7 @@ if ($load_filter_modal) { true, '', false, - 'margin-left:5px; width:'.$filter_id_width.';' + 'width:'.$filter_id_width.';' ); $table->rowclass[] = 'display-grid'; @@ -169,8 +169,9 @@ if ($load_filter_modal) { 'load_filter', false, [ - 'class' => 'mini w25p', - 'style' => 'margin-left: 73%', + 'class' => 'mini w30p', + 'icon' => 'load', + 'style' => 'margin-left: 208px; width: 130px;', 'onclick' => 'load_filter_values();', ], true @@ -189,7 +190,7 @@ function show_filter() { draggable: true, modal: false, closeOnEscape: true, - width: 500 + width: 380 }); } @@ -293,8 +294,9 @@ if ($save_filter_modal) { 'save_filter', false, [ - 'class' => 'mini w25p', - 'style' => 'margin-left: 56%', + 'class' => 'mini ', + 'icon' => 'save', + 'style' => 'margin-left: 175px; width: 125px;', 'onclick' => 'save_new_filter();', ], true @@ -330,8 +332,9 @@ if ($save_filter_modal) { 'update_filter', false, [ - 'class' => 'mini w25p', - 'style' => 'margin-left: 56%', + 'class' => 'mini ', + 'icon' => 'save', + 'style' => 'margin-left: 155px; width: 145px;', 'onclick' => 'save_update_filter();', ], true diff --git a/pandora_console/include/ajax/heatmap.ajax.php b/pandora_console/include/ajax/heatmap.ajax.php index dd22fcdfef..37806fb4a4 100644 --- a/pandora_console/include/ajax/heatmap.ajax.php +++ b/pandora_console/include/ajax/heatmap.ajax.php @@ -45,73 +45,101 @@ if (is_ajax() === true) { $group = get_parameter('group', true); echo ''; - echo '
'; - echo '

'.__('Refresh').'

'; - echo html_print_select( + echo html_print_label_input_block( + __('Refresh'), + html_print_select( + [ + '30' => __('30 seconds'), + (string) SECONDS_1MINUTE => __('1 minute'), + '180' => __('3 minutes'), + (string) SECONDS_5MINUTES => __('5 minutes'), + ], + 'refresh', + $refresh, + '', + '', + 0, + true, + false, + false, + '', + false, + 'width: 100%; margin-top: 10px;' + ), [ - '30' => __('30 seconds'), - (string) SECONDS_1MINUTE => __('1 minute'), - '180' => __('3 minutes'), - (string) SECONDS_5MINUTES => __('5 minutes'), - ], - 'refresh', - $refresh, - '', - '', - 0, - true, - false, - false, - '', - false, - 'margin-top: 3px;' + 'label_class' => 'font-title-font', + 'div_class' => 'mrgn_top_10px', + ] ); - echo '
'; - echo '
'; - echo '

'.__('Search').'

'; - echo html_print_input_text('search', $search, '', 30, 255, true); - echo '
'; - - echo '
'; - echo '

'.__('Type').'

'; - echo html_print_select( + echo html_print_label_input_block( + __('Search'), + html_print_input_text( + 'search', + $search, + '', + 30, + 255, + true, + false, + false, + '', + 'w100p' + ), [ - 0 => __('Group agents'), - 1 => __('Group modules by tag'), - 2 => __('Group modules by module group'), - 3 => __('Group modules by agents'), - ], - 'type', - $type, - '', - '', - 0, - true, - false, - false, - '', - false, - 'margin-top: 3px;width:70%' + 'label_class' => 'font-title-font', + 'div_class' => 'mrgn_top_10px', + ] ); - echo '
'; - echo '
'; - echo '

'.__('Show groups').'

'; - echo html_print_checkbox('group', 1, $group, true); - echo '
'; + echo html_print_label_input_block( + __('Type'), + html_print_select( + [ + 0 => __('Group agents'), + 1 => __('Group modules by tag'), + 2 => __('Group modules by module group'), + 3 => __('Group modules by agents'), + ], + 'type', + $type, + '', + '', + 0, + true, + false, + false, + '', + false, + 'width: 100%; margin-top: 10px;' + ), + [ + 'label_class' => 'font-title-font', + 'div_class' => 'mrgn_top_10px', + ] + ); + + echo html_print_label_input_block( + __('Show groups'), + '
'.html_print_checkbox('group', 1, $group, true).'
', + [ + 'label_class' => 'font-title-font', + 'div_class' => 'mrgn_top_10px', + ] + ); echo ''; } if ($getFilterType === true) { $filter = get_parameter('filter', 0); - echo '
'; + $label = ' '; + switch ($type) { case 0: default: - echo '

'.__('Group').'

'; - echo html_print_input( + $label = __('Group'); + $input = html_print_input( [ 'type' => 'select_groups', 'returnAllGroup' => true, @@ -126,9 +154,9 @@ if (is_ajax() === true) { break; case 1: - echo '

'.__('Tag').'

'; + $label = __('Tag'); if (tags_has_user_acl_tags($config['id_user']) === false) { - echo html_print_select_from_sql( + $input = html_print_select_from_sql( 'SELECT id_tag, name FROM ttag WHERE id_tag @@ -142,7 +170,7 @@ if (is_ajax() === true) { true, false, false, - 'width: 200px', + 'width: 100%', '5' ); } else { @@ -150,7 +178,7 @@ if (is_ajax() === true) { if (!empty($user_tags)) { $id_user_tags = array_keys($user_tags); - echo html_print_select_from_sql( + $input = html_print_select_from_sql( 'SELECT id_tag, name FROM ttag WHERE id_tag IN ('.implode(',', $id_user_tags).') @@ -164,11 +192,11 @@ if (is_ajax() === true) { true, false, false, - 'width: 200px', + 'width: 100%', '5' ); } else { - echo html_print_select_from_sql( + $input = html_print_select_from_sql( 'SELECT id_tag, name FROM ttag WHERE id_tag @@ -182,7 +210,7 @@ if (is_ajax() === true) { true, false, false, - 'width: 200px', + 'width: 100%', '5' ); } @@ -190,8 +218,8 @@ if (is_ajax() === true) { break; case 2: - echo '

'.__('Module group').'

'; - echo html_print_select_from_sql( + $label = __('Module group'); + $input = html_print_select_from_sql( 'SELECT id_mg, name FROM tmodule_group ORDER BY name', 'filter[]', $filter, @@ -202,7 +230,7 @@ if (is_ajax() === true) { true, true, false, - 'width: 200px', + 'width: 100%', '5' ); break; @@ -212,7 +240,14 @@ if (is_ajax() === true) { break; } - echo '
'; + echo html_print_label_input_block( + $label, + $input, + [ + 'label_class' => 'font-title-font', + 'div_class' => 'mrgn_top_10px', + ] + ); } if ($getInfo === true) { diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 296971bfc5..450faa0e9a 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -1279,7 +1279,7 @@ if (check_login()) { if ((int) $module['flag'] === 0) { $additionalLinkAction = '&flag=1'; $linkCaption = __('Force checks'); - $imgaction = 'images/target.png'; + $imgaction = 'images/force@svg.svg'; } else { $additionalLinkAction = ''; $linkCaption = __('Refresh'); diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index 2580d17371..00b9de46f0 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -4132,10 +4132,10 @@ class AgentWizard extends HTML $table->width = '100%'; $table->class = 'info_table'; // Subheaders for Warning and Critical columns. - $subheaders = 'Min.'; - $subheaders .= 'Max.'; - $subheaders .= 'Inv.'; - $subheaders .= '%.'; + $subheaders = 'Min.'; + $subheaders .= 'Max.'; + $subheaders .= 'Inv.'; + $subheaders .= '%.'; // Warning header. $warning_header = html_print_div( @@ -4352,8 +4352,7 @@ class AgentWizard extends HTML ); $data_warning .= html_print_div( [ - 'class' => 'wizard-column-levels-check', - 'style' => 'margin-top: 0.3em;', + 'class' => 'wizard-column-levels-check mrgn_top_10px', 'content' => html_print_checkbox( 'module-warning-inv-'.$uniqueId, $module['inv_warning'], @@ -4369,8 +4368,7 @@ class AgentWizard extends HTML ); $data_warning .= html_print_div( [ - 'class' => 'wizard-column-levels-check', - 'style' => 'margin-top: 0.3em;', + 'class' => 'wizard-column-levels-check mrgn_top_10px', 'content' => html_print_checkbox( 'module-warning-perc-'.$uniqueId, $module['perc_warning'], @@ -4436,8 +4434,7 @@ class AgentWizard extends HTML $data[4] .= html_print_div( [ - 'class' => 'wizard-column-levels-check', - 'style' => 'margin-top: 0.3em;', + 'class' => 'wizard-column-levels-check mrgn_top_10px', 'content' => html_print_checkbox( 'module-critical-inv-'.$uniqueId, $module['inv_critical'], @@ -4454,8 +4451,7 @@ class AgentWizard extends HTML $data[4] .= html_print_div( [ - 'class' => 'wizard-column-levels-check', - 'style' => 'margin-top: 0.3em;', + 'class' => 'wizard-column-levels-check mrgn_top_10px', 'content' => html_print_checkbox( 'module-critical-perc-'.$uniqueId, $module['perc_critical'], @@ -4490,7 +4486,7 @@ class AgentWizard extends HTML '', true, '', - 'pdd_0px' + 'pdd_0px mrgn_top-8px' ); } else { // WIP. Current value of this module. diff --git a/pandora_console/include/class/AgentsAlerts.class.php b/pandora_console/include/class/AgentsAlerts.class.php index 379b595d5a..1e3dc705b8 100644 --- a/pandora_console/include/class/AgentsAlerts.class.php +++ b/pandora_console/include/class/AgentsAlerts.class.php @@ -771,7 +771,7 @@ class AgentsAlerts extends HTML $headerInputs = []; $headerInputs[] = [ - 'label' => __('Group'), + 'label' => ''.__('Group').'', 'id' => 'select-group-id', 'arguments' => [ 'name' => 'group-id', @@ -788,8 +788,9 @@ class AgentsAlerts extends HTML ]; $headerInputs[] = [ - 'label' => __('Show modules without alerts'), + 'label' => ''.__('Show modules without alerts').'', 'id' => 'txt-use-agent-ip', + 'class' => 'display-grid mrgn_lft_15px mrgn_btn_5px', 'arguments' => [ 'name' => 'show-modules-without-alerts', 'checked' => $this->showWithoutAlertModules, diff --git a/pandora_console/include/class/CustomNetScan.class.php b/pandora_console/include/class/CustomNetScan.class.php index e0fd3708ac..2fec9d8b9a 100644 --- a/pandora_console/include/class/CustomNetScan.class.php +++ b/pandora_console/include/class/CustomNetScan.class.php @@ -524,7 +524,7 @@ class CustomNetScan extends Wizard // Schedule. $form['inputs'][] = [ 'label' => __('Interval').ui_print_help_tip( - __('Manual interval means that it will be executed only On-demand'), + __('Manual interval means that it will be executed only On-demand').', '.__('The minimum recomended interval for Recon Task is 5 minutes'), true ), 'class' => 'input-interval', @@ -549,9 +549,6 @@ class CustomNetScan extends Wizard true, false, false - ).ui_print_help_tip( - __('The minimum recomended interval for Recon Task is 5 minutes'), - true ).'', ]; diff --git a/pandora_console/include/functions_cron.php b/pandora_console/include/functions_cron.php index 3467ff9184..5e47040449 100644 --- a/pandora_console/include/functions_cron.php +++ b/pandora_console/include/functions_cron.php @@ -530,7 +530,7 @@ function cron_list_table() $task['id'] ), 'content' => html_print_image( - 'images/change-active.svg', + 'images/force@svg.svg', true, [ 'title' => __('Force run'), @@ -568,7 +568,7 @@ function cron_list_table() $task['id'] ), 'content' => html_print_image( - 'images/change-active.svg', + 'images/force@svg.svg', true, [ 'title' => __('Force run'), @@ -623,7 +623,7 @@ function cron_list_table() $task['id'] ), 'content' => html_print_image( - 'images/change-active.svg', + 'images/force@svg.svg', true, [ 'title' => __('Force run'), @@ -715,7 +715,7 @@ function cron_list_table() $task['id'] ), 'content' => html_print_image( - 'images/change-active.svg', + 'images/force@svg.svg', true, [ 'title' => __('Force run'), @@ -751,7 +751,7 @@ function cron_list_table() $task['id'] ), 'content' => html_print_image( - 'images/change-active.svg', + 'images/force@svg.svg', true, [ 'title' => __('Force run'), @@ -797,7 +797,7 @@ function cron_list_table() $task['id'] ), 'content' => html_print_image( - 'images/change-active.svg', + 'images/force@svg.svg', true, [ 'title' => __('Force run'), @@ -839,7 +839,7 @@ function cron_list_table() $task['id'] ), 'content' => html_print_image( - 'images/change-active.svg', + 'images/force@svg.svg', true, [ 'title' => __('Force run'), @@ -873,7 +873,7 @@ function cron_list_table() $task['id'] ), 'content' => html_print_image( - 'images/change-active.svg', + 'images/force@svg.svg', true, [ 'title' => __('Force run'), diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 8afc257399..9616634adb 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -4560,7 +4560,7 @@ function events_page_details($event, $server_id=0) true, [ 'title' => __('Go to data overview'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); } else { @@ -4569,7 +4569,7 @@ function events_page_details($event, $server_id=0) true, [ 'title' => __('Go to data overview'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', 'style' => 'opacity: .5', ] ); diff --git a/pandora_console/include/functions_inventory.php b/pandora_console/include/functions_inventory.php index f15f888bf6..dc0c23a31c 100644 --- a/pandora_console/include/functions_inventory.php +++ b/pandora_console/include/functions_inventory.php @@ -814,6 +814,10 @@ function get_data_basic_info_sql($params, $count=false) $where .= sprintf(' AND id_agente = %d', $params['id_agent']); } + if ($params['id_group'] > 0) { + $where .= sprintf(' AND id_grupo = %d', $params['id_group']); + } + if ($params['search'] > 0) { $where .= sprintf( ' AND ( alias LIKE "%%%s%%" )', diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 3bf0799599..7a04cbf30a 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -57,7 +57,7 @@ function menu_print_menu(&$menu) $sec = (string) get_parameter('sec'); $sec2 = (string) get_parameter('sec2'); if ($sec2 === 'operation/agentes/ver_agente') { - $sec2 = 'godmode/agentes/configurar_agente'; + $sec2 = 'operation/agentes/estado_agente'; } else if ($sec2 === 'godmode/alerts/configure_alert_template') { $sec2 = 'godmode/alerts/alert_templates'; } else if ($sec2 === 'godmode/events/events') { diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index 0e51faa66c..1d7fffd922 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -97,7 +97,7 @@ function snmp_browser_get_html_tree( // Id used to expand leafs. $sub_id = time().rand(0, getrandmax()); // Display the branch. - $output .= '
  • '; + $output .= '
  • '; // Indent sub branches. for ($i = 1; $i <= $depth; $i++) { diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 3c05eb613a..42ad5f4e36 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3628,6 +3628,11 @@ function ui_print_datatable(array $parameters) $parameters['csv'] = 1; } + $dom_elements = '"plfrtiB"'; + if (isset($parameters['dom_elements'])) { + $dom_elements = '"'.$parameters['dom_elements'].'"'; + } + $filter = ''; // Datatable filter. if (isset($parameters['form']) && is_array($parameters['form'])) { @@ -3790,6 +3795,34 @@ function ui_print_datatable(array $parameters) } $table .= '
  • '; + + if (isset($parameters['data_element']) === true) { + $table .= ''; + foreach ($parameters['data_element'] as $row) { + $table .= ''; + foreach ($row as $td_data) { + $table .= ''; + } + + $table .= ''; + } + + $table .= ''; + + $js = ''; + } + $table .= '
    '.$filter_type.'
    '.$td_data.'
    '; $pagination_class = 'pandora_pagination'; @@ -3813,279 +3846,276 @@ function ui_print_datatable(array $parameters) $export_columns = ',columns: \'th:not(:last-child)\''; } - if (isset($parameters['ajax_url'])) { - $type_data = 'ajax: { - url: "'.ui_get_full_url('ajax.php', false, false, false).'", - type: "POST", - dataSrc: function (json) { - if($("#'.$form_id.'_search_bt") != undefined) { - $("#'.$form_id.'_loading").remove(); - } + if (isset($parameters['data_element']) === false) { + if (isset($parameters['ajax_url'])) { + $type_data = 'ajax: { + url: "'.ui_get_full_url('ajax.php', false, false, false).'", + type: "POST", + dataSrc: function (json) { + if($("#'.$form_id.'_search_bt") != undefined) { + $("#'.$form_id.'_loading").remove(); + } - if (json.error) { - console.error(json.error); - $("#error-'.$table_id.'").html(json.error); - $("#error-'.$table_id.'").dialog({ - title: "Filter failed", - width: 630, - resizable: true, - draggable: true, - modal: false, - closeOnEscape: true, - buttons: { - "Ok" : function () { - $(this).dialog("close"); + if (json.error) { + console.error(json.error); + $("#error-'.$table_id.'").html(json.error); + $("#error-'.$table_id.'").dialog({ + title: "Filter failed", + width: 630, + resizable: true, + draggable: true, + modal: false, + closeOnEscape: true, + buttons: { + "Ok" : function () { + $(this).dialog("close"); + } } - } - }).parent().addClass("ui-state-error"); - } else {'; + }).parent().addClass("ui-state-error"); + } else {'; - if (isset($parameters['ajax_return_operation']) === true - && empty($parameters['ajax_return_operation']) === false - && isset($parameters['ajax_return_operation_function']) === true - && empty($parameters['ajax_return_operation_function']) === false - ) { - $type_data .= ' - if (json.'.$parameters['ajax_return_operation'].' !== undefined) { - '.$parameters['ajax_return_operation_function'].'(json.'.$parameters['ajax_return_operation'].'); - } - '; - } + if (isset($parameters['ajax_return_operation']) === true + && empty($parameters['ajax_return_operation']) === false + && isset($parameters['ajax_return_operation_function']) === true + && empty($parameters['ajax_return_operation_function']) === false + ) { + $type_data .= ' + if (json.'.$parameters['ajax_return_operation'].' !== undefined) { + '.$parameters['ajax_return_operation_function'].'(json.'.$parameters['ajax_return_operation'].'); + } + '; + } + + if (isset($parameters['ajax_postprocess'])) { + $type_data .= ' + if (json.data) { + json.data.forEach(function(item) { + '.$parameters['ajax_postprocess'].' + }); + } else { + json.data = {}; + }'; + } - if (isset($parameters['ajax_postprocess'])) { $type_data .= ' - if (json.data) { - json.data.forEach(function(item) { - '.$parameters['ajax_postprocess'].' + return json.data; + } + }, + data: function (data) { + if($("#button-'.$form_id.'_search_bt") != undefined) { + var loading = \''.html_print_image( + 'images/spinner.gif', + true, + [ + 'id' => $form_id.'_loading', + 'class' => 'loading-search-datatables-button', + ] + ).'\'; + $("#button-'.$form_id.'_search_bt").parent().append(loading); + } + + inputs = $("#'.$form_id.' :input"); + + values = {}; + inputs.each(function() { + values[this.name] = $(this).val(); + }) + + $.extend(data, { + filter: values,'."\n"; + + if (is_array($parameters['ajax_data'])) { + foreach ($parameters['ajax_data'] as $k => $v) { + $type_data .= $k.':'.json_encode($v).",\n"; + } + } + + $type_data .= 'page: "'.$parameters['ajax_url'].'" }); - } else { - json.data = {}; - }'; + + return data; + } + },'; + } else { + $type_data = 'data: '.json_encode($parameters['data_element']).','; } - $type_data .= ' - return json.data; - } - }, - data: function (data) { - if($("#button-'.$form_id.'_search_bt") != undefined) { - var loading = \''.html_print_image( - 'images/spinner.gif', - true, - [ - 'id' => $form_id.'_loading', - 'class' => 'loading-search-datatables-button', - ] - ).'\'; - $("#button-'.$form_id.'_search_bt").parent().append(loading); - } + $serverside = 'true'; + if (isset($parameters['data_element'])) { + $serverside = 'false'; + } - inputs = $("#'.$form_id.' :input"); + // Javascript controller. + $js = ''; } - if (isset($parameters['csv']) === true) { - $js."'$('#".$table_id."').on( 'buttons-processing', function ( e, indicator ) { - if ( indicator ) { - console.log('a'); - } - else { - console.log('b'); - }"; - } - - $js .= '$("table#'.$table_id.'").removeClass("invisible"); - });'; - $js .= ' - $(function() { - $(document).on("preInit.dt", function (ev, settings) { - $("div.dataTables_length").hide(); - $("div.dt-buttons").hide(); - }); - }); - - '; - - $js .= ''; - // Order. $info_msg_arr = []; $info_msg_arr['message'] = $emptyTable; diff --git a/pandora_console/include/lib/Dashboard/Manager.php b/pandora_console/include/lib/Dashboard/Manager.php index 6e2f9a00d8..85497e212f 100644 --- a/pandora_console/include/lib/Dashboard/Manager.php +++ b/pandora_console/include/lib/Dashboard/Manager.php @@ -287,7 +287,7 @@ class Manager implements PublicLogin $this->dashboardId = (int) \get_parameter('dashboardId', 0); if ($this->slides === 1) { - $this->slidesIds = (array) \get_parameter('slidesIds'); + $this->slidesIds = (array) \get_parameter('slidesIds', [get_user_dashboards($config['id_user'])[0]['id']]); $this->cellModeSlides = (int) \get_parameter( 'cellModeSlides', 0 diff --git a/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php b/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php index 53d996607c..01a8781606 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php +++ b/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php @@ -453,6 +453,7 @@ class ModulesByStatus extends Widget 1000, ], ], + 'dom_elements' => 'frtilp', ] ); } catch (\Exception $e) { diff --git a/pandora_console/include/styles/dashboards.css b/pandora_console/include/styles/dashboards.css index 3ac49172d4..1a276fcdfd 100644 --- a/pandora_console/include/styles/dashboards.css +++ b/pandora_console/include/styles/dashboards.css @@ -22,7 +22,7 @@ } #menu_tab { - margin: 0px; + margin: 0; } #menu_tab li.nomn.tab_operation img, @@ -426,12 +426,21 @@ li#search_input_widget { top: 2px; } -div#dashboard-controls { +.select2-search--dropdown .select2-search__field { + width: auto; +} + +div#dashboard-controls-slides { + width: 720px !important; +} + +div#dashboard-controls, +div#dashboard-controls-slides { position: fixed; z-index: 1; top: 10px; right: 10px; - width: 800px; + width: 450px; height: 70px; display: flex; flex-direction: row; @@ -443,27 +452,32 @@ div#dashboard-controls { padding: 0px 10px; } -div#dashboard-controls div { - flex: 0.5; +div#dashboard-controls div, +div#dashboard-controls-slides div { + margin-left: 10px; text-align: center; } -div#dashboard-controls div#dashboard-slides-form-countdown { +div#dashboard-controls div#dashboard-slides-form-countdown, +div#dashboard-controls-slides div#dashboard-slides-form-countdown { flex: 7; } -div#dashboard-controls div#dashboard-slides-name { +div#dashboard-controls div#dashboard-slides-name, +div#dashboard-controls-slides div#dashboard-slides-name { flex: 3; } -div#dashboard-controls div.dashboard-mode { +div#dashboard-controls div.dashboard-mode, +div#dashboard-controls-slides div.dashboard-mode { flex: 1; display: flex; flex-direction: row; justify-content: center; } -div#dashboard-controls div.dashboard-mode a { +div#dashboard-controls div.dashboard-mode a, +div#dashboard-controls-slides div.dashboard-mode a { margin: 0px; } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 933e341e30..508daaca8a 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -805,6 +805,11 @@ select:-internal-list-box { max-height: 400px; } +.mx_height85 { + height: 85px !important; + max-height: 85px !important; +} + .no-text-imp { font-size: 0 !important; } @@ -7002,6 +7007,10 @@ div.graph div.legend table { margin-top: -2px !important; } +.mrgn_top-8px { + margin-top: -8px !important; +} + .mrgn_top-10px { margin-top: -10px; } @@ -10120,10 +10129,6 @@ select:focus { border-color: #8a96a6; } -.dataTables_length > label > select { - min-height: 42px; -} - .dataTables_length > label { font-size: 0px; } @@ -11859,3 +11864,7 @@ li.input-interval .extra-container-input .select2 { .scale-0-8 { transform: scale(0.8); } + +label:has(span.label-alert-agent) { + margin-bottom: 10px; +} diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index f716688e75..1bf1e91029 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -1600,3 +1600,7 @@ a.pandora_pagination, .info_table > tbody > tr > td { border-bottom: 1px solid #3f3f3f; } + +.font-title-font { + color: #fff; +} diff --git a/pandora_console/include/styles/tables.css b/pandora_console/include/styles/tables.css index 4dd0c2e410..fc421444d5 100644 --- a/pandora_console/include/styles/tables.css +++ b/pandora_console/include/styles/tables.css @@ -313,7 +313,7 @@ table.dataTable.info_table.no-footer { a.pandora_pagination { background-color: #f6f7fb; - padding: 11px; + padding: 9px; color: #000; border: 1px solid #cacaca; border-left: none; @@ -362,7 +362,7 @@ a.pandora_pagination.current:hover { background-color: transparent; color: var(--primary-color); font-size: 20px; - height: 42px; + height: 38px; /* height: 32px; */ width: 80px; margin-left: 10px; @@ -816,14 +816,6 @@ div[id^="auto-os-"] > img { height: 20px; } -.dataTables_paginate { - margin-right: 10px; -} - -.dataTables_paginate.paging_simple_numbers { - margin-right: 0; -} - .w22px { width: 22px; } @@ -842,3 +834,13 @@ td.FF-thresholds-pdd { padding: 0px !important; padding-left: 13px !important; } + +div.grid-stack-item-content a.pandora_pagination, +a.mini-pandora-pagination { + padding: 7px; + font-size: 9pt; +} + +input.mini-search-input { + height: 30px; +} diff --git a/pandora_console/operation/agentes/agent_inventory.php b/pandora_console/operation/agentes/agent_inventory.php index e1ba0a7d88..22db47b2fc 100644 --- a/pandora_console/operation/agentes/agent_inventory.php +++ b/pandora_console/operation/agentes/agent_inventory.php @@ -109,44 +109,93 @@ $utimestampSelectValues = array_reduce( // Inventory module select. $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox filters'; $table->size = []; -$table->data = []; +$table->size[0] = '33%'; +$table->size[1] = '33%'; +$table->size[2] = '33%'; +$table->class = 'filter-table-adv'; -$table->data[0][0] = __('Module'); -$table->data[0][1] = html_print_select_from_sql( - $sqlModuleInventoryAgentView, - 'module_inventory_agent_view', - $module, - 'javascript:this.form.submit();', - __('All'), - 0, +$table->data[0][0] = html_print_label_input_block( + __('Module'), + html_print_select_from_sql( + $sqlModuleInventoryAgentView, + 'module_inventory_agent_view', + $module, + 'javascript:this.form.submit();', + __('All'), + 0, + true, + false, + true, + false, + 'width:100%;' + ) +); + +$table->data[0][1] = html_print_label_input_block( + __('Date'), + html_print_select( + $utimestampSelectValues, + 'utimestamp', + $utimestamp, + 'javascript:this.form.submit();', + __('Now'), + 0, + true, + false, + true, + '', + false, + 'width:100%;' + ) +); + +$table->data[0][2] = html_print_label_input_block( + __('Search'), + html_print_input_text( + 'search_string', + $search_string, + '', + 25, + 0, + true + ) +); + +$buttons = html_print_submit_button( + __('Filter'), + 'search_button', + false, + [ + 'icon' => 'search', + 'mode' => 'mini', + ], true ); -$table->data[0][2] = __('Date'); -$table->data[0][3] = html_print_select( - $utimestampSelectValues, - 'utimestamp', - $utimestamp, - 'javascript:this.form.submit();', - __('Now'), - 0, +$searchForm = '
    '; +$searchForm .= html_print_table($table, true); +$searchForm .= html_print_div( + [ + 'class' => 'action-buttons', + 'content' => $buttons, + ], true ); +$searchForm .= '
    '; -$table->data[0][4] = __('Search'); -$table->data[0][5] = html_print_input_text('search_string', $search_string, '', 25, 0, true); -$table->data[0][6] = html_print_submit_button(__('Search'), 'search_button', false, 'class="sub wand"', true); - -// Show filters table. -echo sprintf( - '
    %s
    ', - $id_agente, - html_print_table($table, true) +ui_toggle( + $searchForm, + ''.__('Filters').'', + 'filter_form', + '', + true, + false, + '', + 'white-box-content', + 'box-flat white_table_graph fixed_filter_bar' ); -unset($table); $idModuleInventory = null; $rowTable = 1; @@ -181,7 +230,7 @@ foreach ($rows as $row) { $table->align = []; $table->cellpadding = 4; $table->cellspacing = 4; - $table->class = 'databox filters'; + $table->class = 'info_table'; $table->head = []; $table->head[0] = $row['name'].' - ('.date($config['date_format'], $row['utimestamp']).')'; @@ -210,7 +259,7 @@ foreach ($rows as $row) { foreach ($subHeadTitles as $titleData) { $table->data[0][$iterator] = $titleData; - $table->cellstyle[0][$iterator] = 'background: #373737; color: #FFF;'; + $table->cellstyle[0][$iterator] = 'background: var(--primary-color); color: #FFF;'; $iterator++; } diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index d970c5aa65..f0ae9b033d 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -434,35 +434,39 @@ if ($agent_view_page === true) { ); } -if (((bool) check_acl($config['id_user'], $id_group, 'AW') === true || (bool) check_acl($config['id_user'], $id_group, 'LM') === true)) { - if ($agent_view_page === true) { - html_print_div( - [ - 'class' => 'action-buttons pdd_b_10px pdd_r_5px w100p', - 'content' => html_print_submit_button( +if (is_metaconsole() === false) { + if (((bool) check_acl($config['id_user'], $id_group, 'AW') === true || (bool) check_acl($config['id_user'], $id_group, 'LM') === true)) { + if ($agent_view_page === true) { + html_print_div( + [ + 'class' => 'action-buttons pdd_b_10px pdd_r_5px w100p', + 'content' => html_print_submit_button( + __('Validate'), + 'alert_validate', + false, + [ + 'icon' => 'wand', + 'mode' => 'secondary mini', + ], + true + ), + ] + ); + } else { + html_print_action_buttons( + html_print_submit_button( __('Validate'), 'alert_validate', false, - [ - 'icon' => 'wand', - 'mode' => 'secondary mini', - ], + [ 'icon' => 'wand' ], true ), - ] - ); - } else { - html_print_action_buttons( - html_print_submit_button( - __('Validate'), - 'alert_validate', - false, - [ 'icon' => 'wand' ], - true - ), - ['type' => 'form_action'] - ); + ['type' => 'form_action'] + ); + } } +} else { + html_print_action_buttons(''); } $html_content = ob_get_clean(); diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 815ee32e6c..83da38563a 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -1301,7 +1301,7 @@ if (empty($tableAgents->data) === false) { true, 'offset', false, - 'dataTables_paginate paging_simple_numbers' + 'paging_simple_numbers' ); unset($table); diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 473337011e..5e86d78853 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -907,6 +907,9 @@ $tableFilter->data['second_line'][1] = html_print_label_input_block( true, '', [], + true, + 0, + '30', true ) ); diff --git a/pandora_console/operation/heatmap.php b/pandora_console/operation/heatmap.php index 1e063d3c3d..a982bffb9a 100644 --- a/pandora_console/operation/heatmap.php +++ b/pandora_console/operation/heatmap.php @@ -149,13 +149,13 @@ if ($is_ajax === false && $pure === false) { if ($is_ajax === false && $pure === true) { // Floating menu - Start. - echo '
    '; + echo '
    '; echo '