Merge branch 'develop' into 'ent-9600-Estado-erroneo-de-servidor-cuando-hay-un-TZ-distinto-entre-servidor-consola'
# Conflicts: # pandora_console/extras/mr/61.sql
This commit is contained in:
commit
87d09d47ca
|
@ -285,11 +285,16 @@ server_dependencies=" \
|
|||
java \
|
||||
bind-utils \
|
||||
whois \
|
||||
cpanminus \
|
||||
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \
|
||||
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
|
||||
https://firefly.artica.es/centos7/pandorawmic-1.0.0-1.x86_64.rpm"
|
||||
execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
|
||||
|
||||
# install cpan dependencies
|
||||
execute_cmd "cpanm -i Thread::Semaphore" "Installing Thread::Semaphore"
|
||||
|
||||
|
||||
# SDK VMware perl dependencies
|
||||
vmware_dependencies=" \
|
||||
http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm \
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#######################################################
|
||||
## Tested versions ##
|
||||
# Centos 8.4, 8.5
|
||||
# Rocky 8.4, 8.5
|
||||
# Rocky 8.4, 8.5, 8.6, 8.7
|
||||
# Almalinuz 8.4, 8.5
|
||||
# RedHat 8.5
|
||||
|
||||
|
@ -14,24 +14,25 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
|
|||
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
||||
|
||||
|
||||
S_VERSION='202209231'
|
||||
S_VERSION='202301251'
|
||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||
|
||||
# define default variables
|
||||
[ "$TZ" ] || TZ="Europe/Madrid"
|
||||
[ "$MYVER" ] || MYVER=57
|
||||
[ "$PHPVER" ] || PHPVER=8
|
||||
[ "$DBHOST" ] || DBHOST=127.0.0.1
|
||||
[ "$DBNAME" ] || DBNAME=pandora
|
||||
[ "$DBUSER" ] || DBUSER=pandora
|
||||
[ "$DBPASS" ] || DBPASS=pandora
|
||||
[ "$DBPORT" ] || DBPORT=3306
|
||||
[ "$TZ" ] || TZ="Europe/Madrid"
|
||||
[ "$MYVER" ] || MYVER=57
|
||||
[ "$PHPVER" ] || PHPVER=8
|
||||
[ "$DBHOST" ] || DBHOST=127.0.0.1
|
||||
[ "$DBNAME" ] || DBNAME=pandora
|
||||
[ "$DBUSER" ] || DBUSER=pandora
|
||||
[ "$DBPASS" ] || DBPASS=pandora
|
||||
[ "$DBPORT" ] || DBPORT=3306
|
||||
[ "$DBROOTUSER" ] || DBROOTUSER=root
|
||||
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
|
||||
[ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0
|
||||
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
|
||||
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
|
||||
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
|
||||
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
|
||||
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
|
||||
[ "$PANDORA_LTS" ] || PANDORA_LTS=1
|
||||
[ "$PANDORA_BETA" ] || PANDORA_BETA=0
|
||||
|
||||
# Ansi color code variables
|
||||
|
@ -41,7 +42,6 @@ cyan="\e[0;36m"
|
|||
reset="\e[0m"
|
||||
|
||||
# Functions
|
||||
|
||||
execute_cmd () {
|
||||
local cmd="$1"
|
||||
local msg="$2"
|
||||
|
@ -76,7 +76,7 @@ check_cmd_status () {
|
|||
check_pre_pandora () {
|
||||
|
||||
echo -en "${cyan}Checking environment ... ${reset}"
|
||||
rpm -qa | grep 'pandorafms_' &>> /dev/null && local fail=true
|
||||
rpm -qa | grep -v "pandorawmic" | grep 'pandorafms_' &>> /dev/null && local fail=true
|
||||
[ -d "$PANDORA_CONSOLE" ] && local fail=true
|
||||
[ -f /usr/bin/pandora_server ] && local fail=true
|
||||
|
||||
|
@ -137,7 +137,10 @@ check_root_permissions
|
|||
[ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora
|
||||
|
||||
#advicing BETA PROGRAM
|
||||
[ "$PANDORA_BETA" -ne '0' ] && echo -e "${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
|
||||
echo -e $INSTALLING_VER
|
||||
|
||||
# Connectivity
|
||||
check_repo_connection
|
||||
|
@ -467,6 +470,8 @@ query_cache_size = 64M
|
|||
query_cache_min_res_unit = 2k
|
||||
query_cache_limit = 256K
|
||||
|
||||
#skip-log-bin
|
||||
|
||||
sql_mode=""
|
||||
|
||||
[mysqld_safe]
|
||||
|
@ -477,6 +482,7 @@ EO_CONFIG_F
|
|||
|
||||
if [ "$MYVER" -eq '80' ] ; then
|
||||
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
|
||||
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
|
||||
fi
|
||||
|
||||
execute_cmd "systemctl restart mysqld" "Configuring database engine"
|
||||
|
@ -485,11 +491,18 @@ fi
|
|||
export MYSQL_PWD=$DBPASS
|
||||
|
||||
#Define packages
|
||||
if [ "$PANDORA_BETA" -eq '0' ] ; then
|
||||
if [ "$PANDORA_LTS" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
elif [ "$PANDORA_LTS" -ne '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
elif [ "$PANDORA_BETA" -ne '0' ] ; then
|
||||
fi
|
||||
|
||||
# if beta is enable
|
||||
if [ "$PANDORA_BETA" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://pandorafms.com/community/community-console-rpm-beta/"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
|
|
|
@ -16,7 +16,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
|||
WORKDIR=/opt/pandora/deploy
|
||||
|
||||
|
||||
S_VERSION='2022052501'
|
||||
S_VERSION='202301251'
|
||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||
rm -f $LOGFILE &> /dev/null # remove last log before start
|
||||
|
||||
|
@ -34,6 +34,8 @@ rm -f $LOGFILE &> /dev/null # remove last log before start
|
|||
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
|
||||
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
|
||||
[ "$PANDORA_BETA" ] || PANDORA_BETA=0
|
||||
[ "$PANDORA_LTS" ] || PANDORA_LTS=1
|
||||
|
||||
|
||||
# Ansi color code variables
|
||||
red="\e[0;91m"
|
||||
|
@ -134,7 +136,10 @@ check_root_permissions
|
|||
[ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora
|
||||
|
||||
#advicing BETA PROGRAM
|
||||
[ "$PANDORA_BETA" -ne '0' ] && echo -e "${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
|
||||
echo -e $INSTALLING_VER
|
||||
|
||||
# Connectivity
|
||||
check_repo_connection
|
||||
|
@ -272,14 +277,19 @@ echo -en "${cyan}Installing phantomjs...${reset}"
|
|||
/usr/bin/phantomjs --version &>> "$LOGFILE"
|
||||
check_cmd_status "Error Installing phanromjs"
|
||||
|
||||
# create symlink for fping
|
||||
rm -f /usr/sbin/fping &>> "$LOGFILE"
|
||||
ln -s /usr/bin/fping /usr/sbin/fping &>> "$LOGFILE"
|
||||
|
||||
# Chrome
|
||||
rm -f /usr/bin/chromium-browser &>> "$LOGFILE"
|
||||
execute_cmd "wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" "Downloading google chrome"
|
||||
execute_cmd "apt install -y ./google-chrome-stable_current_amd64.deb" "Intalling google chrome"
|
||||
execute_cmd "ln -s /usr/bin/google-chrome /usr/bin/chromium-browser" "Creating /usr/bin/chromium-browser Symlink"
|
||||
|
||||
# SDK VMware perl dependencies
|
||||
vmware_dependencies=" \
|
||||
lib32z1 \
|
||||
vmware_dependencies="\
|
||||
lib32z1 \
|
||||
lib32z1 \
|
||||
build-essential \
|
||||
uuid uuid-dev \
|
||||
|
@ -350,16 +360,22 @@ systemctl stop apparmor &>> "$LOGFILE"
|
|||
systemctl disable apparmor &>> "$LOGFILE"
|
||||
|
||||
#install mysql
|
||||
debconf-set-selections <<< $(echo -n "mysql-server mysql-server/root_password password $DBROOTPASS") &>> "$LOGFILE"
|
||||
debconf-set-selections <<< $(echo -n "mysql-server mysql-server/root_password_again password $DBROOTPASS") &>> "$LOGFILE"
|
||||
echo -en "${cyan}Installing MySql Server...${reset}"
|
||||
env DEBIAN_FRONTEND=noninteractive apt install -y mysql-server &>> "$LOGFILE"
|
||||
execute_cmd "curl -O https://repo.percona.com/apt/percona-release_latest.generic_all.deb" "Downloading Percona repository for MySQL8"
|
||||
execute_cmd "apt install -y gnupg2 lsb-release ./percona-release_latest.generic_all.deb" "Installing Percona repository for MySQL8"
|
||||
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"
|
||||
check_cmd_status "Error Installing MySql Server"
|
||||
|
||||
|
||||
#Configuring Database
|
||||
if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
|
||||
execute_cmd "systemctl start mysql" "Starting database engine"
|
||||
|
||||
echo """
|
||||
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$DBROOTPASS';
|
||||
""" | mysql -uroot &>> "$LOGFILE"
|
||||
|
||||
export MYSQL_PWD=$DBROOTPASS
|
||||
echo -en "${cyan}Creating Pandora FMS database...${reset}"
|
||||
|
@ -399,11 +415,12 @@ max_connections = 100
|
|||
|
||||
key_buffer_size=4M
|
||||
read_buffer_size=128K
|
||||
|
||||
read_rnd_buffer_size=128K
|
||||
sort_buffer_size=128K
|
||||
join_buffer_size=4M
|
||||
|
||||
skip-log-bin
|
||||
|
||||
sql_mode=""
|
||||
|
||||
log-error=/var/log/mysql/error.log
|
||||
|
@ -417,11 +434,17 @@ execute_cmd "systemctl restart mysql" "Configuring and restarting database engin
|
|||
|
||||
|
||||
#Define packages
|
||||
if [ "$PANDORA_BETA" -eq '0' ] ; then
|
||||
if [ "$PANDORA_LTS" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_server-7.0NG.tar.gz"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_console-7.0NG.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
elif [ "$PANDORA_LTS" -ne '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_server-7.0NG.tar.gz"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_console-7.0NG.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
elif [ "$PANDORA_BETA" -ne '0' ] ; then
|
||||
fi
|
||||
|
||||
if [ "$PANDORA_BETA" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.768
|
||||
Version: 7.0NG.768-230126
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.768"
|
||||
pandora_version="7.0NG.768-230126"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1015,7 +1015,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.768';
|
||||
use constant AGENT_BUILD => '230119';
|
||||
use constant AGENT_BUILD => '230126';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.768
|
||||
%define release 1
|
||||
%define release 230126
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.768
|
||||
%define release 1
|
||||
%define release 230126
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.768"
|
||||
PI_BUILD="230119"
|
||||
PI_BUILD="230126"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{230119}
|
||||
{230126}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
|
|||
{No}
|
||||
|
||||
Windows,Executable
|
||||
{<%AppName%>-Setup<%Ext%>}
|
||||
{<%AppName%>-<%Version%>-Setup<%Ext%>}
|
||||
|
||||
Windows,FileDescription
|
||||
{<%AppName%> <%Version%> Setup}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.768 Build 230119")
|
||||
#define PANDORA_VERSION ("7.0NG.768 Build 230126")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.768(Build 230119))"
|
||||
VALUE "ProductVersion", "(7.0NG.768(Build 230126))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.768
|
||||
Version: 7.0NG.768-230126
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.768"
|
||||
pandora_version="7.0NG.768-230126"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -2,4 +2,15 @@ START TRANSACTION;
|
|||
|
||||
ALTER TABLE `tserver` ADD COLUMN `server_keepalive_utimestamp` BIGINT NOT NULL DEFAULT 0;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `tsesion_filter` (
|
||||
`id_filter` INT NOT NULL AUTO_INCREMENT,
|
||||
`id_name` TEXT NULL,
|
||||
`text` TEXT NULL,
|
||||
`period` TEXT NULL,
|
||||
`ip` TEXT NULL,
|
||||
`type` TEXT NULL,
|
||||
`user` TEXT NULL,
|
||||
PRIMARY KEY (`id_filter`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
COMMIT;
|
||||
|
|
|
@ -290,7 +290,7 @@ $search_text = (string) get_parameter('search_text');
|
|||
$date_from = (string) get_parameter('date_from');
|
||||
$date_to = (string) get_parameter('date_to');
|
||||
$execution_type = (string) get_parameter('execution_type');
|
||||
$show_archived = (bool) get_parameter('archived');
|
||||
$show_archived = (bool) get_parameter_switch('archived', false);
|
||||
$agent_id = (int) get_parameter('agent_id');
|
||||
$agent_name = (string) ((empty($agent_id) === false) ? get_parameter('agent_name') : '');
|
||||
$module_id = (int) get_parameter('module_name_hidden');
|
||||
|
@ -313,12 +313,20 @@ $table_form = new StdClass();
|
|||
$table_form->class = 'databox filters';
|
||||
$table_form->width = '100%';
|
||||
$table_form->rowstyle = [];
|
||||
$table_form->cellstyle[0] = ['width: 100px;'];
|
||||
$table_form->cellstyle[1] = ['width: 100px;'];
|
||||
$table_form->cellstyle[1][2] = 'display: flex; align-items: center;';
|
||||
$table_form->cellstyle[2] = ['width: 100px;'];
|
||||
$table_form->cellstyle[3] = ['text-align: right;'];
|
||||
$table_form->colspan[3][0] = 3;
|
||||
$table_form->data = [];
|
||||
|
||||
$row = [];
|
||||
|
||||
// Search text.
|
||||
$row[] = __('Search').' '.html_print_input_text(
|
||||
$row[] = __('Search');
|
||||
|
||||
$row[] = html_print_input_text(
|
||||
'search_text',
|
||||
$search_text,
|
||||
'',
|
||||
|
@ -356,7 +364,8 @@ $execution_type_fields = [
|
|||
'periodically' => __('Periodically'),
|
||||
'cron' => __('Cron'),
|
||||
];
|
||||
$row[] = __('Execution type').' '.html_print_select(
|
||||
$row[] = __('Execution type');
|
||||
$row[] = html_print_select(
|
||||
$execution_type_fields,
|
||||
'execution_type',
|
||||
$execution_type,
|
||||
|
@ -368,11 +377,11 @@ $row[] = __('Execution type').' '.html_print_select(
|
|||
false
|
||||
);
|
||||
// Show past downtimes.
|
||||
$row[] = __('Show past downtimes').' '.html_print_checkbox(
|
||||
'archived',
|
||||
1,
|
||||
$show_archived,
|
||||
true
|
||||
$row[] = __('Show past downtimes').' '.html_print_switch(
|
||||
[
|
||||
'name' => 'archived',
|
||||
'value' => $show_archived,
|
||||
]
|
||||
);
|
||||
|
||||
$table_form->data[] = $row;
|
||||
|
@ -388,8 +397,8 @@ $params['return'] = true;
|
|||
$params['print_hidden_input_idagent'] = true;
|
||||
$params['hidden_input_idagent_name'] = 'agent_id';
|
||||
$params['hidden_input_idagent_value'] = $agent_id;
|
||||
$agent_input = __('Agent').' '.ui_print_agent_autocomplete_input($params);
|
||||
$row[] = $agent_input;
|
||||
$row[] = __('Agent');
|
||||
$row[] = ui_print_agent_autocomplete_input($params);
|
||||
|
||||
// Module.
|
||||
$row[] = __('Module').' '.html_print_autocomplete_modules(
|
||||
|
@ -402,6 +411,10 @@ $row[] = __('Module').' '.html_print_autocomplete_modules(
|
|||
true
|
||||
);
|
||||
|
||||
$table_form->data[] = $row;
|
||||
|
||||
$row = [];
|
||||
|
||||
$row[] = html_print_submit_button(
|
||||
__('Search'),
|
||||
'search',
|
||||
|
|
|
@ -1353,11 +1353,8 @@ $values = [
|
|||
'Alert detail' => __('Alert detail'),
|
||||
'External link' => __('External link'),
|
||||
'Other' => __('Other'),
|
||||
'Dashboard' => __('Dashboard'),
|
||||
];
|
||||
if (!is_metaconsole()) {
|
||||
$values['Dashboard'] = __('Dashboard');
|
||||
}
|
||||
|
||||
|
||||
$home_screen .= html_print_select(
|
||||
$values,
|
||||
|
@ -1372,7 +1369,14 @@ $home_screen .= html_print_select(
|
|||
).'</div>';
|
||||
|
||||
|
||||
$dashboards = Manager::getDashboards(-1, -1);
|
||||
$dashboards = Manager::getDashboards(
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
false,
|
||||
$id_usr
|
||||
);
|
||||
|
||||
$dashboards_aux = [];
|
||||
if ($dashboards === false) {
|
||||
$dashboards = ['None' => 'None'];
|
||||
|
|
|
@ -333,6 +333,7 @@ if ($delete_user === true) {
|
|||
$result = delete_user($id_user);
|
||||
|
||||
if ($result) {
|
||||
delete_session_user($id_user);
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__('Deleted user %s', io_safe_output($id_user))
|
||||
|
|
|
@ -721,7 +721,7 @@ if ($get_agent_alerts_datatable === true) {
|
|||
}
|
||||
break;
|
||||
|
||||
case 'lastFired':
|
||||
case 'last_fired':
|
||||
switch ($sort) {
|
||||
case 'asc':
|
||||
$selectLastFiredasc = $selected;
|
||||
|
|
|
@ -0,0 +1,457 @@
|
|||
<?php
|
||||
/**
|
||||
* Manage AJAX response for event pages.
|
||||
*
|
||||
* @category Ajax
|
||||
* @package Pandora FMS
|
||||
* @subpackage Events
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
enterprise_include_once('include/functions_audit.php');
|
||||
|
||||
// Check access.
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'ER')
|
||||
&& ! check_acl($config['id_user'], 0, 'EW')
|
||||
&& ! check_acl($config['id_user'], 0, 'EM')
|
||||
) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access event viewer'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
$save_filter_modal = get_parameter('save_filter_modal', 0);
|
||||
$load_filter_modal = get_parameter('load_filter_modal', 0);
|
||||
$get_filter_values = get_parameter('get_filter_values', 0);
|
||||
$update_log_filter = get_parameter('update_log_filter', 0);
|
||||
$save_log_filter = get_parameter('save_log_filter', 0);
|
||||
$recover_aduit_log_select = get_parameter('recover_aduit_log_select', 0);
|
||||
|
||||
|
||||
// Saves an event filter.
|
||||
if ($save_log_filter) {
|
||||
$values = [];
|
||||
$values['id_name'] = get_parameter('id_name');
|
||||
$values['text'] = get_parameter('text', '');
|
||||
$values['period'] = get_parameter('period', '');
|
||||
$values['ip'] = get_parameter('ip', '');
|
||||
$values['type'] = get_parameter('type', -1);
|
||||
$values['user'] = get_parameter('user', -1);
|
||||
|
||||
$exists = (bool) db_get_value_filter(
|
||||
'id_filter',
|
||||
'tsesion_filter',
|
||||
['id_name' => $values['id_name']]
|
||||
);
|
||||
|
||||
if ($exists) {
|
||||
echo 'duplicate';
|
||||
} else {
|
||||
$result = db_process_sql_insert('tsesion_filter', $values);
|
||||
|
||||
if ($result === false) {
|
||||
echo 'error';
|
||||
} else {
|
||||
echo $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($recover_aduit_log_select) {
|
||||
echo json_encode(audit_get_audit_filter_select());
|
||||
}
|
||||
|
||||
if ($update_log_filter) {
|
||||
$values = [];
|
||||
$id = get_parameter('id');
|
||||
$values['text'] = get_parameter('text', '');
|
||||
$values['period'] = get_parameter('period', '');
|
||||
$values['ip'] = get_parameter('ip', '');
|
||||
$values['type'] = get_parameter('type', -1);
|
||||
$values['user'] = get_parameter('user', -1);
|
||||
|
||||
$result = db_process_sql_update(
|
||||
'tsesion_filter',
|
||||
$values,
|
||||
['id_filter' => $id]
|
||||
);
|
||||
|
||||
if ($result === false) {
|
||||
echo 'error';
|
||||
} else {
|
||||
echo 'ok';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($get_filter_values) {
|
||||
$id_filter = get_parameter('id');
|
||||
|
||||
$event_filter = audit_get_audit_log_filter($id_filter);
|
||||
echo json_encode($event_filter);
|
||||
}
|
||||
|
||||
|
||||
if ($load_filter_modal) {
|
||||
$filters = audit_get_audit_filter_select();
|
||||
$user_groups_array = users_get_groups_for_select(
|
||||
$config['id_user'],
|
||||
$access,
|
||||
true,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
echo '<div id="load-filter-select" class="load-filter-modal">';
|
||||
|
||||
$table = new StdClass;
|
||||
$table->id = 'load_filter_form';
|
||||
$table->width = '100%';
|
||||
$table->cellspacing = 4;
|
||||
$table->cellpadding = 4;
|
||||
$table->class = 'databox';
|
||||
if (is_metaconsole()) {
|
||||
$table->cellspacing = 0;
|
||||
$table->cellpadding = 0;
|
||||
$table->class = 'databox filters';
|
||||
}
|
||||
|
||||
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
|
||||
$filter_id_width = '200px';
|
||||
if (is_metaconsole()) {
|
||||
$filter_id_width = '150px';
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$table->rowid[3] = 'update_filter_row1';
|
||||
$data[0] = __('Load filter').$jump;
|
||||
$data[0] .= html_print_select(
|
||||
$filters,
|
||||
'filter_id',
|
||||
'',
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'margin-left:5px; width:'.$filter_id_width.';'
|
||||
);
|
||||
$data[1] = html_print_submit_button(
|
||||
__('Load filter'),
|
||||
'load_filter',
|
||||
false,
|
||||
'class="sub upd" onclick="load_filter_values()"',
|
||||
true
|
||||
);
|
||||
$data[1] .= html_print_input_hidden('load_filter', 1, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
html_print_table($table);
|
||||
echo '</div>';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function show_filter() {
|
||||
$("#load-filter-select").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: false,
|
||||
closeOnEscape: true,
|
||||
width: 450
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function load_filter_values() {
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '<?php echo ui_get_full_url('ajax.php'); ?>',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
page: 'include/ajax/audit_log',
|
||||
get_filter_values: 1,
|
||||
"id" : $('#filter_id :selected').val()
|
||||
},
|
||||
success: function(data) {
|
||||
var options = "";
|
||||
$.each(data,function(i,value){
|
||||
if (i == 'text'){
|
||||
$("#text-filter_text").val(value);
|
||||
}
|
||||
if (i == 'period'){
|
||||
$("#text-filter_period").val(value);
|
||||
}
|
||||
if (i == 'ip'){
|
||||
$("#text-filter_ip").val(value);
|
||||
}
|
||||
if (i == 'type'){
|
||||
$("#filter_type").val(value).change();
|
||||
}
|
||||
if (i == 'user'){
|
||||
$("#filter_user").val(value).change();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Close dialog.
|
||||
$("#load-filter-select").dialog('close');
|
||||
}
|
||||
|
||||
$(document).ready (function() {
|
||||
show_filter();
|
||||
})
|
||||
|
||||
</script>
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ($save_filter_modal) {
|
||||
echo '<div id="save-filter-select" style="width:350px;">';
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'EW') === 1 || check_acl($config['id_user'], 0, 'EM') === 1) {
|
||||
echo '<div id="info_box"></div>';
|
||||
$table = new StdClass;
|
||||
$table->id = 'save_filter_form';
|
||||
$table->width = '100%';
|
||||
$table->cellspacing = 4;
|
||||
$table->cellpadding = 4;
|
||||
$table->class = 'databox';
|
||||
if (is_metaconsole()) {
|
||||
$table->class = 'databox filters';
|
||||
$table->cellspacing = 0;
|
||||
$table->cellpadding = 0;
|
||||
}
|
||||
|
||||
$table->styleTable = 'font-weight: bold; text-align:left;';
|
||||
if (!is_metaconsole()) {
|
||||
$table->style[0] = 'width: 50%; width:50%;';
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$table->rowid[0] = 'update_save_selector';
|
||||
$data[0] = html_print_radio_button(
|
||||
'filter_mode',
|
||||
'new',
|
||||
__('New filter'),
|
||||
true,
|
||||
true
|
||||
);
|
||||
|
||||
$data[1] = html_print_radio_button(
|
||||
'filter_mode',
|
||||
'update',
|
||||
__('Update filter'),
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = [];
|
||||
$table->rowid[1] = 'save_filter_row1';
|
||||
$data[0] = __('Filter name').$jump;
|
||||
$data[0] .= html_print_input_text('id_name', '', '', 15, 255, true);
|
||||
|
||||
$data[1] = html_print_submit_button(
|
||||
__('Save filter'),
|
||||
'save_filter',
|
||||
false,
|
||||
'class="sub wand" onclick="save_new_filter();"',
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = [];
|
||||
$table->rowid[2] = 'save_filter_row2';
|
||||
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = [];
|
||||
$table->rowid[3] = 'update_filter_row1';
|
||||
$data[0] = __('Overwrite filter').$jump;
|
||||
|
||||
$_filters_update = audit_get_audit_filter_select();
|
||||
|
||||
$data[0] .= html_print_select(
|
||||
$_filters_update,
|
||||
'overwrite_filter',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$data[1] = html_print_submit_button(
|
||||
__('Update filter'),
|
||||
'update_filter',
|
||||
false,
|
||||
'class="sub upd" onclick="save_update_filter();"',
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
html_print_table($table);
|
||||
} else {
|
||||
include 'general/noaccess.php';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function show_save_filter() {
|
||||
$('#save_filter_row1').show();
|
||||
$('#save_filter_row2').show();
|
||||
$('#update_filter_row1').hide();
|
||||
// Filter save mode selector
|
||||
$("[name='filter_mode']").click(function() {
|
||||
if ($(this).val() == 'new') {
|
||||
$('#save_filter_row1').show();
|
||||
$('#save_filter_row2').show();
|
||||
$('#submit-save_filter').show();
|
||||
$('#update_filter_row1').hide();
|
||||
}
|
||||
else {
|
||||
$('#save_filter_row1').hide();
|
||||
$('#save_filter_row2').hide();
|
||||
$('#update_filter_row1').show();
|
||||
$('#submit-save_filter').hide();
|
||||
}
|
||||
});
|
||||
$("#save-filter-select").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: false,
|
||||
closeOnEscape: true
|
||||
});
|
||||
}
|
||||
|
||||
function save_new_filter() {
|
||||
|
||||
// If the filter name is blank show error
|
||||
if ($('#text-id_name').val() == '') {
|
||||
$('#info_box').html("<h3 class='error'><?php echo __('Filter name cannot be left blank'); ?></h3>");
|
||||
return false;
|
||||
}
|
||||
|
||||
var id_filter_save;
|
||||
|
||||
jQuery.post ("<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
{
|
||||
"page" : "include/ajax/audit_log",
|
||||
"save_log_filter" : 1,
|
||||
"id_name" : $("#text-id_name").val(),
|
||||
"text" : $("#text-filter_text").val(),
|
||||
"period" : $("#text-filter_period").val(),
|
||||
"ip" : $('#text-filter_ip').val(),
|
||||
"type" : $('#filter_type :selected').val(),
|
||||
"user" : $('#filter_user :selected').val(),
|
||||
},
|
||||
function (data) {
|
||||
$("#info_box").hide();
|
||||
if (data == 'error') {
|
||||
$("#info_box").filter(function(i, item) {
|
||||
if ($(item).data('type_info_box') == "error_create_filter") {
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}).show();
|
||||
} else if (data == 'duplicate') {
|
||||
$('#info_box').html("<h3 class='error'><?php echo __('Filter name already on use'); ?></h3>");
|
||||
$('#info_box').show();
|
||||
} else {
|
||||
// Close dialog.
|
||||
$("#save-filter-select").dialog('close');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// This updates an event filter
|
||||
function save_update_filter() {
|
||||
var id_filter_update = $("#overwrite_filter").val();
|
||||
var name_filter_update = $("#overwrite_filter option[value='"+id_filter_update+"']").text();
|
||||
|
||||
jQuery.post ("<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
{"page" : "include/ajax/audit_log",
|
||||
"update_log_filter" : 1,
|
||||
"id" : $("#overwrite_filter :selected").val(),
|
||||
"text" : $("#text-filter_text").val(),
|
||||
"period" : $("#text-filter_period").val(),
|
||||
"ip" : $('#text-filter_ip').val(),
|
||||
"type" : $('#filter_type :selected').val(),
|
||||
"user" : $('#filter_user :selected').val(),
|
||||
},
|
||||
function (data) {
|
||||
$(".info_box").hide();
|
||||
if (data == 'ok') {
|
||||
$(".info_box").filter(function(i, item) {
|
||||
if ($(item).data('type_info_box') == "success_update_filter") {
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}).show();
|
||||
}
|
||||
else {
|
||||
$(".info_box").filter(function(i, item) {
|
||||
if ($(item).data('type_info_box') == "error_create_filter") {
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
|
||||
// Close dialog
|
||||
$('.ui-dialog-titlebar-close').trigger('click');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function (){
|
||||
show_save_filter();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
return;
|
||||
}
|
|
@ -340,7 +340,7 @@ if (is_ajax() === true) {
|
|||
|
||||
// Group.
|
||||
$secondary_groups = '';
|
||||
$secondary = agents_get_secondary_groups($data['id_agente']);
|
||||
$secondary = enterprise_hook('agents_get_secondary_groups', [$data['id_agente']]);
|
||||
if (isset($secondary['for_select']) === true && empty($secondary['for_select']) === false) {
|
||||
$secondary_groups = implode(', ', $secondary['for_select']);
|
||||
$secondary_groups = ', '.$secondary_groups;
|
||||
|
@ -353,19 +353,26 @@ if (is_ajax() === true) {
|
|||
|
||||
|
||||
// Events.
|
||||
echo '<div class="div-dialog">';
|
||||
echo graph_graphic_agentevents(
|
||||
$id,
|
||||
100,
|
||||
40,
|
||||
SECONDS_1DAY,
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
1
|
||||
$result_graph_event = enterprise_hook(
|
||||
'graph_graphic_agentevents',
|
||||
[
|
||||
$id,
|
||||
100,
|
||||
40,
|
||||
SECONDS_1DAY,
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
1,
|
||||
]
|
||||
);
|
||||
echo '</div>';
|
||||
|
||||
if ($result_graph_event !== -1) {
|
||||
echo '<div class="div-dialog">';
|
||||
echo $result_graph_event;
|
||||
echo '</div>';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,6 +156,26 @@ class AuditLog extends HTML
|
|||
open_meta_frame();
|
||||
}
|
||||
|
||||
$buttons = [];
|
||||
|
||||
$buttons[] = [
|
||||
'id' => 'load-filter',
|
||||
'class' => 'float-left margin-right-2 margin-left-2 sub config',
|
||||
'text' => __('Load filter'),
|
||||
'onclick' => '',
|
||||
];
|
||||
|
||||
$buttons[] = [
|
||||
'id' => 'save-filter',
|
||||
'class' => 'float-left margin-right-2 sub wand',
|
||||
'text' => __('Save filter'),
|
||||
'onclick' => '',
|
||||
];
|
||||
|
||||
// Modal for save/load filters.
|
||||
echo '<div id="save-modal-filter" style="display:none"></div>';
|
||||
echo '<div id="load-modal-filter" style="display:none"></div>';
|
||||
|
||||
// Load datatables user interface.
|
||||
ui_print_datatable(
|
||||
[
|
||||
|
@ -174,9 +194,10 @@ class AuditLog extends HTML
|
|||
],
|
||||
'search_button_class' => 'sub filter float-right',
|
||||
'form' => [
|
||||
'inputs' => [
|
||||
'extra_buttons' => $buttons,
|
||||
'inputs' => [
|
||||
[
|
||||
'label' => __('Search'),
|
||||
'label' => __('Free search').ui_print_help_tip(__('Search filter by User, Action, Date, Source IP or Comments fields content'), true),
|
||||
'type' => 'text',
|
||||
'class' => 'w200px',
|
||||
'id' => 'filter_text',
|
||||
|
@ -211,7 +232,9 @@ class AuditLog extends HTML
|
|||
'type' => 'select_from_sql',
|
||||
'nothing' => __('All'),
|
||||
'nothing_value' => '-1',
|
||||
'sql' => 'SELECT id_user, id_user AS text FROM tusuario',
|
||||
'sql' => 'SELECT id_user, id_user AS text FROM tusuario UNION SELECT "SYSTEM"
|
||||
AS id_user, "SYSTEM" AS text UNION SELECT "N/A"
|
||||
AS id_user, "N/A" AS text',
|
||||
'class' => 'mw250px',
|
||||
'id' => 'filter_user',
|
||||
'name' => 'filter_user',
|
||||
|
@ -269,7 +292,10 @@ class AuditLog extends HTML
|
|||
|
||||
if (empty($this->filterText) === false) {
|
||||
$filter .= sprintf(
|
||||
" AND (accion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%')",
|
||||
" AND (accion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR id_usuario LIKE '%%%s%%' OR fecha LIKE '%%%s%%' OR ip_origen LIKE '%%%s%%')",
|
||||
$this->filterText,
|
||||
$this->filterText,
|
||||
$this->filterText,
|
||||
$this->filterText,
|
||||
$this->filterText
|
||||
);
|
||||
|
@ -366,38 +392,149 @@ class AuditLog extends HTML
|
|||
|
||||
// Javascript content.
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function format(d) {
|
||||
var output = '';
|
||||
<script type="text/javascript">
|
||||
var loading = 0;
|
||||
|
||||
if (d.extendedInfo === '') {
|
||||
output = "<?php echo __('There is no additional information to display'); ?>";
|
||||
} else {
|
||||
output = d.extendedInfo;
|
||||
function format(d) {
|
||||
var output = '';
|
||||
|
||||
if (d.extendedInfo === '') {
|
||||
output = "<?php echo __('There is no additional information to display'); ?>";
|
||||
} else {
|
||||
output = d.extendedInfo;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
$(document).ready(function() {
|
||||
// Add event listener for opening and closing details
|
||||
$('#audit_logs tbody').on('click', 'td.show_extended_info', function() {
|
||||
var tr = $(this).closest('tr');
|
||||
var table = $("#<?php echo $this->tableId; ?>").DataTable();
|
||||
var row = table.row(tr);
|
||||
|
||||
$(document).ready(function() {
|
||||
// Add event listener for opening and closing details
|
||||
$('#audit_logs tbody').on('click', 'td.show_extended_info', function() {
|
||||
var tr = $(this).closest('tr');
|
||||
var table = $("#<?php echo $this->tableId; ?>").DataTable();
|
||||
var row = table.row(tr);
|
||||
|
||||
if (row.child.isShown()) {
|
||||
if (row.child.isShown()) {
|
||||
// This row is already open - close it
|
||||
row.child.hide();
|
||||
tr.removeClass('shown');
|
||||
} else {
|
||||
// Open this row
|
||||
row.child(format(row.data())).show();
|
||||
tr.addClass('shown');
|
||||
}
|
||||
row.child.hide();
|
||||
tr.removeClass('shown');
|
||||
} else {
|
||||
// Open this row
|
||||
row.child(format(row.data())).show();
|
||||
tr.addClass('shown');
|
||||
}
|
||||
$('#audit_logs').css('table-layout','fixed');
|
||||
$('#audit_logs').css('width','95% !important');
|
||||
});
|
||||
|
||||
$('#save-filter').click(function() {
|
||||
if ($('#save-filter-select').length) {
|
||||
$('#save-filter-select').dialog({
|
||||
width: "20%",
|
||||
maxWidth: "25%",
|
||||
title: "<?php echo __('Save filter'); ?>"
|
||||
});
|
||||
$('#info_box').html("");
|
||||
$('#text-id_name').val("");
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '<?php echo ui_get_full_url('ajax.php'); ?>',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
page: 'include/ajax/audit_log',
|
||||
recover_aduit_log_select: 1
|
||||
},
|
||||
success: function(data) {
|
||||
var options = "";
|
||||
$.each(data,function(key,value){
|
||||
options += "<option value='"+key+"'>"+value+"</option>";
|
||||
});
|
||||
$('#overwrite_filter').html(options);
|
||||
$('#overwrite_filter').select2();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (loading == 0) {
|
||||
loading = 1
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '<?php echo ui_get_full_url('ajax.php'); ?>',
|
||||
data: {
|
||||
page: 'include/ajax/audit_log',
|
||||
save_filter_modal: 1,
|
||||
current_filter: $('#latest_filter_id').val()
|
||||
},
|
||||
success: function(data) {
|
||||
$('#save-modal-filter')
|
||||
.empty()
|
||||
.html(data);
|
||||
loading = 0;
|
||||
$('#save-filter-select').dialog({
|
||||
width: "20%",
|
||||
maxWidth: "25%",
|
||||
title: "<?php echo __('Save filter'); ?>"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#save_filter_form-0-1, #radiobtn0002').click(function(){
|
||||
$('#overwrite_filter').select2();
|
||||
});
|
||||
|
||||
/* Filter management */
|
||||
$('#load-filter').click(function (){
|
||||
if($('#load-filter-select').length) {
|
||||
$('#load-filter-select').dialog({width: "20%",
|
||||
maxWidth: "25%",
|
||||
title: "<?php echo __('Load filter'); ?>"
|
||||
});
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '<?php echo ui_get_full_url('ajax.php'); ?>',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
page: 'include/ajax/audit_log',
|
||||
recover_aduit_log_select: 1
|
||||
},
|
||||
success: function(data) {
|
||||
var options = "";
|
||||
$.each(data,function(key,value){
|
||||
options += "<option value='"+key+"'>"+value+"</option>";
|
||||
});
|
||||
$('#filter_id').html(options);
|
||||
$('#filter_id').select2();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (loading == 0) {
|
||||
loading = 1
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '<?php echo ui_get_full_url('ajax.php'); ?>',
|
||||
data: {
|
||||
page: 'include/ajax/audit_log',
|
||||
load_filter_modal: 1
|
||||
},
|
||||
success: function (data){
|
||||
$('#load-modal-filter')
|
||||
.empty()
|
||||
.html(data);
|
||||
loading = 0;
|
||||
$('#load-filter-select').dialog({
|
||||
width: "20%",
|
||||
maxWidth: "25%",
|
||||
title: "<?php echo __('Load filter'); ?>"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
<?php
|
||||
// EOF Javascript content.
|
||||
return ob_get_clean();
|
||||
|
|
|
@ -606,15 +606,13 @@ class CustomNetScan extends Wizard
|
|||
}
|
||||
|
||||
if (isset($this->page) === true && $this->page === 1) {
|
||||
$name_ipam = 'IPAM Recon';
|
||||
// Recon script.
|
||||
$form['inputs'][] = [
|
||||
'label' => __('Recon script'),
|
||||
'arguments' => [
|
||||
'type' => 'select_from_sql',
|
||||
'sql' => sprintf(
|
||||
'SELECT id_recon_script, name FROM trecon_script WHERE name <> "%s" ORDER BY name',
|
||||
$name_ipam
|
||||
'SELECT id_recon_script, name FROM trecon_script ORDER BY name'
|
||||
),
|
||||
'name' => 'id_recon_script',
|
||||
'selected' => $this->task['id_recon_script'],
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC230119';
|
||||
$build_version = 'PC230126';
|
||||
$pandora_version = 'v7.0NG.768';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -805,6 +805,7 @@ define('AUDIT_LOG_DASHBOARD_MANAGEMENT', 'Dashboard management');
|
|||
define('AUDIT_LOG_SERVICE_MANAGEMENT', 'Service management');
|
||||
define('AUDIT_LOG_INCIDENT_MANAGEMENT', 'Incident management');
|
||||
define('AUDIT_LOG_UMC', 'Warp Manager');
|
||||
define('AUDIT_LOG_NMS_VIOLATION', 'NMS Violation');
|
||||
|
||||
// MIMEs.
|
||||
define(
|
||||
|
|
|
@ -3489,8 +3489,9 @@ function graph_custom_sql_graph(
|
|||
$data_result = [];
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$labels = [];
|
||||
$data_bar = [];
|
||||
$labels_pie = [];
|
||||
$data_pie = [];
|
||||
$count = 0;
|
||||
$other = 0;
|
||||
foreach ($data_result as $data_item) {
|
||||
|
|
|
@ -8802,24 +8802,27 @@ function reporting_availability($report, $content, $date=false, $time=false)
|
|||
$data = [];
|
||||
|
||||
$style = io_safe_output($content['style']);
|
||||
if ($style['hide_notinit_agents']) {
|
||||
$aux_id_agents = $agents;
|
||||
$i = 0;
|
||||
foreach ($items as $item) {
|
||||
$utimestamp = db_get_value(
|
||||
'utimestamp',
|
||||
'tagente_datos',
|
||||
'id_agente_modulo',
|
||||
$item['id_agent_module'],
|
||||
true
|
||||
);
|
||||
if (($utimestamp === false)
|
||||
|| (intval($utimestamp) > intval($datetime_to))
|
||||
) {
|
||||
unset($items[$i]);
|
||||
}
|
||||
|
||||
$i++;
|
||||
if (is_array($style)) {
|
||||
if ($style['hide_notinit_agents']) {
|
||||
$aux_id_agents = $agents;
|
||||
$i = 0;
|
||||
foreach ($items as $item) {
|
||||
$utimestamp = db_get_value(
|
||||
'utimestamp',
|
||||
'tagente_datos',
|
||||
'id_agente_modulo',
|
||||
$item['id_agent_module'],
|
||||
true
|
||||
);
|
||||
if (($utimestamp === false)
|
||||
|| (intval($utimestamp) > intval($datetime_to))
|
||||
) {
|
||||
unset($items[$i]);
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,13 +142,21 @@ function users_get_groups_for_select(
|
|||
null
|
||||
);
|
||||
|
||||
if ($id_groups !== null) {
|
||||
$children = groups_get_children($id_groups);
|
||||
foreach ($children as $child) {
|
||||
unset($user_groups[$child['id_grupo']]);
|
||||
if ($id_groups !== null && empty($id_groups) === false) {
|
||||
$children = [];
|
||||
foreach ($id_groups as $key => $id_group) {
|
||||
$children[] = groups_get_children($id_group);
|
||||
}
|
||||
|
||||
unset($user_groups[$id_groups]);
|
||||
if (empty($children) === false) {
|
||||
foreach ($children as $child) {
|
||||
unset($user_groups[$child['id_grupo']]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($id_groups as $key => $id_group) {
|
||||
unset($user_groups[$id_group]);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($user_groups)) {
|
||||
|
@ -811,6 +819,20 @@ function users_get_users_by_group($id_group, $um=false, $disabled=true)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete session user if exist
|
||||
*
|
||||
* @param string $id_user User id.
|
||||
*
|
||||
* @return boolean Return .
|
||||
*/
|
||||
function delete_session_user($id_user)
|
||||
{
|
||||
$sql = "DELETE FROM tsessions_php where data like '%\"".$id_user."\"%'";
|
||||
return db_process_sql($sql);
|
||||
}
|
||||
|
||||
|
||||
function users_has_profile_without_UM($id_user, $id_groups)
|
||||
{
|
||||
$sql = sprintf(
|
||||
|
|
|
@ -154,14 +154,14 @@ function progressbar(
|
|||
/**
|
||||
* Draw vertical bars graph.
|
||||
*
|
||||
* @param array $chart_data Data chart.
|
||||
* @param array $params Params draw chart.
|
||||
* @param integer $ttl Pdf option.
|
||||
* @param array|null $chart_data Data chart.
|
||||
* @param array $params Params draw chart.
|
||||
* @param integer $ttl Pdf option.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function vbar_graph(
|
||||
array $chart_data,
|
||||
array|null $chart_data,
|
||||
array $options
|
||||
) {
|
||||
if (empty($chart_data) === true) {
|
||||
|
|
|
@ -1027,6 +1027,7 @@ class ClusterWizard extends \HTML
|
|||
foreach ($aa_modules as $module) {
|
||||
$inputs[] = [
|
||||
'block_id' => 'from-to-threshold',
|
||||
'label' => '<b>'.$module->name().'</b>',
|
||||
'class' => 'flex-row line w100p',
|
||||
'direct' => 1,
|
||||
'block_content' => [
|
||||
|
|
|
@ -675,7 +675,8 @@ class Manager implements PublicLogin
|
|||
int $offset=-1,
|
||||
int $limit=-1,
|
||||
bool $favourite=false,
|
||||
bool $slideshow=false
|
||||
bool $slideshow=false,
|
||||
string $id_user=''
|
||||
):array {
|
||||
global $config;
|
||||
|
||||
|
@ -693,11 +694,15 @@ class Manager implements PublicLogin
|
|||
$sql_where .= 'AND td.cells_slideshow = 1';
|
||||
}
|
||||
|
||||
if (empty($id_user) === true) {
|
||||
$id_user = $config['id_user'];
|
||||
}
|
||||
|
||||
// Check ACl.
|
||||
if (\is_user_admin($config['id_user']) !== true) {
|
||||
if (\is_user_admin($id_user) !== true) {
|
||||
// Non-admin user can see dashboards of his groups and 'AR' profile.
|
||||
$group_list = \users_get_groups(
|
||||
$config['id_user'],
|
||||
$id_user,
|
||||
'RR',
|
||||
true
|
||||
);
|
||||
|
@ -727,7 +732,7 @@ class Manager implements PublicLogin
|
|||
GROUP BY td.id
|
||||
ORDER BY name%s",
|
||||
$string_groups,
|
||||
$config['id_user'],
|
||||
$id_user,
|
||||
$sql_where,
|
||||
$sql_limit
|
||||
);
|
||||
|
@ -746,7 +751,7 @@ class Manager implements PublicLogin
|
|||
WHERE td.id_group = 0 AND td.id_user = '%s' %s
|
||||
GROUP BY td.id
|
||||
ORDER BY name%s",
|
||||
$config['id_user'],
|
||||
$id_user,
|
||||
$sql_where,
|
||||
$sql_limit
|
||||
);
|
||||
|
|
|
@ -1771,8 +1771,8 @@ class Item extends CachedModel
|
|||
$imageSrc = static::issetInArray(
|
||||
$data,
|
||||
[
|
||||
'image',
|
||||
'imageSrc',
|
||||
'image',
|
||||
'backgroundColor',
|
||||
'backgroundType',
|
||||
'valueType',
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.768';
|
||||
$build = '230119';
|
||||
$build = '230126';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -1480,7 +1480,7 @@ if (!empty($result)) {
|
|||
'agent_small',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'[…]',
|
||||
'font-size:7.5pt;'
|
||||
);
|
||||
|
|
|
@ -31,6 +31,7 @@ global $config;
|
|||
$headerTitle = __('User detail editor');
|
||||
// Load the header.
|
||||
require $config['homedir'].'/operation/users/user_edit_header.php';
|
||||
use PandoraFMS\Dashboard\Manager;
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
include 'include/javascript/timezonepicker/includes/parser.inc';
|
||||
|
@ -442,7 +443,13 @@ if (!$meta) {
|
|||
|
||||
$home_screen .= html_print_select($values, 'section', io_safe_output($user_info['section']), 'show_data_section();', '', -1, true, false, false).'</div>';
|
||||
|
||||
$dashboards = get_user_dashboards($config['id_user']);
|
||||
$dashboards = Manager::getDashboards(
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
false,
|
||||
$config['id_user']
|
||||
);
|
||||
|
||||
$dashboards_aux = [];
|
||||
if ($dashboards === false) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.768
|
||||
%define release 1
|
||||
%define release 230126
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.768
|
||||
%define release 1
|
||||
%define release 230126
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.768
|
||||
%define release 1
|
||||
%define release 230126
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.768
|
||||
Version: 7.0NG.768-230126
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.768"
|
||||
pandora_version="7.0NG.768-230126"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -46,7 +46,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.768";
|
||||
my $pandora_build = "230119";
|
||||
my $pandora_build = "230126";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.768";
|
||||
my $pandora_build = "230119";
|
||||
my $pandora_build = "230126";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.768
|
||||
%define release 1
|
||||
%define release 230126
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.768
|
||||
%define release 1
|
||||
%define release 230126
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.768"
|
||||
PI_BUILD="230119"
|
||||
PI_BUILD="230126"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.768 Build 230119";
|
||||
my $version = "7.0NG.768 Build 230126";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.768 Build 230119";
|
||||
my $version = "7.0NG.768 Build 230126";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
@ -3504,6 +3504,8 @@ sub cli_agent_update() {
|
|||
} else {
|
||||
pandora_update_table_from_hash ($conf, $update, 'id_agente', safe_input($id_agent), 'tagente', $dbh);
|
||||
}
|
||||
|
||||
enterprise_hook('update_agent_cache', [$conf, $dbh, $id_agent]) if ($conf->{'node_metaconsole'} == 1);
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -29,28 +29,29 @@
|
|||
"@types/jest": "^24.9.1",
|
||||
"@typescript-eslint/eslint-plugin": "^1.13.0",
|
||||
"@typescript-eslint/parser": "^1.13.0",
|
||||
"awesome-typescript-loader": "^5.2.1",
|
||||
"clean-webpack-plugin": "^2.0.2",
|
||||
"css-loader": "^2.1.1",
|
||||
"clean-webpack-plugin": "^4.0.0",
|
||||
"css-loader": "^6.7.3",
|
||||
"d3-shape": "^1.3.7",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-prettier": "^4.3.0",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"file-loader": "^3.0.1",
|
||||
"jest": "^24.9.0",
|
||||
"mini-css-extract-plugin": "^0.5.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"jest": "^29.3.1",
|
||||
"mini-css-extract-plugin": "^2.7.2",
|
||||
"npm-watch": "^0.11.0",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"prettier": "^1.19.1",
|
||||
"ts-jest": "^24.3.0",
|
||||
"typescript": "^3.9.9",
|
||||
"url-loader": "^1.1.2",
|
||||
"webpack": "^4.46.0",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-dev-server": "^3.11.2"
|
||||
"ts-jest": "^29.0.3",
|
||||
"typescript": "^4.9.4",
|
||||
"webpack": "^5.75.0",
|
||||
"webpack-cli": "^5.0.1",
|
||||
"webpack-dev-server": "^4.11.1"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions"
|
||||
]
|
||||
],
|
||||
"devDependencies": {
|
||||
"ts-loader": "^9.4.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -722,7 +722,7 @@ export default class VisualConsole {
|
|||
context.containerRef.append(itemInstance.elementRef);
|
||||
return itemInstance;
|
||||
} catch (error) {
|
||||
console.error("Error creating a new element:", error.message);
|
||||
console.error("Error creating a new element:", (error as Error).message);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -759,7 +759,10 @@ export default class VisualConsole {
|
|||
try {
|
||||
this.elementsById[item.id].props = decodeProps(item);
|
||||
} catch (error) {
|
||||
console.error("Error updating an element:", error.message);
|
||||
console.error(
|
||||
"Error updating an element:",
|
||||
(error as Error).message
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -780,7 +783,7 @@ export default class VisualConsole {
|
|||
...decodeProps(item)
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error updating element:", error.message);
|
||||
console.error("Error updating element:", (error as Error).message);
|
||||
}
|
||||
|
||||
// Re-build relations.
|
||||
|
|
|
@ -223,16 +223,11 @@ export default class Odometer extends Item<OdometerProps> {
|
|||
|
||||
let script = document.createElement("script");
|
||||
script.type = "text/javascript";
|
||||
script.onload = function() {
|
||||
script.onload = () => {
|
||||
odometerB.style.transform = `rotate(${rotate}turn)`;
|
||||
};
|
||||
|
||||
if (typeof this.props.metaconsoleId !== "undefined") {
|
||||
script.src = "./../../include/javascript/pandora_alerts.js";
|
||||
} else {
|
||||
script.src = "./include/javascript/pandora_alerts.js";
|
||||
}
|
||||
|
||||
var url_pandora = window.location.pathname.split("/")[1];
|
||||
script.src = `${document.dir}/${url_pandora}/include/javascript/pandora_alerts.js`;
|
||||
odometerA.appendChild(h1);
|
||||
odometerA.appendChild(h2);
|
||||
odometerContainer.appendChild(odometerB);
|
||||
|
@ -325,9 +320,7 @@ export default class Odometer extends Item<OdometerProps> {
|
|||
}
|
||||
|
||||
private getCoords(percent: number, radio: number): string {
|
||||
if (this.props.minMaxValue === "") {
|
||||
percent = percent;
|
||||
} else {
|
||||
if (this.props.minMaxValue !== "") {
|
||||
const minMax = JSON.parse(this.props.minMaxValue);
|
||||
if (minMax["min"] === percent) {
|
||||
percent = 0;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"target": "es5",
|
||||
"module": "es6",
|
||||
"strict": true,
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const path = require("path");
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const CleanWebpackPlugin = require("clean-webpack-plugin");
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
|
||||
const dev = process.env.NODE_ENV !== "production";
|
||||
|
@ -21,7 +19,9 @@ module.exports = {
|
|||
output: {
|
||||
path: buildPath, // The files will be created here.
|
||||
// filename: dev ? "vc.[name].min.js" : "vc.[name].[chunkhash:8].min.js"
|
||||
filename: "vc.[name].min.js"
|
||||
filename: "vc.[name].min.js",
|
||||
assetModuleFilename: "[name][ext]",
|
||||
clean: true
|
||||
},
|
||||
devtool: "source-map",
|
||||
resolve: {
|
||||
|
@ -31,19 +31,27 @@ module.exports = {
|
|||
rules: [
|
||||
// Loader for the Typescript compiler.
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loader: "awesome-typescript-loader"
|
||||
test: /\.(ts)x?$/,
|
||||
exclude: /node_modules|\.d\.ts$/, // this line as well
|
||||
use: {
|
||||
loader: "ts-loader",
|
||||
options: {
|
||||
compilerOptions: {
|
||||
noEmit: false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// This loader builds a main CSS file from all the CSS imports across the files.
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: [
|
||||
use: [
|
||||
// https://github.com/webpack-contrib/mini-css-extract-plugin
|
||||
{
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
options: {
|
||||
hot: true, // if you want HMR - we try to automatically inject hot reloading but if it's not working, add it to the config
|
||||
reloadAll: true // when desperation kicks in - this is a brute force HMR flag
|
||||
//hot: true // if you want HMR - we try to automatically inject hot reloading but if it's not working, add it to the config
|
||||
//reloadAll: true // when desperation kicks in - this is a brute force HMR flag
|
||||
}
|
||||
},
|
||||
// https://webpack.js.org/loaders/css-loader
|
||||
|
@ -52,20 +60,6 @@ module.exports = {
|
|||
options: {
|
||||
sourceMap: true
|
||||
}
|
||||
},
|
||||
// To post process CSS and add some things like prefixes to the rules. e.g.: -webkit-...
|
||||
// https://github.com/postcss/postcss-loader
|
||||
{
|
||||
loader: "postcss-loader",
|
||||
options: {
|
||||
plugins: () => [
|
||||
// Moved to package.json (?)
|
||||
// // To improve the support for old browsers.
|
||||
// require("autoprefixer")({
|
||||
// browsers: ["> 1%", "last 2 versions"]
|
||||
// })
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -74,32 +68,25 @@ module.exports = {
|
|||
// https://webpack.js.org/loaders/url-loader
|
||||
{
|
||||
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
|
||||
loader: "url-loader",
|
||||
options: {
|
||||
limit: 10000,
|
||||
// name: "[name].[hash:8].[ext]"
|
||||
name: "[name].[ext]"
|
||||
type: "asset",
|
||||
generator: {
|
||||
filename: "[name][ext]"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
// This plugin will remove all files inside Webpack's output.path directory,
|
||||
// as well as all unused webpack assets after every successful rebuild.
|
||||
new CleanWebpackPlugin(),
|
||||
// Options for the plugin which extract the CSS files to build a main file.
|
||||
new MiniCssExtractPlugin({
|
||||
// Options similar to the same options in webpackOptions.output
|
||||
// both options are optional
|
||||
// filename: dev ? "vc.[name].css" : "vc.[name].[contenthash:8].css",
|
||||
filename: "vc.[name].css",
|
||||
// Disable to remove warnings about conflicting order between imports.
|
||||
orderWarning: true
|
||||
filename: "vc.[name].css"
|
||||
})
|
||||
],
|
||||
// Static server which runs the playground on npm start.
|
||||
devServer: {
|
||||
open: true,
|
||||
contentBase: "playground"
|
||||
static: path.join(__dirname, "playground")
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue