diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index a49cc294bf..6433324056 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -528,23 +528,6 @@ ServerTokens Prod EO_CONFIG_F -# Add ws proxy options to apache. -cat >> /etc/httpd/conf.modules.d/00-proxy.conf << 'EO_HTTPD_MOD' -LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so - -EO_HTTPD_MOD - -cat >> /etc/httpd/conf.d/wstunnel.conf << 'EO_HTTPD_WSTUNNEL' -ProxyRequests Off - - Require all granted - - -ProxyPass /ws ws://127.0.0.1:8080 -ProxyPassReverse /ws ws://127.0.0.1:8080 - -EO_HTTPD_WSTUNNEL - # Temporal quitar htaccess sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/images/.htaccess sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/attachment/.htaccess @@ -691,16 +674,6 @@ EO_LRA chmod 0644 /etc/logrotate.d/pandora_server chmod 0644 /etc/logrotate.d/pandora_agent -# Add websocket engine start script. -mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/ -chmod +x /etc/init.d/pandora_websocket_engine - -# Start Websocket engine -/etc/init.d/pandora_websocket_engine start &>> $LOGFILE - -# Configure websocket to be started at start. -systemctl enable pandora_websocket_engine &>> $LOGFILE - # Enable pandora ha service systemctl enable pandora_server --now &>> $LOGFILE execute_cmd "systemctl start pandora_server" "Starting Pandora FMS Server" diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index 9917f99631..e6af38ecde 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -639,23 +639,6 @@ ServerTokens Prod EO_CONFIG_F -# Add ws proxy options to apache. -cat >> /etc/httpd/conf.modules.d/00-proxy.conf << 'EO_HTTPD_MOD' -LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so - -EO_HTTPD_MOD - -cat >> /etc/httpd/conf.d/wstunnel.conf << 'EO_HTTPD_WSTUNNEL' -ProxyRequests Off - - Require all granted - - -ProxyPass /ws ws://127.0.0.1:8080 -ProxyPassReverse /ws ws://127.0.0.1:8080 - -EO_HTTPD_WSTUNNEL - # Temporal quitar htaccess sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/images/.htaccess sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/attachment/.htaccess @@ -813,16 +796,6 @@ EO_LRA chmod 0644 /etc/logrotate.d/pandora_server chmod 0644 /etc/logrotate.d/pandora_agent -# Add websocket engine start script. -mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/ &>> "$LOGFILE" -chmod +x /etc/init.d/pandora_websocket_engine &>> "$LOGFILE" - -# Start Websocket engine -/etc/init.d/pandora_websocket_engine start &>> "$LOGFILE" - -# Configure websocket to be started at start. -systemctl enable pandora_websocket_engine &>> "$LOGFILE" - # Enable pandora ha service systemctl enable pandora_server --now &>> "$LOGFILE" execute_cmd "/etc/init.d/pandora_server start" "Starting Pandora FMS Server" diff --git a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh index 4f541b4125..64beb74eb2 100644 --- a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh +++ b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh @@ -601,6 +601,7 @@ EOF_PARAM a2enmod ssl &>> "$LOGFILE" a2enmod headers &>> "$LOGFILE" +a2enmod rewrite &>> "$LOGFILE" a2enconf ssl-params &>> "$LOGFILE" a2ensite default-ssl &>> "$LOGFILE" a2enconf ssl-params &>> "$LOGFILE" @@ -648,17 +649,6 @@ ServerTokens Prod EO_CONFIG_F -#Enable quickshell proxy -cat >> /etc/apache2/mods-enabled/00-proxy.conf << 'EO_HTTPD_WSTUNNEL' -ProxyRequests Off - - Require all granted - - -ProxyPass /ws ws://127.0.0.1:8080 -ProxyPassReverse /ws ws://127.0.0.1:8080 -EO_HTTPD_WSTUNNEL - # Fixing console permissions chmod 600 $PANDORA_CONSOLE/include/config.php &>> "$LOGFILE" chown -R www-data:www-data $PANDORA_CONSOLE &>> "$LOGFILE" @@ -813,16 +803,6 @@ EO_LRA chmod 0644 /etc/logrotate.d/pandora_server chmod 0644 /etc/logrotate.d/pandora_agent -# Add websocket engine start script. -mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/ &>> "$LOGFILE" -chmod +x /etc/init.d/pandora_websocket_engine &>> "$LOGFILE" - -# Start Websocket engine -/etc/init.d/pandora_websocket_engine start &>> "$LOGFILE" - -# Configure websocket to be started at start. -systemctl enable pandora_websocket_engine &>> "$LOGFILE" - # Enable pandora ha service execute_cmd "/etc/init.d/pandora_server start" "Starting Pandora FMS Server" systemctl enable pandora_server &>> "$LOGFILE" diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index 4f49fb8cf5..8cb980cff1 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -310,10 +310,6 @@ module_plugin pandora_df #module_description Postcondition test module #module_end -# This plugin runs several security checks in a Linux system - -#module_plugin pandora_security_check - # Extraction module example #module_begin #module_name Collector diff --git a/pandora_agents/plugins/windows/pandora_security_win/src/pandora_security_win.py b/pandora_agents/plugins/windows/pandora_security_win/src/pandora_security_win.py index d9ac15f978..0fc119bb03 100644 --- a/pandora_agents/plugins/windows/pandora_security_win/src/pandora_security_win.py +++ b/pandora_agents/plugins/windows/pandora_security_win/src/pandora_security_win.py @@ -1,6 +1,9 @@ +# -*- coding: utf-8 -*- + import wmi, sys, winreg, os, subprocess, json, re from datetime import datetime, timedelta - +import argparse +import configparser ## Define modules modules=[] @@ -333,22 +336,19 @@ def check_password_enforcement(): print("Failed to check password enforcement for users.", file=sys.stderr) -def check_login_audit_policy(): +def check_login_audit_policy(auditpol_logon_category, auditpol_logon_success_conf, auditpol_logon_noaudit_conf): try: # Run the auditpol command to check the audit policy for Logon/Logoff - cmd_command = "auditpol /get /subcategory:Logon" - result = subprocess.run(cmd_command, shell=True, capture_output=True, text=True, check=True) - last_line = result.stdout.strip().split('\n')[-1] + cmd_command = f'auditpol /get /subcategory:"{auditpol_logon_category}"' + result = subprocess.run(cmd_command, shell=True, capture_output=True, text=False, check=True) + stdout = result.stdout.decode('cp850', errors='replace') + last_line = stdout.strip().split('\n')[-1] cleaned_line = re.sub(' +', ' ', last_line) # Interpret the result - if "Success and Failure" in result.stdout: + if auditpol_logon_success_conf in stdout: result = 1 - elif "Aciertos y errores" in result.stdout: - result = 1 - elif "No Auditing" in result.stdout: - result = 0 - elif "Sin auditoría" in result.stdout: + elif auditpol_logon_noaudit_conf in stdout: result = 0 else: print("Unable to determine audit policy for Logon/Logoff events.", file=sys.stderr) @@ -366,14 +366,38 @@ def check_login_audit_policy(): print("Failed to check audit policy using auditpol command.", file=sys.stderr) return +def parse_parameter(config=None, key="", default=""): + try: + return config.get("CONF", key) + except Exception as e: + return default if __name__ == "__main__": + + # Parse arguments + parser = argparse.ArgumentParser(description= "", formatter_class=argparse.RawTextHelpFormatter) + parser.add_argument('--conf', help='Path to configuration file', metavar='', required=False) + args = parser.parse_args() + config = configparser.ConfigParser() + + if(args.conf): + try: + with open(args.conf, 'r', encoding='utf-8') as f: + content = f.read() + config.read_string('[CONF]\n' + content) + except Exception as e: + print("Error while reading configuration file, using default values: "+str(e), file=sys.stderr) + + auditpol_logon_category = parse_parameter(config, "auditpol_logon_category", "Logon") + auditpol_logon_success_conf = parse_parameter(config, "auditpol_logon_success_conf", "Success and Failure") + auditpol_logon_noaudit_conf = parse_parameter(config, "auditpol_logon_noaudit_conf", "No Auditing") + check_antivirus_status() check_locksreen_enables() get_windows_update_info() is_firewall_enabled() check_password_enforcement() - check_login_audit_policy() + check_login_audit_policy(auditpol_logon_category, auditpol_logon_success_conf, auditpol_logon_noaudit_conf) for module in modules: print_module(module, True) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 49a0183938..85fd264914 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.776-240404 +Version: 7.0NG.776-240410 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 8bb7b260a7..a1390d619c 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.776-240404" +pandora_version="7.0NG.776-240410" 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/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 882be1bda8..20714a13b7 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -270,6 +270,9 @@ module_plugin pandora_netusage # Service autodiscovery plugin module_plugin autodiscover --default +# This plugin runs several security checks in a Linux system +# module_plugin perl /usr/share/pandora_agent/plugins/pandora_security_check --conf /usr/share/pandora_agent/plugins/pandora_security_check.conf + # Plugin for inventory on the agent. # module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 5d3739cf0a..be678985b8 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.776'; -use constant AGENT_BUILD => '240404'; +use constant AGENT_BUILD => '240410'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index b0ba0ab82d..62bc889628 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240404 +%define release 240410 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index a367cc3aad..35bb00dcd9 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240404 +%define release 240410 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index abf4fb7654..63702a385b 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240404 +%define release 240410 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index a4079517e7..027bf514f6 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240404 +%define release 240410 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index f16c6773a5..1ea84212af 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240404 +%define release 240410 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 6393c44e2f..9ee0aed4d7 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240404" +PI_BUILD="240410" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/unix/plugins/pandora_security_check b/pandora_agents/unix/plugins/pandora_security_check index 0ad845639b..53022feba7 100644 --- a/pandora_agents/unix/plugins/pandora_security_check +++ b/pandora_agents/unix/plugins/pandora_security_check @@ -297,6 +297,10 @@ sub parse_configuration { $line =~ s/^\s+//; $line =~ s/\s+$//; + if($line =~ /^$/) { + next; + } + if ($line =~ /^\[($b_ports|$b_files|$b_passwords)\]$/) { $configuration_block = $1; } @@ -537,7 +541,6 @@ if ($check_files) { if ($can_check_files) { # Check each file integrity - my @errored_files; my @no_integrity_files; # Create unique check files list @@ -556,8 +559,6 @@ if ($check_files) { push @no_integrity_files, $file; } $integrity{$file_key} = $file_md5; - } else { - push @errored_files, $file; } } @@ -571,11 +572,6 @@ if ($check_files) { $value = 0; $desc = "Changed files found:\n" . join("\n", @no_integrity_files); } - - if (@errored_files) { - $value = 0; - $desc .= "\nUnable to check integrity of some files:\n" . join("\n", @errored_files); - } } print_xml_module('Files check status', 'generic_proc', $desc, $value); @@ -596,10 +592,15 @@ if ($check_passwords) { open my $shadow_fh, '<', $shadow_file; while (my $line = <$shadow_fh>) { chomp $line; + + if($line =~ /^$/) { + next; + } + my ($username, $password_hash, @rest) = split /:/, $line; # Skip users with no password hash - if ($password_hash ne "*" && $password_hash ne "!!" && $password_hash ne "!locked") { + if ($password_hash ne "*" && $password_hash ne "!!" && $password_hash ne "!locked" && $password_hash ne "!*") { my $salt = substr($password_hash, 0, rindex($password_hash, '$') + 1); my $user_hash = crypt($username, $salt); if ($user_hash eq $password_hash) { diff --git a/pandora_agents/unix/plugins/pandora_security_check.conf b/pandora_agents/unix/plugins/pandora_security_check.conf new file mode 100644 index 0000000000..c48d94af4d --- /dev/null +++ b/pandora_agents/unix/plugins/pandora_security_check.conf @@ -0,0 +1,22 @@ +[PORTS] +22 +80 +443 +41121 +8080 + +[FILES] +/etc/httpd/httpd.conf +/etc/my.cnf +/etc/sudoers +/etc/passwd +/etc/hosts + +[PASSWORDS] +pandora +PANDORA +P4nd0r4 +password +root +linux +admin diff --git a/pandora_agents/win32/bin/util/pandora_security_win.conf b/pandora_agents/win32/bin/util/pandora_security_win.conf new file mode 100644 index 0000000000..7986220bb4 --- /dev/null +++ b/pandora_agents/win32/bin/util/pandora_security_win.conf @@ -0,0 +1,8 @@ +auditpol_logon_category = Logon +#auditpol_logon_category = Inicio de sesión + +auditpol_logon_success_conf = Success and Failure +#auditpol_logon_success_conf = Aciertos y errores + +auditpol_logon_noaudit_conf = No Auditing +#auditpol_logon_noaudit_conf = Sin auditoría \ No newline at end of file diff --git a/pandora_agents/win32/bin/util/pandora_security_win.exe b/pandora_agents/win32/bin/util/pandora_security_win.exe index a21f40faf6..6be32bc37c 100755 --- a/pandora_agents/win32/bin/util/pandora_security_win.exe +++ b/pandora_agents/win32/bin/util/pandora_security_win.exe @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c58891fbd16bf80f288e0ff4751801aa02dbf4e6c914625b4d49a364c7e0b511 -size 7829249 +oid sha256:293dc77d39c303793a73bf83a2698c5886331f24b8abed4a40566474a64e3f60 +size 7735667 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 3c78f290ea..cd3d838ffd 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240404} +{240410} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index c3675292b4..717d7a0f37 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.776 Build 240404") +#define PANDORA_VERSION ("7.0NG.776 Build 240410") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 374f404f59..170e2b1bc1 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.776(Build 240404))" + VALUE "ProductVersion", "(7.0NG.776(Build 240410))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d651c78e45..52e9d061aa 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.776-240404 +Version: 7.0NG.776-240410 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 5e4f8f1baa..4cac08383a 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.776-240404" +pandora_version="7.0NG.776-240410" package_pear=0 package_pandora=1 diff --git a/pandora_console/api/documentation/swagger-ui-bundle.js b/pandora_console/api/documentation/swagger-ui-bundle.js index 69d6da74a6..c7d16e44f4 100644 --- a/pandora_console/api/documentation/swagger-ui-bundle.js +++ b/pandora_console/api/documentation/swagger-ui-bundle.js @@ -4675,8 +4675,9 @@ return ( "function" == typeof _ && "function" == typeof Symbol && - "symbol" == typeof _("foo") && - "symbol" == typeof Symbol("bar") && w() + "symbol" == typeof _("foo") && + "symbol" == typeof Symbol("bar") && + w() ); }; }, @@ -13386,7 +13387,9 @@ null != s && !w(s) ) || - j.test(s) || !x.test(s) || (null != i && s in Object(i)) + j.test(s) || + !x.test(s) || + (null != i && s in Object(i)) ); }; }, @@ -20230,7 +20233,8 @@ var i = s.memoizedState; if ( (null === i && - null !== (s = s.alternate) && (i = s.memoizedState), + null !== (s = s.alternate) && + (i = s.memoizedState), null !== i) ) return i.dehydrated; @@ -21697,7 +21701,8 @@ null !== ae && ((Z = ae), null !== X && - null != (ae = Kb(ee, X)) && U.push(tf(ee, ae, Z))), + null != (ae = Kb(ee, X)) && + U.push(tf(ee, ae, Z))), Y) ) break; @@ -21894,9 +21899,9 @@ } })(s, u)) && 0 < (_ = oe(_, "onBeforeInput")).length && - ((w = new fr("onBeforeInput", "beforeinput", null, u, w)), - j.push({ event: w, listeners: _ }), - (w.data = ce)); + ((w = new fr("onBeforeInput", "beforeinput", null, u, w)), + j.push({ event: w, listeners: _ }), + (w.data = ce)); } se(j, i); }); @@ -22535,8 +22540,8 @@ var U = s.alternate; null !== U && (P = (U = U.updateQueue).lastBaseUpdate) !== j && - (null === P ? (U.firstBaseUpdate = $) : (P.next = $), - (U.lastBaseUpdate = B)); + (null === P ? (U.firstBaseUpdate = $) : (P.next = $), + (U.lastBaseUpdate = B)); } if (null !== x) { var Y = w.baseState; @@ -22675,7 +22680,8 @@ ? s.shouldComponentUpdate(_, x, j) : !i.prototype || !i.prototype.isPureReactComponent || - !Ie(u, _) || !Ie(w, x); + !Ie(u, _) || + !Ie(w, x); } function ph(s, i, u) { var _ = !1, @@ -25167,11 +25173,11 @@ (s.sibling = null), 5 === s.tag && null !== (i = s.stateNode) && - (delete i[gn], - delete i[yn], - delete i[vn], - delete i[_n], - delete i[wn]), + (delete i[gn], + delete i[yn], + delete i[vn], + delete i[_n], + delete i[wn]), (s.stateNode = null), (s.return = null), (s.dependencies = null), @@ -25282,7 +25288,8 @@ case 15: if ( !Po && - null !== (_ = u.updateQueue) && null !== (_ = _.lastEffect) + null !== (_ = u.updateQueue) && + null !== (_ = _.lastEffect) ) { w = _ = _.next; do { @@ -26026,7 +26033,8 @@ return !0; })(w) && (2 === (i = Jk(s, _)) && - 0 !== (x = xc(s)) && ((_ = x), (i = Ok(s, x))), + 0 !== (x = xc(s)) && + ((_ = x), (i = Ok(s, x))), 1 === i)) ) throw ((u = Go), Lk(s, 0), Dk(s, _), Ek(s, yt()), u); @@ -28469,7 +28477,8 @@ return ( void 0 !== this._readableState && void 0 !== this._writableState && - this._readableState.destroyed && this._writableState.destroyed + this._readableState.destroyed && + this._writableState.destroyed ); }, set: function set(s) { @@ -29506,7 +29515,8 @@ return ( !!$.call(this, s) || (this === Writable && - s && s._writableState instanceof WritableState) + s && + s._writableState instanceof WritableState) ); } })) @@ -33989,7 +33999,8 @@ j = s; if ( "object" == typeof s && - (j = s[(_ = Object.keys(s)[0])]) && j._elem + (j = s[(_ = Object.keys(s)[0])]) && + j._elem ) return ( (j._elem.name = _), @@ -46937,10 +46948,11 @@ !!Jl(s) || (!!s && "object" == typeof s && - !_isString(s) && - (0 === s.length || - (s.length > 0 && - s.hasOwnProperty(0) && s.hasOwnProperty(s.length - 1)))) + !_isString(s) && + (0 === s.length || + (s.length > 0 && + s.hasOwnProperty(0) && + s.hasOwnProperty(s.length - 1)))) ); }); var sc = "undefined" != typeof Symbol ? Symbol.iterator : "@@iterator"; @@ -48536,10 +48548,10 @@ ? !(!s || "object" != typeof s || "string" != typeof s.uri) : ("undefined" != typeof File && s instanceof File) || ("undefined" != typeof Blob && s instanceof Blob) || - !!ArrayBuffer.isView(s) || - (null !== s && - "object" == typeof s && - "function" == typeof s.pipe) + !!ArrayBuffer.isView(s) || + (null !== s && + "object" == typeof s && + "function" == typeof s.pipe) ); } function isArrayOfFile(s, i) { @@ -49050,7 +49062,8 @@ "object" == typeof i && null !== i && "primitive" in i && - "function" == typeof i.primitive && i.primitive() === s, + "function" == typeof i.primitive && + i.primitive() === s, hasClass = (s, i) => "object" == typeof i && null !== i && @@ -58899,13 +58912,12 @@ const parameterEquals = (i, u) => !!s.isParameterElement(i) && !!s.isParameterElement(u) && - !!s.isStringElement(i.name) && - !!s.isStringElement(i.in) && - !!s.isStringElement(u.name) && - !!s.isStringElement(u.in) && - serializers_value(i.name) === - serializers_value(u.name) && - serializers_value(i.in) === serializers_value(u.in), + !!s.isStringElement(i.name) && + !!s.isStringElement(i.in) && + !!s.isStringElement(u.name) && + !!s.isStringElement(u.in) && + serializers_value(i.name) === serializers_value(u.name) && + serializers_value(i.in) === serializers_value(u.in), i = []; return { visitor: { @@ -62689,20 +62701,18 @@ He.createElement( "div", { className: "modal-ux-content" }, - j - .valueSeq() - .map((j, B) => - He.createElement(P, { - key: B, - AST: x, - definitions: j, - getComponent: u, - errSelectors: _, - authSelectors: s, - authActions: i, - specSelectors: w - }) - ) + j.valueSeq().map((j, B) => + He.createElement(P, { + key: B, + AST: x, + definitions: j, + getComponent: u, + errSelectors: _, + authSelectors: s, + authActions: i, + specSelectors: w + }) + ) ) ) ) @@ -65124,15 +65134,13 @@ He.createElement( "tbody", null, - s - .entrySeq() - .map(([s, i]) => - He.createElement(u, { - key: `${s}-${i}`, - xKey: s, - xVal: i - }) - ) + s.entrySeq().map(([s, i]) => + He.createElement(u, { + key: `${s}-${i}`, + xKey: s, + xVal: i + }) + ) ) ) ) @@ -65560,15 +65568,13 @@ He.createElement(_e, { source: _.get("description") }) ), ie && le.size - ? le - .entrySeq() - .map(([s, i]) => - He.createElement(de, { - key: `${s}-${i}`, - xKey: s, - xVal: i - }) - ) + ? le.entrySeq().map(([s, i]) => + He.createElement(de, { + key: `${s}-${i}`, + xKey: s, + xVal: i + }) + ) : null, ae && _.get("content") ? He.createElement( @@ -66472,26 +66478,22 @@ ")" ), Z && et.size - ? et - .entrySeq() - .map(([s, i]) => - He.createElement(de, { - key: `${s}-${i}`, - xKey: s, - xVal: i - }) - ) + ? et.entrySeq().map(([s, i]) => + He.createElement(de, { + key: `${s}-${i}`, + xKey: s, + xVal: i + }) + ) : null, X && tt.size - ? tt - .entrySeq() - .map(([s, i]) => - He.createElement(de, { - key: `${s}-${i}`, - xKey: s, - xVal: i - }) - ) + ? tt.entrySeq().map(([s, i]) => + He.createElement(de, { + key: `${s}-${i}`, + xKey: s, + xVal: i + }) + ) : null ), He.createElement( @@ -68903,16 +68905,14 @@ He.createElement("span", { className: "brace-close" }, "}") ), ye.size - ? ye - .entrySeq() - .map(([s, i]) => - He.createElement(Re, { - key: `${s}-${i}`, - propKey: s, - propVal: i, - propClass: "property" - }) - ) + ? ye.entrySeq().map(([s, i]) => + He.createElement(Re, { + key: `${s}-${i}`, + propKey: s, + propVal: i, + propClass: "property" + }) + ) : null ); } @@ -69093,28 +69093,24 @@ ")" ), ae.size - ? ae - .entrySeq() - .map(([s, i]) => - He.createElement(de, { - key: `${s}-${i}`, - propKey: s, - propVal: i, - propClass: eI - }) - ) + ? ae.entrySeq().map(([s, i]) => + He.createElement(de, { + key: `${s}-${i}`, + propKey: s, + propVal: i, + propClass: eI + }) + ) : null, P && ee.size - ? ee - .entrySeq() - .map(([s, i]) => - He.createElement(de, { - key: `${s}-${i}`, - propKey: s, - propVal: i, - propClass: eI - }) - ) + ? ee.entrySeq().map(([s, i]) => + He.createElement(de, { + key: `${s}-${i}`, + propKey: s, + propVal: i, + propClass: eI + }) + ) : null, Z ? He.createElement(ce, { source: Z }) : null, ie && @@ -69448,12 +69444,13 @@ return ( !(s >= 55296 && s <= 57343) && !(s >= 64976 && s <= 65007) && - 65535 != (65535 & s) && - 65534 != (65535 & s) && - !(s >= 0 && s <= 8) && - 11 !== s && - !(s >= 14 && s <= 31) && - !(s >= 127 && s <= 159) && !(s > 1114111) + 65535 != (65535 & s) && + 65534 != (65535 & s) && + !(s >= 0 && s <= 8) && + 11 !== s && + !(s >= 14 && s <= 31) && + !(s >= 127 && s <= 159) && + !(s > 1114111) ); } function fromCodePoint(s) { @@ -71014,37 +71011,37 @@ return ( P !== $ + 2 && !(P + 1 >= U || 58 !== s.src.charCodeAt(++P)) && - (_ || - (P++, - s.env.footnotes || (s.env.footnotes = {}), - s.env.footnotes.refs || (s.env.footnotes.refs = {}), - (B = s.src.slice($ + 2, P - 2)), - (s.env.footnotes.refs[":" + B] = -1), - s.tokens.push({ - type: "footnote_reference_open", - label: B, - level: s.level++ - }), - (w = s.bMarks[i]), - (x = s.tShift[i]), - (j = s.parentType), - (s.tShift[i] = s.skipSpaces(P) - P), - (s.bMarks[i] = P), - (s.blkIndent += 4), - (s.parentType = "footnote"), - s.tShift[i] < s.blkIndent && - ((s.tShift[i] += s.blkIndent), - (s.bMarks[i] -= s.blkIndent)), - s.parser.tokenize(s, i, u, !0), - (s.parentType = j), - (s.blkIndent -= 4), - (s.tShift[i] = x), - (s.bMarks[i] = w), - s.tokens.push({ - type: "footnote_reference_close", - level: --s.level - })), - !0) + (_ || + (P++, + s.env.footnotes || (s.env.footnotes = {}), + s.env.footnotes.refs || (s.env.footnotes.refs = {}), + (B = s.src.slice($ + 2, P - 2)), + (s.env.footnotes.refs[":" + B] = -1), + s.tokens.push({ + type: "footnote_reference_open", + label: B, + level: s.level++ + }), + (w = s.bMarks[i]), + (x = s.tShift[i]), + (j = s.parentType), + (s.tShift[i] = s.skipSpaces(P) - P), + (s.bMarks[i] = P), + (s.blkIndent += 4), + (s.parentType = "footnote"), + s.tShift[i] < s.blkIndent && + ((s.tShift[i] += s.blkIndent), + (s.bMarks[i] -= s.blkIndent)), + s.parser.tokenize(s, i, u, !0), + (s.parentType = j), + (s.blkIndent -= 4), + (s.tShift[i] = x), + (s.bMarks[i] = w), + s.tokens.push({ + type: "footnote_reference_close", + level: --s.level + })), + !0) ); }, ["paragraph"] @@ -71107,32 +71104,32 @@ return ( !(j >= u) && !(s.tShift[j] < s.blkIndent) && - !(s.tShift[j] - s.blkIndent > 3) && - !((w = s.bMarks[j] + s.tShift[j]) >= (x = s.eMarks[j])) && - (45 === (_ = s.src.charCodeAt(w)) || 61 === _) && - ((w = s.skipChars(w, _)), - !((w = s.skipSpaces(w)) < x) && - ((w = s.bMarks[i] + s.tShift[i]), - (s.line = j + 1), - s.tokens.push({ - type: "heading_open", - hLevel: 61 === _ ? 1 : 2, - lines: [i, s.line], - level: s.level - }), - s.tokens.push({ - type: "inline", - content: s.src.slice(w, s.eMarks[i]).trim(), - level: s.level + 1, - lines: [i, s.line - 1], - children: [] - }), - s.tokens.push({ - type: "heading_close", - hLevel: 61 === _ ? 1 : 2, - level: s.level - }), - !0)) + !(s.tShift[j] - s.blkIndent > 3) && + !((w = s.bMarks[j] + s.tShift[j]) >= (x = s.eMarks[j])) && + (45 === (_ = s.src.charCodeAt(w)) || 61 === _) && + ((w = s.skipChars(w, _)), + !((w = s.skipSpaces(w)) < x) && + ((w = s.bMarks[i] + s.tShift[i]), + (s.line = j + 1), + s.tokens.push({ + type: "heading_open", + hLevel: 61 === _ ? 1 : 2, + lines: [i, s.line], + level: s.level + }), + s.tokens.push({ + type: "inline", + content: s.src.slice(w, s.eMarks[i]).trim(), + level: s.level + 1, + lines: [i, s.line - 1], + children: [] + }), + s.tokens.push({ + type: "heading_close", + hLevel: 61 === _ ? 1 : 2, + level: s.level + }), + !0)) ); } ], @@ -72276,31 +72273,31 @@ return ( !(P + 2 >= j) && 94 === s.src.charCodeAt(P) && - 91 === s.src.charCodeAt(P + 1) && - !(s.level >= s.options.maxNesting) && - ((u = P + 2), - !((_ = parseLinkLabel(s, P + 1)) < 0) && - (i || - (s.env.footnotes || (s.env.footnotes = {}), - s.env.footnotes.list || (s.env.footnotes.list = []), - (w = s.env.footnotes.list.length), - (s.pos = u), - (s.posMax = _), - s.push({ - type: "footnote_ref", - id: w, - level: s.level - }), - s.linkLevel++, - (x = s.tokens.length), - s.parser.tokenize(s), - (s.env.footnotes.list[w] = { - tokens: s.tokens.splice(x) - }), - s.linkLevel--), - (s.pos = _ + 1), - (s.posMax = j), - !0)) + 91 === s.src.charCodeAt(P + 1) && + !(s.level >= s.options.maxNesting) && + ((u = P + 2), + !((_ = parseLinkLabel(s, P + 1)) < 0) && + (i || + (s.env.footnotes || (s.env.footnotes = {}), + s.env.footnotes.list || (s.env.footnotes.list = []), + (w = s.env.footnotes.list.length), + (s.pos = u), + (s.posMax = _), + s.push({ + type: "footnote_ref", + id: w, + level: s.level + }), + s.linkLevel++, + (x = s.tokens.length), + s.parser.tokenize(s), + (s.env.footnotes.list[w] = { + tokens: s.tokens.splice(x) + }), + s.linkLevel--), + (s.pos = _ + 1), + (s.posMax = j), + !0)) ); } ], @@ -72326,27 +72323,27 @@ return ( _ !== P + 2 && !(_ >= j) && - (_++, - (u = s.src.slice(P + 2, _ - 1)), - void 0 !== s.env.footnotes.refs[":" + u] && - (i || - (s.env.footnotes.list || (s.env.footnotes.list = []), - s.env.footnotes.refs[":" + u] < 0 - ? ((w = s.env.footnotes.list.length), - (s.env.footnotes.list[w] = { label: u, count: 0 }), - (s.env.footnotes.refs[":" + u] = w)) - : (w = s.env.footnotes.refs[":" + u]), - (x = s.env.footnotes.list[w].count), - s.env.footnotes.list[w].count++, - s.push({ - type: "footnote_ref", - id: w, - subId: x, - level: s.level - })), - (s.pos = _), - (s.posMax = j), - !0)) + (_++, + (u = s.src.slice(P + 2, _ - 1)), + void 0 !== s.env.footnotes.refs[":" + u] && + (i || + (s.env.footnotes.list || (s.env.footnotes.list = []), + s.env.footnotes.refs[":" + u] < 0 + ? ((w = s.env.footnotes.list.length), + (s.env.footnotes.list[w] = { label: u, count: 0 }), + (s.env.footnotes.refs[":" + u] = w)) + : (w = s.env.footnotes.refs[":" + u]), + (x = s.env.footnotes.list[w].count), + s.env.footnotes.list[w].count++, + s.push({ + type: "footnote_ref", + id: w, + subId: x, + level: s.level + })), + (s.pos = _), + (s.posMax = j), + !0)) ); } ], @@ -72362,41 +72359,41 @@ return ( 60 === s.src.charCodeAt(P) && !((u = s.src.slice(P)).indexOf(">") < 0) && - ((_ = u.match(NI)) - ? !(II.indexOf(_[1].toLowerCase()) < 0) && - ((j = normalizeLink((x = _[0].slice(1, -1)))), - !!s.parser.validateLink(x) && - (i || - (s.push({ - type: "link_open", - href: j, - level: s.level - }), - s.push({ - type: "text", - content: x, - level: s.level + 1 - }), - s.push({ type: "link_close", level: s.level })), - (s.pos += _[0].length), - !0)) - : !!(w = u.match(PI)) && - ((j = normalizeLink("mailto:" + (x = w[0].slice(1, -1)))), - !!s.parser.validateLink(j) && - (i || - (s.push({ - type: "link_open", - href: j, - level: s.level - }), - s.push({ - type: "text", - content: x, - level: s.level + 1 - }), - s.push({ type: "link_close", level: s.level })), - (s.pos += w[0].length), - !0))) + ((_ = u.match(NI)) + ? !(II.indexOf(_[1].toLowerCase()) < 0) && + ((j = normalizeLink((x = _[0].slice(1, -1)))), + !!s.parser.validateLink(x) && + (i || + (s.push({ + type: "link_open", + href: j, + level: s.level + }), + s.push({ + type: "text", + content: x, + level: s.level + 1 + }), + s.push({ type: "link_close", level: s.level })), + (s.pos += _[0].length), + !0)) + : !!(w = u.match(PI)) && + ((j = normalizeLink("mailto:" + (x = w[0].slice(1, -1)))), + !!s.parser.validateLink(j) && + (i || + (s.push({ + type: "link_open", + href: j, + level: s.level + }), + s.push({ + type: "text", + content: x, + level: s.level + 1 + }), + s.push({ type: "link_close", level: s.level })), + (s.pos += w[0].length), + !0))) ); } ], @@ -72420,15 +72417,15 @@ return i >= 97 && i <= 122; })(u) ) && - !!(_ = s.src.slice(x).match(DI)) && - (i || - s.push({ - type: "htmltag", - content: s.src.slice(x, x + _[0].length), - level: s.level - }), - (s.pos += _[0].length), - !0)) + !!(_ = s.src.slice(x).match(DI)) && + (i || + s.push({ + type: "htmltag", + content: s.src.slice(x, x + _[0].length), + level: s.level + }), + (s.pos += _[0].length), + !0)) ); } ], @@ -73554,7 +73551,7 @@ return ( !(!s || !i) && !this.hasFullProtocolRegex.test(i) && - !this.hasWordCharAfterProtocolRegex.test(s) + !this.hasWordCharAfterProtocolRegex.test(s) ); }), (UrlMatchValidator.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//), @@ -75977,19 +75974,17 @@ ? He.createElement( "select", { "data-variable": s, onChange: $ }, - u - .get("enum") - .map(u => - He.createElement( - "option", - { - selected: u === w(i, s), - key: u, - value: u - }, - u - ) + u.get("enum").map(u => + He.createElement( + "option", + { + selected: u === w(i, s), + key: u, + value: u + }, + u ) + ) ) : He.createElement("input", { type: "text", @@ -80766,7 +80761,8 @@ const { examples: i, example: u, default: _ } = s; return ( !!(Array.isArray(i) && i.length >= 1) || - void 0 !== _ || void 0 !== u + void 0 !== _ || + void 0 !== u ); }, extractExample = s => { diff --git a/pandora_console/api/documentation/swagger-ui-es-bundle-core.js b/pandora_console/api/documentation/swagger-ui-es-bundle-core.js index a0770fdc9b..0897eadaf3 100644 --- a/pandora_console/api/documentation/swagger-ui-es-bundle-core.js +++ b/pandora_console/api/documentation/swagger-ui-es-bundle-core.js @@ -2323,7 +2323,8 @@ var ve = { return ( void 0 !== this._readableState && void 0 !== this._writableState && - this._readableState.destroyed && this._writableState.destroyed + this._readableState.destroyed && + this._writableState.destroyed ); }, set: function set(e) { @@ -3336,7 +3337,8 @@ var ve = { return ( !!c.call(this, e) || (this === Writable && - e && e._writableState instanceof WritableState) + e && + e._writableState instanceof WritableState) ); } })) @@ -10833,20 +10835,18 @@ var we = {}; Ke.default.createElement( "div", { className: "modal-ux-content" }, - s - .valueSeq() - .map((s, i) => - Ke.default.createElement(l, { - key: i, - AST: o, - definitions: s, - getComponent: r, - errSelectors: n, - authSelectors: e, - authActions: t, - specSelectors: a - }) - ) + s.valueSeq().map((s, i) => + Ke.default.createElement(l, { + key: i, + AST: o, + definitions: s, + getComponent: r, + errSelectors: n, + authSelectors: e, + authActions: t, + specSelectors: a + }) + ) ) ) ) @@ -13194,15 +13194,13 @@ var we = {}; Ke.default.createElement( "tbody", null, - e - .entrySeq() - .map(([e, t]) => - Ke.default.createElement(r, { - key: `${e}-${t}`, - xKey: e, - xVal: t - }) - ) + e.entrySeq().map(([e, t]) => + Ke.default.createElement(r, { + key: `${e}-${t}`, + xKey: e, + xVal: t + }) + ) ) ) ) @@ -13627,15 +13625,13 @@ var we = {}; Ke.default.createElement(x, { source: n.get("description") }) ), g && y.size - ? y - .entrySeq() - .map(([e, t]) => - Ke.default.createElement(v, { - key: `${e}-${t}`, - xKey: e, - xVal: t - }) - ) + ? y.entrySeq().map(([e, t]) => + Ke.default.createElement(v, { + key: `${e}-${t}`, + xKey: e, + xVal: t + }) + ) : null, h && n.get("content") ? Ke.default.createElement( @@ -16688,16 +16684,14 @@ var we = {}; Ke.default.createElement("span", { className: "brace-close" }, "}") ), w.size - ? w - .entrySeq() - .map(([e, t]) => - Ke.default.createElement(R, { - key: `${e}-${t}`, - propKey: e, - propVal: t, - propClass: "property" - }) - ) + ? w.entrySeq().map(([e, t]) => + Ke.default.createElement(R, { + key: `${e}-${t}`, + propKey: e, + propVal: t, + propClass: "property" + }) + ) : null ); } @@ -16748,16 +16742,14 @@ var we = {}; { title: _, expanded: n <= a, collapsedContent: "[...]" }, "[", d.size - ? d - .entrySeq() - .map(([e, t]) => - Ke.default.createElement(y, { - key: `${e}-${t}`, - propKey: e, - propVal: t, - propClass: "property" - }) - ) + ? d.entrySeq().map(([e, t]) => + Ke.default.createElement(y, { + key: `${e}-${t}`, + propKey: e, + propVal: t, + propClass: "property" + }) + ) : null, i ? Ke.default.createElement(f, { source: i }) @@ -16874,28 +16866,24 @@ var we = {}; ")" ), h.size - ? h - .entrySeq() - .map(([e, t]) => - Ke.default.createElement(v, { - key: `${e}-${t}`, - propKey: e, - propVal: t, - propClass: ka - }) - ) + ? h.entrySeq().map(([e, t]) => + Ke.default.createElement(v, { + key: `${e}-${t}`, + propKey: e, + propVal: t, + propClass: ka + }) + ) : null, l && f.size - ? f - .entrySeq() - .map(([e, t]) => - Ke.default.createElement(v, { - key: `${e}-${t}`, - propKey: e, - propVal: t, - propClass: ka - }) - ) + ? f.entrySeq().map(([e, t]) => + Ke.default.createElement(v, { + key: `${e}-${t}`, + propKey: e, + propVal: t, + propClass: ka + }) + ) : null, m ? Ke.default.createElement(S, { source: m }) : null, g && @@ -18263,15 +18251,13 @@ var we = {}; ")" ), x && c.size - ? c - .entrySeq() - .map(([e, r]) => - Ke.default.createElement(t, { - key: `${e}-${r}`, - xKey: e, - xVal: r - }) - ) + ? c.entrySeq().map(([e, r]) => + Ke.default.createElement(t, { + key: `${e}-${r}`, + xKey: e, + xVal: r + }) + ) : null ), Ke.default.createElement( @@ -20384,10 +20370,12 @@ var we = {}; Ke.default.createElement( "ul", { - className: (0, - ha.default)("json-schema-2020-12-keyword__children", { - "json-schema-2020-12-keyword__children--collapsed": !c - }) + className: (0, ha.default)( + "json-schema-2020-12-keyword__children", + { + "json-schema-2020-12-keyword__children--collapsed": !c + } + ) }, c && Ke.default.createElement( @@ -20577,10 +20565,12 @@ var we = {}; Ke.default.createElement( "ul", { - className: (0, - ha.default)("json-schema-2020-12-keyword__children", { - "json-schema-2020-12-keyword__children--collapsed": !c - }) + className: (0, ha.default)( + "json-schema-2020-12-keyword__children", + { + "json-schema-2020-12-keyword__children--collapsed": !c + } + ) }, c && Ke.default.createElement( @@ -20661,10 +20651,12 @@ var we = {}; Ke.default.createElement( "ul", { - className: (0, - ha.default)("json-schema-2020-12-keyword__children", { - "json-schema-2020-12-keyword__children--collapsed": !c - }) + className: (0, ha.default)( + "json-schema-2020-12-keyword__children", + { + "json-schema-2020-12-keyword__children--collapsed": !c + } + ) }, c && Ke.default.createElement( @@ -21224,10 +21216,12 @@ var we = {}; "li", { key: e, - className: (0, - ha.default)("json-schema-2020-12-$vocabulary-uri", { - "json-schema-2020-12-$vocabulary-uri--disabled": !t - }) + className: (0, ha.default)( + "json-schema-2020-12-$vocabulary-uri", + { + "json-schema-2020-12-$vocabulary-uri--disabled": !t + } + ) }, Ke.default.createElement( "span", @@ -21422,10 +21416,12 @@ var we = {}; Ke.default.createElement( "ul", { - className: (0, - ha.default)("json-schema-2020-12-keyword__children", { - "json-schema-2020-12-keyword__children--collapsed": !n - }) + className: (0, ha.default)( + "json-schema-2020-12-keyword__children", + { + "json-schema-2020-12-keyword__children--collapsed": !n + } + ) }, n && Ke.default.createElement( @@ -21512,10 +21508,12 @@ var we = {}; Ke.default.createElement( "ul", { - className: (0, - ha.default)("json-schema-2020-12-keyword__children", { - "json-schema-2020-12-keyword__children--collapsed": !a - }) + className: (0, ha.default)( + "json-schema-2020-12-keyword__children", + { + "json-schema-2020-12-keyword__children--collapsed": !a + } + ) }, a && Ke.default.createElement( @@ -21583,10 +21581,12 @@ var we = {}; Ke.default.createElement( "ul", { - className: (0, - ha.default)("json-schema-2020-12-keyword__children", { - "json-schema-2020-12-keyword__children--collapsed": !a - }) + className: (0, ha.default)( + "json-schema-2020-12-keyword__children", + { + "json-schema-2020-12-keyword__children--collapsed": !a + } + ) }, a && Ke.default.createElement( @@ -21654,10 +21654,12 @@ var we = {}; Ke.default.createElement( "ul", { - className: (0, - ha.default)("json-schema-2020-12-keyword__children", { - "json-schema-2020-12-keyword__children--collapsed": !a - }) + className: (0, ha.default)( + "json-schema-2020-12-keyword__children", + { + "json-schema-2020-12-keyword__children--collapsed": !a + } + ) }, a && Ke.default.createElement( @@ -21813,10 +21815,12 @@ var we = {}; Ke.default.createElement( "ul", { - className: (0, - ha.default)("json-schema-2020-12-keyword__children", { - "json-schema-2020-12-keyword__children--collapsed": !n - }) + className: (0, ha.default)( + "json-schema-2020-12-keyword__children", + { + "json-schema-2020-12-keyword__children--collapsed": !n + } + ) }, n && Ke.default.createElement( @@ -21877,10 +21881,12 @@ var we = {}; Ke.default.createElement( "ul", { - className: (0, - ha.default)("json-schema-2020-12-keyword__children", { - "json-schema-2020-12-keyword__children--collapsed": !a - }) + className: (0, ha.default)( + "json-schema-2020-12-keyword__children", + { + "json-schema-2020-12-keyword__children--collapsed": !a + } + ) }, a && Ke.default.createElement( diff --git a/pandora_console/api/documentation/swagger-ui-es-bundle.js b/pandora_console/api/documentation/swagger-ui-es-bundle.js index 53039891ad..d0cbef7112 100644 --- a/pandora_console/api/documentation/swagger-ui-es-bundle.js +++ b/pandora_console/api/documentation/swagger-ui-es-bundle.js @@ -4587,8 +4587,9 @@ return ( "function" == typeof _ && "function" == typeof Symbol && - "symbol" == typeof _("foo") && - "symbol" == typeof Symbol("bar") && w() + "symbol" == typeof _("foo") && + "symbol" == typeof Symbol("bar") && + w() ); }; }, @@ -13205,7 +13206,9 @@ null != s && !w(s) ) || - j.test(s) || !x.test(s) || (null != i && s in Object(i)) + j.test(s) || + !x.test(s) || + (null != i && s in Object(i)) ); }; }, @@ -19958,7 +19961,8 @@ var i = s.memoizedState; if ( (null === i && - null !== (s = s.alternate) && (i = s.memoizedState), + null !== (s = s.alternate) && + (i = s.memoizedState), null !== i) ) return i.dehydrated; @@ -21407,7 +21411,8 @@ null !== ae && ((Z = ae), null !== X && - null != (ae = Kb(ee, X)) && U.push(tf(ee, ae, Z))), + null != (ae = Kb(ee, X)) && + U.push(tf(ee, ae, Z))), Y) ) break; @@ -21603,9 +21608,9 @@ } })(s, u)) && 0 < (_ = oe(_, "onBeforeInput")).length && - ((w = new fr("onBeforeInput", "beforeinput", null, u, w)), - j.push({ event: w, listeners: _ }), - (w.data = ce)); + ((w = new fr("onBeforeInput", "beforeinput", null, u, w)), + j.push({ event: w, listeners: _ }), + (w.data = ce)); } se(j, i); }); @@ -22232,8 +22237,8 @@ var U = s.alternate; null !== U && (P = (U = U.updateQueue).lastBaseUpdate) !== j && - (null === P ? (U.firstBaseUpdate = $) : (P.next = $), - (U.lastBaseUpdate = B)); + (null === P ? (U.firstBaseUpdate = $) : (P.next = $), + (U.lastBaseUpdate = B)); } if (null !== x) { var Y = w.baseState; @@ -22372,7 +22377,8 @@ ? s.shouldComponentUpdate(_, x, j) : !i.prototype || !i.prototype.isPureReactComponent || - !Ie(u, _) || !Ie(w, x); + !Ie(u, _) || + !Ie(w, x); } function ph(s, i, u) { var _ = !1, @@ -24842,11 +24848,11 @@ (s.sibling = null), 5 === s.tag && null !== (i = s.stateNode) && - (delete i[gn], - delete i[yn], - delete i[vn], - delete i[_n], - delete i[wn]), + (delete i[gn], + delete i[yn], + delete i[vn], + delete i[_n], + delete i[wn]), (s.stateNode = null), (s.return = null), (s.dependencies = null), @@ -24957,7 +24963,8 @@ case 15: if ( !Po && - null !== (_ = u.updateQueue) && null !== (_ = _.lastEffect) + null !== (_ = u.updateQueue) && + null !== (_ = _.lastEffect) ) { w = _ = _.next; do { @@ -25693,7 +25700,8 @@ return !0; })(w) && (2 === (i = Jk(s, _)) && - 0 !== (x = xc(s)) && ((_ = x), (i = Ok(s, x))), + 0 !== (x = xc(s)) && + ((_ = x), (i = Ok(s, x))), 1 === i)) ) throw ((u = Go), Lk(s, 0), Dk(s, _), Ek(s, yt()), u); @@ -28109,7 +28117,8 @@ return ( void 0 !== this._readableState && void 0 !== this._writableState && - this._readableState.destroyed && this._writableState.destroyed + this._readableState.destroyed && + this._writableState.destroyed ); }, set: function set(s) { @@ -29135,7 +29144,8 @@ return ( !!$.call(this, s) || (this === Writable && - s && s._writableState instanceof WritableState) + s && + s._writableState instanceof WritableState) ); } })) @@ -33559,7 +33569,8 @@ j = s; if ( "object" == typeof s && - (j = s[(_ = Object.keys(s)[0])]) && j._elem + (j = s[(_ = Object.keys(s)[0])]) && + j._elem ) return ( (j._elem.name = _), @@ -46143,10 +46154,11 @@ !!Jl(s) || (!!s && "object" == typeof s && - !_isString(s) && - (0 === s.length || - (s.length > 0 && - s.hasOwnProperty(0) && s.hasOwnProperty(s.length - 1)))) + !_isString(s) && + (0 === s.length || + (s.length > 0 && + s.hasOwnProperty(0) && + s.hasOwnProperty(s.length - 1)))) ); }); var sc = "undefined" != typeof Symbol ? Symbol.iterator : "@@iterator"; @@ -47695,10 +47707,8 @@ ? !(!s || "object" != typeof s || "string" != typeof s.uri) : ("undefined" != typeof File && s instanceof File) || ("undefined" != typeof Blob && s instanceof Blob) || - !!ArrayBuffer.isView(s) || - (null !== s && - "object" == typeof s && - "function" == typeof s.pipe) + !!ArrayBuffer.isView(s) || + (null !== s && "object" == typeof s && "function" == typeof s.pipe) ); } function isArrayOfFile(s, i) { @@ -48197,7 +48207,8 @@ "object" == typeof i && null !== i && "primitive" in i && - "function" == typeof i.primitive && i.primitive() === s, + "function" == typeof i.primitive && + i.primitive() === s, hasClass = (s, i) => "object" == typeof i && null !== i && @@ -57589,12 +57600,12 @@ const parameterEquals = (i, u) => !!s.isParameterElement(i) && !!s.isParameterElement(u) && - !!s.isStringElement(i.name) && - !!s.isStringElement(i.in) && - !!s.isStringElement(u.name) && - !!s.isStringElement(u.in) && - serializers_value(i.name) === serializers_value(u.name) && - serializers_value(i.in) === serializers_value(u.in), + !!s.isStringElement(i.name) && + !!s.isStringElement(i.in) && + !!s.isStringElement(u.name) && + !!s.isStringElement(u.in) && + serializers_value(i.name) === serializers_value(u.name) && + serializers_value(i.in) === serializers_value(u.in), i = []; return { visitor: { @@ -61244,20 +61255,18 @@ He.createElement( "div", { className: "modal-ux-content" }, - j - .valueSeq() - .map((j, B) => - He.createElement(P, { - key: B, - AST: x, - definitions: j, - getComponent: u, - errSelectors: _, - authSelectors: s, - authActions: i, - specSelectors: w - }) - ) + j.valueSeq().map((j, B) => + He.createElement(P, { + key: B, + AST: x, + definitions: j, + getComponent: u, + errSelectors: _, + authSelectors: s, + authActions: i, + specSelectors: w + }) + ) ) ) ) @@ -64919,26 +64928,22 @@ ")" ), Z && et.size - ? et - .entrySeq() - .map(([s, i]) => - He.createElement(de, { - key: `${s}-${i}`, - xKey: s, - xVal: i - }) - ) + ? et.entrySeq().map(([s, i]) => + He.createElement(de, { + key: `${s}-${i}`, + xKey: s, + xVal: i + }) + ) : null, X && tt.size - ? tt - .entrySeq() - .map(([s, i]) => - He.createElement(de, { - key: `${s}-${i}`, - xKey: s, - xVal: i - }) - ) + ? tt.entrySeq().map(([s, i]) => + He.createElement(de, { + key: `${s}-${i}`, + xKey: s, + xVal: i + }) + ) : null ), He.createElement( @@ -67252,16 +67257,14 @@ He.createElement("span", { className: "brace-close" }, "}") ), ye.size - ? ye - .entrySeq() - .map(([s, i]) => - He.createElement(Re, { - key: `${s}-${i}`, - propKey: s, - propVal: i, - propClass: "property" - }) - ) + ? ye.entrySeq().map(([s, i]) => + He.createElement(Re, { + key: `${s}-${i}`, + propKey: s, + propVal: i, + propClass: "property" + }) + ) : null ); } @@ -67430,28 +67433,24 @@ ")" ), ae.size - ? ae - .entrySeq() - .map(([s, i]) => - He.createElement(de, { - key: `${s}-${i}`, - propKey: s, - propVal: i, - propClass: eI - }) - ) + ? ae.entrySeq().map(([s, i]) => + He.createElement(de, { + key: `${s}-${i}`, + propKey: s, + propVal: i, + propClass: eI + }) + ) : null, P && ee.size - ? ee - .entrySeq() - .map(([s, i]) => - He.createElement(de, { - key: `${s}-${i}`, - propKey: s, - propVal: i, - propClass: eI - }) - ) + ? ee.entrySeq().map(([s, i]) => + He.createElement(de, { + key: `${s}-${i}`, + propKey: s, + propVal: i, + propClass: eI + }) + ) : null, Z ? He.createElement(ce, { source: Z }) : null, ie && @@ -67779,12 +67778,13 @@ return ( !(s >= 55296 && s <= 57343) && !(s >= 64976 && s <= 65007) && - 65535 != (65535 & s) && - 65534 != (65535 & s) && - !(s >= 0 && s <= 8) && - 11 !== s && - !(s >= 14 && s <= 31) && - !(s >= 127 && s <= 159) && !(s > 1114111) + 65535 != (65535 & s) && + 65534 != (65535 & s) && + !(s >= 0 && s <= 8) && + 11 !== s && + !(s >= 14 && s <= 31) && + !(s >= 127 && s <= 159) && + !(s > 1114111) ); } function fromCodePoint(s) { @@ -69288,36 +69288,36 @@ return ( P !== $ + 2 && !(P + 1 >= U || 58 !== s.src.charCodeAt(++P)) && - (_ || - (P++, - s.env.footnotes || (s.env.footnotes = {}), - s.env.footnotes.refs || (s.env.footnotes.refs = {}), - (B = s.src.slice($ + 2, P - 2)), - (s.env.footnotes.refs[":" + B] = -1), - s.tokens.push({ - type: "footnote_reference_open", - label: B, - level: s.level++ - }), - (w = s.bMarks[i]), - (x = s.tShift[i]), - (j = s.parentType), - (s.tShift[i] = s.skipSpaces(P) - P), - (s.bMarks[i] = P), - (s.blkIndent += 4), - (s.parentType = "footnote"), - s.tShift[i] < s.blkIndent && - ((s.tShift[i] += s.blkIndent), (s.bMarks[i] -= s.blkIndent)), - s.parser.tokenize(s, i, u, !0), - (s.parentType = j), - (s.blkIndent -= 4), - (s.tShift[i] = x), - (s.bMarks[i] = w), - s.tokens.push({ - type: "footnote_reference_close", - level: --s.level - })), - !0) + (_ || + (P++, + s.env.footnotes || (s.env.footnotes = {}), + s.env.footnotes.refs || (s.env.footnotes.refs = {}), + (B = s.src.slice($ + 2, P - 2)), + (s.env.footnotes.refs[":" + B] = -1), + s.tokens.push({ + type: "footnote_reference_open", + label: B, + level: s.level++ + }), + (w = s.bMarks[i]), + (x = s.tShift[i]), + (j = s.parentType), + (s.tShift[i] = s.skipSpaces(P) - P), + (s.bMarks[i] = P), + (s.blkIndent += 4), + (s.parentType = "footnote"), + s.tShift[i] < s.blkIndent && + ((s.tShift[i] += s.blkIndent), (s.bMarks[i] -= s.blkIndent)), + s.parser.tokenize(s, i, u, !0), + (s.parentType = j), + (s.blkIndent -= 4), + (s.tShift[i] = x), + (s.bMarks[i] = w), + s.tokens.push({ + type: "footnote_reference_close", + level: --s.level + })), + !0) ); }, ["paragraph"] @@ -69376,32 +69376,32 @@ return ( !(j >= u) && !(s.tShift[j] < s.blkIndent) && - !(s.tShift[j] - s.blkIndent > 3) && - !((w = s.bMarks[j] + s.tShift[j]) >= (x = s.eMarks[j])) && - (45 === (_ = s.src.charCodeAt(w)) || 61 === _) && - ((w = s.skipChars(w, _)), - !((w = s.skipSpaces(w)) < x) && - ((w = s.bMarks[i] + s.tShift[i]), - (s.line = j + 1), - s.tokens.push({ - type: "heading_open", - hLevel: 61 === _ ? 1 : 2, - lines: [i, s.line], - level: s.level - }), - s.tokens.push({ - type: "inline", - content: s.src.slice(w, s.eMarks[i]).trim(), - level: s.level + 1, - lines: [i, s.line - 1], - children: [] - }), - s.tokens.push({ - type: "heading_close", - hLevel: 61 === _ ? 1 : 2, - level: s.level - }), - !0)) + !(s.tShift[j] - s.blkIndent > 3) && + !((w = s.bMarks[j] + s.tShift[j]) >= (x = s.eMarks[j])) && + (45 === (_ = s.src.charCodeAt(w)) || 61 === _) && + ((w = s.skipChars(w, _)), + !((w = s.skipSpaces(w)) < x) && + ((w = s.bMarks[i] + s.tShift[i]), + (s.line = j + 1), + s.tokens.push({ + type: "heading_open", + hLevel: 61 === _ ? 1 : 2, + lines: [i, s.line], + level: s.level + }), + s.tokens.push({ + type: "inline", + content: s.src.slice(w, s.eMarks[i]).trim(), + level: s.level + 1, + lines: [i, s.line - 1], + children: [] + }), + s.tokens.push({ + type: "heading_close", + hLevel: 61 === _ ? 1 : 2, + level: s.level + }), + !0)) ); } ], @@ -70516,27 +70516,27 @@ return ( !(P + 2 >= j) && 94 === s.src.charCodeAt(P) && - 91 === s.src.charCodeAt(P + 1) && - !(s.level >= s.options.maxNesting) && - ((u = P + 2), - !((_ = parseLinkLabel(s, P + 1)) < 0) && - (i || - (s.env.footnotes || (s.env.footnotes = {}), - s.env.footnotes.list || (s.env.footnotes.list = []), - (w = s.env.footnotes.list.length), - (s.pos = u), - (s.posMax = _), - s.push({ type: "footnote_ref", id: w, level: s.level }), - s.linkLevel++, - (x = s.tokens.length), - s.parser.tokenize(s), - (s.env.footnotes.list[w] = { - tokens: s.tokens.splice(x) - }), - s.linkLevel--), - (s.pos = _ + 1), - (s.posMax = j), - !0)) + 91 === s.src.charCodeAt(P + 1) && + !(s.level >= s.options.maxNesting) && + ((u = P + 2), + !((_ = parseLinkLabel(s, P + 1)) < 0) && + (i || + (s.env.footnotes || (s.env.footnotes = {}), + s.env.footnotes.list || (s.env.footnotes.list = []), + (w = s.env.footnotes.list.length), + (s.pos = u), + (s.posMax = _), + s.push({ type: "footnote_ref", id: w, level: s.level }), + s.linkLevel++, + (x = s.tokens.length), + s.parser.tokenize(s), + (s.env.footnotes.list[w] = { + tokens: s.tokens.splice(x) + }), + s.linkLevel--), + (s.pos = _ + 1), + (s.posMax = j), + !0)) ); } ], @@ -70562,27 +70562,27 @@ return ( _ !== P + 2 && !(_ >= j) && - (_++, - (u = s.src.slice(P + 2, _ - 1)), - void 0 !== s.env.footnotes.refs[":" + u] && - (i || - (s.env.footnotes.list || (s.env.footnotes.list = []), - s.env.footnotes.refs[":" + u] < 0 - ? ((w = s.env.footnotes.list.length), - (s.env.footnotes.list[w] = { label: u, count: 0 }), - (s.env.footnotes.refs[":" + u] = w)) - : (w = s.env.footnotes.refs[":" + u]), - (x = s.env.footnotes.list[w].count), - s.env.footnotes.list[w].count++, - s.push({ - type: "footnote_ref", - id: w, - subId: x, - level: s.level - })), - (s.pos = _), - (s.posMax = j), - !0)) + (_++, + (u = s.src.slice(P + 2, _ - 1)), + void 0 !== s.env.footnotes.refs[":" + u] && + (i || + (s.env.footnotes.list || (s.env.footnotes.list = []), + s.env.footnotes.refs[":" + u] < 0 + ? ((w = s.env.footnotes.list.length), + (s.env.footnotes.list[w] = { label: u, count: 0 }), + (s.env.footnotes.refs[":" + u] = w)) + : (w = s.env.footnotes.refs[":" + u]), + (x = s.env.footnotes.list[w].count), + s.env.footnotes.list[w].count++, + s.push({ + type: "footnote_ref", + id: w, + subId: x, + level: s.level + })), + (s.pos = _), + (s.posMax = j), + !0)) ); } ], @@ -70598,25 +70598,25 @@ return ( 60 === s.src.charCodeAt(P) && !((u = s.src.slice(P)).indexOf(">") < 0) && - ((_ = u.match(NI)) - ? !(II.indexOf(_[1].toLowerCase()) < 0) && - ((j = normalizeLink((x = _[0].slice(1, -1)))), - !!s.parser.validateLink(x) && - (i || - (s.push({ type: "link_open", href: j, level: s.level }), - s.push({ type: "text", content: x, level: s.level + 1 }), - s.push({ type: "link_close", level: s.level })), - (s.pos += _[0].length), - !0)) - : !!(w = u.match(PI)) && - ((j = normalizeLink("mailto:" + (x = w[0].slice(1, -1)))), - !!s.parser.validateLink(j) && - (i || - (s.push({ type: "link_open", href: j, level: s.level }), - s.push({ type: "text", content: x, level: s.level + 1 }), - s.push({ type: "link_close", level: s.level })), - (s.pos += w[0].length), - !0))) + ((_ = u.match(NI)) + ? !(II.indexOf(_[1].toLowerCase()) < 0) && + ((j = normalizeLink((x = _[0].slice(1, -1)))), + !!s.parser.validateLink(x) && + (i || + (s.push({ type: "link_open", href: j, level: s.level }), + s.push({ type: "text", content: x, level: s.level + 1 }), + s.push({ type: "link_close", level: s.level })), + (s.pos += _[0].length), + !0)) + : !!(w = u.match(PI)) && + ((j = normalizeLink("mailto:" + (x = w[0].slice(1, -1)))), + !!s.parser.validateLink(j) && + (i || + (s.push({ type: "link_open", href: j, level: s.level }), + s.push({ type: "text", content: x, level: s.level + 1 }), + s.push({ type: "link_close", level: s.level })), + (s.pos += w[0].length), + !0))) ); } ], @@ -70640,15 +70640,15 @@ return i >= 97 && i <= 122; })(u) ) && - !!(_ = s.src.slice(x).match(DI)) && - (i || - s.push({ - type: "htmltag", - content: s.src.slice(x, x + _[0].length), - level: s.level - }), - (s.pos += _[0].length), - !0)) + !!(_ = s.src.slice(x).match(DI)) && + (i || + s.push({ + type: "htmltag", + content: s.src.slice(x, x + _[0].length), + level: s.level + }), + (s.pos += _[0].length), + !0)) ); } ], @@ -71740,7 +71740,7 @@ return ( !(!s || !i) && !this.hasFullProtocolRegex.test(i) && - !this.hasWordCharAfterProtocolRegex.test(s) + !this.hasWordCharAfterProtocolRegex.test(s) ); }), (UrlMatchValidator.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//), @@ -74095,19 +74095,17 @@ ? He.createElement( "select", { "data-variable": s, onChange: $ }, - u - .get("enum") - .map(u => - He.createElement( - "option", - { - selected: u === w(i, s), - key: u, - value: u - }, - u - ) + u.get("enum").map(u => + He.createElement( + "option", + { + selected: u === w(i, s), + key: u, + value: u + }, + u ) + ) ) : He.createElement("input", { type: "text", diff --git a/pandora_console/api/documentation/swagger-ui-standalone-preset.js b/pandora_console/api/documentation/swagger-ui-standalone-preset.js index 5a7d464c49..0c1f324ddd 100644 --- a/pandora_console/api/documentation/swagger-ui-standalone-preset.js +++ b/pandora_console/api/documentation/swagger-ui-standalone-preset.js @@ -6859,7 +6859,9 @@ null != e && !i(e) ) || - a.test(e) || !o.test(e) || (null != t && e in Object(t)) + a.test(e) || + !o.test(e) || + (null != t && e in Object(t)) ); }; }, diff --git a/pandora_console/api/documentation/swagger-ui.js b/pandora_console/api/documentation/swagger-ui.js index c72fd6d40e..ae78269ee4 100644 --- a/pandora_console/api/documentation/swagger-ui.js +++ b/pandora_console/api/documentation/swagger-ui.js @@ -4819,20 +4819,18 @@ k().createElement( "div", { className: "modal-ux-content" }, - o - .valueSeq() - .map((o, c) => - k().createElement(l, { - key: c, - AST: s, - definitions: o, - getComponent: r, - errSelectors: a, - authSelectors: e, - authActions: t, - specSelectors: n - }) - ) + o.valueSeq().map((o, c) => + k().createElement(l, { + key: c, + AST: s, + definitions: o, + getComponent: r, + errSelectors: a, + authSelectors: e, + authActions: t, + specSelectors: n + }) + ) ) ) ) @@ -7258,15 +7256,13 @@ k().createElement( "tbody", null, - e - .entrySeq() - .map(([e, t]) => - k().createElement(r, { - key: `${e}-${t}`, - xKey: e, - xVal: t - }) - ) + e.entrySeq().map(([e, t]) => + k().createElement(r, { + key: `${e}-${t}`, + xKey: e, + xVal: t + }) + ) ) ) ) @@ -7698,15 +7694,13 @@ k().createElement(C, { source: a.get("description") }) ), y && f.size - ? f - .entrySeq() - .map(([e, t]) => - k().createElement(_, { - key: `${e}-${t}`, - xKey: e, - xVal: t - }) - ) + ? f.entrySeq().map(([e, t]) => + k().createElement(_, { + key: `${e}-${t}`, + xKey: e, + xVal: t + }) + ) : null, g && a.get("content") ? k().createElement( @@ -10816,16 +10810,14 @@ k().createElement("span", { className: "brace-close" }, "}") ), w.size - ? w - .entrySeq() - .map(([e, t]) => - k().createElement(j, { - key: `${e}-${t}`, - propKey: e, - propVal: t, - propClass: "property" - }) - ) + ? w.entrySeq().map(([e, t]) => + k().createElement(j, { + key: `${e}-${t}`, + propKey: e, + propVal: t, + propClass: "property" + }) + ) : null ); } @@ -10882,16 +10874,14 @@ { title: E, expanded: a <= n, collapsedContent: "[...]" }, "[", m.size - ? m - .entrySeq() - .map(([e, t]) => - k().createElement(f, { - key: `${e}-${t}`, - propKey: e, - propVal: t, - propClass: "property" - }) - ) + ? m.entrySeq().map(([e, t]) => + k().createElement(f, { + key: `${e}-${t}`, + propKey: e, + propVal: t, + propClass: "property" + }) + ) : null, c ? k().createElement(h, { source: c }) @@ -11008,28 +10998,24 @@ ")" ), g.size - ? g - .entrySeq() - .map(([e, t]) => - k().createElement(_, { - key: `${e}-${t}`, - propKey: e, - propVal: t, - propClass: ln - }) - ) + ? g.entrySeq().map(([e, t]) => + k().createElement(_, { + key: `${e}-${t}`, + propKey: e, + propVal: t, + propClass: ln + }) + ) : null, l && h.size - ? h - .entrySeq() - .map(([e, t]) => - k().createElement(_, { - key: `${e}-${t}`, - propKey: e, - propVal: t, - propClass: ln - }) - ) + ? h.entrySeq().map(([e, t]) => + k().createElement(_, { + key: `${e}-${t}`, + propKey: e, + propVal: t, + propClass: ln + }) + ) : null, d ? k().createElement(S, { source: d }) : null, y && @@ -12452,15 +12438,13 @@ ")" ), C && i.size - ? i - .entrySeq() - .map(([e, r]) => - k().createElement(t, { - key: `${e}-${r}`, - xKey: e, - xVal: r - }) - ) + ? i.entrySeq().map(([e, r]) => + k().createElement(t, { + key: `${e}-${r}`, + xKey: e, + xVal: r + }) + ) : null ), k().createElement( @@ -12703,19 +12687,17 @@ ? k().createElement( "select", { "data-variable": e, onChange: i }, - r - .get("enum") - .map(r => - k().createElement( - "option", - { - selected: r === n(t, e), - key: r, - value: r - }, - r - ) + r.get("enum").map(r => + k().createElement( + "option", + { + selected: r === n(t, e), + key: r, + value: r + }, + r ) + ) ) : k().createElement("input", { type: "text", @@ -17499,7 +17481,8 @@ const { examples: t, example: r, default: a } = e; return ( !!(Array.isArray(t) && t.length >= 1) || - void 0 !== a || void 0 !== r + void 0 !== a || + void 0 !== r ); }, extractExample = e => { diff --git a/pandora_console/extras/mr/69.sql b/pandora_console/extras/mr/69.sql index 2be1a25079..63e3a21b32 100644 --- a/pandora_console/extras/mr/69.sql +++ b/pandora_console/extras/mr/69.sql @@ -7712,4 +7712,38 @@ UPDATE `twelcome_tip` SET url = 'https://pandorafms.com/manual/!current/start?id DELETE FROM tconfig WHERE `token` = 'legacy_database_ha'; +-- Add new columns in tdeployment_hosts +ALTER TABLE `tdeployment_hosts` ADD COLUMN `deploy_method` ENUM('SSH', 'HTTP', 'HTTPS') DEFAULT 'SSH'; +ALTER TABLE `tdeployment_hosts` ADD COLUMN `deploy_port` INT UNSIGNED NOT NULL DEFAULT 22; +ALTER TABLE `tdeployment_hosts` ADD COLUMN `server_port` INT UNSIGNED NOT NULL DEFAULT 41121; +ALTER TABLE `tdeployment_hosts` ADD COLUMN `temp_folder` VARCHAR(500) DEFAULT '/tmp'; + +UPDATE + `tdeployment_hosts`, `tconfig_os` +SET + `tdeployment_hosts`.`deploy_method` = 'HTTP', + `tdeployment_hosts`.`deploy_port` = 5985, + `tdeployment_hosts`.`temp_folder` = 'C:\Widnows\Temp' +WHERE + `tdeployment_hosts`.`id_os` = `tconfig_os`.`id_os` AND `tconfig_os`.`name` = 'Windows' AND `tdeployment_hosts`.`deployed` = 0; + +-- Find the name of the foreign key constraint +SELECT @constraint_name := `constraint_name` +FROM `information_schema`.`key_column_usage` +WHERE `table_name` = 'tdeployment_hosts' AND `column_name` = 'id_os'; + +-- Drop the foreign key constraint using dynamic SQL +SET @drop_fk_query = CONCAT('ALTER TABLE `tdeployment_hosts` DROP FOREIGN KEY ', @constraint_name); +PREPARE stmt FROM @drop_fk_query; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + +-- Drop unused columns in tdeployment_hosts +ALTER TABLE `tdeployment_hosts` DROP COLUMN `id_os`; +ALTER TABLE `tdeployment_hosts` DROP COLUMN `os_version`; +ALTER TABLE `tdeployment_hosts` DROP COLUMN `arch`; + +-- Update all deployment recon tasks port +UPDATE `trecon_task` SET `field4` = 41121 WHERE `type` = 9; + COMMIT; \ No newline at end of file diff --git a/pandora_console/general/first_task/cluster_builder.php b/pandora_console/general/first_task/cluster_builder.php index 4f04d37f71..1d81c59c91 100644 --- a/pandora_console/general/first_task/cluster_builder.php +++ b/pandora_console/general/first_task/cluster_builder.php @@ -41,39 +41,28 @@ ui_print_standard_header( ); ui_require_css_file('first_task'); -?> - true, 'message' => __('There are no clusters defined yet.') ]); -?> -
-
- __('Clusters')]); ?> -
-
-

-

-
'; +$msg = __('A cluster is a group of devices that provide the same service in high availability.').'
'; - echo __('Depending on how they provide that service, we can find two types:').'

'; +$msg .= __('Depending on how they provide that service, we can find two types:').'

'; - echo __('Clusters to balance the service load: these are active - active (A/A) mode clusters. It means that all the nodes (or machines that compose it) are working. They must be working because if one stops working, it will overload the others.').'

'; +$msg .= __('Clusters to balance the service load: these are active - active (A/A) mode clusters. It means that all the nodes (or machines that compose it) are working. They must be working because if one stops working, it will overload the others.').'

'; - echo __('Clusters to guarantee service: these are active - passive (A/P) mode clusters. It means that one of the nodes (or machines that make up the cluster) will be running (primary) and another won\'t (secondary). When the primary goes down, the secondary must take over and give the service instead. Although many of the elements of this cluster are active-passive, it will also have active elements in both of them that indicate that the passive node is "online", so that in the case of a service failure in the master, the active node collects this information.'); - ?> -

- - - -
- -
- - -
-
+$msg .= __('Clusters to guarantee service: these are active - passive (A/P) mode clusters. It means that one of the nodes (or machines that make up the cluster) will be running (primary) and another will not (secondary). When the primary goes down, the secondary must take over and give the service instead. Although many of the elements of this cluster are active-passive, it will also have active elements in both of them that indicate that the passive node is "online", so that in the case of a service failure in the master, the active node collects this information.'); + + + +$button = false; +if (check_acl($config['id_user'], 0, 'AW')) { + $button = " +
+ +
"; +} + +echo ui_print_empty_view( + __('There are no defined clusters'), + $msg, + 'clusters.svg', + $button +); diff --git a/pandora_console/general/first_task/custom_graphs.php b/pandora_console/general/first_task/custom_graphs.php index 7840fc631a..aba2e72ee2 100644 --- a/pandora_console/general/first_task/custom_graphs.php +++ b/pandora_console/general/first_task/custom_graphs.php @@ -14,36 +14,22 @@ global $config; check_login(); ui_require_css_file('first_task'); -?> +$msg = __( + 'Graphs are designed to show the data collected by %s in a temporary scale defined by the user. %s Graphs display data in real time. They are generated every time the operator requires any of them and display the up-to-date state.', + get_product_name(), + get_product_name() +); -
-
- __('Custom Graphs')]); ?> -
-
-

- -

-
- 'wand'], - true - ) - ); - ?> -
-
-
\ No newline at end of file +$msg .= '

'.__("There are two types of graphs: The agent's automated graphs and the graphs the user customizes by using one or more modules to do so."); + + $url_new = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder'; + $button = '
+ +
'; + + echo ui_print_empty_view( + __('Create custom graph'), + $msg, + 'custom-graph.svg', + $button + ); diff --git a/pandora_console/general/first_task/map_builder.php b/pandora_console/general/first_task/map_builder.php index dca6b255ad..854c1c8da7 100755 --- a/pandora_console/general/first_task/map_builder.php +++ b/pandora_console/general/first_task/map_builder.php @@ -34,37 +34,30 @@ check_login(); ui_require_css_file('first_task'); if ($vconsoles_write || $vconsoles_manage) { - ?> + $msg = __( + '%s allows users to create visual maps on which each user is able to create his or her own monitoring map. The new visual console editor is much more practical, although the prior visual console editor had its advantages.', + get_product_name() + ); -
-
- __('Visual Console')]); ?> -
-
-

- -

-
- 'wand'], - true - ) - ); - ?> -
-
-
-
'.__( + "On the new visual console, we have been successful in imitating the sensation and touch of a drawing application like GIMP. We have also simplified the editor by dividing it into several subject-divided tabs named 'Data', 'Preview', 'Wizard', 'List of Elements' and 'Editor'." + ); + + $msg .= '

'.__( + " The items the %s Visual Map was designed to handle are 'static images', 'percentage bars', 'module graphs' and 'simple values'", + get_product_name() + ); + + $url_new = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder'; + $button = '
'; + $button .= html_print_input_hidden('edit_layout', 1); + $button .= ''; + $button .= '
'; + + echo ui_print_empty_view( + __('There are no customized visual consoles'), + $msg, + 'visual-console.svg', + $button + ); } diff --git a/pandora_console/general/first_task/service_list.php b/pandora_console/general/first_task/service_list.php index 783e263999..6d0d798a70 100755 --- a/pandora_console/general/first_task/service_list.php +++ b/pandora_console/general/first_task/service_list.php @@ -31,40 +31,25 @@ global $config; check_login(); ui_require_css_file('first_task'); -?> - -
-
- __('Services'), 'class' => 'w120px']); ?> -
-
-

-

- -

-
- 'wand'], - true - ) - ); - ?> -
-
-
- + + '; + + echo ui_print_empty_view( + __('No services found'), + $msg, + 'services.svg', + $button + ); } diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index f4aefb957a..300d72d9cb 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -558,7 +558,7 @@ if ($broker === false) { $tableAgent->data['caption_interval'][0] = __('Interval').ui_print_help_tip(__('Time that elapses when updating data in the agent. Remote modules have their own interval, but this time is used to find out if an agent stopped responding (unknown state). When twice the time interval defined in an agent goes by, it is considered to be in unknown state (or also if all its remote modules are in unknown state). An agent may be in unknown state if all of its local (software agent-based) modules have a last contact time longer than twice the agent interval, even if it has updated remote modules.'), true); // $tableAgent->rowstyle['interval'] = 'width: 260px'; $tableAgent->rowclass['interval'] = 'w540px'; - $tableAgent->data['interval'][0] = html_print_extended_select_for_time( + $tableAgent->data['interval'][0] = html_print_select_agentmodule_interval( 'intervalo', $intervalo, '', diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index f98567d948..065e2303c2 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1501,6 +1501,11 @@ if ($update_module === true || $create_module === true) { $min = (int) get_parameter('min'); $max = (int) get_parameter('max'); $interval = (int) get_parameter('module_interval', $intervalo); + // Limit module interval to at least 60 secs. + if ($interval > 0) { + $interval = max($interval, 60); + } + $ff_interval = (int) get_parameter('module_ff_interval'); $quiet_module = (int) get_parameter('quiet_module'); $cps_module = (int) get_parameter('cps_module'); diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 51607427fa..279872b744 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -1365,4 +1365,9 @@ html_print_div( } + + $(document).ready(function () { + $('#module_action').select2('open'); + $('#module_action').select2('close'); + }); diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index fda655f314..3b858f23a3 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -705,7 +705,19 @@ if ((int) $moduletype === MODULE_DATA) { // be taken the agent interval (this code is at configurar_agente.php). } else { $interval = ($interval === '') ? '300' : $interval; - $outputExecutionInterval = html_print_extended_select_for_time('module_interval', $interval, '', '', '0', false, true, false, false, $classdisabledBecauseInPolicy, $disabledBecauseInPolicy); + $outputExecutionInterval = html_print_select_agentmodule_interval( + 'module_interval', + $interval, + '', + '', + '0', + false, + true, + false, + false, + $classdisabledBecauseInPolicy, + $disabledBecauseInPolicy + ); } $module_id_policy_module = 0; diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index ef1b66a731..269d92f984 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -723,6 +723,11 @@ if ($is_management_allowed === true ['id_grupo' => $id_group] ); + $result_user_profile = db_process_sql_delete( + 'tusuario_perfil', + ['id_grupo' => $id_group] + ); + if ($result && (!$usedGroup['return'])) { db_process_sql_delete( 'tfavmenu_user', @@ -1128,7 +1133,7 @@ if ($tab == 'tree') { $confirm_message = __('The child groups will be updated to use the parent id of the deleted group').'. '.$confirm_message; } - $table->data[$key][6] .= ''.html_print_image( + $table->data[$key][6] .= ''.html_print_image( 'images/delete.svg', true, [ @@ -1214,7 +1219,6 @@ $tab = 'group_edition'; }); $('#button-filter').on('click', function(event) { - console.log('here'); event.preventDefault(); load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules); @@ -1314,5 +1318,39 @@ $tab = 'group_edition'; }); } + function preprocessDeletion(group_id, delete_URL, confirm_text) { + var parameters = {}; + parameters['page'] = 'include/ajax/group'; + parameters['method'] = 'checkGroupIsLinkedToElement'; + parameters['group_id'] = group_id; + parameters['table_name'] = 'tusuario_perfil'; + parameters['field_name'] = 'id_grupo'; + + $.ajax({ + type: "POST", + url: "", + data: parameters, + success: function(data) { + if (data.result == '1') { + confirmDialog({ + title: '', + message: '', + onAccept: function() { + window.location.assign(delete_URL); + } + }); + } else { + if (!confirm(confirm_text)) { + return false; + } else { + window.location.assign(delete_URL); + } + } + }, + dataType: "json" + }); + + return true; + } diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 4bed6d4f35..8cb5da658b 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -131,6 +131,10 @@ if ($update_agents) { ) { if (get_parameter('interval') != -2) { $values['intervalo'] = get_parameter('interval'); + + if ($values['intervalo'] < 60) { + $values['intervalo'] = 60; + } } } @@ -753,7 +757,7 @@ $table->data[1][0] = html_print_label_input_block( $table->data[1][1] = html_print_label_input_block( __('Interval'), - html_print_extended_select_for_time( + html_print_select_agentmodule_interval( 'interval', -2, '', diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 672c59276c..8e2a450a71 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -865,7 +865,7 @@ $table->data[15][0] = html_print_label_input_block( $table->data[16][0] = html_print_label_input_block( __('Interval'), - html_print_extended_select_for_time( + html_print_select_agentmodule_interval( 'module_interval', 0, '', @@ -2444,6 +2444,10 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' case 'module_interval': if ($value != 0) { $values[$field] = $value; + + if ($values[$field] < 60) { + $values[$field] = 60; + } } break; diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 5160933143..40c42fd557 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -426,14 +426,14 @@ if ($access_console_node === true) { if ((bool) check_acl($config['id_user'], 0, 'PM') === true) { // Setup. - $menu_godmode['gsetup']['text'] = __('Setup'); + $menu_godmode['gsetup']['text'] = __('Settings'); $menu_godmode['gsetup']['sec2'] = 'general'; $menu_godmode['gsetup']['id'] = 'god-setup'; $sub = []; // Options Setup. - $sub['general']['text'] = __('Setup'); + $sub['general']['text'] = __('System Settings'); $sub['general']['id'] = 'Setup'; $sub['general']['type'] = 'direct'; $sub['general']['subtype'] = 'nolink'; diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index c04a66b549..7e72262bdf 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -82,6 +82,11 @@ $snmp_oid = (string) get_parameter('snmp_oid'); $snmp_community = (string) get_parameter('snmp_community'); $id_module_group = (int) get_parameter('id_module_group'); $module_interval = (int) get_parameter('module_interval'); +// Limit module interval to at least 60 secs. +if ($module_interval > 0) { + $module_interval = max($module_interval, 60); +} + $id_group = (int) get_parameter('id_group'); $plugin_user = (string) get_parameter('plugin_user'); $plugin_pass = io_input_password((string) get_parameter('plugin_pass')); diff --git a/pandora_console/godmode/modules/manage_network_components_form_common.php b/pandora_console/godmode/modules/manage_network_components_form_common.php index 3f573ec2c8..7a016d7a91 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_common.php +++ b/pandora_console/godmode/modules/manage_network_components_form_common.php @@ -154,7 +154,7 @@ $table->data[2][0] = html_print_label_input_block( $table->data[2][1] = html_print_label_input_block( __('Interval'), - html_print_extended_select_for_time('module_interval', $module_interval, '', '', '0', false, true) + html_print_select_agentmodule_interval('module_interval', $module_interval, '', '', '0', false, true) ); $dynamic_interval_img = ''.html_print_image( diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 806e9e980d..5087bd5349 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1454,7 +1454,7 @@ $class = 'databox filters'; diff --git a/pandora_console/godmode/servers/plugin_registration.php b/pandora_console/godmode/servers/plugin_registration.php index 8394ae8980..9a21f0bc73 100644 --- a/pandora_console/godmode/servers/plugin_registration.php +++ b/pandora_console/godmode/servers/plugin_registration.php @@ -93,33 +93,26 @@ if (is_metaconsole() === true) { } } -$output = '
'; -$output .= '
'; -$output .= html_print_image( - 'images/first_task/icono_grande_import.png', - true, - ['title' => __('Plugin Registration') ] -); -$output .= '
'; -$output .= '
'; -$output .= '

