diff --git a/extras/build_rpm_rhel7.sh b/extras/build_rpm_rhel7.sh index 6bb65d816d..3684bd42e5 100755 --- a/extras/build_rpm_rhel7.sh +++ b/extras/build_rpm_rhel7.sh @@ -11,16 +11,16 @@ echo "Creating RPM packages in $RPMHOME/RPMS" rpmbuild -ba $CODEHOME/pandora_console/pandora_console.rhel7.spec || exit 1 # Server -rpmbuild -ba $CODEHOME/pandora_server/pandora_server.rhel7.spec || exit 1 +#rpmbuild -ba $CODEHOME/pandora_server/pandora_server.rhel7.spec || exit 1 # Unix agent -rpmbuild -ba $CODEHOME/pandora_agents/unix/pandora_agent.rhel7.spec || exit 1 +#rpmbuild -ba $CODEHOME/pandora_agents/unix/pandora_agent.rhel7.spec || exit 1 # Enterprise console rpmbuild -ba $PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.rhel7.spec || exit 1 # Enterprise server -rpmbuild -ba $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.rhel7.spec || exit 1 +#rpmbuild -ba $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.rhel7.spec || exit 1 exit 0 diff --git a/extras/pandora_update_version.sh b/extras/pandora_update_version.sh index 33e0c891f7..edab1affeb 100755 --- a/extras/pandora_update_version.sh +++ b/extras/pandora_update_version.sh @@ -30,6 +30,7 @@ $CODEHOME/pandora_console/pandora_console.rhel7.spec \ $CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \ $CODEHOME/pandora_server/pandora_server.redhat.spec \ $PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.redhat.spec \ +$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.rhel7.spec \ $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.redhat.spec" DEBIAN_FILES="$CODEHOME/pandora_console/DEBIAN \ $CODEHOME/pandora_server/DEBIAN \ diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index ae32bb637c..14c178725b 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.733-190412 +Version: 7.0NG.733-190421 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index dfaee640cd..1790da27f2 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190412" +pandora_version="7.0NG.733-190421" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 8574e5992c..5804ba428e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.733'; -use constant AGENT_BUILD => '190412'; +use constant AGENT_BUILD => '190421'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; @@ -1075,6 +1075,10 @@ sub send_buffered_xml_files ($;$) { unlink ("$temporal_file/$xml_file"); } } + # Do not get stuck trying to send buffered XML files to a secondary server. + elsif ($flag_always == 2) { + last; + } } if (defined($flag_always) && ($flag_always == 2)){ swap_servers (); diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index f422cf9440..385a6f5890 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190412 +%define release 190421 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index aa20c8959d..b6dbe1b74c 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190412 +%define release 190421 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 5a37ec8afb..2fc156dba8 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.733" -PI_BUILD="190412" +PI_BUILD="190421" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index ab6dbf55cf..445411e598 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190412} +{190421} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 29e3fa7c6c..642a88b173 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.733(Build 190412)") +#define PANDORA_VERSION ("7.0NG.733(Build 190421)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f100c45e66..7fc6c1141b 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.733(Build 190412))" + VALUE "ProductVersion", "(7.0NG.733(Build 190421))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9a2377396a..70a862d28c 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.733-190412 +Version: 7.0NG.733-190421 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 8ede0c1194..84b3b0c59d 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190412" +pandora_version="7.0NG.733-190421" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/agents_alerts.php b/pandora_console/extensions/agents_alerts.php index 46272504f6..72b90eeafa 100755 --- a/pandora_console/extensions/agents_alerts.php +++ b/pandora_console/extensions/agents_alerts.php @@ -378,7 +378,8 @@ function mainAgentsAlerts() 'alerts_agents' ); - echo ''; + echo '
'; + echo ''; echo "'; if ($hor_offset > 0) { @@ -421,9 +422,10 @@ function mainAgentsAlerts() continue; } - echo ''; + echo ''; } + echo ''; if (($hor_offset + $block) < $ntemplates) { $new_hor_offset = ($hor_offset + $block); echo "
".__('Agents').' / '.__('Alert templates').''.io_safe_output($tname).html_print_image('images/information_alerts.png', true, ['title' => io_safe_output($tname), 'style' => 'margin-left:5px' ]).''.io_safe_output($tname).'
@@ -455,7 +457,7 @@ function mainAgentsAlerts() $cellstyle = 'background:'.COL_ALERTFIRED.';'; } - echo ' '; + echo ' '; $uniqid = uniqid(); echo '
'; @@ -478,6 +480,23 @@ function mainAgentsAlerts() } echo '
'; + + ui_pagination( + $nagents, + false, + 0, + 0, + false, + 'offset', + true, + 'pagination-bottom', + '', + [ + 'count' => '', + 'offset' => 'offset_param', + ], + 'alerts_agents' + ); } } @@ -487,7 +506,7 @@ function mainAgentsAlerts() function print_alerts_summary_modal_window($id, $alerts) { $table->width = '98%'; - $table->class = 'databox'; + $table->class = 'info_table'; $table->data = []; $table->head[0] = __('Module'); diff --git a/pandora_console/extensions/dbmanager.php b/pandora_console/extensions/dbmanager.php index 2aface6996..546ee463fa 100644 --- a/pandora_console/extensions/dbmanager.php +++ b/pandora_console/extensions/dbmanager.php @@ -148,7 +148,7 @@ function dbmgr_extension_main() echo "
"; $table = new stdClass(); $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; $table->head = array_keys($result[0]); $table->data = $result; diff --git a/pandora_console/extensions/files_repo/files_repo_list.php b/pandora_console/extensions/files_repo/files_repo_list.php index 1d01cd1418..80de4563ae 100644 --- a/pandora_console/extensions/files_repo/files_repo_list.php +++ b/pandora_console/extensions/files_repo/files_repo_list.php @@ -45,11 +45,9 @@ if (!empty($files)) { $table = new stdClass(); $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; $table->style = []; $table->style[1] = 'max-width: 200px;'; - $table->style[2] = 'text-align: center;'; - $table->style[3] = 'text-align: center;'; $table->style[4] = 'text-align: center;'; $table->head = []; $table->head[0] = __('Name'); @@ -81,6 +79,7 @@ if (!empty($files)) { // Last modification // Public URL $data[4] = ''; + $table->cellclass[][4] = 'action_buttons'; if (!empty($file['hash'])) { $public_url = ui_get_full_url(EXTENSIONS_DIR.'/files_repo/files_repo_get_file.php?file='.$file['hash']); $message = __('Copy to clipboard').': Ctrl+C -> Enter'; @@ -92,7 +91,7 @@ if (!empty($files)) { } $data[4] .= ""; - $data[4] .= html_print_image('images/download.png', true, ['title' => __('Download')]); + $data[4] .= html_print_image('images/download.png', true, ['title' => __('Download'), 'style' => 'padding:3px' ]); // Download image $data[4] .= ''; diff --git a/pandora_console/extensions/users_connected.php b/pandora_console/extensions/users_connected.php index 562d757a20..e26b0dab1e 100644 --- a/pandora_console/extensions/users_connected.php +++ b/pandora_console/extensions/users_connected.php @@ -66,10 +66,10 @@ function users_extension_main_god($god=true) $rows = []; echo "
".__('No other users connected').'
'; } else { - $table->cellpadding = 4; - $table->cellspacing = 4; + $table->cellpadding = 0; + $table->cellspacing = 0; $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; $table->size = []; $table->data = []; $table->head = []; diff --git a/pandora_console/extras/mr/27.sql b/pandora_console/extras/mr/27.sql index 738b245ab6..958253a807 100644 --- a/pandora_console/extras/mr/27.sql +++ b/pandora_console/extras/mr/27.sql @@ -1,5 +1,7 @@ START TRANSACTION; +ALTER TABLE `tnetflow_filter` DROP COLUMN `output`; + ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 74f12fcf2f..4cdb88ac30 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -2093,6 +2093,12 @@ INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Di -- ---------------------------------------------------------------------- ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT ''; +-- ---------------------------------------------------------------------- +-- Add column in table `tnetflow_filter` +-- ---------------------------------------------------------------------- +ALTER TABLE `tnetflow_filter` DROP COLUMN `output`; + + -- ---------------------------------------------------------------------- -- Update table `tuser_task` -- ---------------------------------------------------------------------- diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index d3bf94ddc1..3117ddb490 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -284,7 +284,7 @@ if ($config['menu_type'] == 'classic') { $header_support .= '
'; // Documentation. - $header_docu = '
'; + $header_docu = '
'; $header_docu .= ''; $header_docu .= html_print_image('/images/header_docu.png', true, ['title' => __('Go to documentation'), 'class' => 'bot', 'alt' => 'user']); $header_docu .= '
'; diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index a267e36b4d..6ecefbf3ac 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -272,7 +272,9 @@ if (!empty($all_data)) { echo '
'; $table = new stdClass(); - $table->class = 'databox data'; + $table->class = 'info_table'; + $table->cellpadding = 0; + $table->cellspacing = 0; $table->width = '100%'; // Don't specify px. $table->data = []; diff --git a/pandora_console/general/noaccess.php b/pandora_console/general/noaccess.php index 6f6fb7a6a8..8f70661296 100644 --- a/pandora_console/general/noaccess.php +++ b/pandora_console/general/noaccess.php @@ -4,29 +4,35 @@ -
- -
- - - - images/icono_cerrar.png'> - +
+ +
+ images/input_cross.png'> +
+ +
+
+ +
+ +
+
'; + echo __('Please know that all attempts to access this page are recorded in security logs of %s System Database', get_product_name()); + ?> + +
+ +
+ OK +
+
- -
- images/access_denied.png'> -
-
'; - echo __('Please know that all attempts to access this page are recorded in security logs of %s System Database', get_product_name()); - ?> - -
- - -
- -
-OK -
- -
- -
+ +
\ No newline at end of file diff --git a/pandora_console/godmode/admin_access_logs.php b/pandora_console/godmode/admin_access_logs.php index 93c668f00c..67a933d8cb 100644 --- a/pandora_console/godmode/admin_access_logs.php +++ b/pandora_console/godmode/admin_access_logs.php @@ -183,10 +183,10 @@ if (empty($result)) { } $table = new stdClass(); -$table->cellpadding = 4; -$table->cellspacing = 4; +$table->cellpadding = 0; +$table->cellspacing = 0; $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->size = []; $table->data = []; $table->head = []; @@ -246,7 +246,18 @@ foreach ($result as $row) { } } +foreach ($table->rowclass as $key => $value) { + if (strpos($value, 'limit_scroll') !== false) { + $table->colspan[$key] = [7]; + } else { + if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { + $table->cellclass[$key][6] = 'action_buttons'; + } + } +} + html_print_table($table); +ui_pagination($count, $url, 0, 0, false, 'offset', true, 'pagination-bottom'); if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { enterprise_hook('enterpriseAuditFooter'); diff --git a/pandora_console/godmode/agentes/agent_template.php b/pandora_console/godmode/agentes/agent_template.php index f4c93bb9f1..d71249299c 100644 --- a/pandora_console/godmode/agentes/agent_template.php +++ b/pandora_console/godmode/agentes/agent_template.php @@ -225,7 +225,7 @@ if ($result === false) { $table->width = '100%'; $table->cellpadding = 0; $table->cellspacing = 0; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->head = []; $table->data = []; $table->align = []; @@ -253,9 +253,9 @@ foreach ($result as $row) { $data[2] = mb_substr($row['descripcion'], 0, 60); - $data[3] = ''.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'onclick' => "if (!confirm('".__('Are you sure?')."')) return false;"]).'  '; - - $data[3] .= '  '.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update')]).''; + $table->cellclass[][3] = 'action_buttons'; + $data[3] = ''.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'onclick' => "if (!confirm('".__('Are you sure?')."')) return false;"]).''; + $data[3] .= ''.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update')]).''; array_push($table->data, $data); } diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php index 0be7166062..20a9db547a 100644 --- a/pandora_console/godmode/agentes/fields_manager.php +++ b/pandora_console/godmode/agentes/fields_manager.php @@ -97,11 +97,22 @@ if ($delete_field) { } } -$fields = db_get_all_fields_in_table('tagent_custom_fields'); +// Prepare pagination. +$offset = (int) get_parameter('offset'); +$limit = $config['block_size']; +$count_fields = db_get_value('count(*)', 'tagent_custom_fields'); + +$fields = db_get_all_rows_filter( + 'tagent_custom_fields', + [ + 'limit' => $limit, + 'offset' => $offset, + ] +); $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; if ($fields) { $table->head = []; $table->head[0] = __('ID'); @@ -135,14 +146,17 @@ foreach ($fields as $field) { $data[2] = html_print_image('images/icono_stop.png', true, ['style' => 'width:21px;height:21px;']); } + $table->cellclass[][3] = 'action_buttons'; $data[3] = ''.html_print_image('images/config.png', true, ['alt' => __('Edit'), 'title' => __('Edit'), 'border' => '0']).''; - $data[3] .= '  '.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0']).''; + $data[3] .= ''.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0']).''; array_push($table->data, $data); } if ($fields) { + ui_pagination($count_fields, false, $offset); html_print_table($table); + ui_pagination($count_fields, false, $offset, 0, false, 'offset', true, 'pagination-bottom'); } echo '
'; diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 4673bf2f46..902d074f21 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -224,13 +224,13 @@ switch ($config['dbtype']) { break; } -$selected = 'border: 1px solid black;'; -$selectNameUp = ''; -$selectNameDown = ''; -$selectOsUp = ''; -$selectOsDown = ''; -$selectGroupUp = ''; -$selectGroupDown = ''; +$selected = true; +$selectNameUp = false; +$selectNameDown = false; +$selectOsUp = false; +$selectOsDown = false; +$selectGroupUp = false; +$selectGroupDown = false; switch ($sortField) { case 'remote': switch ($sort) { @@ -441,18 +441,27 @@ if (($config['dbtype'] == 'oracle') && ($agents !== false)) { ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset); if ($agents !== false) { - echo ""; - echo ''; - echo "'; - echo ''; + // Urls to sort the table. + $url_up_agente = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled'; + $url_down_agente = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=down&disabled=$disabled'; + $url_up_remote = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=remote&sort=up&disabled=$disabled'; + $url_down_remote = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=remote&sort=down&disabled=$disabled'; + $url_up_os = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=os&sort=up&disabled=$disabled'; + $url_down_os = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=os&sort=down&disabled=$disabled'; + $url_up_group = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=up&disabled=$disabled'; + $url_down_group = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=down&disabled=$disabled'; + + + echo "
'.__('Agent name').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).''; - echo '".__('R').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectRemoteUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectRemoteDown]).''; - echo ''.__('OS').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectOsUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectOsDown]).''; - echo '
"; + echo ''; + echo ''; + echo "'; + echo ''; echo ''; - echo ''; + echo ''; echo ''; echo "'; + echo ''; $color = 1; $rowPair = true; @@ -628,7 +637,7 @@ if ($agents !== false) { $offsetArg = $offset; } - echo "
'.__('Agent name').ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectNameUp, $selectNameDown).'".__('R').ui_get_sorting_arrows($url_up_remote, $url_down_remote, $selectRemoteUp, $selectRemoteDown).''.__('OS').ui_get_sorting_arrows($url_up_os, $url_down_os, $selectOsUp, $selectOsDown).''.__('Type').''.__('Group').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectGroupUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectGroupDown]).''; - echo ''.__('Group').ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown).''.__('Description').'".__('Actions').'
"; + echo ""; if ($agent['disabled']) { echo "'; - ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset); + ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset, 0, false, 'offset', true, 'pagination-bottom'); echo "
"; } else { ui_print_info_message(['no_close' => true, 'message' => __('There are no defined agents') ]); diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 9df6860591..6ad5267c0e 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -358,17 +358,17 @@ if ($multiple_delete) { // TABLE LIST MODULES // ================== $url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente; -$selectNameUp = ''; -$selectNameDown = ''; -$selectServerUp = ''; -$selectServerDown = ''; -$selectTypeUp = ''; -$selectTypeDown = ''; -$selectIntervalUp = ''; -$selectIntervalDown = ''; +$selectNameUp = false; +$selectNameDown = false; +$selectServerUp = false; +$selectServerDown = false; +$selectTypeUp = false; +$selectTypeDown = false; +$selectIntervalUp = false; +$selectIntervalDown = false; $sortField = get_parameter('sort_field'); $sort = get_parameter('sort', 'none'); -$selected = ''; +$selected = true; $order[] = [ 'field' => 'tmodule_group.name', @@ -482,13 +482,13 @@ switch ($sortField) { default: $selectNameUp = $selected; - $selectNameDown = ''; - $selectServerUp = ''; - $selectServerDown = ''; - $selectTypeUp = ''; - $selectTypeDown = ''; - $selectIntervalUp = ''; - $selectIntervalDown = ''; + $selectNameDown = false; + $selectServerUp = false; + $selectServerDown = false; + $selectTypeUp = false; + $selectTypeDown = false; + $selectIntervalUp = false; + $selectIntervalDown = false; switch ($config['dbtype']) { case 'mysql': case 'postgresql': @@ -626,32 +626,39 @@ if ($paginate_module) { ui_pagination($total_modules, $url); } +$url_name = $url.'&sort_field=name&sort='; +$url_server = $url.'&sort_field=server&sort='; +$url_type = $url.'&sort_field=type&sort='; +$url_interval = $url.'&sort_field=interval&sort='; + $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->head = []; -$table->head[0] = __('Name').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).''; +$table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false); +$table->head[0] = __('Name').ui_get_sorting_arrows($url_name.'up', $url_name.'down', $selectNameUp, $selectNameDown); // The access to the policy is granted only with AW permission if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) { $table->head[1] = "".__('P.').''; } -$table->head[2] = "".__('S.').''.' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectServerUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectServerDown]).''; -$table->head[3] = __('Type').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectTypeUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectTypeDown]).''; -$table->head[4] = __('Interval').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectIntervalUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectIntervalDown]).''; +$table->head[2] = "".__('S.').''.ui_get_sorting_arrows($url_server.'up', $url_server.'down', $selectServerUp, $selectServerDown); +$table->head[3] = __('Type').ui_get_sorting_arrows($url_type.'up', $url_type.'down', $selectTypeUp, $selectTypeDown); +$table->head[4] = __('Interval').ui_get_sorting_arrows($url_interval.'up', $url_interval.'down', $selectIntervalUp, $selectIntervalDown); $table->head[5] = __('Description'); $table->head[6] = __('Status'); $table->head[7] = __('Warn'); $table->head[8] = __('Action'); -$table->head[9] = ''.__('Del.').''.html_print_checkbox('all_delete', 0, false, true, false); +$table->head[9] = ''.__('Del.').''; $table->rowstyle = []; $table->style = []; $table->style[0] = 'font-weight: bold'; $table->size = []; +$table->size['checkbox'] = '20px'; $table->size[2] = '70px'; $table->align = []; $table->align[2] = 'left'; @@ -706,15 +713,19 @@ foreach ($modules as $module) { $table->rowstyle[($i - 1)] = 'text-align: center'; $table->rowclass[($i - 1)] = 'datos3'; if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { - $table->colspan[($i - 1)][0] = 10; + $table->colspan[($i - 1)][0] = 11; } else { - $table->colspan[($i - 1)][0] = 9; + $table->colspan[($i - 1)][0] = 10; } $data = []; } } + if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { + $data['checkbox'] = html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true); + } + $data[0] = ''; if (isset($module['deep']) && ($module['deep'] != 0)) { @@ -858,7 +869,7 @@ foreach ($modules as $module) { } if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && $module['id_tipo_modulo'] != 25) { - $data[8] .= ' '; $data[8] .= html_print_image( 'images/copy.png', @@ -870,7 +881,7 @@ foreach ($modules as $module) { // Make a data normalization if (isset($numericModules[$type])) { if ($numericModules[$type] === true) { - $data[8] .= ' '; + $data[8] .= ''; $data[8] .= html_print_image( 'images/chart_curve.png', true, @@ -879,18 +890,19 @@ foreach ($modules as $module) { $data[8] .= ''; } } else { - $data[8] .= ' '.html_print_image( + $data[8] .= html_print_image( 'images/chart_curve.disabled.png', true, ['title' => __('Normalize (Disabled)')] ); + $data[8] .= '  '; } // create network component action if ((is_user_admin($config['id_user'])) && ($module['id_modulo'] == MODULE_NETWORK) ) { - $data[8] .= ' '; $data[8] .= html_print_image( 'images/network.png', @@ -899,11 +911,12 @@ foreach ($modules as $module) { ); $data[8] .= ' '; } else { - $data[8] .= ' '.html_print_image( + $data[8] .= html_print_image( 'images/network.disabled.png', true, ['title' => __('Create network component (Disabled)')] ); + $data[8] .= '  '; } } @@ -917,10 +930,17 @@ foreach ($modules as $module) { ['title' => __('Delete')] ); $data[9] .= ' '; - $data[9] .= html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true); } + $table->cellclass[] = [ + 8 => 'action_buttons', + 9 => 'action_buttons', + ]; array_push($table->data, $data); + $table->cellclass[] = [ + 8 => 'action_buttons', + 9 => 'action_buttons', + ]; } if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php index 790944b472..a9529248b0 100755 --- a/pandora_console/godmode/agentes/planned_downtime.list.php +++ b/pandora_console/godmode/agentes/planned_downtime.list.php @@ -393,7 +393,7 @@ else { // View available downtimes present in database (if any of them) $table = new StdClass(); - $table->class = 'databox data'; + $table->class = 'info_table'; $table->width = '100%'; $table->cellstyle = []; @@ -518,9 +518,9 @@ else { } html_print_table($table); + ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset, 0, false, 'offset', true, 'pagination-bottom'); echo '
'; - echo '
'; // CSV export button echo '
'; html_print_button( diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index 6140d5407a..0de86bf070 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -221,7 +221,7 @@ if ($delete_action) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->data = []; $table->head = []; $table->head[0] = __('Name'); @@ -281,6 +281,10 @@ foreach ($actions as $action) { } if (check_acl($config['id_user'], $action['id_group'], 'LM')) { + $table->cellclass[] = [ + 2 => 'action_buttons', + 3 => 'action_buttons', + ]; $data[2] = ''.html_print_image('images/copy.png', true).''; $data[3] = 'width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->data = []; $table->head = []; @@ -431,6 +431,7 @@ foreach ($commands as $command) { io_safe_output($command['description']) ); $data['action'] = ''; + $table->cellclass[]['action'] = 'action_buttons'; if (! $command['internal']) { $data['action'] = ''; $data['action'] .= ' 'agent_name', 'order' => 'ASC', @@ -360,12 +361,12 @@ switch ($sortField) { $selectDisabledDown = ''; $selectStandbyUp = ''; $selectStandbyDown = ''; - $selectAgentUp = ''; - $selectAgentDown = ''; + $selectAgentUp = false; + $selectAgentDown = false; $selectModuleUp = $selected; - $selectModuleDown = ''; - $selectTemplateUp = ''; - $selectTemplateDown = ''; + $selectModuleDown = false; + $selectTemplateUp = false; + $selectTemplateDown = false; $order = [ 'field' => 'agent_module_name', 'order' => 'ASC', @@ -402,12 +403,21 @@ if (!$id_agente) { $url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente='.$id_agente.'&offset='.$offset.$form_params; } +// Urls to sort the table. +$url_up_agente = $url.'&sort_field=agent&sort=up&pure='.$pure; +$url_down_agente = $url.'&sort_field=agent&sort=down&pure='.$pure; +$url_up_module = $url.'&sort_field=module&sort=up&pure='.$pure; +$url_down_module = $url.'&sort_field=module&sort=down&pure='.$pure; +$url_up_template = $url.'&sort_field=template&sort=up&pure='.$pure; +$url_down_template = $url.'&sort_field=template&sort=down&pure='.$pure; + + $table = new stdClass(); if (is_metaconsole()) { $table->class = 'alert_list databox'; } else { - $table->class = 'databox data'; + $table->class = 'info_table'; } $table->width = '100%'; @@ -427,7 +437,7 @@ $table->head = []; if (! $id_agente) { $table->style = []; $table->style[0] = 'font-weight: bold;'; - $table->head[0] = __('Agent').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectAgentUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectAgentDown]).''; + $table->head[0] = __('Agent').ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectAgentUp, $selectAgentDown); $table->size[0] = '4%'; $table->size[1] = '8%'; $table->size[2] = '8%'; @@ -439,7 +449,7 @@ if (! $id_agente) { $table->size[4] = '8%'; }*/ } else { - $table->head[0] = __('Module').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectModuleUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectModuleDown]).''; + $table->head[0] = __('Module').ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown); // Different sizes or the layout screws up $table->size[0] = '0%'; $table->size[1] = '10%'; @@ -452,7 +462,7 @@ if (! $id_agente) { $table->size[4] = '1%'; } -$table->head[1] = __('Template').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectTemplateUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectTemplateDown]).''; +$table->head[1] = __('Template').ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown); $table->head[2] = __('Actions'); $table->head[3] = __('Status'); $table->head[4] = "".__('Op.').''; @@ -728,6 +738,10 @@ foreach ($simple_alerts as $alert) { $data[3] = ui_print_status_image($status, $title, true); + $table->cellclass[] = [ + 3 => 'action_buttons', + 4 => 'action_buttons', + ]; $data[4] = ''; if ($alert['disabled']) { $data[4] .= html_print_input_image('enable', 'images/lightbulb_off.png', 1, 'padding:0px', true); @@ -742,7 +756,7 @@ foreach ($simple_alerts as $alert) { // To manage alert is necessary LW permissions in the agent group if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) { - $data[4] .= '  '; + $data[4] .= ''; if (!$alert['standby']) { $data[4] .= html_print_input_image('standby_off', 'images/bell.png', 1, 'padding:0px;', true); $data[4] .= html_print_input_hidden('standbyon_alert', 1, true); @@ -771,7 +785,7 @@ foreach ($simple_alerts as $alert) { // To manage alert is necessary LW permissions in the agent group if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) { - $data[4] .= '  '; + $data[4] .= ''; $is_cluster = (bool) get_parameter('id_cluster'); if (!$is_cluster) { if ($alert['disabled']) { @@ -815,6 +829,11 @@ foreach ($simple_alerts as $alert) { if (isset($data)) { html_print_table($table); + if ($id_agente) { + ui_pagination($total, 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$id_agente.$form_params.$sort_params, 0, 0, false, 'offset', true, 'pagination-bottom'); + } else { + ui_pagination($total, 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list'.$form_params.$sort_params, 0, 0, false, 'offset', true, 'pagination-bottom'); + } } else { ui_print_info_message(['no_close' => true, 'message' => __('No alerts defined') ]); } diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index f00dbe5827..4542169cf3 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -339,7 +339,7 @@ if ($templates === false) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->data = []; $table->head = []; $table->head[0] = __('Name'); @@ -375,6 +375,7 @@ foreach ($templates as $template) { $data[3] = alerts_get_alert_templates_type_name($template['type']); if (check_acl($config['id_user'], $template['id_group'], 'LM')) { + $table->cellclass[][4] = 'action_buttons'; $data[4] = ''; $data[4] .= html_print_input_hidden('duplicate_template', 1, true); $data[4] .= html_print_input_hidden('source_id', $template['id'], true); @@ -396,6 +397,7 @@ foreach ($templates as $template) { ui_pagination($total_templates, $url); if (isset($data)) { html_print_table($table); + ui_pagination($total_templates, $url, 0, 0, false, 'offset', true, 'pagination-bottom'); } else { ui_print_info_message(['no_close' => true, 'message' => __('No alert templates defined') ]); } diff --git a/pandora_console/godmode/category/category.php b/pandora_console/godmode/category/category.php index 727be02057..e1a61a4db6 100755 --- a/pandora_console/godmode/category/category.php +++ b/pandora_console/godmode/category/category.php @@ -82,7 +82,13 @@ $filter['limit'] = (int) $config['block_size']; // Search action: This will filter the display category view $result = false; -$result = categories_get_all_categories(); +$result = db_get_all_rows_filter( + 'tcategory', + [ + 'limit' => $filter['limit'], + 'offset' => $filter['offset'], + ] +); // Display categories previously filtered or not $rowPair = true; @@ -94,7 +100,7 @@ if (!empty($result)) { $table = new stdClass(); $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; $table->data = []; $table->head = []; @@ -123,7 +129,8 @@ if (!empty($result)) { $data[1] .= ''.html_print_image('images/cross.png', true, ['title' => 'Delete']).''; } else { $data[0] = "".$category['name'].''; - $data[1] = "".html_print_image('images/config.png', true, ['title' => 'Edit']).'  '; + $table->cellclass[][1] = 'action_buttons'; + $data[1] = "".html_print_image('images/config.png', true, ['title' => 'Edit']).''; $data[1] .= ''.html_print_image('images/cross.png', true, ['title' => 'Delete']).''; } @@ -131,6 +138,7 @@ if (!empty($result)) { } html_print_table($table); + ui_pagination($total_categories, $url, $offset, 0, false, 'offset', true, 'pagination-bottom'); } else { // No categories available or selected ui_print_info_message(['no_close' => true, 'message' => __('No categories found') ]); diff --git a/pandora_console/godmode/events/event_filter.php b/pandora_console/godmode/events/event_filter.php index 40d60650f6..60ba973996 100644 --- a/pandora_console/godmode/events/event_filter.php +++ b/pandora_console/godmode/events/event_filter.php @@ -113,31 +113,33 @@ if ($filters === false) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->head = []; -$table->head[0] = __('Name'); -$table->head[1] = __('Group'); -$table->head[2] = __('Event type'); -$table->head[3] = __('Event status'); -$table->head[4] = __('Severity'); -$table->head[5] = __('Action').html_print_checkbox('all_delete', 0, false, true, false); +$table->head[0] = html_print_checkbox('all_delete', 0, false, true, false); +$table->head[1] = __('Name'); +$table->head[2] = __('Group'); +$table->head[3] = __('Event type'); +$table->head[4] = __('Event status'); +$table->head[5] = __('Severity'); +$table->head[6] = __('Action'); $table->style = []; -$table->style[0] = 'font-weight: bold'; +$table->style[1] = 'font-weight: bold'; $table->align = []; -$table->align[1] = 'left'; $table->align[2] = 'left'; $table->align[3] = 'left'; - $table->align[4] = 'left'; + $table->align[5] = 'left'; +$table->align[6] = 'left'; $table->size = []; -$table->size[0] = '50%'; -$table->size[1] = '5px'; -$table->size[2] = '80px'; +$table->size[0] = '20px'; +$table->size[1] = '50%'; +$table->size[2] = '5px'; $table->size[3] = '80px'; $table->size[4] = '80px'; -$table->size[5] = '40px'; +$table->size[5] = '80px'; +$table->size[6] = '40px'; $table->data = []; $total_filters = db_get_all_rows_filter('tevent_filter', false, 'COUNT(*) AS total'); @@ -147,13 +149,14 @@ $total_filters = $total_filters[0]['total']; foreach ($filters as $filter) { $data = []; - $data[0] = ''.$filter['id_name'].''; - $data[1] = ui_print_group_icon($filter['id_group_filter'], true); - $data[2] = events_get_event_types($filter['event_type']); - $data[3] = events_get_status($filter['status']); - $data[4] = events_get_severity_types($filter['severity']); - $data[5] = "".html_print_image('images/cross.png', true, ['title' => __('Delete')]).''.html_print_checkbox_extended('delete_multiple[]', $filter['id_filter'], false, false, '', 'class="check_delete"', true); + $data[0] = html_print_checkbox_extended('delete_multiple[]', $filter['id_filter'], false, false, '', 'class="check_delete"', true); + $data[1] = ''.$filter['id_name'].''; + $data[2] = ui_print_group_icon($filter['id_group_filter'], true); + $data[3] = events_get_event_types($filter['event_type']); + $data[4] = events_get_status($filter['status']); + $data[5] = events_get_severity_types($filter['severity']); + $table->cellclass[][6] = 'action_buttons'; + $data[6] = "".html_print_image('images/cross.png', true, ['title' => __('Delete')]).''; array_push($table->data, $data); } @@ -188,8 +191,6 @@ echo '
'; ?> width = '100%'; $table->id = 'table_filemanager'; if (!defined('METACONSOLE')) { - $table->class = 'databox data'; + $table->class = 'info_table'; $table->title = ''.__('Index of %s', $relative_directory).''; } @@ -582,13 +629,6 @@ function filemanager_file_explorer( $table->head[2] = __('Last modification'); $table->head[3] = __('Size'); $table->head[4] = __('Actions'); - if (!defined('METACONSOLE')) { - $table->headstyle[0] = 'background-color:#82B92E'; - $table->headstyle[1] = 'background-color:#82B92E'; - $table->headstyle[2] = 'background-color:#82B92E'; - $table->headstyle[3] = 'background-color:#82B92E'; - $table->headstyle[4] = 'background-color:#82B92E'; - } $prev_dir = explode('/', $relative_directory); $prev_dir_str = ''; @@ -608,85 +648,6 @@ function filemanager_file_explorer( $table->colspan[0][1] = 5; } - if (is_writable($real_directory)) { - $table->rowstyle[1] = 'display: none;'; - $table->data[1][0] = ''; - $table->data[1][1] = ''; - - $table->data[1][1] .= ''; - - $table->data[1][1] .= ''; - - $table->data[1][1] .= ''; - - $table->colspan[1][1] = 5; - } - foreach ($files as $fileinfo) { $fileinfo['realpath'] = str_replace('\\', '/', $fileinfo['realpath']); $relative_path = str_replace($_SERVER['DOCUMENT_ROOT'], '', $fileinfo['realpath']); @@ -815,10 +776,45 @@ function filemanager_file_explorer( if (defined('METACONSOLE')) { echo "
"; } else { - echo "
"; + $tabs_dialog = ''; + + echo ''; + + echo ''; + + echo ' '; + + echo "'; } else { - echo "
"; + echo "
"; echo "".__('The directory is read-only'); echo '
'; } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index b2a4a98b36..d6e017a9c0 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -972,6 +972,23 @@ function ui_format_alert_row($alert, $agent=true, $url='', $agent_style=false) $data = []; + // Validate checkbox + if (!defined('METACONSOLE')) { + if (check_acl($config['id_user'], $id_group, 'LW') || check_acl($config['id_user'], $id_group, 'LM')) { + $data[$index['validate']] = ''; + + $data[$index['validate']] .= html_print_checkbox( + 'validate[]', + $alert['id'], + false, + true, + false, + '', + true + ); + } + } + if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if (is_metaconsole()) { $node = metaconsole_get_connection_by_id($alert['server_data']['id']); @@ -1102,22 +1119,6 @@ function ui_format_alert_row($alert, $agent=true, $url='', $agent_style=false) $data[$index['status']] = ui_print_status_image($status, $title, true); - if (!defined('METACONSOLE')) { - if (check_acl($config['id_user'], $id_group, 'LW') || check_acl($config['id_user'], $id_group, 'LM')) { - $data[$index['validate']] = ''; - - $data[$index['validate']] .= html_print_checkbox( - 'validate[]', - $alert['id'], - false, - true, - false, - '', - true - ); - } - } - return $data; } @@ -1880,7 +1881,7 @@ function ui_pagination( if ($print_total_items) { $output = "'; @@ -1906,10 +1907,11 @@ function ui_pagination( // Show the count of items if ($print_total_items) { - $output .= sprintf(__('Total items: %s'), $count); - $output .= '
'; + $output .= '
'.sprintf(__('Total items: %s'), $count).'
'; } + $output .= "
"; + // Show GOTO FIRST PAGE button if ($number_of_pages > $block_limit) { if (!empty($script)) { @@ -1925,10 +1927,10 @@ function ui_pagination( $script_modified ); - $output .= " '; + $output .= "".html_print_image('images/go_first_g.png', true, ['class' => 'bot']).''; } else { - $output .= " '; + $output .= "".html_print_image('images/go_first_g.png', true, ['class' => 'bot']).''; } } @@ -1954,10 +1956,10 @@ function ui_pagination( $script_modified ); - $output .= "'; + $output .= "".html_print_image('images/go_previous_g.png', true, ['class' => 'bot']).''; } else { - $output .= "'; + $output .= "".html_print_image('images/go_previous_g.png', true, ['class' => 'bot']).''; } } @@ -1966,9 +1968,9 @@ function ui_pagination( $actual_page = (int) ($offset / $pagination); if ($iterator == $actual_page) { - $output .= ""; + $output .= "
"; } else { - $output .= ''; + $output .= "
"; } $offset_page = ($iterator * $pagination); @@ -1986,15 +1988,15 @@ function ui_pagination( $script_modified ); - $output .= "'; + $output .= "".html_print_image('images/go_next_g.png', true, ['class' => 'bot']).''; } else { - $output .= "'; + $output .= "".html_print_image('images/go_next_g.png', true, ['class' => 'bot']).''; } } @@ -2043,13 +2045,15 @@ function ui_pagination( $script_modified ); - $output .= "'; + $output .= "".html_print_image('images/go_last_g.png', true, ['class' => 'bot']).''; } else { - $output .= "'; + $output .= "".html_print_image('images/go_last_g.png', true, ['class' => 'bot']).''; } } + $output .= '
'; + // total_number // End div and layout $output .= '
'; @@ -4421,3 +4425,34 @@ function ui_get_favicon() return 'images/custom_favicon/'.$config['custom_favicon']; } + + +/** + * Show sorting arrows for tables + * + * @return string HTML anchor link with the arrow icon. + */ +function ui_get_sorting_arrows($url_up, $url_down, $selectUp, $selectDown) +{ + $arrow_up = 'images/sort_up_black.png'; + $arrow_down = 'images/sort_down_black.png'; + + // Green arrows for the selected. + if ($selectUp === true) { + $arrow_up = 'images/sort_up_green.png'; + } + + if ($selectDown === true) { + $arrow_down = 'images/sort_down_green.png'; + } + + if (is_metaconsole()) { + $arrow_up = 'images/sort_up.png'; + $arrow_down = 'images/sort_down.png'; + } + + return ' + '.html_print_image($arrow_up, true, ['alt' => 'up']).' + '.html_print_image($arrow_down, true, ['alt' => 'down']).' + '; +} diff --git a/pandora_console/include/styles/menu.css b/pandora_console/include/styles/menu.css index dcb9db06cb..7846a3f9a6 100644 --- a/pandora_console/include/styles/menu.css +++ b/pandora_console/include/styles/menu.css @@ -260,11 +260,6 @@ ul li { } /* End */ -ul li a:hover { - color: #e2144a; -} /* Hover Styles */ -/*li ul li a { padding: 2px 5px; } Sub Menu Styles */ - /* * --------------------------------------------------------------------- * - MAIN LEFT MENU and SUBMENU - diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 00e48c9b1b..bd0001b769 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -998,22 +998,6 @@ div#cont { background-color: #80BA27 !important; }*/ -/*tr.datos, tr.datost, tr.datosb , tr.datos_id, -tr.datosf9 { - #background-color: #eaeaea; -} - -tr.datos2, tr.datos2t, -tr.datos2b, tr.datos2_id , tr.datos2f9 { - #background-color: #f2f2f2; -} - -tr.datos:hover, tr.datost:hover, tr.datosb:hover, tr.datos_id:hover, -tr.datosf9:hover, tr.datos2:hover, tr.datos2t:hover, -tr.datos2b:hover, tr.datos2_id:hover, tr.datos2f9:hover { - #background-color: #efefef; -}*/ - /* * --------------------------------------------------------------------- * - REPORTS - @@ -1030,17 +1014,26 @@ tr.datos2b:hover, tr.datos2_id:hover, tr.datos2f9:hover { } td.datos3, -td.datos3 * { - background-color: #666; - color: white !important; +td.datos4 { + background-color: #fff; + color: #000 !important; + border-bottom: 2px solid #82b92e !important; + border-left: none !important; + border-right: none !important; + height: 30px; + font-size: 8.6pt; + font-weight: normal; } -td.datos4, -td.datos4 * { +td.datos4 { /*Add !important because in php the function html_print_table write style in cell and this is style head.*/ text-align: center !important; - background-color: #666; - color: white !important; +} + +td.datos3 *, +td.datos4 * { + font-size: 8.6pt; + font-weight: normal; } /*td.datos_id { @@ -2111,7 +2104,7 @@ a.autorefresh_txt, font-size: 8.5pt; } -@media screen and (min-width: 1024px) and (max-width: 1200px) { +@media screen and (max-width: 1200px) { #header_searchbar input.search_input { width: 135px; } @@ -2171,10 +2164,6 @@ div#logo_text3 { margin-left: 4px; padding-top: 0px; }*/ -.pagination { - margin-top: 15px; - margin-bottom: 5px; -} .pagination * { margin-left: 0px !important; margin-right: 0px !important; @@ -3312,8 +3301,7 @@ div.div_groups_status { } .databox.filters, -.databox.data, -.databox.profile_list { +.databox.data { margin-bottom: 20px; } @@ -3321,14 +3309,6 @@ div.div_groups_status { padding: 10px; padding-left: 20px; } -.databox.profile_list > tbody > tr > td { - padding: 4px 1px; - padding-left: 5px; - border-bottom: 1px solid #e2e2e2; -} -.databox.profile_list > tbody > tr > a.tip > img { - margin: 0px; -} .databox.filters > tbody > tr > td > img, .databox.filters > tbody > tr > td > div > a > img, @@ -3958,7 +3938,7 @@ span.log_zone_line_error { background-color: #eee; } .checkselected { - background-color: #eee; + background-color: #eee !important; } .tag-wrapper { padding: 0 10px 0 0; @@ -5034,3 +5014,427 @@ select#autorefresh_list:-internal-list-box { .table_three_columns .table_td { width: 33%; } + +/* + * --------------------------------------------------------------------- + * - TABLES TO SHOW INFORMATION + * --------------------------------------------------------------------- + */ + +table.info_table { + background-color: #fff; + margin-bottom: 10px; + border-spacing: 0; +} + +table.info_table > tbody > tr:nth-child(even) { + background-color: #f5f5f5; +} + +table.info_table tr:first-child > th { + background-color: #fff; + border-top: 1px solid #e2e2e2; + color: #000; + text-align: left; + vertical-align: middle; +} + +table.info_table th { + font-size: 7.5pt; + letter-spacing: 0.3pt; + color: #000; + background-color: #fff; +} + +table.info_table > thead > tr > th:first-child { + border-left: 1px solid #e2e2e2; +} + +table.info_table > thead > tr > th:last-child { + border-right: 1px solid #e2e2e2; +} + +table.info_table tr th { + border-bottom: 1px solid #e2e2e2; +} + +table.info_table > thead > tr:first-child > th:last-child { + border-top-right-radius: 4px; +} + +table.info_table > thead > tr:first-child > th:first-child { + border-top-left-radius: 4px; +} + +table.info_table > thead > tr > th, +table.info_table > tbody > tr > th, +table.info_table > thead > tr > th a { + padding-left: 9px; + padding-right: 9px; + padding-top: 9px; + padding-bottom: 9px; + font-weight: normal; + color: #000; + font-size: 8.6pt; +} + +table.info_table > tbody > tr > td { + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; + border: none; + padding-left: 9px; + padding-right: 9px; + padding-top: 7px; + padding-bottom: 7px; + border-bottom: 1px solid #e2e2e2; +} + +table.info_table > tbody > tr:last-child > td:first-child { + border-bottom-left-radius: 4px; +} + +table.info_table > tbody > tr > td:first-child { + border-left: 1px solid #e2e2e2; +} + +table.info_table > tbody > tr:last-child > td:last-child { + border-bottom-right-radius: 4px; +} + +table.info_table > tbody > tr > td:last-child { + border-right: 1px solid #e2e2e2; +} + +table.info_table > tbody > tr > td > img, +table.info_table > thead > tr > th > img, +table.info_table > tbody > tr > td > div > a > img, +table.info_table > tbody > tr > td > span > img, +table.info_table > tbody > tr > td > span > a > img, +table.info_table > tbody > tr > td > a > img, +table.info_table > tbody > tr > td > form > a > img { + vertical-align: middle; +} + +table.info_table > tbody > tr:hover { + background-color: #eee !important; +} + +.info_table.profile_list > thead > tr > th > a.tip { + padding: 0px; +} + +/* This class is for the icons of actions and operations in the tables. */ +.action_buttons a[href] img, +.action_buttons input[type="image"], +.action_button_img { + border-radius: 4px; + border: 1px solid #dcdcdc !important; + padding: 1px; + box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); + max-width: 21px; + background-color: transparent !important; /*BORRAR*/ +} + +/* This class is for only one icon to be a button type. */ +.action_button_img { + cursor: pointer; +} + +.action_buttons a, +.action_buttons input[type="image"] { + margin-right: 5px; +} + +.action_buttons a:last-child, +.action_buttons input[type="image"]:last-child { + margin-right: 0px; +} + +.action_buttons a:hover { + background-color: #fff; + display: inline-block; + border-radius: 4px; +} + +.action_buttons input[type="image"]:hover { + background-color: #fff !important; +} + +/* Tables to upload files */ +#table_filemanager tr:first-child th span { + font-weight: bold; +} + +.file_table_buttons { + text-align: right; + margin-bottom: 10px; +} + +.file_table_buttons a img { + border: 1px solid #e2e2e2; + padding: 5px; + border-radius: 4px; + margin-right: 10px; + box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); +} + +#file_table_modal { + display: flex; + justify-content: space-between; + margin-bottom: 40px; +} + +#file_table_modal .create_folder, +#file_table_modal .create_text_file, +#file_table_modal .upload_file { + width: 33%; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + margin-right: 2px; + background-color: #e6e6e6; +} + +.file_table_buttons a:last-child img, +#file_table_modal .upload_file { + margin-right: 0px !important; +} + +#file_table_modal li a { + display: block; + padding: 5px; +} + +#file_table_modal li img, +#file_table_modal li span { + vertical-align: middle; +} + +#file_table_modal li img { + margin-right: 10px; +} + +#create_folder, +#create_text_file, +#upload_file { + margin-bottom: 30px; +} + +#create_folder input#text-dirname, +#create_text_file input#text-name_file { + width: 100%; + margin-right: 5px; + box-sizing: border-box; + margin-bottom: 10px; +} + +#upload_file input#file-file { + width: 70%; +} + +#create_folder input#submit-crt, +#create_text_file input#submit-create, +#upload_file input#submit-go { + float: right; +} + +#upload_file input#submit-go { + margin-top: 10px; +} + +.file_table_modal_active { + background-color: #fff !important; + border: 1px solid #e6e6e6; + border-bottom: none; +} + +/* Inventory table */ +.inventory_table_buttons { + text-align: right; + margin-bottom: 10px; +} + +.inventory_table_buttons a { + font-weight: bolder; + display: inline-block; + border: 1px solid #e2e2e2; + padding: 8px; + border-radius: 4px; + box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); +} + +.inventory_table_buttons a img, +.inventory_table_buttons a span { + vertical-align: middle; +} + +.inventory_table_buttons a img { + padding-left: 10px; +} + +.inventory_tables thead th span:first-child { + float: left; + font-weight: bold; +} + +.inventory_tables thead th span { + font-size: 8.6pt; +} + +.inventory_tables tbody > tr:first-child { + font-weight: bold; +} + +/* Tag view */ +table.info_table.agent_info_table { + margin-bottom: 20px; +} +table.agent_info_table tr { + background-color: #fff !important; +} + +table.agent_info_table > tbody > tr > td { + border-bottom: none; +} + +table.agent_info_table > tbody > tr:last-child > td { + border-bottom: 1px solid #e2e2e2; +} + +table.agent_info_table thead > tr:first-child th { + background-color: #f5f5f5; +} + +table.agent_info_table thead > tr:first-child th span, +table.agent_info_table thead > tr:first-child th { + font-weight: bold; + font-size: 8.6pt; +} + +table.info_table.agent_info_table td { + padding-left: 20px; + padding-right: 20px; +} + +table.info_table.agent_info_table table#agent_table { + padding-top: 15px; +} + +table.info_table.agent_info_table table#module_table { + padding-top: 10px; + padding-bottom: 15px; +} + +table.info_table.agent_info_table table.info_table { + margin-bottom: 0; +} + +.agent_info_table_opened { + background-color: #82b92e !important; + color: #fff !important; + border-color: #82b92e !important; +} + +.agent_info_table_closed { + background-color: #fff !important; + color: #000 !important; + border-radius: 4px; +} + +/* Tag view */ +table.info_table.policy_table tr { + background-color: #fff !important; +} + +table.info_table.policy_sub_table thead > tr:first-child th { + background-color: #f5f5f5; +} + +table.info_table.policy_sub_table { + padding: 20px 15px; + margin-bottom: 0; +} + +/* Arrows to sort the tables. */ +.sort_arrow { + display: inline-grid; + vertical-align: middle; +} +.sort_arrow a { + padding: 0 0 0 5px !important; +} + +/* + * --------------------------------------------------------------------- + * - PAGINATION + * --------------------------------------------------------------------- + */ +.pagination { + display: flex; + justify-content: space-between; + align-items: flex-end; + margin-bottom: 10px; + margin-top: 15px; +} + +.pagination .page_number { + border: 1px solid #cacaca; + border-right: 0px; + text-align: center; +} + +.pagination .page_number a { + padding: 5px; + min-width: 12px; + display: block; +} + +.pagination .page_number:hover, +.pagination .pagination-arrows:hover { + background-color: #e2e2e2; +} + +.pagination .total_number > *:first-child { + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; +} + +.pagination .total_number > *:last-child { + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-right: 1px solid #cacaca !important; +} + +.pagination .page_number_active { + font-weight: bold; + background-color: #82b92e; + color: #fff; + border-color: #82b92e; +} + +.pagination .page_number_active a { + color: #fff; +} + +.pagination .total_pages { +} + +.pagination .total_number { + display: flex; + justify-content: flex-end; +} + +.pagination a { + margin: 0 !important; +} + +.pagination .pagination-arrows { + border: 1px solid #cacaca; + border-right: 0px; +} + +.pagination-bottom { + margin-bottom: 15px; + margin-top: 0px; + align-items: flex-start; +} diff --git a/pandora_console/index.php b/pandora_console/index.php index 78f4c76571..3c33a1a1e0 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1254,6 +1254,11 @@ require 'include/php_to_js_values.php';