merge develop into ent-10633-pantalla-de-timeout

This commit is contained in:
Daniel Cebrian 2023-03-30 09:15:10 +02:00
commit b9fc352578
259 changed files with 10830 additions and 7102 deletions

View File

@ -174,7 +174,7 @@ execute_cmd "dnf module disable -y mysql" "Disabiling mysql module"
if [ "$MYVER" -eq '80' ] ; then
execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module"
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-24" "Installing Percona Server 80"
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-80" "Installing Percona Server 80"
fi
if [ "$MYVER" -ne '80' ] ; then

View File

@ -155,7 +155,7 @@ execute_cmd "apt install -y gnupg2 lsb-release ./percona-release_latest.generic_
execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8"
echo -en "${cyan}Installing Percona Server for MySQL8...${reset}"
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server &>> "$LOGFILE"
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server percona-xtrabackup-80 &>> "$LOGFILE"
check_cmd_status "Error Installing MySql Server"
#Configuring Database

View File

@ -42,7 +42,7 @@ check_cmd_status () {
echo "Error installing Pandora FMS Agent for detailed error please check log: $LOGFILE"
rm -rf $HOME/pandora_deploy_tmp/*.rpm* &>> $LOGFILE
exit 1
else
else
echo -e "${green}OK${reset}"
return 0
fi
@ -65,6 +65,12 @@ check_root_permissions () {
fi
}
install_tarball () {
tar xvzf $1
cd unix && ./pandora_agent_installer --install
}
install_autodiscover () {
local arch=$1
wget http://firefly.artica.es/projects/autodiscover-linux.zip
@ -145,14 +151,17 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
$package_manager_cmd install -y http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm &>> $LOGFILE
echo -en "${cyan}Installing Pandora FMS agent...${reset}"
check_cmd_status 'Error installing Pandora FMS agent'
[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection"
fi
if [[ $OS_RELEASE == 'debian' ]]; then
execute_cmd "apt update" 'Updating repos'
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies'
execute_cmd 'wget http://firefly.artica.es/pandorafms/latest/Debian_Ubuntu/pandorafms.agent_linux_7.0NG.deb' 'Downloading Pandora FMS agent dependencies'
execute_cmd 'apt install -y ./pandorafms.agent_linux_7.0NG.deb' 'Installing Pandora FMS agent'
execute_cmd 'wget http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz' 'Downloading Pandora FMS agent package'
execute_cmd 'install_tarball pandorafms_agent_linux-7.0NG.tar.gz' 'Installing Pandora FMS agent'
[[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection"
cd $HOME/pandora_deploy_tmp
fi
# Configuring Agente
@ -165,6 +174,7 @@ fi
[[ $PANDORA_AGENT_ALIAS ]] && sed -i "s/^#agent_alias.*$/agent_alias $PANDORA_AGENT_ALIAS/g" $PANDORA_AGENT_CONF
[[ $PANDORA_SECONDARY_GROUPS ]] && sed -i "s/^# secondary_groups.*$/secondary_groups $PANDORA_SECONDARY_GROUPS/g" $PANDORA_AGENT_CONF
[[ $TIMEZONE ]] && ln -sfn /usr/share/zoneinfo/$TIMEZONE /etc/localtime
[[ $PANDORA_AGENT_SSL ]] && sed -i "s/^#server_ssl.*$/server_ssl $PANDORA_AGENT_SSL/g" $PANDORA_AGENT_CONF
#installing autodiscover

View File

@ -238,7 +238,7 @@ execute_cmd "dnf module disable -y mysql" "Disabiling mysql module"
if [ "$MYVER" -eq '80' ] ; then
execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module"
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-24" "Installing Percona Server 80"
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-80" "Installing Percona Server 80"
fi
if [ "$MYVER" -ne '80' ] ; then

View File

@ -273,6 +273,7 @@ server_dependencies=" \
libencode-perl \
cron \
libgeo-ip-perl \
arping \
openjdk-8-jdk "
execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
@ -385,7 +386,7 @@ execute_cmd "apt install -y gnupg2 lsb-release ./percona-release_latest.generic_
execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8"
echo -en "${cyan}Installing Percona Server for MySQL8...${reset}"
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server &>> "$LOGFILE"
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server percona-xtrabackup-80 &>> "$LOGFILE"
check_cmd_status "Error Installing MySql Server"

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, AIX version
# Version 7.0NG.770, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, FreeBSD Version
# Version 7.0NG.770, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, HP-UX Version
# Version 7.0NG.770, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux
# Version 7.0NG.770, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux
# Version 7.0NG.770, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, Solaris Version
# Version 7.0NG.770, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.769
# Version 7.0NG.770
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.769, AIX version
# Version 7.0NG.770, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.769
# Version 7.0NG.770
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.769, HPUX Version
# Version 7.0NG.770, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769
# Version 7.0NG.770
# Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769
# Version 7.0NG.770
# Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769
# Version 7.0NG.770
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.769, Solaris version
# Version 7.0NG.770, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, AIX version
# Version 7.0NG.770, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.769-230315
Version: 7.0NG.770-230329
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.769-230315"
pandora_version="7.0NG.770-230329"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -31,7 +31,7 @@ fi
if [ "$#" -ge 2 ]; then
VERSION="$2"
else
VERSION="7.0NG.769"
VERSION="7.0NG.770"
fi
# Path for the generated DMG file

View File

@ -19,11 +19,11 @@
<choice id="com.pandorafms.pandorafms_src" visible="false">
<pkg-ref id="com.pandorafms.pandorafms_src"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.769" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.770" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.769" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.770" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" />
<script>
<![CDATA[

View File

@ -5,9 +5,9 @@
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.769</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.769 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.769</string>
<key>CFBundleVersion</key> <string>7.0NG.770</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.770 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.770</string>
<key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string>

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux
# Version 7.0NG.770, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, FreeBSD Version
# Version 7.0NG.770, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, HP-UX Version
# Version 7.0NG.770, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux
# Version 7.0NG.770, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux
# Version 7.0NG.770, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, NetBSD Version
# Version 7.0NG.770, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.769, Solaris Version
# Version 7.0NG.770, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1022,8 +1022,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.769';
use constant AGENT_BUILD => '230315';
use constant AGENT_VERSION => '7.0NG.770';
use constant AGENT_BUILD => '230329';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -3749,6 +3749,7 @@ sub module_plugin ($) {
# Do not save the output if there was an error
if ($? != 0) {
log_message ('error', "plugin execution '". $command ."' exited with error code " . $?);
return ();
}

View File

@ -3,8 +3,8 @@
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.769
%define release 230315
%define version 7.0NG.770
%define release 230329
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,8 +3,8 @@
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.769
%define release 230315
%define version 7.0NG.770
%define release 230329
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.769"
PI_BUILD="230315"
PI_VERSION="7.0NG.770"
PI_BUILD="230329"
OS_NAME=`uname -s`
FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.769
# Version 7.0NG.770
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.769}
{Pandora FMS Windows Agent v7.0NG.770}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230315}
{230329}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.769 Build 230315")
#define PANDORA_VERSION ("7.0NG.770 Build 230329")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.769(Build 230315))"
VALUE "ProductVersion", "(7.0NG.770(Build 230329))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.769-230315
Version: 7.0NG.770-230329
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.769-230315"
pandora_version="7.0NG.770-230329"
package_pear=0
package_pandora=1

View File

@ -240,7 +240,28 @@ function pandora_files_repo_operation()
}
// Header.
ui_print_page_header(__('Files repository'), 'images/extensions.png', false, '', false, $onheader);
ui_print_standard_header(
__('Files repository'),
'images/extensions.png',
false,
'',
false,
$onheader,
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Extension manager'),
],
[
'link' => '',
'label' => __('Files repository'),
],
]
);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php';

View File

@ -441,84 +441,95 @@ function quickShellSettings()
}
// Form. Using old style.
echo '<fieldset>';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Quickshell').'</legend>';
$t = new StdClass();
$t->data = [];
$t->width = '100%';
$t->class = 'databox filters';
$t->class = 'filter-table-adv';
$t->data = [];
$t->style = [];
$t->style[0] = 'font-weight: bold; width: 40%;';
$t->style[0] = 'width: 50%;';
$t->data[0][0] = __('Gotty path');
$t->data[0][1] = html_print_input_text(
'gotty',
$config['gotty'],
'',
30,
100,
true
$t->data[0][] = html_print_label_input_block(
__('Gotty path'),
html_print_input_text(
'gotty',
$config['gotty'],
'',
30,
100,
true
)
);
$t->data[1][0] = __('Gotty host');
$t->data[1][1] = html_print_input_text(
'gotty_host',
$config['gotty_host'],
'',
30,
100,
true
$t->data[0][] = html_print_label_input_block(
__('Gotty host'),
html_print_input_text(
'gotty_host',
$config['gotty_host'],
'',
30,
100,
true
)
);
$t->data[2][0] = __('Gotty ssh port');
$t->data[2][1] = html_print_input_text(
'gotty_ssh_port',
$config['gotty_ssh_port'],
'',
30,
100,
true
$t->data[1][] = html_print_label_input_block(
__('Gotty ssh port'),
html_print_input_text(
'gotty_ssh_port',
$config['gotty_ssh_port'],
'',
30,
100,
true
)
);
$t->data[3][0] = __('Gotty telnet port');
$t->data[3][1] = html_print_input_text(
'gotty_telnet_port',
$config['gotty_telnet_port'],
'',
30,
100,
true
$t->data[1][] = html_print_label_input_block(
__('Gotty telnet port'),
html_print_input_text(
'gotty_telnet_port',
$config['gotty_telnet_port'],
'',
30,
100,
true
)
);
$hidden = new StdClass();
$hidden = new stdClass();
$hidden->data = [];
$hidden->width = '100%';
$hidden->class = 'databox filters';
$hidden->class = 'filter-table-adv';
$hidden->data = [];
$hidden->style[0] = 'font-weight: bold;width: 40%;';
$hidden->style[0] = 'width: 50%;';
$hidden->data[0][0] = __('Gotty user');
$hidden->data[0][1] = html_print_input_text(
'gotty_user',
$config['gotty_user'],
'',
30,
100,
true
$hidden->data[0][] = html_print_label_input_block(
__('Gotty user'),
html_print_input_text(
'gotty_user',
$config['gotty_user'],
'',
30,
100,
true
)
);
$hidden->data[1][0] = __('Gotty password');
$hidden->data[1][1] = html_print_input_password(
'gotty_pass',
io_output_password($config['gotty_pass']),
'',
30,
100,
true
$hidden->data[0][] = html_print_label_input_block(
__('Gotty password'),
html_print_input_password(
'gotty_pass',
io_output_password($config['gotty_pass']),
'',
30,
100,
true
)
);
$hidden->data[1][1] .= ui_print_reveal_password('gotty_pass', true);
html_print_table($t);

View File

@ -1,5 +1,28 @@
START TRANSACTION;
CREATE TABLE IF NOT EXISTS `tconsole` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_console` BIGINT NOT NULL DEFAULT 0,
`description` TEXT,
`version` TINYTEXT,
`last_execution` INT UNSIGNED NOT NULL DEFAULT 0,
`console_type` TINYINT NOT NULL DEFAULT 0,
`timezone` TINYTEXT,
`public_url` TEXT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
ALTER TABLE `tuser_task_scheduled` ADD COLUMN `id_console` BIGINT NOT NULL DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `ssh_status` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `db_status` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `replication_status` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `replication_delay` BIGINT DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `master` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `utimestamp` BIGINT DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `mysql_version` VARCHAR(10) DEFAULT '';
ALTER TABLE `tdatabase` ADD COLUMN `pandora_version` VARCHAR(10) DEFAULT '';
UPDATE tconfig_os SET `icon_name` = 'linux@os.svg' WHERE `id_os` = 1;
UPDATE tconfig_os SET `icon_name` = 'solaris@os.svg' WHERE `id_os` = 2;
UPDATE tconfig_os SET `icon_name` = 'aix@os.svg' WHERE `id_os` = 3;
@ -166,4 +189,6 @@ CREATE TABLE IF NOT EXISTS `tfavmenu_user` (
`section` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`));
INSERT INTO `tconfig` (`token`, `value`) VALUES ('legacy_database_ha', 1);
COMMIT;

View File

@ -27,10 +27,27 @@ require_once __DIR__.'/../include/functions_ui.php';
require_once __DIR__.'/../include/functions.php';
require_once __DIR__.'/../include/functions_html.php';
echo '<style>
:root {';
if ($config['style'] === 'pandora') {
echo '--login-background-color: rgba(255, 255, 255, 0.4);';
echo '--login-label-color: #545454;';
echo '--login-text-color: #000;';
$style_theme = 'white-theme';
} else {
echo '--login-background-color: rgba(0, 0, 0, 0.8);';
echo '--login-label-color: #c5c5c5;';
echo '--login-text-color: #fff;';
$style_theme = '';
}
echo '}
</style>';
if ($config['visual_animation']) {
// form#login_form, div.login_data {
echo '<style>
div.container_login {
div.container_login {
animation: container_login 3s ease;
}
@ -120,7 +137,13 @@ if (empty($config['background_opacity']) === false) {
$opacity = 30;
}
$login_body_style = 'style="'.$background_100.'background: linear-gradient(rgba(0,0,0,.'.$opacity.'), rgba(0,0,0,.'.$opacity.")), url('".$background_url."');\"";
if ($config['style'] === 'pandora') {
$opacity_color = '255, 255, 255, .';
} else {
$opacity_color = '0, 0, 0, .';
}
$login_body_style = 'style="'.$background_100.'background: linear-gradient(rgba('.$opacity_color.$opacity.'), rgba('.$opacity_color.$opacity.")), url('".$background_url."');\"";
// Get alternative custom in case of db fail.
$custom_fields = [
@ -147,7 +170,7 @@ foreach ($custom_fields as $field) {
$docs_logo = ui_get_docs_logo();
$support_logo = ui_get_support_logo();
echo '<div id="login_body" '.$login_body_style.'>';
echo '<div id="header_login">';
echo '<div id="header_login" class="'.$style_theme.'">';
echo '<div id="list_icon_docs_support"><ul>';
@ -185,12 +208,12 @@ echo '</div>';
echo '<div class="container_login">';
echo '<div class="login_page">';
echo '<form method="post" action="'.ui_get_full_url('index.php'.$url).'" ><div class="login_logo_icon">';
echo '<form method="post" id="login_form" action="'.ui_get_full_url('index.php'.$url).'" ><div class="login_logo_icon">';
echo '<a href="'.$logo_link.'">';
if (is_metaconsole() === true) {
if (!isset($config['custom_logo_login'])) {
html_print_image(
'enterprise/images/custom_logo_login/login_logo.png',
'enterprise/images/custom_logo_login/Pandora-FMS-1.png',
false,
[
'class' => 'login_logo',
@ -215,13 +238,13 @@ if (is_metaconsole() === true) {
}
} else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (!isset($config['custom_logo_login'])) {
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/login_logo_v7.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else {
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/'.$config['custom_logo_login']), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
}
} else {
if (empty($config['custom_logo_login']) === true) {
html_print_image(ui_get_full_url('images/custom_logo_login/pandora_logo.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
html_print_image(ui_get_full_url('images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else {
html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
}
@ -297,7 +320,7 @@ switch ($login_screen) {
);
echo '</div>';
} else {
echo '<div class="login_nick">';
echo '<div class="login_nick '.$style_theme.'">';
html_print_input_text_extended(
'nick',
'',
@ -307,10 +330,11 @@ switch ($login_screen) {
'',
false,
'',
'autocomplete="off" placeholder="'.__('User').'"'
'autocomplete="off" class="input" placeholder=" "'
);
echo '<label for="nick" class="placeholder">'.__('User').'</label>';
echo '</div>';
echo '<div class="login_pass">';
echo '<div class="login_pass '.$style_theme.'">';
html_print_input_text_extended(
'pass',
'',
@ -320,20 +344,18 @@ switch ($login_screen) {
'',
false,
'',
'autocomplete="off" placeholder="'.__('Password').'"',
'autocomplete="off" class="input " placeholder=" " style="background-image: url(images/enable.svg);"',
false,
true
);
echo '<label for="pass" class="placeholder">'.__('Password').'</label>';
echo '</div>';
echo '<div class="login_button">';
html_print_submit_button(
__('Login'),
__('Let&#39;s go'),
'login_button',
false,
[
'fixed_id' => 'submit-login_button',
'icon' => 'signin',
]
['fixed_id' => 'submit-login_button']
);
echo '</div>';
}
@ -346,15 +368,36 @@ switch ($login_screen) {
}
}
echo '<div class="login_nick">';
echo '<div class="login_nick '.$style_theme.'">';
echo '<div>';
echo '</div>';
html_print_input_text_extended('auth_code', '', 'auth_code', '', '', '', false, '', 'class="login login_password" placeholder="'.__('Authentication code').'"', false, true);
html_print_input_text_extended(
'auth_code',
'',
'auth_code',
'',
'',
'',
false,
'',
'class="login login_password input" placeholder=" "',
false,
true
);
echo '<label for="pass" class="placeholder">'.__('Authentication code').'</label>';
echo '</div>';
echo '<div class="login_button">';
// html_print_submit_button(__('Check code').'&nbsp;&nbsp;>', 'login_button', false, 'class="next_login"');
html_print_submit_button(__('Check code').'&nbsp;&nbsp;>', 'login_button', false, [ 'fixed_id' => 'submit-login_button', 'class' => 'next_login']);
html_print_submit_button(
__('Check code'),
'login_button',
false,
[
'fixed_id' => 'submit-login_button',
'class' => 'next_login',
]
);
echo '</div>';
break;
@ -425,78 +468,79 @@ html_print_csrf_hidden();
echo '</form></div>';
echo '<div class="login_data">';
echo '<div class ="img_banner_login">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (empty($config['custom_splash_login']) === false && $config['custom_splash_login'] !== 'default') {
if ($config['custom_splash_login'] !== 'none.png') {
html_print_image(
'enterprise/images/custom_splash_login/'.$config['custom_splash_login'],
false,
[
'class' => 'splash-logo',
'alt' => 'splash',
'border' => 0,
],
false,
false
);
}
} else {
echo '
<div class="loginimg-container">
<div class="lineone"></div>
<div class="linetwo"></div>
<div class="linethree"></div>
<div style="display:flex;">
<div class="towerone"></div>
<div class="towertwo"></div>
<div class="towerthree"></div>
<div class="towerfour"></div>
</div>
</div>
';
}
} else {
echo '
<div class="loginimg-container">
<div class="lineone"></div>
<div class="linetwo"></div>
<div class="linethree"></div>
<div style="display:flex;">
<div class="towerone"></div>
<div class="towertwo"></div>
<div class="towerthree"></div>
<div class="towerfour"></div>
</div>
</div>
';
}
echo '</div>';
echo '<div class ="text_banner_login">';
echo '<div><span class="span1">';
echo '<div><span class="span1">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title1_login']) {
echo io_safe_output($config['custom_title1_login']);
} else {
echo __('WELCOME TO %s', get_product_name());
echo __('ONE TOOL TO RULE THEM ALL');
}
} else {
echo __('WELCOME TO %s', get_product_name());
echo __('ONE TOOL TO RULE THEM ALL');
}
echo '</span></div>';
echo '<div><span class="span2">';
echo '</span></div>';
echo '<div><span class="span2">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title2_login']) {
echo io_safe_output($config['custom_title2_login']);
} else {
echo __('NEXT GENERATION');
}
} else {
echo __('NEXT GENERATION');
}
echo '</span></div>';
echo '</div>';
echo '<div class ="img_banner_login">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (empty($config['custom_splash_login']) === false && $config['custom_splash_login'] !== 'default') {
html_print_image(
'enterprise/images/custom_splash_login/'.$config['custom_splash_login'],
false,
[
'alt' => 'splash',
'border' => 0,
],
false,
false
);
} else {
echo '
<div class="loginimg-container">
<div class="lineone"></div>
<div class="linetwo"></div>
<div class="linethree"></div>
<div style="display:flex;">
<div class="towerone"></div>
<div class="towertwo"></div>
<div class="towerthree"></div>
<div class="towerfour"></div>
</div>
</div>
';
}
} else {
echo '
<div class="loginimg-container">
<div class="lineone"></div>
<div class="linetwo"></div>
<div class="linethree"></div>
<div style="display:flex;">
<div class="towerone"></div>
<div class="towertwo"></div>
<div class="towerthree"></div>
<div class="towerfour"></div>
</div>
</div>
';
}
echo '</div>';
echo '</div>';
echo '</span></div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';

View File

@ -184,7 +184,7 @@ if (!$double_auth_enabled
background: "black"
},
width: 500,
height: 400,
height: 'auto',
close: function (event, ui) {
// Abort the ajax request
if (typeof request != 'undefined'){

View File

@ -487,21 +487,18 @@ if (isset($groups[$grupo]) === true || $new_agent === true) {
$tableAgent->data['primary_group'][0] .= html_print_input_hidden('grupo', $grupo, true);
}
$tableAgent->data['primary_group'][0] .= html_print_div(
[
'content' => ui_print_group_icon(
$grupo,
true,
'',
($id_agente === 0) ? 'display: none;' : '',
true,
false,
false,
'after_input_icon'
),
],
true
$tableAgent->data['primary_group'][0] .= '<span id="group_preview">';
$tableAgent->data['primary_group'][0] .= ui_print_group_icon(
$grupo,
true,
'',
($id_agente === 0) ? 'display: none;' : '',
true,
false,
false,
'after_input_icon'
);
$tableAgent->data['primary_group'][0] .= '</span>';
$tableAgent->data['caption_interval'][0] = __('Interval');
// $tableAgent->rowstyle['interval'] = 'width: 260px';
@ -969,23 +966,23 @@ foreach ($fields as $field) {
$link_url = '';
}
$data_field[1] = '<span style="line-height: 3.5;">'.__('Link text:').'</span>';
$data_field[1] .= '<br>';
$data_field[1] .= html_print_textarea(
$customContent = '<span style="line-height: 3.5;">'.__('Link text:').'</span>';
$customContent .= '<br>';
$customContent .= html_print_textarea(
'customvalue_'.$field['id_field'].'[]',
2,
65,
1000,
$link_text,
'class="min-height-30px w100p"',
true
);
$data_field[1] .= '<br>';
$data_field[1] .= '<span style="line-height: 3.5;">'.__('Link URL:').'</span>';
$data_field[1] .= '<br>';
$data_field[1] .= html_print_textarea(
$customContent .= '<br>';
$customContent .= '<span style="line-height: 3.5;">'.__('Link URL:').'</span>';
$customContent .= '<br>';
$customContent .= html_print_textarea(
'customvalue_'.$field['id_field'].'[]',
2,
65,
1000,
$link_url,
'class="min-height-30px w100p"',
true
@ -994,7 +991,7 @@ foreach ($fields as $field) {
$customContent = html_print_textarea(
'customvalue_'.$field['id_field'],
2,
65,
1000,
$custom_value,
'class="min-height-30px w100p"',
true
@ -1039,7 +1036,7 @@ if (empty($fields) === false) {
'',
true,
false,
'white_box white_box_opened white_table_graph_fixed',
'white_box white_box_opened white_table_graph_fixed no_border',
'no-border custom_fields_elements'
);
}

View File

@ -827,12 +827,6 @@ if ($id_agente) {
'link' => '',
'label' => $tab_name,
],
],
[
'id_element' => $id_agente,
'url' => 'godmode/agentes/configurar_agente&tab=main&id_agente='.$id_agente,
'label' => agents_get_alias($id_agente),
'section' => 'Agents',
]
);
}

View File

@ -57,14 +57,33 @@ if ($id_field) {
$combo_values = $field['combo_values'] ? $field['combo_values'] : '';
$is_combo_enable = $config['is_combo_enable'];
$is_link_enabled = $field['is_link_enabled'];
ui_print_page_header(__('Update agent custom field'), 'images/custom_field.png', false, '', true, '');
$header_title = __('Update agent custom field');
} else {
ui_print_page_header(__('Create agent custom field'), 'images/custom_field.png', false, '', true, '');
$header_title = __('Create agent custom field');
}
$table = new stdClass();
$table->class = 'databox';
$table->id = 'configure_field';
ui_print_standard_header(
$header_title,
'images/custom_field.png',
false,
'',
true,
[],
[
[
'link' => 'index.php?sec=gagente&sec2=godmode/agentes/fields_manager',
'label' => __('Resources'),
],
[
'link' => 'index.php?sec=gagente&sec2=godmode/agentes/fields_manager',
'label' => __('Custom field'),
],
[
'link' => '',
'label' => __('Edit'),
],
]
);
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p class='center bolder'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
@ -82,80 +101,96 @@ echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Informati
echo "<p class='center bolder'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
echo '</div>';
$table = new stdClass();
$table->class = 'databox filter-table-adv';
$table->id = 'configure_field';
$table->width = '100%';
$table->size = [];
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
$table->data[0][0] = __('Name');
$table->data[1][0] = html_print_input_text(
'name',
$name,
'',
35,
100,
true
$table->data[0][0] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$name,
'',
35,
100,
true
)
);
$table->data[2][0] = __('Pass type').ui_print_help_tip(
__('The fields with pass type enabled will be displayed like html input type pass in html'),
true
);
$table->data[2][1] = __('Display on front').ui_print_help_tip(
__('The fields with display on front enabled will be displayed into the agent details'),
true
);
$table->data[2][2] = __('Link type');
$table->data[3][0] = html_print_checkbox_switch(
'is_password_type',
1,
$is_password_type,
true
);
$table->data[3][1] = html_print_checkbox_switch(
'display_on_front',
1,
$display_on_front,
true
);
$table->data[3][2] = html_print_checkbox_switch_extended(
'is_link_enabled',
1,
$is_link_enabled,
false,
'',
'',
true
);
$table->data[4][0] = __('Enabled combo');
$table->data[5][0] = html_print_checkbox_switch_extended(
'is_combo_enable',
0,
$config['is_combo_enable'],
false,
'',
'',
true
$table->data[0][1] = html_print_label_input_block(
__('Display on front').ui_print_help_tip(
__('The fields with display on front enabled will be displayed into the agent details'),
true
),
html_print_checkbox_switch(
'display_on_front',
1,
$display_on_front,
true
)
);
$table->cellstyle[4][1] = 'display: none;';
$table->cellstyle[5][1] = 'display: none;';
$table->data[4][1] = __('Combo values').ui_print_help_tip(
__('Set values separated by comma'),
true
);
$table->data[5][1] = html_print_textarea(
'combo_values',
3,
65,
io_safe_output($combo_values),
'',
true
$table->data[1][0] = html_print_label_input_block(
__('Link type'),
html_print_checkbox_switch_extended(
'is_link_enabled',
1,
$is_link_enabled,
false,
'',
'',
true
)
);
$table->data[2][0] = html_print_label_input_block(
__('Pass type').ui_print_help_tip(
__('The fields with pass type enabled will be displayed like html input type pass in html'),
true
),
html_print_checkbox_switch(
'is_password_type',
1,
$is_password_type,
true
)
);
echo '<form name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
$table->data[2][1] = html_print_label_input_block(
__('Enabled combo'),
html_print_checkbox_switch_extended(
'is_combo_enable',
0,
$config['is_combo_enable'],
false,
'',
'',
true
)
);
$table->data[3][0] = html_print_label_input_block(
__('Combo values').ui_print_help_tip(
__('Set values separated by comma'),
true
),
html_print_textarea(
'combo_values',
3,
65,
io_safe_output($combo_values),
'',
true
)
);
echo '<form class="max_floating_element_size" name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
html_print_table($table);
if ($id_field > 0) {
@ -195,64 +230,66 @@ echo '</form>';
$(document).ready (function () {
if($('input[type=hidden][name=update_field]').val() == 1 && $('#textarea_combo_values').val() != ''){
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show();
$('#configure_field-3').show();
$('input[type=checkbox][name=is_password_type]').change(function (e) {
dialog_message("#message_set_password");
$('input[type=checkbox][name=is_password_type]').prop('checked', false);
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show();
$('#configure_field-3').show();
e.preventDefault();
});
$('input[type=checkbox][name=is_combo_enable]').change(function (e) {
if($('#textarea_combo_values').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
dialog_message("#message_set_combo");
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show();
e.preventDefault();
}
});
});
$('input[type=checkbox][name=is_combo_enable]').change(function (e) {
if($('#textarea_combo_values').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
dialog_message("#message_set_combo");
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-3').show();
e.preventDefault();
}
});
} else {
$('#configure_field-3').hide();
}
if ($('input[type=checkbox][name=is_link_enabled]').is(":checked") === true) {
$('#configure_field-1').hide();
$('#configure_field-3').hide();
$('#configure_field-2').hide();
} else {
$('#configure_field-1').show();
$('#configure_field-3').show();
$('#configure_field-2').show();
}
$('input[type=checkbox][name=is_link_enabled]').change(function () {
if( $(this).is(":checked") ){
$('#configure_field-1').hide();
if( $('input[type=checkbox][name=is_link_enabled]').prop('checked') ){
$('#configure_field-2').hide();
$('#configure_field-3').hide();
} else{
$('#configure_field-1').show();
$('#configure_field-3').show();
$('#configure_field-2').show();
if($('input[type=checkbox][name=is_combo_enable]').prop('checked') === true) {
$('#configure_field-3').show();
}
}
});
$('input[type=checkbox][name=is_combo_enable]').change(function () {
if( $(this).is(":checked") ){
$('#configure_field-4').show();
if( $('input[type=checkbox][name=is_combo_enable]').prop('checked') ){
$('#configure_field-3').show();
dialog_message("#message_no_set_password");
$('#configure_field-1').hide();
$('#configure_field-5').hide();
}
else{
$('#configure_field-4').hide();
$('#configure_field-3').hide();
$('#configure_field-1').show();
$('#configure_field-5').show();
}
});
$('input[type=checkbox][name=is_password_type]').change(function () {
if( $(this).is(":checked")){
if( $('input[type=checkbox][name=is_password_type]').prop('checked')){
dialog_message("#message_no_set_combo");
$('#configure_field-3').hide();
$('#configure_field-5').hide();
}
else{
$('#configure_field-3').show();
$('#configure_field-5').show();
if($('input[type=checkbox][name=is_combo_enable]').prop('checked') === true) {
$('#configure_field-3').show();
}
}
});
});

View File

@ -225,7 +225,7 @@ if (db_get_num_rows($sql) == 0) {
} else {
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox info_trable';
$table->class = 'databox info_table max_floating_element_size';
$table->data = [];
$table->head = [];
$table->styleTable = '';

View File

@ -794,7 +794,7 @@ if ($agents !== false) {
// Agent name column (1). Agent name.
$agentNameColumn = html_print_anchor(
[
'href' => ui_get_full_url($agentNameUrl),
'href' => ui_get_full_url($agentViewUrl),
'title' => $agent['nombre'],
'content' => ui_print_truncate_text($agent['alias'], 'agent_medium').implode('', $additionalDataAgentName),
],
@ -866,7 +866,6 @@ if ($agents !== false) {
// Operating System icon column.
$osIconColumn = html_print_div(
[
'class' => 'main_menu_icon invert_filter',
'content' => ui_print_os_icon($agent['id_os'], false, true),
],
true
@ -885,7 +884,6 @@ if ($agents !== false) {
// Group icon and name column.
$agentGroupIconColumn = html_print_div(
[
'class' => 'main_menu_icon invert_filter',
'content' => ui_print_group_icon($agent['id_grupo'], true),
],
true
@ -907,12 +905,12 @@ if ($agents !== false) {
$agentDisableEnableTitle = __('Enable agent');
$agentDisableEnableAction = 'enable_agent';
$agentDisableEnableCaption = __('You are going to enable a cluster agent. Are you sure?');
$agentDisableEnableIcon = 'change-pause.svg';
$agentDisableEnableIcon = 'change-active.svg';
} else {
$agentDisableEnableTitle = __('Disable agent');
$agentDisableEnableAction = 'disable_agent';
$agentDisableEnableCaption = __('You are going to disable a cluster agent. Are you sure?');
$agentDisableEnableIcon = 'change-active.svg';
$agentDisableEnableIcon = 'change-pause.svg';
}
$agentActionButtons[] = html_print_menu_button(

View File

@ -1117,7 +1117,7 @@ $modalCreateModule .= html_print_div(
'class' => 'action-buttons-right-forced',
'content' => html_print_submit_button(
__('Create'),
'create_module',
'modal_button_create',
false,
[
'icon' => 'next',
@ -1142,7 +1142,6 @@ html_print_div(
<script type="text/javascript">
function create_module_dialog(){
console.log('Entra');
$('#modal').dialog({
title: '<?php echo __('Create Module'); ?>',
resizable: true,

View File

@ -741,8 +741,8 @@ $outputForm .= ui_toggle(
false,
true,
'',
'',
'box-flat white_table_flex white_table_graph_fixed'
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph'
);
$outputForm .= ui_toggle(
@ -753,8 +753,8 @@ $outputForm .= ui_toggle(
true,
true,
'',
'',
'box-flat white_table_flex white_table_graph_fixed'
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph'
);
$outputForm .= ui_toggle(
@ -765,8 +765,8 @@ $outputForm .= ui_toggle(
true,
true,
'',
'',
'box-flat white_table_flex white_table_graph_fixed'
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph'
);
if ((int) $moduletype !== 13) {
@ -784,8 +784,8 @@ if ((int) $moduletype !== 13) {
true,
true,
'',
'',
'box-flat white_table_flex white_table_graph_fixed'
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph'
);
}

View File

@ -445,79 +445,75 @@ $tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width
$tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').'&nbsp;';
if ((isset($stringTypeModule) === false || $stringTypeModule === false)) {
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'min_warning',
$min_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['warning_threshold'][1] .= html_print_input_text(
'max_warning',
$max_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'min_warning',
$min_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['warning_threshold'][1] .= html_print_input_text(
'max_warning',
$max_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'),
html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'),
html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'),
],
[ 'class' => 'margin-top-10' ],
true
);
}
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'),
html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'),
html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'),
],
[ 'class' => 'margin-top-10' ],
true
);
if (isset($stringTypeModule) === true && $stringTypeModule === true) {
$basicThresholdsIntervalWarning = [];
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
'warning_inverse_string',
1,
$warning_inverse,
true,
$disabledBecauseInPolicy
);
$basicThresholdsIntervalWarning = [];
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
'warning_inverse_string',
1,
$warning_inverse,
true,
$disabledBecauseInPolicy
);
$tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalWarning),
],
true
);
$tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalWarning),
],
true
);
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'str_warning',
str_replace('"', '', $str_warning),
'',
10,
1024,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
}
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'str_warning',
str_replace('"', '', $str_warning),
'',
10,
1024,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div(
@ -532,87 +528,84 @@ $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div(
$tableBasicThresholds->rowclass['caption_critical_threshold'] = 'field_half_width pdd_t_10px';
$tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').'&nbsp;';
if ((isset($stringTypeModule) === false || $stringTypeModule === false)) {
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'min_critical',
$min_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text(
'max_critical',
$max_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'min_critical',
$min_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text(
'max_critical',
$max_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('critical_thresholds_checks', 'normal_critical', __('Normal'), ($percentage_critical && $critical_inverse) === false, false, '', '', true, false, '', 'radius-normal_critical'),
html_print_radio_button_extended('critical_thresholds_checks', 'critical_inverse', __('Inverse interval'), $critical_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-critical_inverse'),
html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), $percentage_critical, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'),
],
[ 'class' => 'margin-top-10' ],
true
);
}
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('critical_thresholds_checks', 'normal_critical', __('Normal'), ($percentage_critical && $critical_inverse) === false, false, '', '', true, false, '', 'radius-normal_critical'),
html_print_radio_button_extended('critical_thresholds_checks', 'critical_inverse', __('Inverse interval'), $critical_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-critical_inverse'),
html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), $percentage_critical, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'),
],
[ 'class' => 'margin-top-10' ],
true
);
if (isset($stringTypeModule) === true && $stringTypeModule === true) {
$basicThresholdsIntervalCritical = [];
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
'critical_inverse_string',
1,
$critical_inverse,
true,
$disabledBecauseInPolicy
);
$tableBasicThresholds->rowclass['caption_switch_critical_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalCritical),
],
true
);
$basicThresholdsIntervalCritical = [];
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
'critical_inverse_string',
1,
$critical_inverse,
true,
$disabledBecauseInPolicy
);
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div(
[
'id' => 'percentage_critical',
'content' => $divPercentageContent,
],
true
);
$tableBasicThresholds->rowclass['caption_switch_critical_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalCritical),
],
true
);
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'str_critical',
str_replace('"', '', $str_critical),
'',
10,
1024,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
);
}
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div(
[
'id' => 'percentage_critical',
'content' => $divPercentageContent,
],
true
);
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'str_critical',
str_replace('"', '', $str_critical),
'',
10,
1024,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
);
$table_simple->rowstyle['thresholds_table'] = 'margin-top: 15px;height: 340px;width: 100%';
$table_simple->cellclass['thresholds_table'][0] = 'table_section half_section_left';
@ -622,6 +615,7 @@ if (modules_is_string_type($id_module_type) === false || (bool) $edit === true)
$table_simple->data['thresholds_table'][1] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
}
$table_simple->rowclass['caption_historical_data'] = 'mrgn_top_10px';
$table_simple->data['caption_historical_data'][0] = __('Historical data');
if ($disabledBecauseInPolicy) {
// If is disabled, we send a hidden in his place and print a false
@ -1461,74 +1455,97 @@ html_print_input_hidden('module_macro_count', $macro_count);
$table_new_relations = new stdClass();
$table_new_relations->id = 'module_new_relations';
$table_new_relations->width = '100%';
$table_new_relations->class = 'no-class';
$table_new_relations->class = 'filter-table-adv';
$table_new_relations->data = [];
$table_new_relations->style = [];
$table_new_relations->style[0] = 'width: 10%; font-weight: bold;';
$table_new_relations->style[1] = 'width: 25%; text-align: center;';
$table_new_relations->style[2] = 'width: 10%; font-weight: bold;';
$table_new_relations->style[3] = 'width: 25%; text-align: center;';
$table_new_relations->style[4] = 'width: 10%; font-weight: bold;';
$table_new_relations->style[5] = 'width: 25%; text-align: center;';
$table_new_relations->size[0] = '33%';
$table_new_relations->size[1] = '33%';
$table_new_relations->size[2] = '33%';
$table_new_relations->data[0][0] = __('Agent');
$params = [];
$params['return'] = true;
$params['show_helptip'] = true;
$params['input_name'] = 'autocomplete_agent_name';
$params['helptip_text'] = '';
$params['use_hidden_input_idagent'] = true;
$params['print_hidden_input_idagent'] = true;
$params['hidden_input_idagent_id'] = 'hidden-autocomplete_id_agent';
$params['javascript_function_action_after_select_js_call'] = 'change_modules_autocomplete_input();';
$table_new_relations->data[0][1] = ui_print_agent_autocomplete_input($params);
$table_new_relations->data[0][2] = __('Module');
$table_new_relations->data[0][3] = "<div id='module_autocomplete'></div>";
$table_new_relations->data[0][0] = html_print_label_input_block(
__('Agent'),
ui_print_agent_autocomplete_input($params)
);
$table_new_relations->data[0][1] = html_print_label_input_block(
__('Module'),
'<div id="module_autocomplete">'.html_print_input_text('', '', '', false, 255, true, true, false, '', 'w100p').'</div>'
);
$array_rel_type = [];
$array_rel_type['direct'] = __('Direct');
$array_rel_type['failover'] = __('Failover');
$table_new_relations->data[0][4] = __('Rel. type');
$table_new_relations->data[0][5] = html_print_select(
$array_rel_type,
'relation_type',
'',
'',
'',
0,
true,
false,
true,
''
$table_new_relations->data[0][2] = html_print_label_input_block(
__('Rel. type'),
html_print_select(
$array_rel_type,
'relation_type',
'',
'',
'',
0,
true,
false,
true,
'w100p',
false,
'width:100%'
)
);
$table_new_relations->data[0][6] = html_print_button(
__('Add relationship'),
$table_new_relations->data[1][0] = ' ';
$table_new_relations->data[1][1] = ' ';
$table_new_relations->cellstyle[1][2] = 'width:100% !important;';
$table_new_relations->cellclass[1][2] = 'flex flex-end';
$table_new_relations->data[1][2] = "<div id='add_relation_status' class='inline_line' style='margin-right:10px'></div>".html_print_button(
__('Add relationship')."<div id='add_relation_status'></div>",
'add_relation',
false,
'javascript: add_new_relation();',
'class="sub add"',
'add_new_relation();',
[
'class' => 'mini',
'icon' => 'next',
'mode' => 'secondary',
'style' => 'margin-top: 10px; margin-right: 10px',
],
true
);
$table_new_relations->data[0][6] .= "&nbsp;&nbsp;<div id='add_relation_status' class='inline_line'></div>";
// Relationship list.
$table_relations = new stdClass();
$table_relations->id = 'module_relations';
$table_relations->width = '100%';
$table_relations->class = 'databox data';
$table_relations->class = 'info_table';
$table_relations->styleTable = 'border: none';
$table_relations->head = [];
$table_relations->data = [];
$table_relations->rowstyle = [];
$table_relations->rowstyle[-1] = 'display: none;';
$table_relations->style = [];
$table_relations->style[3] = 'width: 10%; text-align: center;';
$table_relations->style[4] = 'width: 10%; text-align: center;';
$table_relations->head[0] = __('Agent');
$table_relations->head[1] = __('Module');
$table_relations->head[2] = __('Type');
$table_relations->head[3] = __('Changes');
$table_relations->head[4] = __('Delete');
$table_relations->headclass[0] = 'w20p';
$table_relations->headclass[1] = 'w20p';
$table_relations->headclass[2] = 'w20p';
$table_relations->headclass[3] = 'w20p';
$table_relations->headclass[4] = 'w20p';
$table_relations->style[0] = 'width:20%';
$table_relations->style[1] = 'width:20%';
$table_relations->style[2] = 'width:20%';
$table_relations->style[3] = 'width:20%';
$table_relations->style[4] = 'width:20%';
// Create an invisible row to use their html to add new rows.
$table_relations->data[-1][0] = '';
@ -1560,6 +1577,9 @@ if ($id_agent_module) {
$relations_count = 0;
foreach ($module_relations as $key => $module_relation) {
// Styles.
$table_relations->cellclass[$relations_count][4] = 'table_action_buttons';
if ($module_relation['module_a'] == $id_agent_module) {
$module_id = $module_relation['module_b'];
$agent_id = modules_give_agent_id_from_module_id(
@ -1623,6 +1643,11 @@ ui_require_jquery_file('json');
/* <![CDATA[ */
$(document).ready (function () {
var disabledBecauseInPolicy = <?php echo '\''.((empty($disabledBecauseInPolicy) === true) ? '0' : '1').'\''; ?>;
var idModuleType = '<?php echo $type_names_hash[$id_module_type]; ?>';
if (idModuleType != '') {
setModuleType(idModuleType);
}
$("#right").click (function () {
jQuery.each($("select[name='id_tag_available[]'] option:selected"), function (key, value) {
tag_name = $(value).html();
@ -2037,6 +2062,7 @@ function change_modules_autocomplete_input () {
else {
module_autocomplete.html(error_icon);
}
$('#text-autocomplete_module_name').addClass('w90p');
},
error: function (data) {
module_autocomplete.removeClass('working');
@ -2099,15 +2125,15 @@ function add_new_relation () {
}
var rowHTML = '<tr id="module_relations-' + relationsCount + '" class="' + rowClass + '">' +
'<td id="module_relations-' + relationsCount + '-0"><b>' + agent_b_name + '</b></td>' +
'<td id="module_relations-' + relationsCount + '-1">' + module_b_name + '</td>' +
'<td id="module_relations-' + relationsCount + '-2">' + relation_type + '</td>' +
'<td id="module_relations-' + relationsCount + '-3" class="w10p center">' +
'<td style="width:20%" id="module_relations-' + relationsCount + '-0"><b>' + agent_b_name + '</b></td>' +
'<td style="width:20%" id="module_relations-' + relationsCount + '-1">' + module_b_name + '</td>' +
'<td style="width:20%" id="module_relations-' + relationsCount + '-2">' + relation_type + '</td>' +
'<td style="width:20%" id="module_relations-' + relationsCount + '-3">' +
'<a id="disable_updates_button" class="alpha50" href="javascript: change_lock_relation(' + relationsCount + ', ' + data + ');">' +
'<?php echo html_print_image('images/policy@svg.svg', true, ['class' => 'main_menu_icon invert_filter']); ?>' +
'</a>' +
'</td>' +
'<td id="module_relations-' + relationsCount + '-4" class="w10p center">' +
'<td style="width:20%" id="module_relations-' + relationsCount + '-4" class="table_action_buttons">' +
'<a id="delete_relation_button" href="javascript: delete_relation(' + relationsCount + ', ' + data + ');">' +
'<?php echo html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']); ?>' +
'</a>' +

View File

@ -152,9 +152,7 @@ foreach ($password_fields as $k => $p) {
load_plugin_macros_fields('simple-macro');
forced_title_callback();
}
$(document).ready(function () {
observerInputPassword();
});
$('select#id_plugin').select2('close');
}
</script>

View File

@ -42,8 +42,6 @@ if (empty($edit_module)) {
}
$data = [];
$data[0] = __('Target IP').' '.ui_print_help_icon('wmi_module_tab', true);
if ($page == 'enterprise/godmode/policies/policy_modules') {
if ($ip_target != 'auto' && $ip_target != '') {
$custom_ip_target = $ip_target;
@ -60,7 +58,7 @@ if ($page == 'enterprise/godmode/policies/policy_modules') {
$target_ip_values['force_pri'] = __('Force primary key');
$target_ip_values['custom'] = __('Custom');
$data[1] = html_print_select(
$inputs = html_print_select(
$target_ip_values,
'ip_target',
$ip_target,
@ -72,109 +70,171 @@ if ($page == 'enterprise/godmode/policies/policy_modules') {
false,
'',
false,
'width:200px;'
'width: 100%; margin-top: 10px;'
);
$data[1] .= html_print_input_text('custom_ip_target', $custom_ip_target, '', 15, 60, true);
$inputs .= html_print_input_text('custom_ip_target', $custom_ip_target, '', 15, 60, true);
} else {
if ($ip_target == 'auto') {
$ip_target = agents_get_address($id_agente);
}
$data[1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true);
$inputs = html_print_input_text(
'ip_target',
$ip_target,
'',
15,
60,
true,
false,
false,
'',
'mrgn_top_10px w100p'
);
}
$data[2] = __('Namespace').ui_print_help_tip(__('Optional. WMI namespace. If unsure leave blank.'), true);
$data[3] = html_print_input_text(
'tcp_send',
$tcp_send,
'',
5,
20,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
$data[0] = html_print_label_input_block(
__('Target IP').' <span class="help_icon_15px">'.ui_print_help_icon('wmi_module_tab', true),
$inputs,
[
'label_class' => 'font-title-font',
'div_class' => 'w100p mrgn_right_20px',
]
);
$data[2] = html_print_label_input_block(
__('Namespace').ui_print_help_tip(__('Optional. WMI namespace. If unsure leave blank.'), true),
html_print_input_text(
'tcp_send',
$tcp_send,
'',
5,
20,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy.' mrgn_top_10px w100p'
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p mrgn_right_20px',
]
);
push_table_simple($data, 'target_ip');
$data = [];
$data[0] = __('Username');
$data[1] = html_print_input_text(
'plugin_user',
$plugin_user,
'',
15,
60,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
$data[0] = html_print_label_input_block(
__('Username'),
html_print_input_text(
'plugin_user',
$plugin_user,
'',
15,
60,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy.' w100p'
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
);
$data[2] = __('Password');
$data[3] = html_print_input_password(
'plugin_pass',
'',
'',
15,
60,
true,
$disabledBecauseInPolicy,
false,
$classdisabledBecauseInPolicy,
'new-password'
$data[2] = html_print_label_input_block(
__('Password'),
html_print_input_password(
'plugin_pass',
'',
'',
15,
60,
true,
$disabledBecauseInPolicy,
false,
$classdisabledBecauseInPolicy.' w100p',
'new-password',
true
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
);
$table_simple->rowclass['user_pass'] = 'w100p mrgn_top_10px';
push_table_simple($data, 'user_pass');
$data = [];
$data[0] = __('WMI query');
$data[1] = html_print_input_text(
'snmp_oid',
$snmp_oid,
'',
35,
255,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
$data[0] = html_print_label_input_block(
__('WMI query'),
html_print_input_text(
'snmp_oid',
$snmp_oid,
'',
35,
255,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
);
$table_simple->colspan['wmi_query'][1] = 3;
$data[2] = html_print_label_input_block(
__('Key string').ui_print_help_tip(__('Optional. Substring to look for in the WQL query result. The module returns 1 if found, 0 if not.'), true),
html_print_input_text(
'snmp_community',
$snmp_community,
'',
20,
60,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
);
$table_simple->rowclass['wmi_query'] = 'w100p mrgn_top_10px';
push_table_simple($data, 'wmi_query');
$data = [];
$data[0] = __('Key string').ui_print_help_tip(__('Optional. Substring to look for in the WQL query result. The module returns 1 if found, 0 if not.'), true);
$data[1] = html_print_input_text(
'snmp_community',
$snmp_community,
'',
20,
60,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
);
$data[2] = __('Field number').ui_print_help_tip(__('Column number to retrieve from the WQL query result (starting from zero).'), true);
$data[3] = html_print_input_text(
'tcp_port',
$tcp_port,
'',
5,
15,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
$data[0] = html_print_label_input_block(
__('Field number').ui_print_help_tip(__('Column number to retrieve from the WQL query result (starting from zero).'), true),
html_print_input_text(
'tcp_port',
$tcp_port,
'',
5,
15,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy.' mrgn_right_20px'
),
[
'label_class' => 'font-title-font',
'div_class' => 'w50p display-grid',
]
);
$table_simple->rowclass['key_field'] = 'w100p mrgn_top_10px';
push_table_simple($data, 'key_field');
?>
<script type="text/javascript">
@ -191,11 +251,6 @@ $(document).ready (function () {
$("#text-custom_ip_target").hide();
}
});
// Add input password values with js to hide it in browser inspector.
$('#password-plugin_pass').val('<?php echo $plugin_pass; ?>');
observerInputPassword();
});
</script>

View File

@ -123,7 +123,7 @@ $table->data[1][0] = html_print_label_input_block(
'w100p',
false,
'width: 100%;'
).'<span id="advanced_action" class="advanced_actions invisible"><br>'.__('Number of alerts match from').' '.html_print_input_text('fires_min', '', '', 4, 10, true).' '.__('to').' '.html_print_input_text('fires_max', '', '', 4, 10, true).'</span>'.$create_action
).'<span id="advanced_action" class="advanced_actions invisible"><br>'.__('Number of alerts match from').' '.html_print_input_text('fires_min', '', '', 4, 10, true).' '.__('to').' '.html_print_input_text('fires_max', '', '', 4, 10, true).'</span><div class="flex_justify_end">'.$create_action.'</div>'
);
$own_info = get_user_info($config['id_user']);
@ -162,7 +162,7 @@ $table->data[1][1] = html_print_label_input_block(
'w100p',
false,
'width: 100%;'
).' <a class="template_details invisible" href="#">'.html_print_image('images/zoom.png', true, ['class' => 'img_help']).'</a>'.$create_template
).' <a class="template_details invisible" href="#">'.html_print_image('images/zoom.png', true, ['class' => 'img_help']).'</a><div class="flex_justify_end">'.$create_template.'</div>'
);
$table->data[2][0] = html_print_label_input_block(
@ -187,7 +187,7 @@ $table->data[2][0] = html_print_label_input_block(
);
if (isset($step) === false) {
echo '<form class="add_alert_form max_floating_element_size" method="post">';
echo '<form id="form_alerts" class="add_alert_form max_floating_element_size" method="post">';
html_print_table($table);
}
@ -216,6 +216,26 @@ if (isset($step) === false) {
true
);
if ($_GET['sec2'] === 'operation/cluster/cluster') {
html_print_div(
[
'content' => html_print_submit_button(
__('Add alert'),
'add',
false,
[
'icon' => 'wand',
'form' => 'form_alerts',
'mode' => 'secondary',
],
true
),
'style' => 'display:none',
'id' => 'add_alert_div',
]
);
}
html_print_action_buttons($actionButtons, ['right_content' => $pagination]);
html_print_input_hidden('create_alert', 1);

View File

@ -679,7 +679,7 @@ foreach ($simple_alerts as $alert) {
true,
[
'id' => 'template-details-'.$alert['id_alert_template'],
'class' => 'img_help action_button_img invert_filter',
'class' => 'img_help main_menu_icon invert_filter',
]
);
$data[2] .= '</a> ';
@ -757,7 +757,7 @@ foreach ($simple_alerts as $alert) {
true,
[
'title' => __('Delete action'),
'class' => 'action_button_img invert_filter',
'class' => 'main_menu_icon invert_filter',
]
);
$data[3] .= html_print_input_hidden('delete_action', 1, true);
@ -772,7 +772,7 @@ foreach ($simple_alerts as $alert) {
true,
[
'title' => __('Update action'),
'class' => 'action_button_img invert_filter',
'class' => 'main_menu_icon invert_filter',
'onclick' => 'show_display_update_action(\''.$action['id'].'\',\''.$alert['id'].'\',\''.$alert['id_agent_module'].'\',\''.$action_id.'\',\''.$alert['id_agent_module'].'\')',
]
);
@ -967,17 +967,19 @@ foreach ($simple_alerts as $alert) {
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$policyInfo = policies_is_alert_in_policy2($alert['id'], false);
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if (is_array($policyInfo) === false && $module_linked === false) {
if ((is_array($policyInfo) === false && $module_linked === false)
|| (is_array($policyInfo) === false && $module_linked === '1')
) {
$data[$index['policy']] = '';
} else {
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') {
$img = 'images/unlinkpolicy.png';
} else {
$img = 'images/policies_mc.png';
$img = 'images/policy@svg.svg';
}
$data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
$data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name'], 'class' => 'invert_filter main_menu_icon']).'</a>';
}
}
}

View File

@ -497,45 +497,47 @@ if (is_metaconsole() === false) {
$buttons = '';
}
if ($tab !== 'alert') {
if ($tab === 'list') {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
if ($_GET['sec2'] !== 'operation/cluster/cluster') {
if ($tab !== 'alert') {
if ($tab === 'list') {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('List'),
],
]
);
} else {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
'link' => '',
'label' => __('List'),
],
]
);
} else {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('Create'),
],
]
);
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('Create'),
],
]
);
}
}
}
} else {

View File

@ -122,24 +122,24 @@ $sec = (is_metaconsole() === true) ? 'advanced' : 'galertas';
// case delete_templete action is performed.
if (!$delete_template) {
// Header.
if (is_metaconsole() === true) {
alerts_meta_print_header();
} else {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
[],
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
[],
[
[
[
'link' => '',
'label' => __('Alert templates'),
],
]
);
}
'link' => '',
'label' => __('Alerts'),
],
[
'link' => '',
'label' => __('Alert templates'),
],
]
);
}
if ($update_template) {

View File

@ -704,6 +704,19 @@ if ($step == 2) {
)
);
$usr_groups = implode(
',',
array_keys(users_get_groups($config['id_user'], 'LM', true))
);
$sql_query = sprintf(
'SELECT id, name
FROM talert_actions
WHERE id_group IN (%s)
ORDER BY name',
$usr_groups
);
$table->data[2][1] = html_print_label_input_block(
__('Default action').ui_print_help_tip(
__('Unless they\'re left blank, the fields from the action will override those set on the template.'),
@ -801,19 +814,6 @@ if ($step == 2) {
)
);
$usr_groups = implode(
',',
array_keys(users_get_groups($config['id_user'], 'LM', true))
);
$sql_query = sprintf(
'SELECT id, name
FROM talert_actions
WHERE id_group IN (%s)
ORDER BY name',
$usr_groups
);
$table->data[5][0] = html_print_label_input_block(
__('Condition type'),
html_print_select(

View File

@ -0,0 +1,69 @@
<?php
/**
* Consoles manager.
*
* @category Tools
* @package Pandora FMS
* @subpackage Enterprise
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
use PandoraFMS\Console;
use PandoraFMS\View;
// Begin.
global $config;
check_login();
if (check_acl($config['id_user'], 0, 'PM') === false
&& is_user_admin($config['id_user']) === false
) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Consoles Management'
);
include 'general/noaccess.php';
exit;
}
$ajax_url = ui_get_full_url('ajax.php');
$message = '';
$error = false;
// Check is any consoles are registered.
$results = db_get_all_rows_in_table('tconsole');
$message = '';
if ($results === false) {
$message = ui_print_info_message(
__('If you want to have your consoles registered, you must define them by editing config.php in each individual console and wait for cron to run in order to be registered.')
);
}
View::render(
'consoles/list',
[
'ajax_url' => $ajax_url,
'message' => $message,
]
);

View File

@ -132,7 +132,8 @@ $table->data[1][1] = '<a href="javascript:">'.html_print_image(
[
'id' => 'right',
'title' => __('Add fields to select'),
'style' => 'rotate: 180deg; width: 40px',
'style' => 'rotate: 180deg;',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
@ -141,7 +142,7 @@ $table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
[
'id' => 'left',
'title' => __('Delete fields to select'),
'style' => 'width: 40px',
'style' => '',
]
).'</a>';
@ -169,6 +170,7 @@ $table->data[1][2] .= '<a href="javascript:">'.html_print_image(
[
'onclick' => 'sortUpDown(\'up\');',
'title' => __('Move up selected fields'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$table->data[1][2] .= '<a href="javascript:">'.html_print_image(
@ -177,6 +179,7 @@ $table->data[1][2] .= '<a href="javascript:">'.html_print_image(
[
'onclick' => 'sortUpDown(\'down\');',
'title' => __('Move down selected fields'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$table->data[1][2] .= '</div></div>';

View File

@ -84,7 +84,7 @@ $buttons['gis_maps_list'] = [
true,
[
'title' => __('GIS Maps list'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
).'</a>',
];
@ -96,19 +96,30 @@ if ($idMap) {
true,
[
'title' => __('View GIS'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
).'</a>',
];
}
ui_print_page_header(
// Header.
ui_print_standard_header(
__('GIS Maps builder'),
'images/gm_gis.png',
false,
'configure_gis_map_edit',
true,
$buttons
false,
$buttons,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('GIS Maps'),
],
]
);
switch ($action) {
@ -480,7 +491,7 @@ $table->data[1][1] = "<table class='no-class' border='0' id='map_connection'>
<a href='javascript: addConnectionMap();'>".html_print_image(
'images/add.png',
true,
['class' => 'invert_filter']
['class' => 'invert_filter main_menu_icon']
)."</a>
<input type='hidden' name='map_connection_list' value='' id='map_connection_list' />
<input type='hidden' name='layer_list' value='' id='layer_list' />
@ -583,7 +594,7 @@ $table->data[1][1] = '<div id="form_layer" class="invisible">
$table->data[1][1] .= html_print_button(__('Add agent'), 'add_agent', true, '', 'class="sub add"', true);
$table->data[1][1] .= html_print_button(__('Add agent'), 'add_agent', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
$params = [];
$params['return'] = true;
@ -628,7 +639,7 @@ $params['javascript_is_function_select'] = true;
// Filter by group.
$params['disabled_javascript_on_blur_function'] = false;
$agent_for_group_input = ui_print_agent_autocomplete_input($params);
$add_group_btn = html_print_button(__('Add'), 'add_group', true, '', 'class="sub add"', true);
$add_group_btn = html_print_button(__('Add'), 'add_group', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
$table->data[1][1] .= '<tr><td colspan="4"><hr /></td></tr>
<tr>
@ -660,21 +671,19 @@ $table->data[1][1] .= '<tr>
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
switch ($action) {
case 'save_new':
case 'edit_map':
case 'update_saved':
if (empty($invalidFields) === true) {
html_print_submit_button(_('Save map'), 'save_button', false, 'class="sub wand"');
$action_button = html_print_submit_button(_('Save map'), 'save_button', false, ['mode' => 'primary', 'icon' => 'next'], true);
} else {
html_print_submit_button(_('Update map'), 'update_button', false, 'class="sub upd"');
$action_button = html_print_submit_button(_('Update map'), 'update_button', false, ['mode' => 'primary', 'icon' => 'next'], true);
}
break;
case 'new_map':
html_print_submit_button(_('Save map'), 'save_button', false, 'class="sub wand"');
$action_button = html_print_submit_button(_('Save map'), 'save_button', false, ['mode' => 'primary', 'icon' => 'next'], true);
break;
default:
@ -682,7 +691,10 @@ switch ($action) {
break;
}
echo '</div>';
html_print_action_buttons(
$action_button,
['type' => 'form_action']
);
echo '</form>';
@ -702,7 +714,7 @@ echo '</form>';
false,
[
'alt' => '',
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
);
?>
@ -899,7 +911,7 @@ function setLayerEditorData (data) {
var $layerFormVisibleCheckbox = $("input#checkbox-layer_visible_form");
var $layerFormAgentsFromGroupSelect = $("#layer_group_form");
var $layerFormAgentInput = $("input#text-agent_alias");
var $layerFormAgentButton = $("input#button-add_agent");
var $layerFormAgentButton = $("button#button-add_agent");
var $layerFormAgentsListItems = $("tr.agents_list_item");
var $layerFormGroupsListItems = $("tr.groups_list_item");
@ -1005,7 +1017,7 @@ function getAgentRow (layerId, agentId, agentAlias) {
var $deleteCol = $("<td />");
var $agentAlias = $("<span class=\"agent_alias\" data-agent-id=\"" + agentId + "\">" + agentAlias + "</span>");
var $removeBtn = $('<a class="delete_row" href="javascript:" <?php echo html_print_image('images/delete.svg', false, ['class' => 'invert_filter']); ?> </a>');
var $removeBtn = $('<a class="delete_row" href="javascript:" <?php echo html_print_image('images/delete.svg', false, ['class' => 'invert_filter main_menu_icon']); ?> </a>');
$removeBtn.click(function (event) {
var $layerRow = $("tr#layer_row_" + layerId);
@ -1061,7 +1073,7 @@ function getGroupRow (layerId, groupId, groupName, agentId, agentAlias) {
+ "<i>" + agentAlias + "</i>"
+ ")"
+ "</span>");
var $removeBtn = $('<a class="delete_row" href="javascript:;"><?php echo html_print_image('images/delete.svg', true, ['class' => 'invert_filter']); ?></a>');
var $removeBtn = $('<a class="delete_row" href="javascript:;"><?php echo html_print_image('images/delete.svg', true, ['class' => 'invert_filter main_menu_icon']); ?></a>');
$removeBtn.click(function (event) {
var $layerRow = $("tr#layer_row_" + layerId);
@ -1139,8 +1151,8 @@ function getLayerRow (layerId, layerData) {
var $layerName = $("<span class=\"layer_name\">" + layerData.name + "</span>");
var $sortUpBtn = $("<a class=\"up_arrow\" href=\"javascript:;\" />");
var $sortDownBtn = $("<a class=\"down_arrow\" href=\"javascript:;\" />");
var $editBtn = $('<a class="edit_layer" href="javascript:;"><?php echo html_print_image('images/edit.svg', true, ['class' => 'invert_filter']); ?></a>');
var $removeBtn = $('<a class="delete_row" href="javascript:;"><?php echo html_print_image('images/delete.svg', true, ['class' => 'invert_filter']); ?></a>');
var $editBtn = $('<a class="edit_layer" href="javascript:;"><?php echo html_print_image('images/edit.svg', true, ['class' => 'invert_filter main_menu_icon']); ?></a>');
var $removeBtn = $('<a class="delete_row" href="javascript:;"><?php echo html_print_image('images/delete.svg', true, ['class' => 'invert_filter main_menu_icon']); ?></a>');
$sortUpBtn.click(moveLayerRowUpOnClick);
$sortDownBtn.click(moveLayerRowDownOnClick);
@ -1231,9 +1243,9 @@ function onLayerGroupIdChange (event) {
// Bind events
$("form#form_setup").submit(onFormSubmit);
$("input#button-add_agent").click(addAgentClick);
$("button#button-add_agent").click(addAgentClick);
$("select#layer_group_id").change(onLayerGroupIdChange);
$("input#button-add_group").click(addGroupClick);
$("button#button-add_group").click(addGroupClick);
// Populate layer list
var layers = <?php echo json_encode($layer_list); ?>;

View File

@ -118,7 +118,7 @@ if (is_metaconsole() === true) {
// Data before table.
$files = list_files('images/', '@groups.svg', 1, 0);
$files = list_files(((is_metaconsole() === true) ? '../../' : '').'images/', '@groups.svg', 1, 0);
$table = new stdClass();
$table->width = '100%';

View File

@ -445,7 +445,7 @@ if ($is_management_allowed === true
if ($aviable_name === true) {
$values = [
'nombre' => $name,
'icon' => empty($icon) ? '' : substr($icon, 0, -4),
'icon' => $icon,
'parent' => $id_parent,
'disabled' => $alerts_disabled,
'custom_id' => $custom_id,
@ -513,7 +513,7 @@ if ($is_management_allowed === true && $update_group === true) {
if ($aviable_name === true) {
$values = [
'nombre' => $name,
'icon' => empty($icon) ? '' : substr($icon, 0, -4),
'icon' => $icon,
'parent' => ($id_parent == -1) ? 0 : $id_parent,
'disabled' => !$alerts_enabled,
'custom_id' => $custom_id,
@ -718,7 +718,7 @@ if ($is_management_allowed === true
'tfavmenu_user',
[
'id_element' => $id_group,
'section' => 'Tactic_group',
'section' => 'Groups',
'id_user' => $config['id_user'],
]
);
@ -741,12 +741,11 @@ if ($is_management_allowed === true
// Credential store is loaded previously in this document to avoid
// process group tree - list forms.
ui_print_spinner(__('Loading'));
if ($tab == 'tree') {
/*
* Group tree view.
*/
ui_print_spinner(__('Loading'));
echo "<div id='tree-controller-recipient'></div>";
} else {
/*
@ -906,7 +905,6 @@ if ($tab == 'tree') {
foreach ($groups as $key => $group) {
$url_edit = 'index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo'];
$url_tactical = 'index.php?sec=gagente&sec2=godmode/groups/tactical&id_group='.$group['id_grupo'];
if (is_metaconsole()) {
$url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups';
} else {
@ -915,7 +913,7 @@ if ($tab == 'tree') {
$table->data[$key][0] = $group['id_grupo'];
if ($is_management_allowed === true) {
$table->data[$key][1] = '<a href="'.$url_tactical.'">'.$group['nombre'].'</a>';
$table->data[$key][1] = '<a href="'.$url_edit.'">'.$group['nombre'].'</a>';
} else {
$table->data[$key][1] = $group['nombre'];
}
@ -926,7 +924,7 @@ if ($tab == 'tree') {
true,
[
'style' => '',
'class' => 'bot',
'class' => 'bot main_menu_icon invert_filter',
'alt' => io_safe_input($group['nombre']),
'title' => io_safe_input($group['nombre']),
],
@ -987,7 +985,7 @@ if ($tab == 'tree') {
true,
'offset',
false,
'pagination-bottom'
''
);
} else {
ui_print_info_message(
@ -1039,6 +1037,7 @@ $tab = 'group_edition';
<script type="text/javascript">
var treeController = TreeController.getController();
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
treeController.recipient.empty();

View File

@ -72,14 +72,14 @@ if (is_metaconsole() === false) {
],
[
'link' => '',
'label' => __('Tactic group'),
'label' => __('Tactical group view'),
],
],
[
'id_element' => $id_group,
'url' => 'gagent&sec2=godmode/groups/tactical&id_group='.$id_group,
'label' => groups_get_name($id_group),
'section' => 'Tactic_group',
'section' => 'Groups',
]
);
}
@ -187,7 +187,7 @@ try {
[
'id' => 'list_agents_tactical',
'class' => 'info_table',
'style' => 'width: 100%',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $columnNames,
'return' => true,
@ -196,6 +196,7 @@ try {
'method' => 'getAgentsByGroup',
'id_group' => $id_group,
],
'dom_elements' => 'lpfti',
'no_sortable_columns' => [-1],
'order' => [
'field' => 'alias',

View File

@ -270,7 +270,7 @@ $agents_with_templates_json = json_encode($agents_with_templates_json);
echo "<input type='hidden' id='hidden-agents_with_templates' value='$agents_with_templates_json'>";
attachActionButton('add', 'create', $table->width);
attachActionButton('add', 'create', $table->width, false, $SelectAction);
echo '</form>';

View File

@ -293,7 +293,7 @@ $table->data[2][3] = '';
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_alerts">';
html_print_table($table);
attachActionButton('add', 'add', $table->width);
attachActionButton('add', 'add', $table->width, false, $SelectAction);
echo '</form>';

View File

@ -295,7 +295,7 @@ array_push($table->data, $data);
html_print_table($table);
attachActionButton('create_profiles', 'update', $table->width);
attachActionButton('create_profiles', 'update', $table->width, false, $SelectAction);
echo '</form>';

View File

@ -310,7 +310,7 @@ echo '<legend><span>'.__('To agent(s)').'</span></legend>';
html_print_table($table);
echo '</fieldset>';
attachActionButton('do_operation', 'copy', $table->width);
attachActionButton('do_operation', 'copy', $table->width, false, $SelectAction);
echo '</form>';

View File

@ -298,7 +298,7 @@ $agents_with_templates_json = json_encode($agents_with_templates_json);
echo "<input type='hidden' id='hidden-agents_with_templates' value='".$agents_with_templates_json."'>";
attachActionButton('delete', 'delete', $table->width);
attachActionButton('delete', 'delete', $table->width, false, $SelectAction);
echo '</form>';

View File

@ -188,7 +188,7 @@ $params = [
echo get_table_inputs_masive_agents($params);
if (is_metaconsole() === true || is_management_allowed() === true) {
attachActionButton('delete', 'delete', '100%');
attachActionButton('delete', 'delete', '100%', false, $SelectAction);
}
echo '</form>';

View File

@ -358,7 +358,7 @@ $table->data[2][3] = html_print_select([], 'module[]', '', false, '', '', true,
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_alerts" >';
html_print_table($table);
attachActionButton('delete', 'delete', $table->width);
attachActionButton('delete', 'delete', $table->width, false, $SelectAction);
echo '</form>';

View File

@ -583,7 +583,7 @@ $table->data['form_agents_3'][3] = html_print_select(
echo '<form method="post" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >';
html_print_table($table);
attachActionButton('delete', 'delete', $table->width);
attachActionButton('delete', 'delete', $table->width, false, $SelectAction);
echo '</form>';

View File

@ -246,7 +246,7 @@ array_push($table->data, $data);
html_print_table($table);
attachActionButton('delete_profiles', 'delete', $table->width);
attachActionButton('delete_profiles', 'delete', $table->width, false, $SelectAction);
echo '</form>';

View File

@ -1257,7 +1257,7 @@ echo '<h3 class="error invisible" id="message"> </h3>';
html_print_input_hidden('id_agente', $id_agente);
attachActionButton('update_agents', 'update', $table->width);
attachActionButton('update_agents', 'update', $table->width, false, $SelectAction);
// Shown and hide div.
echo '</div></form>';

View File

@ -1265,7 +1265,7 @@ $table->data['edit1'][1] = '<table width="100%">';
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit">';
html_print_table($table);
attachActionButton('update', 'update', $table->width);
attachActionButton('update', 'update', $table->width, false, $SelectAction);
echo '</form>';

View File

@ -391,7 +391,7 @@ echo '<form method="POST" id="form-massive_plugin_edition"
html_print_table($table);
attachActionButton('update', 'update', $table->width);
attachActionButton('update', 'update', $table->width, false, $SelectAction);
echo '</form>';

View File

@ -556,7 +556,7 @@ echo sprintf(
);
echo '</div>';
attachActionButton('edit_users', 'update', '100%');
attachActionButton('edit_users', 'update', '100%', false, $SelectAction);
echo '</form>';

View File

@ -220,7 +220,7 @@ $alertstab = [
true,
[
'title' => __('Alerts operations'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
).'</a>',
'active' => $tab == 'massive_alerts',
@ -232,7 +232,7 @@ $userstab = [
true,
[
'title' => __('Users operations'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
).'</a>',
'active' => $tab == 'massive_users',
@ -244,7 +244,7 @@ $agentstab = [
true,
[
'title' => __('Agents operations'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
).'</a>',
'active' => $tab == 'massive_agents',
@ -256,7 +256,7 @@ $modulestab = [
true,
[
'title' => __('Modules operations'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
).'</a>',
'active' => $tab == 'massive_modules',
@ -268,7 +268,7 @@ $pluginstab = [
true,
[
'title' => __('Plugins operations'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
).'</a>',
'active' => $tab == 'massive_plugins',
@ -306,22 +306,62 @@ $onheader['snmp'] = $snmptab;
$onheader['satellite'] = $satellitetab;
$onheader['services'] = $servicestab;
// Header.
if (is_metaconsole() === false) {
ui_print_page_header(
__('Bulk operations').' &raquo; '.$options[$option],
ui_print_standard_header(
__('Bulk operations').' - '.$options[$option],
'images/gm_massive_operations.png',
false,
$help_header,
true,
$onheader,
false,
'massivemodal'
[
$agentstab,
$modulestab,
$pluginstab,
$userstab,
$alertstab,
$policiestab,
$snmptab,
$satellitetab,
$servicestab,
],
[
[
'link' => '',
'label' => __('Configuration'),
],
[
'link' => '',
'label' => __('Bulk operations'),
],
]
);
} else {
massive_meta_print_header();
ui_print_standard_header(
__('Bulk operations').' - '.$options[$option],
'images/gm_massive_operations.png',
false,
$help_header,
false,
[
$userstab,
$agentstab,
],
[
[
'link' => '',
'label' => __('Configuration'),
],
[
'link' => '',
'label' => __('Bulk operations'),
],
]
);
}
// Checks if the PHP configuration is correctly.
if ((get_cfg_var('max_execution_time') != 0)
|| (get_cfg_var('max_input_time') != -1)
@ -403,29 +443,26 @@ if (is_management_allowed() === false) {
);
}
echo '<br />';
echo '<form method="post" id="form_options" action="'.$url.'">';
echo '<table border="0"><tr><td>';
echo __('Action');
echo '</td><td>';
html_print_select(
$tip = '';
if ($option === 'edit_agents' || $option === 'edit_modules') {
$tip = ui_print_help_tip(__('The blank fields will not be updated'), true);
}
$SelectAction = '<form method="post" id="form_options" action="'.$url.'">';
$SelectAction .= '<span class="mrgn_lft_10px mrgn_right_10px">'._('Action').'</span>';
$SelectAction .= html_print_select(
$options,
'option',
$option,
'this.form.submit()',
'',
0,
false,
true,
false,
false
);
if ($option === 'edit_agents' || $option === 'edit_modules') {
ui_print_help_tip(__('The blank fields will not be updated'));
}
).$tip;
echo '</td></tr></table>';
echo '</form>';
echo '<br />';
$SelectAction .= '</form>';
switch ($option) {
case 'delete_alerts':

View File

@ -308,6 +308,13 @@ if ($access_console_node === true) {
$sub['godmode/servers/modificar_server']['id'] = 'Manage_servers';
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true
|| is_user_admin($config['id_user']) === true
) {
$sub['godmode/consoles/consoles']['text'] = __('Manage consoles');
$sub['godmode/consoles/consoles']['id'] = 'Manage consoles';
}
// This subtabs are only for Pandora Admin.
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
enterprise_hook('ha_cluster');
@ -364,6 +371,11 @@ if ($access_console_node === true) {
$sub2['godmode/setup/setup&section=net']['text'] = __('Netflow');
$sub2['godmode/setup/setup&section=net']['refr'] = 0;
}
if ((bool) $config['activate_sflow'] === true) {
$sub2['godmode/setup/setup&section=sflow']['text'] = __('Sflow');
$sub2['godmode/setup/setup&section=sflow']['refr'] = 0;
}
}
$sub2['godmode/setup/setup&section=ehorus']['text'] = __('eHorus');

View File

@ -297,7 +297,7 @@ if (!empty($table->data)) {
html_print_input_hidden('multiple_delete', 1);
ui_pagination($count_network_templates, false, $offset);
html_print_table($table);
ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, 'pagination-bottom');
ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, '');
echo "<div class='pdd_l_5px right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>';

View File

@ -56,9 +56,13 @@ ui_print_standard_header(
[
[
'link' => '',
'label' => __('Netflow'),
'label' => __('Resources'),
],
],
[
'link' => '',
'label' => __('Netflow filters'),
],
]
);
$is_windows = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
@ -211,7 +215,6 @@ $buttons = html_print_submit_button(
true
);
// hd($filters);
if (empty($filters) === false) {
echo '<form id="multiple_delete" method="POST" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&pure='.$pure.'">';
html_print_input_hidden('multiple_delete', 1);

View File

@ -71,11 +71,11 @@ $max_graph = $config['max_graph_container'];
$buttons['graph_list'] = [
'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs">'.html_print_image(
'images/list.png',
'images/logs@svg.svg',
true,
[
'title' => __('Graph list'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];

View File

@ -445,7 +445,7 @@ if (!empty($graphs)) {
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
html_print_input_hidden('multiple_delete', 1);
html_print_table($table);
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, '');
echo "<div class='right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</form>';

View File

@ -115,6 +115,7 @@ $exception_condition_value = 10;
$modulegroup = 0;
$period = SECONDS_1DAY;
$search = '';
$full_text = 0;
$log_number = 1000;
// Added support for projection graphs.
$period_pg = SECONDS_5DAY;
@ -316,6 +317,7 @@ switch ($action) {
$source = $es['source'];
$search = $es['search'];
$log_number = empty($es['log_number']) ? $log_number : $es['log_number'];
$full_text = empty($es['full_text']) ? 0 : $es['full_text'];
break;
case 'simple_graph':
@ -1047,17 +1049,6 @@ $class = 'databox filters';
?>
<table id="table_item_edit_reporting" class="<?php echo $class; ?>" id="" border="0" cellpadding="4" cellspacing="4" width="100%">
<?php
if (defined('METACONSOLE')) {
echo '<thead>
<tr>
<th align=center colspan=5>
'.__('Item Editor').'
</th>
</tr>
</thead>';
}
?>
<tbody>
<tr id="row_type" class="datos">
<td class="bolder w220px">
@ -1324,6 +1315,14 @@ $class = 'databox filters';
<td >
<?php
html_print_input_text('search', $search, '', 40, 100);
html_print_checkbox(
'full_text',
1,
$full_text,
false,
false
);
ui_print_help_tip(__('Full context'), false);
?>
</td>
</tr>

View File

@ -201,139 +201,86 @@ if (($agentFilter == 0) && ($moduleFilter == 0) && ($typeFilter == 0)) {
$urlFilter = '&agent_filter='.$agentFilter.'&module_filter='.$moduleFilter.'&type_filter='.$typeFilter;
if (!defined('METACONSOLE')) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '33%';
$table->size[1] = '33%';
$table->size[1] = '33%';
$table->data[0][0] = html_print_label_input_block(
__('Agents'),
html_print_select(
$agents,
'agent_filter',
$agentFilter,
'',
__('All'),
0,
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][1] = html_print_label_input_block(
__('Modules'),
html_print_select(
$modules,
'module_filter',
$moduleFilter,
'',
__('All'),
0,
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][2] = html_print_label_input_block(
__('Type'),
html_print_select(
$types,
'type_filter',
$typeFilter,
'',
__('All'),
0,
true,
false,
true,
'',
false,
'width:100%'
)
);
$form = '<form method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report='.$idReport.'">';
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'filter',
false,
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= html_print_input_hidden('action', 'filter', true);
$form .= '</form>';
ui_toggle($form, __('Filters'), '', '', false);
} else {
$table = new stdClass();
$table->width = '96%';
$table->class = 'databox_filters';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->data[0][0] = __('Agents');
$table->data[0][1] = html_print_select(
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '33%';
$table->size[1] = '33%';
$table->size[1] = '33%';
$table->data[0][0] = html_print_label_input_block(
__('Agents'),
html_print_select(
$agents,
'agent_filter',
$agentFilter,
'',
__('All'),
0,
true
);
$table->data[0][2] = __('Modules');
$table->data[0][3] = html_print_select(
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][1] = html_print_label_input_block(
__('Modules'),
html_print_select(
$modules,
'module_filter',
$moduleFilter,
'',
__('All'),
0,
true
);
$table->data[0][4] = __('Type');
$table->data[0][5] = html_print_select(
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][2] = html_print_label_input_block(
__('Type'),
html_print_select(
$types,
'type_filter',
$typeFilter,
'',
__('All'),
0,
true
);
$table->style[6] = 'text-align:right;';
$table->data[0][6] = html_print_submit_button(
__('Filter'),
'filter',
true,
false,
'class="sub upd"',
true
).html_print_input_hidden('action', 'filter', true);
true,
'',
false,
'width:100%'
)
);
$form = '<form method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report='.$idReport.'">';
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'filter',
false,
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= html_print_input_hidden('action', 'filter', true);
$form .= '</form>';
$filters = '<form class="filters_form" method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=
list_items&action=filter&id_report='.$idReport.'">';
$filters .= html_print_table($table, true);
$filters .= '</form>';
ui_toggle($filters, __('Show Options'));
}
ui_toggle($form, __('Filters'), '', '', false);
$where = '1=1';
if ($typeFilter != '0') {
@ -412,16 +359,9 @@ $table->style[0] = 'text-align: right;';
if ($items) {
$table->width = '100%';
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox data';
$arrow_up = 'images/sort_up.png';
$arrow_down = 'images/sort_down.png';
} else {
$table->class = 'info_table';
$arrow_up = 'images/sort_up_black.png';
$arrow_down = 'images/sort_down_black.png';
}
$table->class = 'info_table';
$arrow_up = 'images/sort_up_black.png';
$arrow_down = 'images/sort_down_black.png';
$table->size = [];
$table->size[0] = '5px';
@ -717,90 +657,65 @@ foreach ($items as $item) {
}
}
if (defined('METACONSOLE')) {
if ($items != false) {
ui_pagination($countItems, 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter);
html_print_table($table);
ui_pagination($countItems, 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter);
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=".$idReport."'
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
echo "<div class='right w100p'>";
if ($items != false) {
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
html_print_table($table);
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
if (check_acl($config['id_user'], 0, 'RM')) {
html_print_input_hidden('ids_items_to_delete', '');
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete right mrgn_btn_15px"');
}
echo "<form id='form_delete' action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=".$idReport."'
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
echo '</div>';
echo '</form>';
}
} else {
if ($items != false) {
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
html_print_table($table);
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
echo "<form id='form_delete' action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=".$idReport."'
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
echo '<div class="action-buttons w100p">';
html_print_input_hidden('ids_items_to_delete', '');
$ActionButtons[] = html_print_submit_button(
__('Delete'),
'delete_btn',
false,
[
'class' => 'sub ok',
'icon' => 'next',
],
true
);
html_print_action_buttons(
implode('', $ActionButtons),
['type' => 'form_action']
);
echo '</div>';
echo '</form>';
}
echo '<div class="action-buttons w100p">';
html_print_input_hidden('ids_items_to_delete', '');
$ActionButtons[] = html_print_submit_button(
__('Delete'),
'delete_btn',
false,
[
'class' => 'sub ok',
'icon' => 'next',
],
true
);
html_print_action_buttons(
implode('', $ActionButtons),
['type' => 'form_action']
);
echo '</div>';
echo '</form>';
}
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
if (defined('METACONSOLE')) {
$table->colspan[0][0] = 3;
$table->size = [];
$table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
$table->class = 'databox data';
$table->head[0] = __('Sort items');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
$table->data[1][0] = __('Sort selected items from position: ');
$table->data[1][1] = html_print_select_style(
$table->data[1][0] = html_print_label_input_block(
__('Sort selected items from position: '),
html_print_select_style(
[
'before' => __('Move before to'),
'after' => __('Move after to'),
],
'move_to',
'',
'',
'width:100%',
'',
'',
0,
true
);
$table->data[1][2] = html_print_input_text_extended(
true,
)
);
$table->data[1][2] = html_print_label_input_block(
__('Position'),
html_print_input_text_extended(
'position_to_sort',
1,
'text-position_to_sort',
@ -811,93 +726,42 @@ if (defined('METACONSOLE')) {
"only_numbers('position_to_sort');",
'',
true
);
$table->data[1][2] .= html_print_input_hidden('ids_items_to_sort', '', true);
$table->data[1][3] = html_print_submit_button(__('Sort'), 'sort_submit', false, 'class="sub upd"', true);
).html_print_input_hidden('ids_items_to_sort', '', true)
);
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."'
method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
html_print_table($table);
echo '</form>';
} else {
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data[1][0] = html_print_label_input_block(
__('Sort selected items from position: '),
html_print_select_style(
[
'before' => __('Move before to'),
'after' => __('Move after to'),
],
'move_to',
'',
'width:100%',
'',
'',
0,
true,
)
);
$table->data[1][2] = html_print_label_input_block(
__('Position'),
html_print_input_text_extended(
'position_to_sort',
1,
'text-position_to_sort',
'',
3,
10,
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."' method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Sort'),
'sort_submit',
false,
"only_numbers('position_to_sort');",
'',
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
).html_print_input_hidden('ids_items_to_sort', '', true)
);
),
],
true
);
$form .= html_print_input_hidden('action', 'sort_items', true);
$form .= '</form>';
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."' method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Sort'),
'sort_submit',
false,
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= html_print_input_hidden('action', 'sort_items', true);
$form .= '</form>';
ui_toggle($form, __('Sort items'), '', '', false);
}
ui_toggle($form, __('Sort items'), '', '', false);
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
if (defined('METACONSOLE')) {
$table->colspan[0][0] = 3;
$table->size = [];
$table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
$table->class = 'databox data';
$table->head[0] = __('Delete items');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
$table->data[1][0] = __('Delete selected items from position: ');
$table->data[1][1] = html_print_select_style(
$table->data[0][0] = html_print_label_input_block(
__('Delete selected items from position: '),
html_print_select_style(
[
'above' => __('Delete above to'),
'below' => __('Delete below to'),
@ -909,8 +773,11 @@ if (defined('METACONSOLE')) {
'',
0,
true
);
$table->data[1][2] = html_print_input_text_extended(
)
);
$table->data[0][1] = html_print_label_input_block(
__('Poisition'),
html_print_input_text_extended(
'position_to_delete',
1,
'text-position_to_delete',
@ -921,75 +788,33 @@ if (defined('METACONSOLE')) {
"only_numbers('position_to_delete');",
'',
true
);
$table->data[1][2] .= html_print_input_hidden('ids_items_to_delete', '', true);
$table->data[1][3] = html_print_submit_button(__('Delete'), 'delete_submit', false, 'class="sub upd"', true);
)
);
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
method='post'>";
html_print_table($table);
echo '</form>';
} else {
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data[0][0] = html_print_label_input_block(
__('Delete selected items from position: '),
html_print_select_style(
[
'above' => __('Delete above to'),
'below' => __('Delete below to'),
],
'delete_m',
'',
'',
'',
'',
0,
true
)
);
$table->data[0][1] = html_print_label_input_block(
__('Poisition'),
html_print_input_text_extended(
'position_to_delete',
1,
'text-position_to_delete',
'',
3,
10,
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
method='post'>";
$form .= html_print_input_hidden('ids_items_to_delete', '', true);
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Delete'),
'delete_submit',
false,
"only_numbers('position_to_delete');",
'',
[
'class' => 'mini',
'icon' => 'delete',
'mode' => 'secondary',
],
true
)
);
),
],
true
);
$form .= '</form>';
ui_toggle($form, __('Delete items'), '', '', false);
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
method='post'>";
$form .= html_print_input_hidden('ids_items_to_delete', '', true);
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Delete'),
'delete_submit',
false,
[
'class' => 'mini',
'icon' => 'delete',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= '</form>';
ui_toggle($form, __('Delete items'), '', '', false);
}
?>
<script type="text/javascript">

View File

@ -70,21 +70,13 @@ $table->head = [];
$table->data = [];
$table->size = [];
if (is_metaconsole() === true) {
$table->class = 'databox filters';
$table->head[0] = __('Main data');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
$table->size[0] = '15%';
$table->size[1] = '90%';
$table->style[0] = 'font-weight: bold; vertical-align: top;';
} else {
$table->class = 'filter-table-adv databox';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->size[2] = '50%';
$table->size[3] = '50%';
}
$table->class = 'filter-table-adv databox';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->size[2] = '50%';
$table->size[3] = '50%';
$write_groups = users_get_groups_for_select(
false,
@ -95,35 +87,20 @@ $write_groups = users_get_groups_for_select(
'id_grupo'
);
if (is_metaconsole() === true) {
$table->data['name'][0] = __('Name');
$table->data['name'][1] = html_print_input_text(
$table->data[0][0] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$reportName,
__('Name'),
80,
false,
100,
true,
false,
true
);
)
);
$table->data['group'][0] = __('Group');
} else {
$table->data[0][0] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$reportName,
__('Name'),
false,
100,
true,
false,
true
)
);
}
// If the report group is not among the
// RW groups (special permission) we add it.
@ -137,9 +114,10 @@ if (users_can_manage_group_all('RW') === true) {
$return_all_group = true;
}
if (is_metaconsole() === true) {
$table->data['group'][1] = '<div class="w290px inline">';
$table->data['group'][1] .= html_print_input(
$table->data[0][1] = html_print_label_input_block(
__('Group'),
html_print_input(
[
'type' => 'select_groups',
'id_user' => $config['id_user'],
@ -153,28 +131,23 @@ if (is_metaconsole() === true) {
'return' => true,
'required' => true,
]
);
$table->data['group'][1] .= '</div>';
} else {
$table->data[0][1] = html_print_label_input_block(
__('Group'),
html_print_input(
[
'type' => 'select_groups',
'id_user' => $config['id_user'],
'privilege' => 'AR',
'returnAllGroup' => $return_all_group,
'name' => 'id_group',
'selected' => $idGroupReport,
'script' => '',
'nothing' => '',
'nothing_value' => '',
'return' => true,
'required' => true,
]
)
);
}
)
);
$table->colspan[1][0] = 2;
$table->data[1][0] = html_print_label_input_block(
__('Description'),
html_print_textarea(
'description',
2,
1,
$description,
'',
true
)
);
if ($report_id_user == $config['id_user']
|| is_user_admin($config['id_user'])
@ -185,13 +158,12 @@ if ($report_id_user == $config['id_user']
'group_edit' => __('The next group can edit the report'),
'user_edit' => __('Only the user and admin user can edit the report'),
];
if (is_metaconsole() === true) {
$table->data['access'][0] = __('Write Access');
$table->data['access'][0] .= ui_print_help_tip(
$table->data[2][0] = html_print_label_input_block(
__('Write Access').ui_print_help_tip(
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
true
);
$table->data['access'][1] = html_print_select(
),
html_print_select(
$type_access,
'type_access',
$type_access_selected,
@ -199,16 +171,18 @@ if ($report_id_user == $config['id_user']
'',
0,
true
);
)
);
$class = ' invisible_important ';
if ($type_access_selected == 'group_edit') {
$class = '';
}
$options['div_class'] = 'invisible_important';
$options['div_id'] = 'group_edit';
if ($type_access_selected == 'group_edit') {
$options['div_class'] = '';
}
$table->data['access'][1] .= '<span class="access_subform'.$class.'" id="group_edit">';
$table->data['access'][1] .= '<div class="w290px inline">';
$table->data['access'][1] .= html_print_select_groups(
$table->data[2][1] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'RW',
false,
@ -218,48 +192,9 @@ if ($report_id_user == $config['id_user']
'',
'',
true
);
$table->data['access'][1] .= '</div>';
$table->data['access'][1] .= '</span>';
} else {
$table->data[1][0] = html_print_label_input_block(
__('Write Access').ui_print_help_tip(
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
true
),
html_print_select(
$type_access,
'type_access',
$type_access_selected,
'change_type_access(this)',
'',
0,
true
)
);
$options['div_class'] = 'invisible_important';
$options['div_id'] = 'group_edit';
if ($type_access_selected == 'group_edit') {
$options['div_class'] = '';
}
$table->data[1][1] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'RW',
false,
'id_group_edit',
$id_group_edit,
false,
'',
'',
true
),
$options
);
}
),
$options
);
}
if ($enterpriseEnable) {
@ -268,91 +203,41 @@ if ($enterpriseEnable) {
$non_interactive_check = $non_interactive;
}
if (is_metaconsole() === true) {
$table->data['interactive_report'][0] = __('Non interactive report');
$table->data['interactive_report'][1] .= html_print_checkbox_switch(
$table->data[2][1] = html_print_label_input_block(
__('Non interactive report'),
html_print_checkbox_switch(
'non_interactive',
1,
$non_interactive_check,
true
);
} else {
$table->data[2][0] = html_print_label_input_block(
__('Non interactive report'),
html_print_checkbox_switch(
'non_interactive',
1,
$non_interactive_check,
true
)
);
}
}
if (is_metaconsole() === true) {
$table->data['description'][0] = __('Description');
$table->data['description'][1] = html_print_textarea(
'description',
2,
80,
$description,
'',
true
);
} else {
$table->data[2][1] = html_print_label_input_block(
__('Description'),
html_print_textarea(
'description',
2,
1,
$description,
'',
true
)
);
}
if (enterprise_installed() === true) {
if (is_metaconsole() === true) {
$table->data['cover'][0] = __('Generate cover page in PDF render');
$table->data['cover'][1] = html_print_checkbox_switch(
$table->data[3][0] = html_print_label_input_block(
__('Generate cover page in PDF render'),
html_print_checkbox_switch(
'cover_page_render',
1,
$cover_page_render,
true
);
)
);
$table->data['index'][0] = __('Generate index in PDF render');
$table->data['index'][1] = html_print_checkbox_switch(
$table->data[3][1] = html_print_label_input_block(
__('Generate index in PDF render'),
html_print_checkbox_switch(
'index_render',
1,
$index_render,
true
);
} else {
$table->data[3][0] = html_print_label_input_block(
__('Generate cover page in PDF render'),
html_print_checkbox_switch(
'cover_page_render',
1,
$cover_page_render,
true
)
);
$table->data[3][1] = html_print_label_input_block(
__('Generate index in PDF render'),
html_print_checkbox_switch(
'index_render',
1,
$index_render,
true
)
);
}
)
);
}
echo '<form class="" method="post">';
html_print_table($table);

View File

@ -713,13 +713,14 @@ switch ($action) {
$table_aux = new stdClass();
$table_aux->width = '100%';
if (is_metaconsole()) {
$table_aux->class = 'databox filters';
$table_aux->class = 'filter-table-adv';
$table_aux->size[0] = '30%';
$table_aux->size[1] = '30%';
$table_aux->size[2] = '30%';
$table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
$table_aux->data[0][1] = html_print_select_groups(
$table_aux->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
$access,
true,
@ -737,116 +738,56 @@ switch ($action) {
false,
false,
'id_grupo'
).'<br>';
)
);
$table_aux->data[0][2] = '<b>'.__('Free text for search: ');
$table_aux->data[0][2] .= ui_print_help_tip(
$table_aux->data[0][1] = html_print_label_input_block(
__('Free text for search: ').ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
);
$table_aux->data[0][2] .= '</b>';
$table_aux->data[0][3] = html_print_input_text(
),
html_print_input_text(
__('search'),
$search,
'',
30,
'',
true
);
} else {
$table_aux->class = 'filter-table-adv';
$table_aux->size[0] = '30%';
$table_aux->size[1] = '30%';
$table_aux->size[2] = '30%';
$table_aux->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
$access,
true,
'id_group',
$id_group,
'',
'',
'',
true,
false,
true,
'',
false,
'',
false,
false,
'id_grupo'
)
);
$table_aux->data[0][1] = html_print_label_input_block(
__('Free text for search: ').ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
),
html_print_input_text(
__('search'),
$search,
'',
30,
'',
true
)
);
}
if (is_metaconsole()) {
$table_aux->data[0][6] = html_print_submit_button(
__('Search'),
'search_submit',
false,
'class="sub upd"',
true
);
}
)
);
$url_rb = 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder';
if (is_metaconsole()) {
$filter = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
$filter .= html_print_table($table_aux, true);
$filter .= '</form>';
ui_toggle($filter, __('Show Option'));
} else {
$searchForm = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
$searchForm .= html_print_table($table_aux, true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'search_submit',
false,
[
'mode' => 'mini',
'icon' => 'search',
],
true
),
],
true
);
$searchForm .= '</form>';
$searchForm = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
$searchForm .= html_print_table($table_aux, true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'search_submit',
false,
[
'mode' => 'mini',
'icon' => 'search',
],
true
),
],
true
);
$searchForm .= '</form>';
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
false,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
}
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
false,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
ui_require_jquery_file('pandora.controls');
ui_require_jquery_file('ajaxqueue');
@ -1656,11 +1597,13 @@ switch ($action) {
$agents_to_report = get_parameter('id_agents3');
$source = get_parameter('source', '');
$search = get_parameter('search', '');
$full_text = (integer) get_parameter('full_text', 0);
$log_number = get_parameter('log_number', '');
$es['source'] = $source;
$es['id_agents'] = $agents_to_report;
$es['search'] = $search;
$es['full_text'] = $full_text;
$es['log_number'] = $log_number;
$values['external_source'] = json_encode($es);
@ -2601,11 +2544,13 @@ switch ($action) {
$agents_to_report = get_parameter('id_agents3');
$source = get_parameter('source', '');
$search = get_parameter('search', '');
$full_text = (integer) get_parameter('full_text', 0);
$log_number = get_parameter('log_number', '');
$es['source'] = $source;
$es['id_agents'] = $agents_to_report;
$es['search'] = $search;
$es['full_text'] = $full_text;
$es['log_number'] = $log_number;
$values['external_source'] = json_encode($es);
@ -3612,7 +3557,7 @@ switch ($action) {
$buttons = [
'list_reports' => [
'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'">'.html_print_image('images/report_list.png', true, ['title' => __('Reports list'), 'class' => 'invert_filter']).'</a>',
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Reports list'), 'class' => 'invert_filter main_menu_icon']).'</a>',
],
];

View File

@ -137,8 +137,6 @@ echo $formHidden;
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filter-table-adv';
$table->size = [];
$table->size[0] = '50%';
@ -369,69 +367,65 @@ $(document).ready (function () {
$("#button-getsize").click(function(event){
event.preventDefault();
if ($('#imagen').attr('src') != '') {
if (parseInt($('#imagen').width()) < 1024){
alert('Default width is '+$('#imagen').width()+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html(1024);
if (parseInt($('#imagen').width()) < 1024){
alert('Default width is '+$('#imagen').width()+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html(1024);
} else{
$('input[name=width]').val($('#imagen').width());
$('#preimagew').html($('#imagen').width());
}
if (parseInt($('#imagen').height()) < 768){
alert('Default height is '+$('#imagen').height()+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
} else{
$('input[name=height]').val($('#imagen').height());
$('#preimageh').html($('#imagen').height());
}
} else {
original_image=new Image();
url_hack_metaconsole = metaconsole_url();
original_image.src= url_hack_metaconsole + 'images/console/background/'+$('#background').val();
if (parseInt(original_image.width) < 1024){
alert('Default width is '+original_image.width+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html(1024);
} else {
$('input[name=width]').val(original_image.height);
$('#preimagew').html(original_image.height);
}
if (parseInt(original_image.height) < 768){
alert('Default height is '+original_image.height+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
} else {
$('input[name=height]').val(original_image.height);
$('#preimageh').html(original_image.height);
}
}
else{
$('input[name=width]').val($('#imagen').width());
$('#preimagew').html($('#imagen').width());
}
if (parseInt($('#imagen').height()) < 768){
alert('Default height is '+$('#imagen').height()+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
}
else{
$('input[name=height]').val($('#imagen').height());
$('#preimageh').html($('#imagen').height());
}
}
else{
original_image=new Image();
url_hack_metaconsole = metaconsole_url();
original_image.src= url_hack_metaconsole + 'images/console/background/'+$('#background').val();
if (parseInt(original_image.width) < 1024){
alert('Default width is '+original_image.width+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html(1024);
}
else{
$('input[name=width]').val(original_image.height);
$('#preimagew').html(original_image.height);
}
if (parseInt(original_image.height) < 768){
alert('Default height is '+original_image.height+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
}
else{
$('input[name=height]').val(original_image.height);
$('#preimageh').html(original_image.height);
}
}
});
$( "input[type=submit]" ).click(function( event ) {
if (parseInt($('input[name=width]').val()) < 1024){
alert('Default width is '+$('input[name=width]').val()+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html('1024');
var x = 1;
}
$( "button[type=submit]" ).click(function( event ) {
console.log('aaaaaaaaaaa');
if (parseInt($('input[name=width]').val()) < 1024){
alert('Default width is '+$('input[name=width]').val()+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html('1024');
var x = 1;
}
if (parseInt($('input[name=height]').val()) < 768){
alert('Default height is '+$('input[name=height]').val()+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html('768');
var y = 1;
}
if (x || y){
return false;
}
if (parseInt($('input[name=height]').val()) < 768){
alert('Default height is '+$('input[name=height]').val()+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html('768');
var y = 1;
}
if (x || y){
return false;
}
});
//Preload image size and activate auto image size changer when user click over a image in the selector

View File

@ -63,7 +63,7 @@ if (empty($idVisualConsole) === true) {
$idVisualConsole = get_parameter('id', 0);
}
if (!defined('METACONSOLE')) {
if (is_metaconsole() === false) {
$action_name_parameter = 'action';
} else {
$action_name_parameter = 'action2';
@ -93,7 +93,6 @@ $activeTab = get_parameterBetweenListValues(
'data'
);
// Visual console creation tab and actions.
if (empty($idVisualConsole)) {
$visualConsole = null;
@ -137,7 +136,6 @@ $refr = (int) get_parameter('refr', $config['vc_refr']);
$id_layout = 0;
// Save/Update data in DB
global $statusProcessInDB;
if (empty($statusProcessInDB)) {
@ -786,7 +784,7 @@ if (isset($config['vc_refr']) and $config['vc_refr'] != 0) {
$view_refresh = '300';
}
if (!defined('METACONSOLE')) {
if (is_metaconsole() === false) {
$url_base = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action=';
$url_view = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='.$idVisualConsole.'&refr='.$view_refresh;
} else {
@ -798,14 +796,18 @@ if (!defined('METACONSOLE')) {
$hash = User::generatePublicHash();
$buttons = [];
$buttons['consoles_list'] = [
'active' => false,
'text' => '<a href="index.php?sec=network&sec2=godmode/reporting/map_builder&refr='.$refr.'">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Visual consoles list'), 'class' => 'main_menu_icon invert_filter']).'</a>',
];
$buttons['public_link'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('operation/visual_console/public_console.php?hash='.$hash.'&refr='.$refr.'&id_layout='.$idVisualConsole.'&id_user='.$config['id_user']).'">'.html_print_image('images/item-icon.svg', true, ['title' => __('Show link to public Visual Console'), 'class' => 'main_menu_icon invert_filter']).'</a>',
'text' => '<a href="'.ui_get_full_url(
'operation/visual_console/public_console.php?hash='.$hash.'&refr='.$refr.'&id_layout='.$idVisualConsole.'&id_user='.$config['id_user'],
false,
false,
false
).'">'.html_print_image('images/item-icon.svg', true, ['title' => __('Show link to public Visual Console'), 'class' => 'main_menu_icon invert_filter']).'</a>',
];
$buttons['data'] = [
'active' => false,
@ -839,7 +841,7 @@ $buttons['view'] = [
'text' => '<a href="'.$url_view.'">'.html_print_image('images/enable.svg', true, ['title' => __('View'), 'class' => 'main_menu_icon invert_filter']).'</a>',
];
if ($idVisualConsole === false) {
if (empty($idVisualConsole) === true) {
$buttons = ['data' => $buttons['data']];
// Show only the data tab
// If it is a fail try, reset the values
@ -850,9 +852,8 @@ if ($idVisualConsole === false) {
$buttons[$activeTab]['active'] = true;
$tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : '';
ui_print_standard_header(
$visualConsoleName,
($visualConsoleName ?? ''),
'images/visual_console.png',
false,
$tab_builder,

View File

@ -228,11 +228,24 @@ if (isset($_GET['server']) === true) {
$advanced_editor = false;
if ($server_type === 13) {
echo "<table cellpadding='4' cellspacing='4' class='databox filters font_bold margin-bottom-10' width='100%'>
echo "<table cellpadding='4' cellspacing='4' class='databox filters margin-bottom-10 max_floating_element_size filter-table-adv'>
<tr>";
echo '<td class="w100p">';
echo __('Dynamic search').'&nbsp;&nbsp;';
html_print_input_text('search_config_token', $search, '', 12);
echo html_print_label_input_block(
__('Dynamic search'),
html_print_input_text(
'search_config_token',
$search,
'',
12,
255,
true,
false,
false,
'',
'w400px'
)
);
echo '</td>';
echo '</tr></table>';
}

View File

@ -254,7 +254,7 @@ foreach ($servers as $server) {
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
$data[8] .= html_print_image(
'images/remote_configuration@svg.svg',
'images/remote-configuration@svg.svg',
true,
[
'title' => __('Remote configuration'),

View File

@ -65,7 +65,7 @@ switch ($action) {
$table = new stdClass();
$table->class = 'info_table';
$table->width = '98%';
$table->width = '100%';
$table->head[0] = __('Map connection name');
$table->head[1] = __('Group');
$table->head[3] = __('Delete');
@ -84,7 +84,7 @@ if ($mapsConnections !== false) {
'<a href="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2&amp;action=edit_connection_map&amp;id_connection_map='.$mapsConnection['id_tmap_connection'].'">'.$mapsConnection['conection_name'].'</a>',
ui_print_group_icon($mapsConnection['group_id'], true),
'<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=gis&amp;id_connection_map='.$mapsConnection['id_tmap_connection'].'&amp;action=delete_connection"
onClick="javascript: if (!confirm(\''.__('Do you wan delete this connection?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter']).'</a>',
onClick="javascript: if (!confirm(\''.__('Do you wan delete this connection?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter main_menu_icon']).'</a>',
];
$table->cellclass[][2] = 'table_action_buttons';
}
@ -95,6 +95,14 @@ html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<form action="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2" method="post">';
html_print_input_hidden('action', 'create_connection_map');
html_print_submit_button(__('Create'), '', false, 'class="sub next"');
html_print_action_buttons(
html_print_submit_button(
__('Create'),
'',
false,
['icon' => 'wand'],
true
)
);
echo '</form>';
echo '</div>';

View File

@ -50,13 +50,23 @@ echo '<form action="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2" method="
switch ($action) {
case 'create_connection_map':
// Header.
ui_print_page_header(
ui_print_standard_header(
__('Create new map connection'),
'',
false,
'map_connection_tab',
true,
$buttons
$buttons,
[
[
'link' => '',
'label' => __('Setup'),
],
[
'link' => '',
'label' => __('Setup').' - '.__('Gis'),
],
]
);
$mapConnection_name = '';
@ -77,13 +87,23 @@ switch ($action) {
case 'edit_connection_map':
// Header.
ui_print_page_header(
ui_print_standard_header(
__('Edit map connection'),
'',
false,
'map_connection_tab',
true,
$buttons
$buttons,
[
[
'link' => '',
'label' => __('Setup'),
],
[
'link' => '',
'label' => __('Setup').' - '.__('Gis'),
],
]
);
$idConnectionMap = get_parameter('id_connection_map');

View File

@ -25,8 +25,25 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
exit;
}
// Header
ui_print_page_header(__('Site news management'), '', false, '', true);
// Header.
ui_print_standard_header(
__('Site news management'),
'images/custom_field.png',
false,
'',
true,
[],
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Site news'),
],
]
);

View File

@ -55,7 +55,7 @@ $iconData[] = html_print_select(
$iconData[] = html_print_div(
[
'id' => 'icon_image',
'class' => 'inverse_filter main_menu_icon',
'class' => 'invert_filter main_menu_icon',
'style' => 'margin-left: 10px',
'content' => ui_print_os_icon($idOS, false, true),
],

View File

@ -69,7 +69,6 @@ if ($is_management_allowed === true) {
$table->head[4] = '';
}
$table->align[1] = 'center';
if ($is_management_allowed === true) {
$table->align[4] = 'center';
}
@ -100,7 +99,7 @@ $table->data = [];
foreach ($osList as $os) {
$data = [];
$data[] = $os['id_os'];
$data[] = html_print_div(['class' => 'invert_filter main_menu_icon', 'content' => ui_print_os_icon($os['id_os'], false, true)], true);
$data[] = ui_print_os_icon($os['id_os'], false, true);
if ($is_management_allowed === true) {
if (is_metaconsole() === true) {
$osNameUrl = 'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=edit&tab2=builder&id_os='.$os['id_os'];
@ -133,7 +132,7 @@ foreach ($osList as $os) {
$data[] = html_print_anchor(
[
'href' => $hrefDelete,
'class' => 'inverse_filter main_menu_icon',
'class' => 'invert_filter main_menu_icon',
'content' => html_print_image('images/delete.svg', true),
],
true
@ -147,17 +146,41 @@ foreach ($osList as $os) {
$table->data[] = $data;
}
$tablePagination = '';
if (isset($data) === true) {
html_print_table($table);
ui_pagination($count_osList, ui_get_url_refresh(['message' => false]), $offset, 0, false, 'offset', true, 'pagination-bottom');
$tablePagination = ui_pagination(
$count_osList,
ui_get_url_refresh(['message' => false]),
$offset,
0,
true,
'offset',
false,
''
);
} else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]);
}
$buttons = '';
if (is_metaconsole() === true) {
echo '<form method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=builder">';
echo "<div style='text-align:right;width:".$table->width."'>";
html_print_submit_button(__('Create OS'), '', false, 'class="sub next"');
echo '</div>';
echo '</form>';
$buttons .= '<form method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=builder">';
$buttons .= html_print_submit_button(
__('Create OS'),
'',
false,
['icon' => 'next'],
true
);
$buttons .= '</form>';
}
html_print_action_buttons(
$buttons,
[
'type' => 'data_table',
'class' => 'fixed_action_buttons',
'right_content' => $tablePagination,
]
);

Some files were not shown because too many files have changed in this diff Show More