'.__('Plugin registration').'

'; -$output .= '

'; -$output .= __('This extension makes registering server plugins an easier task. Here you can upload a server plugin in .pspz zipped format. Please refer to the official documentation on how to obtain and use Server Plugins.'); -$output .= '

'; -$output .= __('You can get more plugins in our'); -$output .= '
'; -$output .= ' '.__('Public Resource Library'); -$output .= ''; -$output .= '

'; + +$msg = __('This extension makes registering server plugins an easier task. Here you can upload a server plugin in .pspz zipped format. Please refer to the official documentation on how to obtain and use Server Plugins.'); +$msg .= '

'; +$msg .= __('You can get more plugins in our'); +$msg .= ''; +$msg .= ' '.__('Public Resource Library'); +$msg .= ''; // Upload form. -$output .= "
"; -$output .= ''; -$output .= "
"; -$output .= ""; -$output .= '
'; -$output .= '
'; -$output .= '
'; +$button = "
"; +$button .= ""; +$button .= ""; +$button .= '
'; + +$output = ui_print_empty_view( + __('Register plugins'), + $msg, + 'plugins.svg', + $button +); echo $output; diff --git a/pandora_console/godmode/setup/license.php b/pandora_console/godmode/setup/license.php index 2bc556ac62..518d4bab97 100644 --- a/pandora_console/godmode/setup/license.php +++ b/pandora_console/godmode/setup/license.php @@ -68,7 +68,7 @@ if ($renew_license_result !== null) { } if ($update_settings) { - if (!is_metaconsole()) { + if (is_metaconsole() === false) { // Node. foreach ($_POST['keys'] as $key => $value) { db_process_sql_update( diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 56b81d230e..348f98b31d 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -1461,7 +1461,7 @@ $table_vc->data[$row][] = html_print_label_input_block( $table_vc->data[$row][] = html_print_label_input_block( __('Number of favorite visual consoles to show in the menu'), - "" + '' ); $row++; @@ -1477,6 +1477,12 @@ $table_vc->data[$row][] = html_print_label_input_block( ) ); +$table_vc->data[$row][] = html_print_label_input_block( + __('Visual console default text margin (em)'), + '' +); +$row++; + $table_vc->data[$row][] = html_print_label_input_block( __('Lock screen orientation when viewing on mobile devices'), html_print_checkbox_switch( @@ -1486,7 +1492,6 @@ $table_vc->data[$row][] = html_print_label_input_block( true ) ); -$row++; $table_vc->data[$row][] = html_print_label_input_block( __('Display item frame on alert triggered').ui_print_help_tip(__('It displays an orange box around items that have triggered an alert.'), true), diff --git a/pandora_console/godmode/update_manager/just_enterprise_warning.php b/pandora_console/godmode/update_manager/just_enterprise_warning.php new file mode 100644 index 0000000000..79de165bd1 --- /dev/null +++ b/pandora_console/godmode/update_manager/just_enterprise_warning.php @@ -0,0 +1,110 @@ + + + + + \ No newline at end of file diff --git a/pandora_console/godmode/update_manager/update_manager.php b/pandora_console/godmode/update_manager/update_manager.php index 3cb774c4d5..fdfc3611fd 100644 --- a/pandora_console/godmode/update_manager/update_manager.php +++ b/pandora_console/godmode/update_manager/update_manager.php @@ -166,5 +166,9 @@ switch ($tab) { $mode = \UpdateManager\UI\Manager::MODE_ONLINE; include $config['homedir'].'/godmode/um_client/index.php'; include $config['homedir'].'/godmode/update_manager/modal_lts_update.php'; + + if (enterprise_installed() === false) { + include $config['homedir'].'/godmode/update_manager/just_enterprise_warning.php'; + } break; } diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 5d352ebeb1..e3c049d758 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -100,6 +100,26 @@ class DiscoveryTaskList extends HTML // Load styles. parent::run(); + $deploymentCenter = new DeploymentCenter(); + echo $deploymentCenter->loadJS(); + ui_require_css_file('deployment_list'); + + html_print_div( + [ + 'content' => '', + 'id' => 'modal_add_target', + 'class' => 'invisible', + ] + ); + + html_print_div( + [ + 'content' => '', + 'id' => 'modal_deploy_targets', + 'class' => 'invisible', + ] + ); + $this->prepareBreadcrum( [ [ @@ -184,7 +204,7 @@ class DiscoveryTaskList extends HTML } if (is_reporting_console_node() === false) { - $ret2 = $this->showList(__('Host & devices tasks'), [0, 1]); + $ret2 = $this->showList(__('Host & devices tasks'), [0, 1, 9]); $ret2 .= $this->showList(__('Applications tasks'), [3, 4, 5, 10, 11, 12], 'app'); $ret2 .= $this->showList(__('Cloud tasks'), [6, 7, 8, 13, 14], 'cloud'); $ret2 .= $this->showList(__('Custom tasks'), [-1], 'custom'); @@ -874,14 +894,12 @@ class DiscoveryTaskList extends HTML break; case DISCOVERY_DEPLOY_AGENTS: - // Internal deployment task. - $no_operations = true; $data[6] = html_print_image( 'images/osx-terminal@groups.svg', true, ['title' => __('Agent deployment')] ).'  '; - $data[6] .= __('Discovery.Agent.Deployment (legacy)'); + $data[6] .= __('Discovery.Agent.Deployment'); break; case DISCOVERY_APP_MICROSOFT_SQL_SERVER: @@ -1007,6 +1025,7 @@ class DiscoveryTaskList extends HTML && $task['type'] != DISCOVERY_APP_SAP && $task['type'] != DISCOVERY_CLOUD_AWS_RDS && $task['type'] != DISCOVERY_CLOUD_AWS_S3 + && $task['type'] != DISCOVERY_DEPLOY_AGENTS ) { if (check_acl($config['id_user'], 0, 'MR') && (int) $task['type'] !== DISCOVERY_EXTENSION) { $data[9] .= ''; @@ -1066,25 +1085,40 @@ class DiscoveryTaskList extends HTML ).''; } } else { - $url_edit = sprintf( - 'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d', - $this->getTargetWiz($task, $recon_script_data), - $task['id_rt'] - ); + // Create the url edit. + switch ((int) $task['type']) { + case DISCOVERY_EXTENSION: + $url_edit = ui_get_full_url( + sprintf( + 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=%s&mode=%s&id_task=%s', + $task['section'], + $task['short_name'], + $task['id_rt'], + ) + ); + break; - if ((int) $task['type'] === DISCOVERY_EXTENSION) { - $url_edit = sprintf( - 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=%s&mode=%s&id_task=%s', - $task['section'], - $task['short_name'], - $task['id_rt'], - ); + case DISCOVERY_DEPLOY_AGENTS: + if (empty($task['field1']) === false) { + $url_edit = 'javascript:show_deploy_targets('.$task['id_rt'].')'; + } else { + $url_edit = 'javascript:show_scan_targets('.$task['id_rt'].')'; + } + break; + + default: + $url_edit = ui_get_full_url( + sprintf( + 'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d', + $this->getTargetWiz($task, $recon_script_data), + $task['id_rt'] + ) + ); + break; } // Check if is a H&D, Cloud or Application or IPAM. - $data[9] .= ''.html_print_image( + $data[9] .= ''.html_print_image( 'images/edit.svg', true, [ diff --git a/pandora_console/images/empty_views/aws.svg b/pandora_console/images/empty_views/aws.svg new file mode 100644 index 0000000000..dc7cdca069 --- /dev/null +++ b/pandora_console/images/empty_views/aws.svg @@ -0,0 +1,50 @@ + + + No AWS found + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/empty_views/clusters.svg b/pandora_console/images/empty_views/clusters.svg new file mode 100644 index 0000000000..fff5bf7569 --- /dev/null +++ b/pandora_console/images/empty_views/clusters.svg @@ -0,0 +1,85 @@ + + + 696E9E4D-6D6D-4E30-B1C6-1CBF60018B2A + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/empty_views/custom-graph.svg b/pandora_console/images/empty_views/custom-graph.svg new file mode 100644 index 0000000000..5321c3a91e --- /dev/null +++ b/pandora_console/images/empty_views/custom-graph.svg @@ -0,0 +1,93 @@ + + + D0434C46-6D79-4C4C-9726-C296821D870B + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/empty_views/ncm.svg b/pandora_console/images/empty_views/ncm.svg new file mode 100644 index 0000000000..da43101e5b --- /dev/null +++ b/pandora_console/images/empty_views/ncm.svg @@ -0,0 +1,68 @@ + + + 7C2E23EA-BCA7-4E5D-BAD4-CF7507F60894 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/empty_views/plugins.svg b/pandora_console/images/empty_views/plugins.svg new file mode 100644 index 0000000000..a66e5a0b7d --- /dev/null +++ b/pandora_console/images/empty_views/plugins.svg @@ -0,0 +1,63 @@ + + + A84B8A2A-F149-4822-9084-B43F3D4C6C8F + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/empty_views/sap.svg b/pandora_console/images/empty_views/sap.svg new file mode 100644 index 0000000000..01d338c0c7 --- /dev/null +++ b/pandora_console/images/empty_views/sap.svg @@ -0,0 +1,59 @@ + + + E164C8FF-CEE9-4F16-BA63-5FB4919DD393 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/empty_views/services.svg b/pandora_console/images/empty_views/services.svg new file mode 100644 index 0000000000..5b485933c9 --- /dev/null +++ b/pandora_console/images/empty_views/services.svg @@ -0,0 +1,86 @@ + + + D3A9E7AB-A2B9-4073-9525-28AED9DF6D51 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/empty_views/visual-console.svg b/pandora_console/images/empty_views/visual-console.svg new file mode 100644 index 0000000000..9143f65483 --- /dev/null +++ b/pandora_console/images/empty_views/visual-console.svg @@ -0,0 +1,63 @@ + + + E456EC32-2047-44E1-9548-F616AC208D65 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/empty_views/vmware.svg b/pandora_console/images/empty_views/vmware.svg new file mode 100644 index 0000000000..665991272a --- /dev/null +++ b/pandora_console/images/empty_views/vmware.svg @@ -0,0 +1,58 @@ + + + 4960C5A6-9E07-4510-BA7E-097B9AE32028 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/external_alert.svg b/pandora_console/images/external_alert.svg new file mode 100644 index 0000000000..3a4b512a3b --- /dev/null +++ b/pandora_console/images/external_alert.svg @@ -0,0 +1,7 @@ + + + alerta externa + + + + \ No newline at end of file diff --git a/pandora_console/images/free_license.svg b/pandora_console/images/free_license.svg new file mode 100644 index 0000000000..a6a7ab5bb3 --- /dev/null +++ b/pandora_console/images/free_license.svg @@ -0,0 +1,85 @@ + + + 771F63E3-1B6F-4CAC-94BD-C4F0EC2141AA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/linking.svg b/pandora_console/images/linking.svg new file mode 100644 index 0000000000..87470b4493 --- /dev/null +++ b/pandora_console/images/linking.svg @@ -0,0 +1,10 @@ + + + linking + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/tree/corner@tree-dark.svg b/pandora_console/images/tree/corner@tree-dark.svg new file mode 100644 index 0000000000..66aa81f0e6 --- /dev/null +++ b/pandora_console/images/tree/corner@tree-dark.svg @@ -0,0 +1,12 @@ + + + + Dark / 20 / dotted corner@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/images/tree/corner_straight@tree-dark.svg b/pandora_console/images/tree/corner_straight@tree-dark.svg new file mode 100644 index 0000000000..5a958e59a5 --- /dev/null +++ b/pandora_console/images/tree/corner_straight@tree-dark.svg @@ -0,0 +1,18 @@ + + + + Dark / 20 / dotted corner@svg + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/tree/corner_straight_minus@tree-dark.svg b/pandora_console/images/tree/corner_straight_minus@tree-dark.svg new file mode 100644 index 0000000000..092cf40252 --- /dev/null +++ b/pandora_console/images/tree/corner_straight_minus@tree-dark.svg @@ -0,0 +1,26 @@ + + + + Dark / 20 / dotted corner@svg + Created with Sketch. + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/tree/corner_straight_plus@tree-dark.svg b/pandora_console/images/tree/corner_straight_plus@tree-dark.svg new file mode 100644 index 0000000000..e9840c7b08 --- /dev/null +++ b/pandora_console/images/tree/corner_straight_plus@tree-dark.svg @@ -0,0 +1,27 @@ + + + + Dark / 20 / dotted corner@svg + Created with Sketch. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/tree/straight@tree-dark.svg b/pandora_console/images/tree/straight@tree-dark.svg new file mode 100644 index 0000000000..c5a47a2f9a --- /dev/null +++ b/pandora_console/images/tree/straight@tree-dark.svg @@ -0,0 +1,13 @@ + + + + Dark / 20 / dotted straight@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/include/api.php b/pandora_console/include/api.php index 4836f98c64..00119668e6 100644 --- a/pandora_console/include/api.php +++ b/pandora_console/include/api.php @@ -114,6 +114,7 @@ if ($info === 'version') { exit; } +$user_in_db = null; if (empty($apiPassword) === true || (empty($apiPassword) === false && $api_password === $apiPassword) || $apiTokenValid === true diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 24af0a860c..b7c9498973 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -3137,7 +3137,7 @@ class ConsoleSupervisor return; } - $sync = new PandoraFMS\Enterprise\Metaconsole\Synchronizer(true); + $sync = new PandoraFMS\Enterprise\Metaconsole\Synchronizer(); $counts = $sync->getQueues(true); if (count($counts) === 0) { @@ -3195,7 +3195,7 @@ class ConsoleSupervisor return; } - $sync = new PandoraFMS\Enterprise\Metaconsole\Synchronizer(true); + $sync = new PandoraFMS\Enterprise\Metaconsole\Synchronizer(); $queues = $sync->getQueues(); if (count($queues) === 0) { // Clean all. @@ -3325,27 +3325,34 @@ class ConsoleSupervisor public function checkTotalModulesByAgent() { $modules_by_agent = db_process_sql( - 'SELECT count(*) AS modules_by_agent + 'SELECT count(*) AS count FROM tagente a LEFT JOIN tagente_modulo m ON a.id_agente = m.id_agente + WHERE m.disabled = 0 GROUP BY m.id_agente' ); $show_warning = false; - foreach ($modules_by_agent as $key => $total_modules) { - if ($total_modules['modules_by_agent'] > 200) { - $this->notify( - [ - 'type' => 'NOTIF.MODULES_AGENT.ALERT', - 'title' => __('Your system has an average of %s modules per agent', $total_modules['modules_by_agent']), - 'message' => __('This is higher than the recommended maximum (200). This may result in poor performance of your system.'), - 'icon_notification' => self::ICON_HEADSUP, - 'url' => '__url__index.php?sec=gagente&sec2=godmode/agentes/modificar_agente', - ] - ); - $show_warning = true; - break; - } + + if ($modules_by_agent !== false) { + $agents = count($modules_by_agent); + $modules = array_sum(array_column($modules_by_agent, 'count')); + + $ratio = ($modules / $agents); + $ratio = round($ratio, 2); + } + + if ($ratio > 200) { + $this->notify( + [ + 'type' => 'NOTIF.MODULES_AGENT.ALERT', + 'title' => __('Your system has an average of %s modules per agent', $ratio), + 'message' => __('This is higher than the recommended maximum (200). This may result in poor performance of your system.'), + 'icon_notification' => self::ICON_HEADSUP, + 'url' => '__url__index.php?sec=gagente&sec2=godmode/agentes/modificar_agente', + ] + ); + $show_warning = true; } if ($show_warning === false) { diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index cf561c9b3c..72c75f7c39 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ use DI\ContainerBuilder; /* * Pandora build version and version */ -$build_version = 'PC240404'; +$build_version = 'PC240410'; $pandora_version = 'v7.0NG.776'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 60d22cee1e..c2dc891bcc 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -470,7 +470,7 @@ function get_user_language($id_user=null) if ($id_user !== null) { $userinfo = get_user_info($id_user); - if ($userinfo['language'] != 'default') { + if (isset($userinfo['language']) === true && $userinfo['language'] != 'default') { return $userinfo['language']; } } @@ -6943,6 +6943,48 @@ function get_defined_translation($string) } +/** + * General utility to check if at least one element in an array meets a certain criteria defined by passed function. + * + * @param array $array Array to be checked. + * @param callable $fn Checking function (must accept one argument => array item to be evaluated and returns + * true/false depending on whether or not the condition was fulfilled). + * + * @return boolean + */ +function array_some(array $array, callable $fn) +{ + foreach ($array as $value) { + if ($fn($value) === true) { + return true; + } + } + + return false; +} + + +/** + * General utility to check if every element in an array meets a certain criteria defined by passed function. + * + * @param array $array Array to be checked. + * @param callable $fn Checking function (must accept one argument => array item to be evaluated and returns + * true/false depending on whether or not the condition was fulfilled). + * + * @return boolean + */ +function array_every(array $array, callable $fn) +{ + foreach ($array as $value) { + if ($fn($value) === false) { + return false; + } + } + + return true; +} + + /** * Merge any number of arrays by pairs of elements at the same index. * diff --git a/pandora_console/include/functions_clippy.php b/pandora_console/include/functions_clippy.php index a20cbef290..eb494e2b30 100644 --- a/pandora_console/include/functions_clippy.php +++ b/pandora_console/include/functions_clippy.php @@ -322,6 +322,11 @@ function clippy_context_help($help=null) $title = $clippy_modules_not_learning_mode['tours']['modules_not_learning_mode']['steps'][0]['title']; $intro = $clippy_modules_not_learning_mode['tours']['modules_not_learning_mode']['steps'][0]['intro']; $img = $clippy_modules_not_learning_mode['tours']['modules_not_learning_mode']['steps'][0]['img']; + } else if ($help === 'agent_module_interval') { + $clippy_agent_module_interval = clippy_agent_module_interval(); + $title = $clippy_agent_module_interval['tours']['agent_module_interval']['steps'][0]['title']; + $intro = $clippy_agent_module_interval['tours']['agent_module_interval']['steps'][0]['intro']; + $img = $clippy_agent_module_interval['tours']['agent_module_interval']['steps'][0]['img']; } else { $img = html_print_image( 'images/info-warning.svg', diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index baf09bd9fc..d344c3ce9c 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1259,6 +1259,10 @@ function config_update_config() $error_update[] = __('Default line menu items for the Visual Console'); } + if (config_update_value('vc_text_margin', (int) get_parameter('vc_text_margin', 1), true) === false) { + $error_update[] = __('Default text margin for the Visual Console'); + } + if (config_update_value('vc_line_thickness', (int) get_parameter('vc_line_thickness'), true) === false) { $error_update[] = __('Default line thickness for the Visual Console'); } @@ -2930,6 +2934,10 @@ function config_process_config() config_update_value('vc_menu_items', 10); } + if (!isset($config['vc_text_margin'])) { + config_update_value('vc_text_margin', 1); + } + if (!isset($config['ser_menu_items'])) { config_update_value('ser_menu_items', 10); } diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index be880a3655..eba07feece 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1235,6 +1235,8 @@ function events_get_all( io_safe_input($filter['user_comment']), $filter['user_comment'] ); + + array_unshift($fields, 'DISTINCT te.id_evento AS distinct_event'); } // Source. @@ -2713,6 +2715,7 @@ function events_print_type_img( $icon = 'images/module_warning.png'; break; + case 'unknown': case 'going_unknown': $icon = 'images/module_unknown.png'; break; @@ -2741,7 +2744,6 @@ function events_print_type_img( $icon = 'images/configuration@svg.svg'; break; - case 'unknown': default: $style .= ' invert_filter'; $icon = 'images/event.svg'; @@ -2993,6 +2995,9 @@ function events_print_type_description($type, $return=false) break; case 'unknown': + $output .= __('Unknown'); + break; + default: $output .= __('Unknown type:').': '.$type; break; @@ -5861,6 +5866,7 @@ function events_get_instructions($event, $max_text_length=300) } switch ($event['event_type']) { + case 'unknown': case 'going_unknown': if ($event['unknown_instructions'] != '') { $value = str_replace( diff --git a/pandora_console/include/functions_groups.php b/pandora_console/include/functions_groups.php index a09baf5d9f..1cce0ec199 100644 --- a/pandora_console/include/functions_groups.php +++ b/pandora_console/include/functions_groups.php @@ -107,22 +107,6 @@ function groups_check_used($idGroup) $return['tables'][] = __('Discovery task'); } - switch ($config['dbtype']) { - case 'mysql': - case 'postgresql': - $numRows = db_get_num_rows('SELECT * FROM tgraph WHERE id_group = '.$idGroup.';'); - break; - - case 'oracle': - $numRows = db_get_num_rows('SELECT * FROM tgraph WHERE id_group = '.$idGroup); - break; - } - - if ($numRows > 0) { - $return['return'] = true; - $return['tables'][] = __('Graphs'); - } - switch ($config['dbtype']) { case 'mysql': case 'postgresql': diff --git a/pandora_console/include/functions_groupview.php b/pandora_console/include/functions_groupview.php index 7ababa9b95..9c1ae5841c 100644 --- a/pandora_console/include/functions_groupview.php +++ b/pandora_console/include/functions_groupview.php @@ -206,3 +206,43 @@ function groupview_get_groups_list($id_user=false, $access='AR', $is_not_paginat 'counter' => $counter, ]; } + + +function get_recursive_groups_heatmap($parent_group, $acl) +{ + if ($parent_group['counter'] > 0) { + foreach ($parent_group['groups'] as $group_key => $group_value) { + if ((int) $group_value['_id_'] === 0) { + continue; + } + + $childrens = groups_get_children($group_value['_id_'], true, $acl, false); + if (empty($childrens) === false) { + foreach ($childrens as $children) { + $children_status = groups_get_status($children['id_grupo']); + $parent_group['groups'][$group_key]['_monitor_checks_']++; + switch ($children_status) { + case AGENT_STATUS_CRITICAL: + $parent_group['groups'][$group_key]['_monitors_critical_']++; + break; + + case AGENT_STATUS_WARNING: + $parent_group['groups'][$group_key]['_monitors_warning_']++; + break; + + case AGENT_STATUS_UNKNOWN: + $parent_group['groups'][$group_key]['_monitors_unknown_']++; + break; + + case AGENT_STATUS_NORMAL: + default: + $parent_group['groups'][$group_key]['_monitors_ok_']++; + break; + } + } + } + } + } + + return $parent_group; +} diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 52ed76bd6b..a3a46dbc52 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -16,7 +16,7 @@ * @package Include * @subpackage HTML */ - +use PandoraFMS\Enterprise\Metaconsole\Node; if (!isset($config)) { $working_dir = getcwd(); $working_dir = str_replace('\\', '/', $working_dir); @@ -1854,6 +1854,301 @@ function html_print_select_multiple_modules_filtered(array $data):string } +/** + * Form multiple inputs for slect groups. + * + * @param array $data Data inputs. + * + * @return string Html output. + */ +function html_print_select_multiple_modules_filtered_formated(array $data):string +{ + if (is_ajax() === true) { + ui_require_javascript_file( + 'multiselect_filtered', + 'include/javascript/', + true + ); + ui_require_css_file( + 'multiselect_filtered', + 'include/styles/', + true + ); + } else { + ui_require_javascript_file('multiselect_filtered'); + ui_require_css_file('multiselect_filtered'); + } + + $uniqId = $data['uniqId']; + + $return_all_group = isset($data['mReturnAllGroup']) ? $data['mReturnAllGroup'] : true; + + // Group. + $output = '
'; + $output .= html_print_input( + [ + 'label' => __('Group'), + 'label_class' => 'font-title-font', + 'name' => 'filtered-module-group-'.$uniqId, + 'returnAllGroup' => $return_all_group, + 'privilege' => 'AR', + 'type' => 'select_groups', + 'return' => true, + 'script' => 'fmAgentChange(\''.$uniqId.'\')', + 'selected' => $data['mGroup'], + ] + ); + + // Groups module. + $module_groups = db_get_all_rows_sql( + 'SELECT * FROM tmodule_group ORDER BY name' + ); + $module_groups = array_reduce( + $module_groups, + function ($carry, $item) { + $carry[$item['id_mg']] = $item['name']; + return $carry; + } + ); + + $output .= html_print_input( + [ + 'label' => __('Module group'), + 'label_class' => 'font-title-font', + 'type' => 'select', + 'fields' => $module_groups, + 'name' => 'filtered-module-module-group-'.$uniqId, + 'selected' => $data['mModuleGroup'], + 'return' => true, + 'nothing' => __('All'), + 'nothing_value' => 0, + 'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')', + ] + ); + $output .= '
'; + $output .= '
'; + + // Recursion. + $output .= html_print_input( + [ + 'label' => __('Recursion'), + 'label_class' => 'font-title-font', + 'type' => 'switch', + 'name' => 'filtered-module-recursion-'.$uniqId, + 'value' => (empty($data['mRecursion']) === true) ? false : true, + 'checked' => (empty($data['mRecursion']) === true) ? false : true, + 'return' => true, + 'id' => 'filtered-module-recursion-'.$uniqId, + 'onchange' => 'fmAgentChange(\''.$uniqId.'\')', + ] + ); + + $commonModules = 0; + if (empty($data['mShowCommonModules']) === false) { + $commonModules = 1; + } + + $output .= html_print_input( + [ + 'label' => __('Only common modules'), + 'label_class' => 'font-title-font', + 'type' => 'switch', + 'checked' => $commonModules, + 'value' => $commonModules, + 'name' => 'filtered-module-show-common-modules-'.$uniqId, + 'id' => 'filtered-module-show-common-modules-'.$uniqId, + 'return' => true, + 'onchange' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')', + ] + ); + + $output .= '
'; + + if (empty($data['searchBar']) === false && $data['searchBar'] === true) { + $output .= '
'; + + $output .= '
'; + $output .= html_print_input( + [ + 'type' => 'text', + 'name' => 'agent-searchBar-'.$uniqId, + 'onKeyUp' => 'searchAgent(\''.$uniqId.'\')', + 'placeholder' => __('Type to search agents'), + 'return' => true, + ] + ); + + $output .= '
'; + + $output .= '
'; + $output .= html_print_input( + [ + 'type' => 'text', + 'name' => 'module-searchBar-'.$uniqId, + 'onKeyUp' => 'searchModule(\''.$uniqId.'\')', + 'return' => true, + 'placeholder' => __('Type to search modules'), + ] + ); + + $output .= '
'; + + $output .= '
'; + } + + $output .= '
'; + // Agent. + $agents = agents_get_group_agents( + // Id_group. + $data['mGroup'], + // Search. + false, + // Case. + 'lower', + // NoACL. + false, + // ChildGroups. + false, + // Serialized. + false, + // Separator. + '|', + // Add_alert_bulk_op. + false, + // Force_serialized. + false, + // Meta_fields. + ($data['mMetaFields'] ?? is_metaconsole()) + ); + + if ((empty($agents)) === true || $agents == -1) { + $agents = []; + } + + if ($data['mShowSelectedOtherGroups']) { + $selected_agents = explode(',', $data['mAgents']); + foreach ($selected_agents as $agent_id) { + if (!array_key_exists($agent_id, $agents)) { + $agents[$agent_id] = agents_get_alias($agent_id); + } + } + } + + if (is_metaconsole() === true) { + $output .= html_print_input( + [ + 'label' => __('Agents'), + 'label_class' => 'font-title-font', + 'type' => 'select', + 'fields' => $agents, + 'name' => 'filtered-module-agents-'.$uniqId, + 'selected' => explode(',', $data['mAgents']), + 'return' => true, + 'multiple' => true, + 'style' => 'min-width: 200px;max-width:200px;', + 'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')', + 'placeholder' => (isset($data['placeholderAgents']) === true) ? $data['placeholderAgents'] : '', + 'truncate_size' => 300, + ] + ); + } else { + $output .= html_print_input( + [ + 'label' => __('Agents'), + 'label_class' => 'font-title-font', + 'type' => 'select_from_sql', + 'sql' => 'SELECT `id_agente`,`alias` FROM tagente', + 'name' => 'filtered-module-agents-'.$uniqId, + 'selected' => explode(',', $data['mAgents']), + 'return' => true, + 'multiple' => true, + 'style' => 'min-width: 200px;max-width:200px;', + 'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')', + 'placeholder' => (isset($data['placeholderAgents']) === true) ? $data['placeholderAgents'] : '', + 'truncate_size' => 300, + ] + ); + } + + if (empty($data['mAgents']) === false + && empty($data['mModuleGroup'] === false) + ) { + $all_modules = get_modules_agents( + $data['mModuleGroup'], + explode(',', $data['mAgents']), + !$commonModules, + !is_metaconsole(), + is_metaconsole(), + false + ); + } else { + $all_modules = []; + } + + $mModules = $data['mModules']; + if (is_array($data['mModules']) === false) { + $mModules = explode( + ',', + $data['mModules'] + ); + } else { + if (is_metaconsole()) { + foreach ($data['mModules'] as $row) { + $exp = explode('|', $row); + if (empty($exp[0]) === false) { + if (is_numeric($exp[1]) === false) { + if (is_metaconsole() === true) { + $node = new Node($exp[0]); + $node->connect(); + } + + $module = explode(' » ', $exp[1]); + $id_agente = db_get_sql(sprintf('SELECT id_agente FROM tagente WHERE nombre = "%s"', $module[1])); + $id_agente_modulo = db_get_sql(sprintf('SELECT id_agente_modulo FROM tagente_modulo WHERE nombre = "%s" AND id_agente = %s', $module[2], $id_agente)); + $array = [ + $exp[0].'|'.$id_agente_modulo => $exp[0].'|'.$id_agente_modulo, + ]; + $mModules = array_merge($mModules, $array); + if (is_metaconsole() === true) { + $node->disconnect(); + } + } + } + } + } + } + + $result = []; + // Clean double safe input. + foreach ($mModules as $name) { + $result[] = io_safe_output($name); + } + + $output .= html_print_input( + [ + 'label' => __('Modules'), + 'label_class' => 'font-title-font', + 'type' => 'select', + 'fields' => $all_modules, + 'name' => 'filtered-module-modules-'.$uniqId, + 'selected' => $result, + 'return' => true, + 'multiple' => true, + 'style' => 'max-width:98%;', + 'input_class' => 'flex-colum-center-important', + 'truncate_size' => 300, + ] + ); + + $output .= '
'; + if ($data['return'] === false) { + echo $output; + } + + return $output; +} + + /** * Prints an array of fields in a popup menu of a form based on a SQL query. * The first and second columns of the query will be used. @@ -1896,6 +2191,7 @@ function html_print_select_from_sql( $class='', $required=false, $placeholder='', + $title=false, ) { global $config; @@ -1943,7 +2239,8 @@ function html_print_select_from_sql( '', false, null, - $placeholder + $placeholder, + $title ); } @@ -2290,7 +2587,7 @@ function html_print_extended_select_for_time( echo ''; - echo '
'; + echo '
'; html_print_input_text($uniq_name.'_text', $selected, '', $size, 255, false, $readonly, false, '', $class, $script_input); html_print_input_hidden($name, $selected, false, $uniq_name); @@ -2317,7 +2614,7 @@ function html_print_extended_select_for_time( false, false ); - echo ' '.html_print_image( + echo '  '.html_print_image( 'images/logs@svg.svg', true, [ @@ -2358,6 +2655,174 @@ function html_print_extended_select_for_time( } +/** + * Render agent/module interval-specific time selection set of inputs + * from html_print_extended_select_for_time with additional structure and + * behavior associated (establishes a limit of at least 60 seconds to be + * selected and displays notice when this limit is actively selected). + * + * @param string $name Select form name. + * @param mixed $selected Current selected value. Can be a single value or an array of selected values (in combination with multiple). + * @param string $script Javascript onChange (select) code. + * @param string $nothing Label when nothing is selected. + * @param mixed $nothing_value Value when nothing is selected. + * @param integer $size Size of the input. + * @param boolean $return Whether to return an output string or echo now (optional, echo by default). + * @param boolean $select_style Wherter to assign to combo a unique name (to have more than one on same page, like dashboard). + * @param boolean $unique_name Uunique name value. + * @param string $class Class value. + * @param boolean $readonly Readonly value. + * @param string $custom_fields Custom fields value. + * @param string $style_icon Style icon value. + * @param boolean $no_change No change value. + * @param boolean $allow_zero Allow the use of the value zero. + + * @return string HTML code if return parameter is true. + */ +function html_print_select_agentmodule_interval( + $name, + $selected='', + $script='', + $nothing='', + $nothing_value='0', + $size=false, + $return=false, + $select_style=false, + $unique_name=true, + $class='', + $readonly=false, + $custom_fields=false, + $style_icon='', + $no_change=false, + $allow_zero=0, + $units=null, + $script_input='' +) { + global $config; + + include_once $config['homedir'].'/include/functions_clippy.php'; + + $output = '
'; + $output .= html_print_extended_select_for_time( + $name, + $selected, + $script, + $nothing, + $nothing_value, + $size, + $return, + $select_style, + $unique_name, + $class, + $readonly + ); + + $unique_id = ''; + + if ($unique_name === true) { + $pattern = '/'.$name.'([a-fA-F0-9]+)_default/'; + + if (preg_match($pattern, $output, $matches)) { + // Obtain the unique ID of the generated input. + $unique_id = $matches[1]; + $name .= $unique_id; + } + } + + $output .= html_print_div( + [ + 'id' => 'agent_module_interval_clippy'.$unique_id, + 'class' => 'invisible flex align-self-center', + 'content' => clippy_context_help('agent_module_interval'), + ], + true + ); + + $output .= ""; + $output .= '
'; + return $output; +} + + /** * Print selects to configure the cron of a module. * @@ -4133,6 +4598,10 @@ function html_print_table(&$table, $return=false) $headStyle = ''; } + if (isset($table->headStyle[$heading])) { + $headStyle = ' style = "'.$table->headStyle[$heading].'" '; + } + $output .= ''.$heading.''; } @@ -5723,6 +6192,7 @@ function html_print_input($data, $wrapper='div', $input_only=false) ((isset($data['class']) === true) ? $data['class'] : ''), ((isset($data['required']) === true) ? $data['required'] : false), ((isset($data['placeholder']) === true) ? $data['placeholder'] : null), + ((isset($data['title']) === true) ? $data['title'] : false), ); break; @@ -6108,6 +6578,10 @@ function html_print_input($data, $wrapper='div', $input_only=false) $output .= html_print_select_multiple_modules_filtered($data); break; + case 'select_multiple_modules_filtered_formated': + $output .= html_print_select_multiple_modules_filtered_formated($data); + break; + case 'datalist': $output .= html_print_datalist( $data['name'], diff --git a/pandora_console/include/functions_inventory.php b/pandora_console/include/functions_inventory.php index 5f9e3bd62d..a93a760f88 100644 --- a/pandora_console/include/functions_inventory.php +++ b/pandora_console/include/functions_inventory.php @@ -99,9 +99,9 @@ function inventory_get_data( // Prepare pagination. $url = sprintf( '?sec=estado&sec2=operation/inventory/inventory&agent_id=%s&agent=%s&id_group=%s&export=%s&module_inventory_general_view=%s&search_string=%s&utimestamp=%s&period=%s&order_by_agent=%s&submit_filter=%d', - $pagination_url_parameters['inventory_id_agent'], - $pagination_url_parameters['inventory_agent'], - $pagination_url_parameters['inventory_id_group'], + (isset($pagination_url_parameters['inventory_id_agent']) ?? ''), + (isset($pagination_url_parameters['inventory_agent']) ?? ''), + (isset($pagination_url_parameters['inventory_id_group']) ?? ''), $export_csv, $inventory_module_name, $inventory_search_string, @@ -710,7 +710,9 @@ function inventory_get_datatable( $inventory_search_string='', $export_csv=false, $return_mode=false, - $order_by_agent=false + $order_by_agent=false, + $date_init=false, + $status_agent=-1, ) { global $config; @@ -737,6 +739,10 @@ function inventory_get_datatable( array_push($where, 'tagent_module_inventory.id_agente IN ('.implode(',', $agents_ids).')'); } + if ($status_agent > -1) { + array_push($where, 'tagente.disabled ='.$status_agent); + } + if ($inventory_module_name[0] !== '0' && $inventory_module_name !== '' && $inventory_module_name !== 'all' @@ -750,21 +756,23 @@ function inventory_get_datatable( } if ($utimestamp > 0) { - array_push($where, 'tagente_datos_inventory.utimestamp <= '.$utimestamp.' '); + array_push($where, 'tagent_module_inventory.utimestamp <= '.$utimestamp.' '); + } + + if ($date_init !== false) { + array_push($where, 'tagent_module_inventory.utimestamp >= '.$date_init.' '); } $sql = sprintf( 'SELECT tmodule_inventory.*, tagent_module_inventory.*, tagente.alias as name_agent, - tagente_datos_inventory.utimestamp as last_update, - tagente_datos_inventory.timestamp as last_update_timestamp, - tagente_datos_inventory.data as data_inventory + tagent_module_inventory.utimestamp as last_update, + tagent_module_inventory.timestamp as last_update_timestamp, + tagent_module_inventory.data as data_inventory FROM tmodule_inventory - INNER JOIN tagent_module_inventory + LEFT JOIN tagent_module_inventory ON tmodule_inventory.id_module_inventory = tagent_module_inventory.id_module_inventory - INNER JOIN tagente_datos_inventory - ON tagent_module_inventory.id_agent_module_inventory = tagente_datos_inventory.id_agent_module_inventory LEFT JOIN tagente ON tagente.id_agente = tagent_module_inventory.id_agente @@ -884,12 +892,14 @@ function get_data_basic_info_sql($params, $count=false) } $where = 'WHERE 1=1 '; - if ($params['id_agent'] > 0 && $count === true) { - $where .= sprintf(' AND id_agente = %d', $params['id_agent']); - } else if ($params['id_agent'] > 0 && $count === false) { + if ($params['id_agent'] > 0) { $where .= sprintf(' AND %s.id_agente = %d', $table, $params['id_agent']); } + if ($params['status'] >= 0) { + $where .= sprintf(' AND %s.disabled = %d', $table, $params['status']); + } + if ($params['id_group'] > 0) { $where .= sprintf(' AND id_grupo = %d', $params['id_group']); } else { @@ -910,7 +920,7 @@ function get_data_basic_info_sql($params, $count=false) ); } - if ($params['utimestamp'] > 0 && $count === false) { + if ($params['utimestamp'] > 0) { $where .= sprintf( ' AND utimestamp BETWEEN %d AND %d', ($params['utimestamp'] - $params['period']), @@ -977,21 +987,20 @@ function get_data_basic_info_sql($params, $count=false) $limit_condition = ''; $order_condition = ''; - $fields = 'count(*)'; $innerjoin = ''; $groupby = ''; - if ($count !== true) { - if (is_metaconsole() === true) { - $fields = 'tmetaconsole_agent.*, tagent_secondary_group.*, tagent_custom_data.*'; - } else { - $fields = 'tagente.*, tagent_secondary_group.*, tagent_custom_data.*'; - } + if (is_metaconsole() === true) { + $fields = 'tmetaconsole_agent.*, tagent_secondary_group.*, tagent_custom_data.*'; + } else { + $fields = 'tagente.*, tagent_secondary_group.*, tagent_custom_data.*'; + } - $innerjoin = 'LEFT JOIN tagente_estado ON '.$table.'.id_agente = tagente_estado.id_agente '; - $innerjoin .= 'LEFT JOIN tagent_secondary_group ON '.$table.'.id_agente = tagent_secondary_group.id_agent '; - $innerjoin .= 'LEFT JOIN tagent_custom_data ON '.$table.'.id_agente = tagent_custom_data.id_agent '; - $groupby = 'GROUP BY '.$table.'.id_agente'; + $innerjoin = 'LEFT JOIN tagente_estado ON '.$table.'.id_agente = tagente_estado.id_agente '; + $innerjoin .= 'LEFT JOIN tagent_secondary_group ON '.$table.'.id_agente = tagent_secondary_group.id_agent '; + $innerjoin .= 'LEFT JOIN tagent_custom_data ON '.$table.'.id_agente = tagent_custom_data.id_agent '; + + if ($count !== true) { $limit_condition = sprintf( 'LIMIT %d, %d', $params['start'], @@ -999,8 +1008,12 @@ function get_data_basic_info_sql($params, $count=false) ); $order_condition = sprintf('ORDER BY %s', $params['order']); + } else { + $fields = 'COUNT(*)'; } + $groupby = 'GROUP BY '.$table.'.id_agente'; + $sql = sprintf( 'SELECT %s FROM %s @@ -1018,13 +1031,19 @@ function get_data_basic_info_sql($params, $count=false) $limit_condition ); + $sql_count = sprintf( + 'SELECT COUNT(*) + FROM (%s) AS sub_sql', + $sql + ); + if ($count !== true) { $result = db_get_all_rows_sql($sql); if ($result === false) { $result = []; } } else { - $result = db_get_sql($sql); + $result = db_get_sql($sql_count); if ($result === false) { $result = 0; } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index af05902517..27ea241de8 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3352,8 +3352,8 @@ function reporting_inventory($report, $content, $type) $date, '', false, - 'csv', false, + 'csv', '', [], $inventory_regular_expression @@ -3367,12 +3367,13 @@ function reporting_inventory($report, $content, $type) $date, '', false, - 'hash', false, + 'hash', '', [], $inventory_regular_expression ); + break; } diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 321cb77f69..ae7279a40d 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2644,7 +2644,7 @@ function reporting_html_inventory($table, $item, $pdf=0) } else { // Grouped type inventory. $type_modules = array_reduce( - $item['data'], + ($item['data'] ?? []), function ($carry, $it) { $carry[$it['name']][] = $it; return $carry; @@ -5169,7 +5169,7 @@ function reporting_html_value( $table->colspan['data']['cell'] = 3; $table->cellstyle['data']['cell'] = 'text-align: left;'; - $table->data['data']['cell'] = '

'; + $table->data['data']['cell'] = '

'; if ($check_empty && empty($item['data']['value'])) { $table->data['data']['cell'] .= __('Unknown'); @@ -6380,6 +6380,7 @@ function reporting_html_sql($table, $item, $pdf=0) // Print the header. foreach ($row as $key => $value) { $table2->head[] = $key; + $table2->headStyle[$key] = 'text-align: center;'; } } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 34bd3a0fdd..468dae0c4d 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4283,6 +4283,12 @@ function ui_print_datatable(array $parameters) $js = ''; $js .= ' diff --git a/pandora_console/operation/inventory/inventory.php b/pandora_console/operation/inventory/inventory.php index 5f812f67e9..cd793fe274 100755 --- a/pandora_console/operation/inventory/inventory.php +++ b/pandora_console/operation/inventory/inventory.php @@ -85,12 +85,13 @@ if ($custom_date === '1') { } } else { $date_end = date('Y/m/d H:i:s'); - $date_init = date('Y/m/d H:i:s', (strtotime($date_end) - $range)); + $date_init = date('Y/m/d H:i:s', (strtotime($date_end) - (int) $range)); $period = (strtotime($date_end) - strtotime($date_init)); } $date_init = strtotime($date_init); $utimestamp = strtotime($date_end); +$status_agent = (int) get_parameter('status', -1); if (is_ajax() === true) { $get_csv_url = (bool) get_parameter('get_csv_url'); @@ -180,6 +181,8 @@ if (is_ajax() === true) { $order = get_datatable_order(); $id_agent = (int) get_parameter('id_agent', 0); $id_group = (int) get_parameter('id_group', 0); + $utimestamp = (int) get_parameter('utimestamp', 0); + $period = (int) get_parameter('period', 0); if (isset($filter['value']) === false) { $filter['value'] = ''; @@ -192,8 +195,9 @@ if (is_ajax() === true) { 'order' => $order, 'id_agent' => $id_agent, 'id_group' => $id_group, - 'utimestamp' => strtotime($utimestamp), + 'utimestamp' => $utimestamp, 'period' => $period, + 'status' => $status_agent, ]; $data = get_data_basic_info_sql($params); @@ -449,6 +453,8 @@ if ($is_metaconsole === true) { if ($inventory_id_agent > 0) { $sql .= ' AND id_agente = '.$inventory_id_agent; $agents_node = [$inventory_id_agent => $inventory_id_agent]; + } else { + $agents_node = [-1 => true]; } $result_module = db_get_all_rows_sql($sql); @@ -462,8 +468,8 @@ if ($is_metaconsole === true) { $export, false, $order_by_agent, - $server, - $pagination_url_parameters + $date_init, + $status_agent ); $data_tmp['server_name'] = $connection['server_name']; @@ -495,6 +501,8 @@ if ($is_metaconsole === true) { if ($inventory_id_agent > 0) { $sql .= ' AND id_agente = '.$inventory_id_agent; $agents_node = [$inventory_id_agent => $inventory_id_agent]; + } else { + $agents_node = [-1 => true]; } $result = db_get_all_rows_sql($sql); @@ -510,8 +518,8 @@ if ($is_metaconsole === true) { $export, false, $order_by_agent, - $server, - $pagination_url_parameters + $date_init, + $status_agent ); $data_tmp['server_name'] = $server['server_name']; @@ -764,6 +772,23 @@ if (is_metaconsole() === false) { ); } +$table->data[2][0] = html_print_label_input_block( + __('Status agent'), + html_print_select( + [ + -1 => __('All'), + 0 => __('Enabled'), + 1 => __('Disabled'), + ], + 'status', + $status_agent, + '', + '', + 0, + true + ) +); + $searchForm .= html_print_table($table, true); $searchForm .= html_print_div( [ @@ -1054,12 +1079,17 @@ if ($inventory_module !== 'basic') { } } } else { - // Single agent selected. - if ($inventory_id_agent > 0 && isset($agents[$inventory_id_agent]) === true) { - $agents = [$inventory_id_agent => $agents[$inventory_id_agent]]; + if ($inventory_id_agent > 0) { + // Single agent selected. + if ($inventory_id_agent > 0 && isset($agents[$inventory_id_agent]) === true) { + $agents = [$inventory_id_agent => $agents[$inventory_id_agent]]; + } + + $agents_ids = array_keys($agents); + } else { + $agents_ids = [-1]; } - $agents_ids = array_keys($agents); if (count($agents_ids) > 0) { $rows = inventory_get_datatable( $agents_ids, @@ -1068,7 +1098,9 @@ if ($inventory_module !== 'basic') { $inventory_search_string, $export, false, - $order_by_agent + $order_by_agent, + $date_init, + $status_agent ); } @@ -1275,6 +1307,7 @@ if ($inventory_module !== 'basic') { 'no_sortable_columns' => [], 'data_element' => $data, 'searching' => true, + 'dom_elements' => 'rtipB', 'order' => [ 'field' => $columns[0], 'direction' => 'asc', @@ -1355,6 +1388,9 @@ if ($inventory_module !== 'basic') { 'id_agent' => $id_agente, 'id_group' => $inventory_id_group, 'search' => $search, + 'status' => $status_agent, + 'utimestamp' => (($range !== 'none') ? $utimestamp : 0), + 'period' => $period, ], 'zeroRecords' => __('Agent info not found'), 'emptyTable' => __('Agent info not found'), diff --git a/pandora_console/operation/visual_console/view.php b/pandora_console/operation/visual_console/view.php index 7d44c7b69b..ef63456f6a 100644 --- a/pandora_console/operation/visual_console/view.php +++ b/pandora_console/operation/visual_console/view.php @@ -627,6 +627,14 @@ if ($pure === true) { + +'; $widget_description = db_get_value_sql('SELECT description FROM twidget WHERE id ='.$cellData['id_widget']); $output .= html_print_input_hidden('widget_name_'.$cellData['id'], $widget_description, true); + $output .= html_print_input_hidden('widget_id_'.$cellData['id'], $cellData['id_widget'], true); $output .= html_print_image( 'images/configuration@svg.svg', true, diff --git a/pandora_console/views/dashboard/configurationWidgets.php b/pandora_console/views/dashboard/configurationWidgets.php index 24f2019f86..373094bfe7 100644 --- a/pandora_console/views/dashboard/configurationWidgets.php +++ b/pandora_console/views/dashboard/configurationWidgets.php @@ -32,6 +32,7 @@ ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/', true); ui_require_javascript_file('pandora', 'include/javascript/', true); $output = ''; +$widgetId = json_decode(io_safe_output(get_parameter('extradata')), true)['widgetId']; $form = [ 'action' => '#', @@ -64,4 +65,8 @@ HTML::printForm( ] ); +if ($widgetId == '10') { + $output .= ui_require_css_file('agent_module_view', 'include/styles/', true, true); +} + echo $output; diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 1ba0ec7409..76d11c9723 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.776-240404 +Version: 7.0NG.776-240410 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index d2034da4d3..fc13bffbf7 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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.776-240404" +pandora_version="7.0NG.776-240410" package_cpan=0 package_pandora=1 diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 8dcb2ee0f4..eded19d4db 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -711,6 +711,9 @@ ncmserver_threads 1 # NCM utility to avoid Net::SSH::Expect issues in multi-threaded environments. ncm_ssh_utility /usr/share/pandora_server/util/ncm_ssh_extension +# Utility to deploy software agents via SSH or WinRM. +agent_deployer_utility /usr/share/pandora_server/util/pandora_agent_deployer + # Pandora FMS Daemon Watchdog execution interval in seconds (PANDORA FMS ENTERPRISE ONLY). ha_interval 30 diff --git a/pandora_server/conf/tentacle_server.conf.new b/pandora_server/conf/tentacle_server.conf.new index a7cec8fd2c..9f0452d82b 100644 --- a/pandora_server/conf/tentacle_server.conf.new +++ b/pandora_server/conf/tentacle_server.conf.new @@ -21,7 +21,7 @@ daemon 1 #insecure 0 # [-i] Filters (regexp:dir;regexp:dir...). -filters .*\.conf:conf;.*\.md5:md5;.*\.zip:collections;.*\.lock:trans;.*\.rcmd:commands +filters .*\.conf:conf;.*\.md5:md5;.*\.zip:collections;.*\.lock:trans;.*\.rcmd:commands;.*\.agent_setup\.exe:agent;.*\.agent_setup\.tar\.gz:agent # [-m] Maximum file size allowed by the server in bytes # max_size 2000000 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 89c4aeebe6..e8ab246cfc 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -46,7 +46,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.776"; -my $pandora_build = "240404"; +my $pandora_build = "240410"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash @@ -556,6 +556,8 @@ sub pandora_load_config { $pa_config->{'ncmserver_threads'} = 1; # 7.0.758 $pa_config->{'ncm_ssh_utility'} = '/usr/share/pandora_server/util/ncm_ssh_extension'; # 7.0.758 + $pa_config->{'agent_deployer_utility'} = '/usr/share/pandora_server/util/pandora_agent_deployer'; # 7.0.777 + $pa_config->{"pandora_service_cmd"} = 'service pandora_server'; # 7.0.761 $pa_config->{"tentacle_service_cmd"} = 'service tentacle_serverd'; # 7.0.761 $pa_config->{"tentacle_service_watchdog"} = 1; # 7.0.761 @@ -1337,6 +1339,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^ncm_ssh_utility\s+(.*)/i) { $pa_config->{'ncm_ssh_utility'}= clean_blank($1); } + elsif ($parametro =~ m/^agent_deployer_utility\s+(.*)/i) { + $pa_config->{'agent_deployer_utility'}= clean_blank($1); + } elsif ($parametro =~ m/^ha_file\s(.*)/i) { $pa_config->{'ha_file'} = clean_blank($1); } diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index a6af94d2fd..5221e7a699 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4064,8 +4064,16 @@ sub pandora_check_type_custom_field_for_itsm ($) { ########################################################################## sub pandora_update_agent_custom_field ($$$$) { my ($dbh, $token, $field, $id_agent) = @_; + my $exist_field = get_db_value($dbh, 'SELECT count(*) FROM tagent_custom_data WHERE id_field = ? AND id_agent = ?', $field, $id_agent); my $result = undef; - $result = db_update ($dbh, 'UPDATE tagent_custom_data SET description = ? WHERE id_field = ? AND id_agent = ?', safe_input($token), $field, $id_agent); + + $token = safe_input($token); + + if (!$exist_field) { + $result = defined(db_insert ($dbh, 'id_field', 'INSERT INTO tagent_custom_data (`description`, `id_field`, `id_agent`) VALUES (?, ?, ?)', $token, $field, $id_agent)) ? 1 : 0; + } else { + $result = db_update ($dbh, 'UPDATE tagent_custom_data SET description = ? WHERE id_field = ? AND id_agent = ?', $token, $field, $id_agent); + } return $result; } diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index 918d331215..3dc3d44f17 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -148,21 +148,23 @@ sub data_producer ($) { WHERE id_recon_server = ? AND disabled = 0 AND ((utimestamp = 0 AND interval_sweep != 0 OR status = 1) - OR (status < 0 AND interval_sweep > 0 AND (utimestamp + interval_sweep) < UNIX_TIMESTAMP()))', $server_id); + OR (status < 0 AND interval_sweep > 0 AND (utimestamp + interval_sweep) < UNIX_TIMESTAMP()) + OR (status < 0 AND utimestamp = 0 AND interval_sweep = 0))', $server_id); } else { @rows = get_db_rows ($dbh, 'SELECT * FROM trecon_task WHERE (id_recon_server = ? OR id_recon_server NOT IN (SELECT id_server FROM tserver WHERE status = 1 AND server_type = ?)) AND disabled = 0 AND ((utimestamp = 0 AND interval_sweep != 0 OR status = 1) - OR (status < 0 AND interval_sweep > 0 AND (utimestamp + interval_sweep) < UNIX_TIMESTAMP()))', $server_id, DISCOVERYSERVER); + OR (status < 0 AND interval_sweep > 0 AND (utimestamp + interval_sweep) < UNIX_TIMESTAMP()) + OR (status < 0 AND utimestamp = 0 AND interval_sweep = 0))', $server_id, DISCOVERYSERVER); } foreach my $row (@rows) { - # Discovery apps must be fully set up. + # Discovery apps must be fully set up. if ($row->{'type'} == DISCOVERY_APP && $row->{'setup_complete'} != 1) { logger($pa_config, 'Setup for recon app task ' . $row->{'id_app'} . ' not complete.', 10); - next; + next; } # Update task status @@ -313,13 +315,7 @@ sub data_consumer ($$) { # Clean tmp file. if (defined($cnf_extra{'creds_file'}) && -f $cnf_extra{'creds_file'}) { - unlink($cnf_extra{'creds_file'}); - } - - - # Clean one shot tasks - if ($task->{'type'} eq DISCOVERY_DEPLOY_AGENTS) { - db_delete_limit($dbh, ' trecon_task ', ' id_rt = ? ', 1, $task->{'id_rt'}); + unlink($cnf_extra{'creds_file'}); } }; if ($@) { diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 5d21f53bb9..5752e127f7 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.776"; -my $pandora_build = "240404"; +my $pandora_build = "240410"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 39c69c63d7..1b6dc1efcd 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.776 -%define release 240404 +%define release 240410 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index bfb5725669..ac39093af0 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.776 -%define release 240404 +%define release 240410 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 7e1d429362..a359767ded 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240404" +PI_BUILD="240410" MODE=$1 if [ $# -gt 1 ]; then @@ -344,6 +344,8 @@ install () { chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/commands mkdir $DESTDIR$PANDORA_SPOOL/data_in/discovery 2> /dev/null chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/discovery + mkdir $DESTDIR$PANDORA_SPOOL/data_in/agent 2> /dev/null + chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/agent mkdir -p $DESTDIR$PANDORA_LOG 2> /dev/null chown -R pandora:apache $DESTDIR$PANDORA_LOG 2> /dev/null chmod 2774 $DESTDIR$PANDORA_LOG 2> /dev/null @@ -435,6 +437,28 @@ install () { then echo cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_DIR cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_DIR + + # Add agents deployment filters if not added yet + filter_changed=0 + tentacle_filters=$(grep -E '^\s*filters\s*.*$' "$DESTDIR$TENTACLE_CFG_FILE" | sed 's/\\/\\\\/g') + if ! [[ $tentacle_filters =~ \.\*\\\\\.agent_setup\\\\\.exe:agent ]] + then + sed -i -e "s/$tentacle_filters/$tentacle_filters;.*\\\\.agent_setup\\\\.exe:agent/" "$DESTDIR$TENTACLE_CFG_FILE" + filter_changed=1 + fi + tentacle_filters=$(grep -E '^\s*filters\s*.*$' "$DESTDIR$TENTACLE_CFG_FILE" | sed 's/\\/\\\\/g') + if ! [[ $tentacle_filters =~ \.\*\\\\\.agent_setup\\\\\.tar\\\\\.gz:agent ]] + then + sed -i -e "s/$tentacle_filters/$tentacle_filters;.*\\\\.agent_setup\\\\.tar\\\\.gz:agent/" "$DESTDIR$TENTACLE_CFG_FILE" + filter_changed=1 + fi + + if [ $filter_changed -eq 1 ] + then + echo "Tentacle filter updated for agent deployment feature." + echo "Please restart 'tentacle_serverd' service." + fi + else echo cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_FILE cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_FILE diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 101a9a9ddb..129231cd49 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.776 Build 240404"; +my $version = "7.0NG.776 Build 240410"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5469c50f29..f4403289b9 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.776 Build 240404"; +my $version = "7.0NG.776 Build 240410"; # save program name for logging my $progname = basename($0); @@ -3404,9 +3404,14 @@ sub cli_agent_update_custom_fields() { } } + if(!defined($new_value)) { + print_log "[ERROR] Error updating field '$field' no new value has been provided\n\n"; + exit; + } + print_log "\n[INFO] Updating field '$field' in agent with ID '$id_agent'\n\n"; - my $result = pandora_agent_update_custom_field ($dbh, $new_value, $custom_field, $id_agent); + my $result = pandora_update_agent_custom_field ($dbh, $new_value, $custom_field, $id_agent); if($result == "0E0"){ print_log "[ERROR] Error updating field '$field'\n\n"; @@ -7916,7 +7921,7 @@ sub pandora_manage_main ($$$) { 'values' => [ 'unknown','alert_fired','alert_recovered','alert_ceased', 'alert_manual_validation','recon_host_detected','system', - 'error','new_agent','going_up_warning','going_up_critical','going_down_warning', + 'error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_unknown', 'going_down_normal','going_down_critical','going_up_normal','configuration_change' ] },