mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
Merge remote-tracking branch 'origin/develop' into ent-9676-modulos-de-inventario-se-actualicen-datos-cuando-venga-el-xml-con-nombre-y-sin-datos
This commit is contained in:
commit
307057f934
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
# ==================
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
# ==================
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
# ==================
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.769-230310
|
||||
Version: 7.0NG.770-230330
|
||||
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.769-230310"
|
||||
pandora_version="7.0NG.770-230330"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -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
|
||||
|
@ -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[
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 => '230310';
|
||||
use constant AGENT_VERSION => '7.0NG.770';
|
||||
use constant AGENT_BUILD => '230330';
|
||||
|
||||
# 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 ();
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.769
|
||||
%define release 230310
|
||||
%define version 7.0NG.770
|
||||
%define release 230330
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.769
|
||||
%define release 230310
|
||||
%define version 7.0NG.770
|
||||
%define release 230330
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -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="230310"
|
||||
PI_VERSION="7.0NG.770"
|
||||
PI_BUILD="230330"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -6,21 +6,22 @@
|
||||
#
|
||||
# (c) A. Kevin Rojas <kevin.rojas@pandorafms.com>
|
||||
#
|
||||
# Edited in 2023 by Alejandro Sánchez <alejandro.sanchez@pandorafms.com>
|
||||
#
|
||||
# TO DO LIST:
|
||||
# - Enable child services detection (Windows)
|
||||
# - Make CPU/Memory usage available for child services (Windows)
|
||||
#
|
||||
###################################################
|
||||
|
||||
try:
|
||||
from sys import argv
|
||||
from sys import stderr
|
||||
from sys import exit
|
||||
import psutil
|
||||
from subprocess import Popen
|
||||
from subprocess import PIPE
|
||||
from subprocess import DEVNULL
|
||||
from subprocess import getstatusoutput
|
||||
import psutil
|
||||
except ModuleNotFoundError as err:
|
||||
print("{} error: {}. Exiting...".format(argv[0], err), file=stderr)
|
||||
exit(1)
|
||||
@ -28,99 +29,100 @@ except ModuleNotFoundError as err:
|
||||
module_list = []
|
||||
VERSION = "1.2"
|
||||
|
||||
def win_service(servicelist, option=False, memcpu=False):
|
||||
|
||||
#########################################################################################
|
||||
# Powershell class
|
||||
#########################################################################################
|
||||
class PSCheck:
|
||||
@staticmethod
|
||||
def check_service(servicename, option=False, memcpu=False):
|
||||
"""Check services with powershell by parsing their DisplayName. Returns a dict\
|
||||
list with the name of the service and a boolean with its status.\n
|
||||
Requires service name (case insensitive)."""
|
||||
pscall = Popen(["powershell", "Get-Service", "-Name", "'*"+ str(servicename) + "*'",
|
||||
"|", "Select-Object", "-ExpandProperty", "Name"],
|
||||
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
|
||||
result = pscall.communicate()
|
||||
result = str(result[0]).strip().split("\n")
|
||||
procname = ''
|
||||
if result != '':
|
||||
output = []
|
||||
for element in result:
|
||||
if element != '':
|
||||
# Get process name
|
||||
procname = PSCheck.get_serviceprocess(element)
|
||||
# Get process status
|
||||
parstatus = PSCheck.getstatus(element)
|
||||
if memcpu and parstatus == 1:
|
||||
usage = get_memcpu(str(procname), str(element))
|
||||
output += usage
|
||||
# Generate module with name and status
|
||||
parent = service_module(str(element), parstatus)
|
||||
output += parent
|
||||
if option:
|
||||
children = PSCheck.getchildren(element, memcpu)
|
||||
if isinstance(children, list) and len(children) > 1:
|
||||
for child in children:
|
||||
output += child
|
||||
else:
|
||||
output += children
|
||||
else:
|
||||
next
|
||||
|
||||
if output and element and procname:
|
||||
return ({"name" : element, "process" : procname, "modules": output})
|
||||
modules_default = []
|
||||
modules_percentage=[]
|
||||
## take all services
|
||||
services=psutil.win_service_iter()
|
||||
for service in services:
|
||||
if service.name() in servicelist:
|
||||
serv=service.as_dict()
|
||||
if serv['status']=='running':
|
||||
value=1
|
||||
else:
|
||||
return (None)
|
||||
value=0
|
||||
|
||||
@staticmethod
|
||||
def getchildren(servicename, memcpu=False):
|
||||
"""Gets Dependent services of a given Windows service"""
|
||||
pschild = Popen(["powershell", "Get-Service", "-Name '" + str(servicename) +
|
||||
"' -DS", "|", "Select-Object", "-ExpandProperty", "Name"],
|
||||
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
|
||||
children = pschild.communicate()[0].strip()
|
||||
kids = []
|
||||
for child in (children.split("\n") if children != "" else []):
|
||||
status = PSCheck.getstatus(child)
|
||||
kids += service_module(str(child), status, "Service " + str(servicename) + " - Status")
|
||||
if status:
|
||||
if memcpu:
|
||||
kidsusage = get_memcpu(str(child))
|
||||
for usage in kidsusage:
|
||||
kids += usage
|
||||
## create module for each service
|
||||
parent = build_module("Service " + str(serv['name']) + " - Status", value,"generic_proc")
|
||||
modules_default +=parent
|
||||
|
||||
# memory and cpu percentage
|
||||
if memcpu:
|
||||
## process
|
||||
srv_pid = service.pid()
|
||||
process = psutil.Process(srv_pid)
|
||||
proc_name = process.name()
|
||||
##cpu
|
||||
value_cpu=process.cpu_percent(interval=0.5)
|
||||
parent = build_module("Service " + str(proc_name) + " - CPU usage", value_cpu,"generic_data")
|
||||
parent[0].update([("unit","%"),("module_parent",str(serv['name']))])
|
||||
modules_percentage +=parent
|
||||
##mem
|
||||
value_mem=process.memory_percent()
|
||||
parent = build_module("Service " + str(proc_name) + " - Memory usage", value_mem,"generic_data")
|
||||
parent[0].update([("unit","%"),("module_parent",str(serv['name']))])
|
||||
modules_percentage +=parent
|
||||
|
||||
|
||||
for module in modules_default:
|
||||
print_module(module, 1)
|
||||
if memcpu:
|
||||
for module in modules_percentage:
|
||||
print_module(module, 1)
|
||||
|
||||
def lnx_service(services_list, memcpu=False):
|
||||
"""Creates modules for Linux servers"""
|
||||
modules = []
|
||||
sysctl = getstatusoutput("command -v systemctl")[0]
|
||||
servic = getstatusoutput("command -v service")[0]
|
||||
for srvc in services_list:
|
||||
status = None
|
||||
if sysctl == 0:
|
||||
### Systemd available
|
||||
syscall = Popen(["systemctl", "show", "-pLoadState", "-pActiveState", srvc], stdout=PIPE,
|
||||
stdin=DEVNULL, universal_newlines=True)
|
||||
result = syscall.communicate()
|
||||
srvstatus = result[0].strip().lower().split("\n")
|
||||
if srvstatus[0] == "loadstate=not-found":
|
||||
next
|
||||
else:
|
||||
if srvstatus[1] == "activestate=active":
|
||||
modules += build_module("Service " + srvc + " - Status", 1, "generic_proc")
|
||||
status = 1
|
||||
elif srvstatus[1] == "activestate=inactive":
|
||||
modules += build_module("Service " +srvc+ " - Status", 0, "generic_proc")
|
||||
status = 0
|
||||
elif sysctl != 0 and servic == 0:
|
||||
### Systemd not available, switch to service command
|
||||
syscall = Popen(["service", srvc, "status"], stdout=PIPE,
|
||||
stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
|
||||
result = syscall.communicate()[0].lower()
|
||||
if "is running" in result:
|
||||
modules += build_module("Service " + srvc + " - Status", 1, "generic_proc")
|
||||
status = 1
|
||||
elif "is stopped" in result:
|
||||
modules += build_module("Service " +srvc+ " - Status", 0, "generic_proc")
|
||||
status = 0
|
||||
else:
|
||||
next
|
||||
return kids
|
||||
|
||||
@staticmethod
|
||||
def getstatus(servicename):
|
||||
"""Gets the status of a given Windows service"""
|
||||
running = Popen(["powershell", "Get-Service", "-Name '" + str(servicename) +
|
||||
"' |", "Select-Object", "-ExpandProperty", "Status"],
|
||||
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
|
||||
status = running.communicate()[0].strip()
|
||||
return int(status == "Running")
|
||||
|
||||
@staticmethod
|
||||
def get_serviceprocess(servicename):
|
||||
"""Gets name of the process of the service"""
|
||||
service = psutil.win_service_get(servicename)
|
||||
srv_pid = service.pid()
|
||||
process = psutil.Process(srv_pid)
|
||||
proc_name = process.name()
|
||||
return proc_name
|
||||
else:
|
||||
print("No systemd or service commands available. Exiting...", file=stderr)
|
||||
exit()
|
||||
if status:
|
||||
module_list.append(srvc)
|
||||
if memcpu:
|
||||
modules += get_memcpu(srvc, None)
|
||||
|
||||
for m in modules:
|
||||
print_module(m, 1)
|
||||
|
||||
|
||||
#########################################################################################
|
||||
# Services creation
|
||||
#########################################################################################
|
||||
|
||||
def service_module(name, value, parent=None):
|
||||
def build_module(name, value, module_type, parent=None):
|
||||
#print ("service_module BEGIN "+str(now(0,1)))
|
||||
module = [{
|
||||
"name" : "Service "+ name + " - Status",
|
||||
"type" : "generic_proc",
|
||||
"name" : name ,
|
||||
"type" : module_type,
|
||||
"value" : value,
|
||||
"module_parent" : parent,
|
||||
}]
|
||||
@ -167,74 +169,6 @@ def proc_percentbyname(procname): ############# 03/03/2020
|
||||
next
|
||||
#print ("proc_percentbyname END "+str(now(0,1)))
|
||||
return [sum(memory),sum(cpu)]
|
||||
|
||||
def win_service(servicelist, option=False, memcpu=False):
|
||||
"""Creates modules for Windows servers."""
|
||||
modules = []
|
||||
for srvc in servicelist:
|
||||
if srvc and len(srvc) > 2:
|
||||
output = PSCheck.check_service(srvc, option, memcpu)
|
||||
if output is not None and output["modules"]:
|
||||
modules += PSCheck.check_service(srvc.strip(), option, memcpu)["modules"]
|
||||
module_list.append(srvc)
|
||||
#winprocess = output["name"]
|
||||
#if memcpu == True:
|
||||
# modules += get_memcpu(winprocess) ## Only available for parent service ATM.
|
||||
else:
|
||||
next
|
||||
else:
|
||||
next
|
||||
for module in modules:
|
||||
print_module(module, 1)
|
||||
|
||||
|
||||
def lnx_service(services_list, memcpu=False):
|
||||
"""Creates modules for Linux servers"""
|
||||
modules = []
|
||||
sysctl = getstatusoutput("command -v systemctl")[0]
|
||||
servic = getstatusoutput("command -v service")[0]
|
||||
for srvc in services_list:
|
||||
status = None
|
||||
if sysctl == 0:
|
||||
### Systemd available
|
||||
syscall = Popen(["systemctl", "show", "-pLoadState", "-pActiveState", srvc], stdout=PIPE,
|
||||
stdin=DEVNULL, universal_newlines=True)
|
||||
result = syscall.communicate()
|
||||
srvstatus = result[0].strip().lower().split("\n")
|
||||
if srvstatus[0] == "loadstate=not-found":
|
||||
next
|
||||
else:
|
||||
if srvstatus[1] == "activestate=active":
|
||||
modules += service_module(srvc, 1)
|
||||
status = 1
|
||||
elif srvstatus[1] == "activestate=inactive":
|
||||
modules += service_module(srvc, 0)
|
||||
status = 0
|
||||
elif sysctl != 0 and servic == 0:
|
||||
### Systemd not available, switch to service command
|
||||
syscall = Popen(["service", srvc, "status"], stdout=PIPE,
|
||||
stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
|
||||
result = syscall.communicate()[0].lower()
|
||||
if "is running" in result:
|
||||
modules += service_module(srvc, 1)
|
||||
status = 1
|
||||
elif "is stopped" in result:
|
||||
modules += service_module(srvc, 0)
|
||||
status = 0
|
||||
else:
|
||||
next
|
||||
else:
|
||||
print("No systemd or service commands available. Exiting...", file=stderr)
|
||||
exit()
|
||||
if status:
|
||||
module_list.append(srvc)
|
||||
if memcpu:
|
||||
modules += get_memcpu(srvc, None)
|
||||
|
||||
for m in modules:
|
||||
print_module(m, 1)
|
||||
|
||||
|
||||
#########################################################################################
|
||||
# print_module function
|
||||
#########################################################################################
|
||||
@ -356,6 +290,7 @@ def main():
|
||||
service_list = ["MySQL", "postgresql", "pgsql", "oracle", "MSSQL", "IISADMIN",
|
||||
"apache", "nginx", "W3svc", "NTDS", "Netlogon", "DNS", "MSExchangeADTopology",
|
||||
"MSExchangeServiceHost", "MSExchangeSA", "MSExchangeTransport"]
|
||||
|
||||
discover(OS, service_list)
|
||||
elif psutil.LINUX:
|
||||
OS = "Linux"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
{230310}
|
||||
{230330}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.769 Build 230310")
|
||||
#define PANDORA_VERSION ("7.0NG.770 Build 230330")
|
||||
|
||||
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.769(Build 230310))"
|
||||
VALUE "ProductVersion", "(7.0NG.770(Build 230330))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.769-230310
|
||||
Version: 7.0NG.770-230330
|
||||
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.769-230310"
|
||||
pandora_version="7.0NG.770-230330"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
@ -729,16 +729,31 @@ function mainAgentsModules()
|
||||
if (isset($modules_selected[0]) === true && $modules_selected[0]) {
|
||||
$all_modules = [];
|
||||
foreach ($modules_selected as $key => $value) {
|
||||
$name = modules_get_agentmodule_name($value);
|
||||
$sql = "SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE nombre = '".$name."';";
|
||||
if (is_int($value)) {
|
||||
$name = modules_get_agentmodule_name($value);
|
||||
$sql = "SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE nombre = '".$name."';";
|
||||
|
||||
$result_sql = db_get_all_rows_sql($sql);
|
||||
$result_sql = db_get_all_rows_sql($sql);
|
||||
|
||||
if (is_array($result_sql)) {
|
||||
foreach ($result_sql as $key => $value) {
|
||||
$all_modules[$value['id_agente_modulo']] = io_safe_output($name);
|
||||
if (is_array($result_sql)) {
|
||||
foreach ($result_sql as $key => $value) {
|
||||
$all_modules[$value['id_agente_modulo']] = io_safe_output($name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$name = $value;
|
||||
$sql = "SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE nombre = '".$name."';";
|
||||
|
||||
$result_sql = db_get_all_rows_sql($sql);
|
||||
|
||||
if (is_array($result_sql)) {
|
||||
foreach ($result_sql as $key => $value) {
|
||||
$all_modules[$value['id_agente_modulo']] = io_safe_output($name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -838,7 +853,7 @@ function mainAgentsModules()
|
||||
|
||||
echo '<tr>';
|
||||
|
||||
echo "<th width='140px' class='pdd_r_10px align_right'>".__('Agents').' / '.__('Modules').'</th>';
|
||||
echo "<th width='40px' class='pdd_r_10px align_left'>".__('Agents').' / '.__('Modules').'</th>';
|
||||
|
||||
if ($hor_offset > 0) {
|
||||
$new_hor_offset = ($hor_offset - $block);
|
||||
@ -958,7 +973,7 @@ function mainAgentsModules()
|
||||
|
||||
foreach ($module['id'] as $module_id) {
|
||||
if (!$match && array_key_exists($module_id, $agent_modules)) {
|
||||
echo "<td class='center'>";
|
||||
echo "<td class='center' style='text-align:left;'>";
|
||||
$win_handle = dechex(crc32($module_id.$module['name']));
|
||||
$graph_type = return_graphtype(modules_get_agentmodule_type($module_id));
|
||||
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."', 800, 480)";
|
||||
|
@ -115,11 +115,11 @@ function pandora_files_repo_godmode()
|
||||
}
|
||||
|
||||
// Header tabs.
|
||||
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view'), 'class' => 'invert_filter']).'</a>';
|
||||
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/configuration@svg.svg', true, ['title' => __('Administration view'), 'class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
$godmode['godmode'] = 1;
|
||||
$godmode['active'] = 1;
|
||||
|
||||
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/eye_show.png', true, ['title' => __('Operation view'), 'class' => 'invert_filter']).'</a>';
|
||||
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/see-details@svg.svg', true, ['title' => __('Operation view'), 'class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
$operation['operation'] = 1;
|
||||
|
||||
$onheader = [
|
||||
@ -226,10 +226,10 @@ function pandora_files_repo_operation()
|
||||
// Header tabs.
|
||||
$onheader = [];
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view'), 'class' => 'invert_filter']).'</a>';
|
||||
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/configuration@svg.svg', true, ['title' => __('Administration view'), 'class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
$godmode['godmode'] = 1;
|
||||
|
||||
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/eye_show.png', true, ['title' => __('Operation view'), 'class' => 'invert_filter']).'</a>';
|
||||
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/see-details@svg.svg', true, ['title' => __('Operation view'), 'class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
$operation['operation'] = 1;
|
||||
$operation['active'] = 1;
|
||||
|
||||
@ -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';
|
||||
|
@ -133,9 +133,12 @@ if (!empty($files)) {
|
||||
);
|
||||
$data[4] .= "<a href=\"$config_url\">";
|
||||
$data[4] .= html_print_image(
|
||||
'images/config.png',
|
||||
'images/edit.svg',
|
||||
true,
|
||||
['title' => __('Edit')]
|
||||
[
|
||||
'title' => __('Edit'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
// Edit image
|
||||
$data[4] .= '</a>';
|
||||
@ -145,11 +148,11 @@ if (!empty($files)) {
|
||||
);
|
||||
$data[4] .= " <a href=\"$delete_url\" onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\">";
|
||||
$data[4] .= html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
// Delete image
|
||||
|
@ -140,25 +140,26 @@ function quickShell()
|
||||
ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
|
||||
$wiz->printForm(
|
||||
[
|
||||
'form' => [
|
||||
'form' => [
|
||||
'method' => 'POST',
|
||||
'action' => '#',
|
||||
],
|
||||
'inputs' => [
|
||||
[
|
||||
'class' => 'w100p',
|
||||
'arguments' => [
|
||||
'name' => 'submit',
|
||||
'label' => __('Retry'),
|
||||
'type' => 'submit',
|
||||
'attributes' => ['icon' => 'next'],
|
||||
'return' => true,
|
||||
],
|
||||
],
|
||||
'id' => 'retry_form',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Retry'),
|
||||
'submit',
|
||||
false,
|
||||
[
|
||||
'icon' => 'next',
|
||||
'form' => 'retry_form',
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -168,6 +169,7 @@ function quickShell()
|
||||
'action' => '#',
|
||||
'class' => 'wizard',
|
||||
'method' => 'post',
|
||||
'id' => 'connect_form',
|
||||
],
|
||||
'inputs' => [
|
||||
[
|
||||
@ -198,19 +200,24 @@ function quickShell()
|
||||
'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);",
|
||||
],
|
||||
],
|
||||
[
|
||||
'arguments' => [
|
||||
'type' => 'submit',
|
||||
'label' => __('Connect'),
|
||||
'attributes' => ['icon' => 'cog'],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Connect'),
|
||||
'submit',
|
||||
false,
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'form' => 'connect_form',
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -434,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);
|
||||
|
||||
|
@ -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;
|
||||
@ -87,4 +110,85 @@ CREATE INDEX idx_disabled ON talert_template_modules (disabled);
|
||||
|
||||
INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select alias from tagente where safe_mode_module = 0');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `twelcome_tip` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`id_lang` VARCHAR(20) NULL,
|
||||
`id_profile` INT NOT NULL,
|
||||
`title` VARCHAR(255) NOT NULL,
|
||||
`text` TEXT NOT NULL,
|
||||
`url` VARCHAR(255) NULL,
|
||||
`enable` TINYINT NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `twelcome_tip_file` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`twelcome_tip_file` INT NOT NULL,
|
||||
`filename` VARCHAR(255) NOT NULL,
|
||||
`path` VARCHAR(255) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `twelcome_tip_file`
|
||||
FOREIGN KEY (`twelcome_tip_file`)
|
||||
REFERENCES `twelcome_tip` (`id`)
|
||||
ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
INSERT INTO `twelcome_tip` VALUES
|
||||
(1,'es',0,'¿Sabías que puedes monitorizar webs?','De manera sencilla a través de chequeos HTTP estándar o transaccional mediante transacciones centralizadas WUX, o descentralizadas con el plugin UX de agente.','https://pandorafms.com/manual/es/documentation/03_monitoring/06_web_monitoring','1'),
|
||||
(2,'es',0,'Monitorización remota de dispositivos SNMP','Los dispositivos de red como switches, AP, routers y firewalls se pueden monitorizar remotamente usando el protocolo SNMP. Basta con saber su IP, la comunidad SNMP y lanzar un wizard SNMP desde la consola.','https://pandorafms.com/manual/es/documentation/03_monitoring/03_remote_monitoring#monitorizacion_snmp','1'),
|
||||
(3,'es',0,'Monitorizar rutas desde una IP a otra','Existe un plugin especial que sirve para monitorizar visualmente las rutas desde una IP a otra de manera visual y dinámica, según va cambiando con el tiempo.','https://pandorafms.com/manual/es/documentation/03_monitoring/03_remote_monitoring#monitorizacion_de_rutas','1'),
|
||||
(4,'es',0,'¿Tu red pierde paquetes?','Se puede medir la pérdida de paquetes en tu red usando un agente y un plugin libre llamado “Packet Loss”. Esto es especialmente útil en redes Wifi o redes compartidas con muchos usuarios. Escribimos un artículo en nuestro blog hablando de ello, echale un vistazo','https://pandorafms.com/blog/es/perdida-de-paquetes/','1'),
|
||||
(5,'es',0,'Usar Telegram con Pandora FMS','Perfecto para recibir alertas con gráficas empotradas y personalizar así la recepción de avisos de manera individual o en un canal común con mas personas. ','https://pandorafms.com/library/telegram-bot-cli/','1'),
|
||||
(6,'es',0,'Monitorizar JMX (Tomcat, Websphere, Weblogic, Jboss, Apache Kafka, Jetty, GlassFish…)','Existe un plugin Enterprise que sirve para monitorizar cualquier tecnología JMX. Se puede usar de manera local (como plugin local) o de manera remota con el plugin server.','https://pandorafms.com/library/jmx-monitoring/','1'),
|
||||
(7,'es',0,'¿Sabes que cada usuario puede tener su propia Zona Horaria?','Se puede establecer zonas horarias diferentes para cada usuario, de manera que interprete los datos teniendo en cuenta la diferencia horaria. Pandora FMS también puede tener servidores y agentes en diferentes zonas horarias. ¡Por todo el mundo!','','1'),
|
||||
(8,'es',0,'Paradas planificadas','Se puede definir, a nivel de agente y a nivel de módulo, períodos en los cuales se ignoren las alertas y/o los datos recogidos. Es perfecto para planificar paradas de servicio o desconexión de los sistemas monitorizados. También afecta a los informes SLA, evitando que se tengan en cuenta esos intervalos de tiempo.    ','https://pandorafms.com/manual/es/documentation/04_using/11_managing_and_administration#paradas_de_servicio_planificadas','1'),
|
||||
(9,'es',0,'Personalizar los emails de alerta ','¿Sabías que se pueden personalizar los mails de alertas de Pandora? Solo tienes que editar el código HTML por defecto de las acciones de alerta de tipo email.  ','https://pandorafms.com/manual/en/documentation/04_using/01_alerts#editing_an_action','1'),
|
||||
(10,'es',0,'Usando iconos personalizados en consolas visuales ','Gracias a los iconos personalizados se pueden crear vistas muy personalizadas, como la de la imagen, que representa racks con los tipos de servidores en el orden que están colocados dentro del rack. Perfecto para que un técnico sepa exactamente qué máquina esta fallando. Más visual no puede ser, de ahi el nombre.  ','https://pandorafms.com/manual/start?id=es/documentation/04_using/05_data_presentation_visual_maps','1'),
|
||||
(11,'es',0,'Consolas visuales: mapas de calor ','La consola permite integrar en un fondo personalizado una serie de datos, que en función de su valor se representen con unos colores u otros, en tiempo real. Las aplicaciones son infinitas, solo depende de tu imaginación.   ','https://pandorafms.com/manual/es/documentation/04_using/05_data_presentation_visual_maps#mapa_de_calor_o_nube_de_color','1'),
|
||||
(12,'es',0,'Auditoría interna de la consola ','La consola registra todas las actividades relevantes de cada usuario conectado a la consola. Esto incluye la aplicación de configuraciones, validaciones de eventos y alertas, conexión y desconexión y cientos de otras operaciones. La seguridad en Pandora FMS ha sido siempre una de las características del diseño de su arquitectura.  ','https://pandorafms.com/manual/es/documentation/04_using/11_managing_and_administration#log_de_auditoria','1'),
|
||||
(13,'es',0,'Sistema de provisión automática de agentes ','El sistema de autoprovisión de agentes, permite que un agente recién ingresado en el sistema aplique automáticamente cambios en su configuración (como moverlo de grupo, asignarle ciertos valores en campos personalizados) y por supuesto aplicarle determinadas politicas de monitorización. Es una de las funcionalidades más potentes, orientadas a gestionar parques de sistemas muy extensos.  ','https://pandorafms.com/manual/start?id=es/documentation/02_installation/05_configuration_agents#configuracion_automatica_de_agentes','1'),
|
||||
(14,'es',0,'Modo oscuro ','¿Sabes que existe un modo oscuro en Pandora FMS? Un administrador lo puede activar a nivel global desde las opciones de configuración visuales o cualquier usuario a nivel individual, en las opciones de usuario. ','','1'),
|
||||
(15,'es',0,'Google Sheet ','¿Sabes que se puede coger el valor de una celda de una hoja de cálculo de Google Sheet?, utilizamos la API para pedir el dato a través de un plugin remoto. Es perfecto para construir cuadros de mando de negocio, obtener alertas en tiempo real y crear tus propios informes a medida.  ','https://pandorafms.com/library/google-sheets-plugin/','1'),
|
||||
(16,'es',0,'Tablas de ARP','¿Sabes que existe un módulo de inventario para sacar las tablas ARP de tus servidores windows? Es fácil de instalar y puede darte información muy detallada de tus equipos.','https://pandorafms.com/library/arp-table-windows-local/','1'),
|
||||
(17,'es',0,'Enlaces de red en la consola visual ','Existe un elemento de consola visual llamado “Network link” que permite mostrar visualmente la unión de dos interfaces de red, su estado y el tráfico de subida/bajada, de una manera muy visual.  ','https://pandorafms.com/manual/es/documentation/04_using/05_data_presentation_visual_maps#enlace_de_red','1'),
|
||||
(18,'es',0,'¿Conoces los informes de disponibilidad? ','Son muy útiles ya que te dicen el tiempo (%) que un chequeo ha estado en diferentes estados a lo largo de un lapso de tiempo, por ejemplo, una semana. Ofrece datos crudos completos de lo que se ha hecho con el detalle suficiente para convencer a un proveedor o un cliente.  ','','1'),
|
||||
(19,'es',0,'Gráficas de disponibilidad ','Parecidos a los informes de disponibilidad, pero mucho mas visuales, ofrecen el detalle de estado de un monitor a lo largo del tiempo. Se pueden agrupar con otro módulo para ofrecer datos finales teniendo en cuenta la alta disponibilidad de un servicio. Son perfectos para su uso en informes a proveedores y/o clientes.  ','https://pandorafms.com/manual/es/documentation/04_using/08_data_presentation_reports#grafico_de_disponibilidad','1'),
|
||||
(20,'es',0,'Zoom en gráficas de datos ','¿Sabes que Pandora FMS permite hacer zoom en una parte de la gráfica. Con eso ampliarás la información de la gráfica. Si estás viendo una gráfica de un mes y amplías, podrás ver los datos de ese intervalo. Si utilizas una gráfica con datos de resolución completa (los llamamos gráficas TIP) podrás ver el detalle de cada dato, aunque tu gráfica tenga miles de muestras.  ','','1'),
|
||||
(21,'es',0,'Gráficas de resolución completa ','Pandora FMS y otras herramientas cuando tienen que mostrar una gráfica obtienen los datos de la fuente de datos y luego “simplifican” la gráfica, ya que si la serie de datos tiene 10,000 elementos y la gráfica solo tiene 300 pixeles de ancho no pueden caber todos, asi que se “simplifican” esos 10,000 puntos en solo 300.   Sin embargo al simplificar se pierde “detalle” en la gráfica, y por supuesto no podemos “hacer zoom”. Las gráficas de Pandora FMS permiten mostrar y usar todos los datos en una gráfica, que llamamos “TIP” que muestra todos los puntos superpuestos y además permite que al hacer zoom no se pierda resolución.   ','','1'),
|
||||
(22,'es',0,'Política de contraseñas','La consola de Pandora FMS tiene un sistema de gestión de política de credenciales, para reforzar la seguridad local (además de permitir la autenticación externa contra un LDAP, Active Directory o SAML). A través de este sistema podemos forzar cambios de password cada X días, guardar un histórico de passwords usadas o evitar el uso de ciertas contraseñas entre otras acciones.  ','https://pandorafms.com/manual/es/documentation/04_using/12_console_setup?s%5B%5D%3Dcontrase%25C3%25B1as#password_policy','1'),
|
||||
(23,'es',0,'Autenticación de doble factor ','Es posible activar (y forzar su uso a todos los usuarios) un sistema de doble autenticación (usando Google Auth) para que cualquier usuario se autentique además de con una contraseña, con un sistema de token de un solo uso, dando al sistema mucha más seguridad.  ','https://pandorafms.com/manual/en/documentation/04_using/12_console_setup?s%5B%5D%3Dgoogle%26s%5B%5D%3Dauth#authentication','1');
|
||||
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`, `filename`, `path`) VALUES
|
||||
(1, 'monitorizar_web.png', 'images/tips/'),
|
||||
(2, 'monitorizar_snmp.png', 'images/tips/'),
|
||||
(3, 'monitorizar_desde_ip.png', 'images/tips/'),
|
||||
(4, 'tu_red_pierde_paquetes.png', 'images/tips/'),
|
||||
(5, 'telegram_con_pandora.png', 'images/tips/'),
|
||||
(6, 'monitorizar_con_jmx.png', 'images/tips/'),
|
||||
(7, 'usuario_zona_horaria.png', 'images/tips/'),
|
||||
(8, 'paradas_planificadas.png', 'images/tips/'),
|
||||
(9, 'personalizar_los_emails.png', 'images/tips/'),
|
||||
(10, 'iconos_personalizados.png', 'images/tips/'),
|
||||
(11, 'mapa_de_calor.png', 'images/tips/'),
|
||||
(12, 'auditoria.png', 'images/tips/'),
|
||||
(15, 'google_sheets.png', 'images/tips/'),
|
||||
(17, 'enlaces_consola_visual.png', 'images/tips/'),
|
||||
(18, 'informe_disponibiliad.png', 'images/tips/'),
|
||||
(19, 'graficas_disponibilidad.png', 'images/tips/'),
|
||||
(20, 'zoom_en_graficas.png', 'images/tips/'),
|
||||
(22, 'politica_de_pass.png', 'images/tips/');
|
||||
|
||||
ALTER TABLE `tusuario` ADD COLUMN `show_tips_startup` TINYINT UNSIGNED NOT NULL DEFAULT 1;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `tfavmenu_user` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`id_user` VARCHAR(255) NOT NULL,
|
||||
`id_element` TEXT,
|
||||
`url` TEXT NOT NULL,
|
||||
`label` VARCHAR(255) NOT NULL,
|
||||
`section` VARCHAR(255) NOT NULL,
|
||||
PRIMARY KEY (`id`));
|
||||
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('legacy_database_ha', 1);
|
||||
|
||||
COMMIT;
|
||||
|
@ -117,6 +117,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
}
|
||||
}
|
||||
|
||||
$search_bar .= '<div id="result_order" class="result_order"></div>';
|
||||
$search_bar .= '<input id="keywords" name="keywords"';
|
||||
if (!isset($config['search_keywords'])) {
|
||||
$search_bar .= "value='".__('Enter keywords to search')."'";
|
||||
@ -126,15 +127,11 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
$search_bar .= "value='".$config['search_keywords']."'";
|
||||
}
|
||||
|
||||
$search_bar .= 'type="search" onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');"
|
||||
onkeyup="showinterpreter()" class="search_input"/>';
|
||||
$search_bar .= 'type="search" onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" onkeyup="showinterpreter()" class="search_input"/>';
|
||||
|
||||
|
||||
$search_bar .= '<div id="result_order" class="result_order"></div>';
|
||||
// $search_bar .= 'onClick="javascript: document.quicksearch.submit()"';
|
||||
$search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />";
|
||||
$search_bar .= '</form>';
|
||||
|
||||
$header_searchbar = '<div id="header_searchbar">'.$search_bar.'</div>';
|
||||
}
|
||||
|
||||
@ -410,7 +407,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
|
||||
|
||||
// User.
|
||||
// $headerUserImage = (is_user_admin($config['id_user']) === true) ? 'images/header_user_admin_green.png' : 'images/header_user_green.png';
|
||||
$headerUser = [];
|
||||
$headerUser[] = html_print_image(
|
||||
'images/edit_user@header.svg',
|
||||
|
@ -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'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').' >', 'login_button', false, 'class="next_login"');
|
||||
html_print_submit_button(__('Check code').' >', '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>';
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Lateral Main Menu.
|
||||
*
|
||||
@ -233,13 +234,16 @@ echo '</div>';
|
||||
const id_selected = '<?php echo $menu1_selected; ?>';
|
||||
if (id_selected != '') {
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
if (menuType_val === 'classic') {
|
||||
const closedMenuId = localStorage.getItem("closedMenuId");
|
||||
if (menuType_val === 'classic' &&
|
||||
(closedMenuId === '' || `icon_${id_selected}` !== closedMenuId)
|
||||
) {
|
||||
$(`ul#subicon_${id_selected}`).show();
|
||||
// Arrow.
|
||||
$(`#icon_${id_selected}`).children().first().children().last().removeClass('arrow_menu_down');
|
||||
$(`#icon_${id_selected}`).children().first().children().last().addClass('arrow_menu_up');
|
||||
}
|
||||
|
||||
// Arrow.
|
||||
$(`#icon_${id_selected}`).children().first().children().last().removeClass('arrow_menu_down');
|
||||
$(`#icon_${id_selected}`).children().first().children().last().addClass('arrow_menu_up');
|
||||
// Span.
|
||||
$(`#icon_${id_selected}`).children().first().children().eq(1).addClass('span_selected');
|
||||
|
||||
@ -272,11 +276,11 @@ echo '</div>';
|
||||
table_hover = $(this);
|
||||
handsIn = 1;
|
||||
openTime = new Date().getTime();
|
||||
$("ul#sub"+table_hover[0].id).show();
|
||||
$("ul#sub" + table_hover[0].id).show();
|
||||
get_menu_items(table_hover);
|
||||
if (typeof(table_noHover) != 'undefined') {
|
||||
if ("ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id ) {
|
||||
$("ul#sub"+table_noHover[0].id).hide();
|
||||
if ("ul#sub" + table_hover[0].id != "ul#sub" + table_noHover[0].id) {
|
||||
$("ul#sub" + table_noHover[0].id).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -287,9 +291,9 @@ echo '</div>';
|
||||
handsIn = 0;
|
||||
setTimeout(function() {
|
||||
opened = new Date().getTime() - openTime;
|
||||
if(opened > 2500 && handsIn == 0) {
|
||||
if (opened > 2500 && handsIn == 0) {
|
||||
openTime = 4000;
|
||||
$("ul#sub"+table_noHover[0].id).hide();
|
||||
$("ul#sub" + table_noHover[0].id).hide();
|
||||
}
|
||||
}, 2500);
|
||||
}
|
||||
@ -301,10 +305,10 @@ echo '</div>';
|
||||
table_hover2 = $(this);
|
||||
handsIn2 = 1;
|
||||
openTime2 = new Date().getTime();
|
||||
$("#sub"+table_hover2[0].id).show();
|
||||
if( typeof(table_noHover2) != 'undefined') {
|
||||
if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id ) {
|
||||
$("ul#sub"+table_noHover2[0].id).hide();
|
||||
$("#sub" + table_hover2[0].id).show();
|
||||
if (typeof(table_noHover2) != 'undefined') {
|
||||
if ("ul#sub" + table_hover2[0].id != "ul#sub" + table_noHover2[0].id) {
|
||||
$("ul#sub" + table_noHover2[0].id).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -314,10 +318,10 @@ echo '</div>';
|
||||
table_noHover2 = table_hover2;
|
||||
handsIn2 = 0;
|
||||
setTimeout(function() {
|
||||
opened = new Date().getTime() - openTime2;
|
||||
if(opened >= 3000 && handsIn2 == 0) {
|
||||
opened = new Date().getTime() - openTime2;
|
||||
if (opened >= 3000 && handsIn2 == 0) {
|
||||
openTime2 = 4000;
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
$("ul#sub" + table_hover2[0].id).hide();
|
||||
}
|
||||
}, 3500);
|
||||
}
|
||||
@ -328,12 +332,12 @@ echo '</div>';
|
||||
if (!click_display && menuType_val === 'collapsed') {
|
||||
|
||||
openTime = 4000;
|
||||
if( typeof(table_hover) != 'undefined') {
|
||||
$("ul#sub"+table_hover[0].id).hide();
|
||||
if (typeof(table_hover) != 'undefined') {
|
||||
$("ul#sub" + table_hover[0].id).hide();
|
||||
}
|
||||
|
||||
if( typeof(table_hover2) != 'undefined') {
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
if (typeof(table_hover2) != 'undefined') {
|
||||
$("ul#sub" + table_hover2[0].id).hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -350,14 +354,22 @@ echo '</div>';
|
||||
}
|
||||
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
const closedMenuId = localStorage.getItem("closedMenuId");
|
||||
|
||||
if (classes.includes('selected') === true) {
|
||||
if (classes.includes('selected') === true
|
||||
&& (closedMenuId === '' || closedMenuId !== id)
|
||||
) {
|
||||
if (menuType_val === 'collapsed' && $(`ul#sub${id}`).is(':hidden')) {
|
||||
$(`ul#sub${id}`).show();
|
||||
get_menu_items(table_hover);
|
||||
} else {
|
||||
$(`#${id}`).removeClass('selected');
|
||||
$(`ul#sub${id}`).hide();
|
||||
|
||||
const liSelected = $(`ul#sub${id}`).find('.selected');
|
||||
if (liSelected.length > 0) {
|
||||
localStorage.setItem("closedMenuId", id);
|
||||
}
|
||||
// Arrow.
|
||||
table_hover.children().first().children().last().removeClass('arrow_menu_up');
|
||||
table_hover.children().first().children().last().addClass('arrow_menu_down');
|
||||
@ -376,6 +388,12 @@ echo '</div>';
|
||||
} else {
|
||||
$(`ul#sub${id}`).show();
|
||||
$(`#${id}`).addClass('selected');
|
||||
|
||||
const liSelected = $(`ul#sub${id}`).find('.selected');
|
||||
if (liSelected.length > 0) {
|
||||
localStorage.setItem("closedMenuId", '');
|
||||
}
|
||||
|
||||
// Arrow.
|
||||
$(this).children().last().removeClass('arrow_menu_down');
|
||||
$(this).children().last().addClass('arrow_menu_up');
|
||||
@ -415,7 +433,7 @@ echo '</div>';
|
||||
}
|
||||
});
|
||||
|
||||
$('.sub_subMenu').click(function (event) {
|
||||
$('.sub_subMenu').click(function(event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
@ -432,10 +450,10 @@ echo '</div>';
|
||||
var index = item.index();
|
||||
|
||||
var top_submenu = menu_calculate_top(index, item_height);
|
||||
top_submenu = top_submenu+'px';
|
||||
$('#'+id_submenu+' ul.submenu').css('position', 'fixed');
|
||||
$('#'+id_submenu+' ul.submenu').css('top', top_submenu);
|
||||
$('#'+id_submenu+' ul.submenu').css('left', '60px');
|
||||
top_submenu = top_submenu + 'px';
|
||||
$('#' + id_submenu + ' ul.submenu').css('position', 'fixed');
|
||||
$('#' + id_submenu + ' ul.submenu').css('top', top_submenu);
|
||||
$('#' + id_submenu + ' ul.submenu').css('left', '60px');
|
||||
}
|
||||
|
||||
|
||||
@ -456,4 +474,4 @@ echo '</div>';
|
||||
return height_logo + height_tabs + padding_menu + height_position;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
@ -15,7 +15,7 @@
|
||||
<style>
|
||||
#alert_messages_na {
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
@ -160,9 +160,9 @@
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class='modalokbutto cerrar'>
|
||||
<span class='modalokbuttontex'>OK</span>
|
||||
</div>
|
||||
<button type="submit" class="cerrar submitButton" name="" id="" value="OK">
|
||||
<span id="" style="" class="font_11">OK</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="opacidad"></div>
|
||||
@ -173,6 +173,4 @@
|
||||
$(".cerrar").click(function() {
|
||||
window.location = "<?php echo $config['homeurl']; ?>";
|
||||
});
|
||||
|
||||
$('div#page').css('background-color', '#d3d3d3');
|
||||
</script>
|
||||
|
@ -31,6 +31,7 @@ global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_register.php';
|
||||
require_once $config['homedir'].'/include/class/WelcomeWindow.class.php';
|
||||
require_once $config['homedir'].'/include/class/TipsWindow.class.php';
|
||||
|
||||
|
||||
if ((bool) is_ajax() === true) {
|
||||
@ -109,6 +110,16 @@ try {
|
||||
$welcome = false;
|
||||
}
|
||||
|
||||
try {
|
||||
if (isset($_SESSION['showed_tips_window']) === false) {
|
||||
$tips_window = new TipsWindow();
|
||||
if ($tips_window !== null) {
|
||||
$tips_window->run();
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
$double_auth_enabled = (bool) db_get_value('id', 'tuser_double_auth', 'id_user', $config['id_user']);
|
||||
|
||||
if (isset($config['2FA_all_users']) === false) {
|
||||
@ -173,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'){
|
||||
|
@ -61,79 +61,110 @@ ui_print_warning_message(
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filter-table-adv mrgn_top_15px pdd_t_0px_important';
|
||||
$table->data = [];
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->head[0] = __('Agent position');
|
||||
$table->head_colspan[0] = 4;
|
||||
$table->headstyle[0] = 'text-align:center';
|
||||
$table->style[0] = 'font-weight: bold; ';
|
||||
$table->style[2] = 'font-weight: bold; ';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[2] = '50%';
|
||||
|
||||
$table->data[1][0] = __('Latitude: ');
|
||||
$table->data[1][1] = html_print_input_text_extended(
|
||||
'latitude',
|
||||
$agentData['stored_latitude'],
|
||||
'text-latitude',
|
||||
'',
|
||||
20,
|
||||
20,
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'onchange' => 'setIgnoreGISDataEnabled()',
|
||||
'onkeyup' => 'setIgnoreGISDataEnabled()',
|
||||
],
|
||||
true
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Latitude: '),
|
||||
html_print_input_text_extended(
|
||||
'latitude',
|
||||
$agentData['stored_latitude'],
|
||||
'text-latitude',
|
||||
'',
|
||||
20,
|
||||
20,
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'onchange' => 'setIgnoreGISDataEnabled()',
|
||||
'onkeyup' => 'setIgnoreGISDataEnabled()',
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][2] = __('Longitude: ');
|
||||
$table->data[1][3] = html_print_input_text_extended(
|
||||
'longitude',
|
||||
$agentData['stored_longitude'],
|
||||
'text-longitude',
|
||||
'',
|
||||
20,
|
||||
20,
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'onchange' => 'setIgnoreGISDataEnabled()',
|
||||
'onkeyup' => 'setIgnoreGISDataEnabled()',
|
||||
],
|
||||
true
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Longitude: '),
|
||||
html_print_input_text_extended(
|
||||
'longitude',
|
||||
$agentData['stored_longitude'],
|
||||
'text-longitude',
|
||||
'',
|
||||
20,
|
||||
20,
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'onchange' => 'setIgnoreGISDataEnabled()',
|
||||
'onkeyup' => 'setIgnoreGISDataEnabled()',
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][0] = __('Altitude: ');
|
||||
$table->data[2][1] = html_print_input_text_extended(
|
||||
'altitude',
|
||||
$agentData['stored_altitude'],
|
||||
'text-altitude',
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'onchange' => 'setIgnoreGISDataEnabled()',
|
||||
'onkeyup' => 'setIgnoreGISDataEnabled()',
|
||||
],
|
||||
true
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Altitude: '),
|
||||
html_print_input_text_extended(
|
||||
'altitude',
|
||||
$agentData['stored_altitude'],
|
||||
'text-altitude',
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'onchange' => 'setIgnoreGISDataEnabled()',
|
||||
'onkeyup' => 'setIgnoreGISDataEnabled()',
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][2] = __('Ignore new GIS data:');
|
||||
$table->data[2][3] = __('Yes').' '.html_print_radio_button_extended('update_gis_data', 0, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true);
|
||||
$table->data[2][3] .= __('No').' '.html_print_radio_button_extended('update_gis_data', 1, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true);
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Ignore new GIS data: '),
|
||||
'<div class="flex mrgn_top_5px">'.__('Yes').' '.html_print_radio_button_extended(
|
||||
'update_gis_data',
|
||||
0,
|
||||
'',
|
||||
$updateGisData,
|
||||
false,
|
||||
'',
|
||||
'class="mrgn_right_40px"',
|
||||
true
|
||||
).__('No').' '.html_print_radio_button_extended(
|
||||
'update_gis_data',
|
||||
1,
|
||||
'',
|
||||
$updateGisData,
|
||||
false,
|
||||
'',
|
||||
'class="mrgn_right_40px"',
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente;
|
||||
echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();'>";
|
||||
echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();' class='max_floating_element_size'>";
|
||||
html_print_input_hidden('update_gis', 1);
|
||||
html_print_table($table);
|
||||
|
||||
echo '<div class="action-buttons float-left" style="width: '.$table->width.';">';
|
||||
html_print_submit_button(__('Update'), '', false, 'class="sub upd"');
|
||||
echo '</div>';
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'',
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
)
|
||||
);
|
||||
echo '</form>';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
@ -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'
|
||||
);
|
||||
}
|
||||
|
@ -196,29 +196,52 @@ foreach ($nps as $row) {
|
||||
|
||||
$filterTable = new stdClass();
|
||||
$filterTable->width = '100%';
|
||||
$filterTable->class = 'fixed_filter_bar';
|
||||
$filterTable->class = 'filter-table-adv';
|
||||
$filterTable->size[0] = '100%';
|
||||
$filterTable->data = [];
|
||||
$filterTable->data[0][0] = __('Module templates');
|
||||
$filterTable->data[1][0] = html_print_select($select, 'template_id', '', '', '', 0, true, false, true, '', false, 'max-width: 200px !important');
|
||||
$filterTable->data[1][1] = html_print_div(
|
||||
|
||||
$filterTable->data[0][0] = html_print_label_input_block(
|
||||
__('Module templates'),
|
||||
html_print_select(
|
||||
$select,
|
||||
'template_id',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 250px '
|
||||
)
|
||||
);
|
||||
|
||||
$filterTable->data[1][0] = html_print_submit_button(
|
||||
__('Assign'),
|
||||
'crt',
|
||||
false,
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Assign'),
|
||||
'crt',
|
||||
false,
|
||||
[
|
||||
'icon' => 'wand',
|
||||
'mode' => 'secondary mini',
|
||||
],
|
||||
true
|
||||
),
|
||||
'class' => 'float-right',
|
||||
'icon' => 'wand',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$outputFilterTable = '<form style="border:0" class="fixed_filter_bar" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">';
|
||||
$outputFilterTable .= html_print_table($filterTable, true);
|
||||
$outputFilterTable = '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">';
|
||||
$outputFilterTable .= ui_toggle(
|
||||
html_print_table($filterTable, true),
|
||||
'<span class="subsection_header_title">'.__('Assign').'</span>',
|
||||
__('Assign'),
|
||||
'assign',
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
'white-box-content no_border',
|
||||
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
$outputFilterTable .= '</form>';
|
||||
|
||||
echo $outputFilterTable;
|
||||
|
@ -808,7 +808,7 @@ if ($id_agente) {
|
||||
$pure = (int) get_parameter('pure');
|
||||
if ($pure === 0) {
|
||||
ui_print_standard_header(
|
||||
__('Agent setup view'),
|
||||
__('Agent setup view').' ( '.strtolower(agents_get_alias($id_agente)).' )',
|
||||
'images/agent.png',
|
||||
false,
|
||||
$helper,
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -174,7 +174,7 @@ foreach ($fields as $field) {
|
||||
$data[1] = $field['name'];
|
||||
|
||||
$data[2] = html_print_image(
|
||||
((bool) $field['display_on_front'] === true) ? 'images/validate.svg' : 'images/icono_stop.png',
|
||||
((bool) $field['display_on_front'] === true) ? 'images/validate.svg' : 'images/fail@svg.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
);
|
||||
|
@ -180,14 +180,26 @@ if ($load_inventory_module) {
|
||||
$form_buttons = '';
|
||||
if ($load_inventory_module) {
|
||||
$form_buttons .= html_print_input_hidden('id_agent_module_inventory', $id_agent_module_inventory, true);
|
||||
$form_buttons .= html_print_submit_button(__('Update'), 'update_inventory_module', false, 'class="sub next"', true);
|
||||
$form_buttons .= html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_inventory_module',
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$form_buttons .= html_print_submit_button(__('Add'), 'add_inventory_module', false, 'class="sub next"', true);
|
||||
$form_buttons .= html_print_submit_button(
|
||||
__('Add'),
|
||||
'add_inventory_module',
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
echo ui_get_inventory_module_add_form(
|
||||
'index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente,
|
||||
$form_buttons,
|
||||
html_print_action_buttons($form_buttons, [], true),
|
||||
$load_inventory_module,
|
||||
$id_os,
|
||||
$target,
|
||||
@ -213,10 +225,10 @@ if (db_get_num_rows($sql) == 0) {
|
||||
} else {
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox info_table max_floating_element_size';
|
||||
$table->data = [];
|
||||
$table->head = [];
|
||||
$table->styleTable = 'margin-top: 20px;';
|
||||
$table->styleTable = '';
|
||||
$table->head[0] = "<span title='".__('Policy')."'>".__('P.').'</span>';
|
||||
$table->head[1] = __('Name');
|
||||
$table->head[2] = __('Description');
|
||||
@ -235,7 +247,7 @@ if (db_get_num_rows($sql) == 0) {
|
||||
if ($id_policy) {
|
||||
$policy = policies_get_policy($id_policy);
|
||||
$data[0] = '<a href="index.php?sec=gmodules&sec2='.ENTERPRISE_DIR.'/godmode/policies/policies&id='.$id_policy.'">';
|
||||
$data[0] .= html_print_image('images/policies_mc.png', true, ['border' => '0', 'title' => $policy['name']]);
|
||||
$data[0] .= html_print_image('images/policy@svg.svg', true, ['border' => '0', 'title' => $policy['name'], 'class' => 'main_menu_icon invert_filter']);
|
||||
$data[0] .= '</a>';
|
||||
} else {
|
||||
$data[0] = '';
|
||||
@ -247,15 +259,15 @@ if (db_get_num_rows($sql) == 0) {
|
||||
$data[4] = human_time_description_raw($row['interval']);
|
||||
// Delete module
|
||||
$data[5] = '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'&delete_inventory_module='.$row['id_agent_module_inventory'].'" onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">';
|
||||
$data[5] .= html_print_image('images/cross.png', true, ['border' => '0', 'title' => __('Delete'), 'class' => 'invert_filter']);
|
||||
$data[5] .= html_print_image('images/delete.svg', true, ['border' => '0', 'title' => __('Delete'), 'class' => 'main_menu_icon invert_filter']);
|
||||
$data[5] .= '</b></a> ';
|
||||
// Update module
|
||||
$data[5] .= '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'&load_inventory_module='.$row['id_module_inventory'].'">';
|
||||
$data[5] .= html_print_image('images/config.png', true, ['border' => '0', 'title' => __('Update'), 'class' => 'invert_filter']);
|
||||
$data[5] .= html_print_image('images/edit.svg', true, ['border' => '0', 'title' => __('Update'), 'class' => 'main_menu_icon invert_filter']);
|
||||
$data[5] .= '</b></a> ';
|
||||
// Force refresh module
|
||||
$data[5] .= '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'&force_inventory_module='.$row['id_agent_module_inventory'].'">';
|
||||
$data[5] .= html_print_image('images/target.png', true, ['border' => '0', 'title' => __('Force'), 'class' => 'invert_filter']).'</b></a>';
|
||||
$data[5] .= html_print_image('images/change-active.svg', true, ['border' => '0', 'title' => __('Force'), 'class' => 'main_menu_icon invert_filter']).'</b></a>';
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
|
@ -302,93 +302,122 @@ foreach ($pre_fields as $key => $value) {
|
||||
|
||||
// Filter table.
|
||||
$filterTable = new stdClass();
|
||||
$filterTable->class = 'fixed_filter_bar';
|
||||
$filterTable->class = 'filter-table-adv w100p';
|
||||
$filterTable->size[0] = '20%';
|
||||
$filterTable->size[1] = '20%';
|
||||
$filterTable->size[2] = '20%';
|
||||
$filterTable->size[3] = '20%';
|
||||
$filterTable->size[4] = '20%';
|
||||
$filterTable->data = [];
|
||||
$filterTable->cellstyle[0][0] = 'width:0';
|
||||
$filterTable->cellstyle[0][1] = 'width:0';
|
||||
$filterTable->cellstyle[0][2] = 'width:0';
|
||||
$filterTable->cellstyle[0][3] = 'width:0';
|
||||
|
||||
$filterTable->data[0][0] = __('Group');
|
||||
$filterTable->data[1][0] = html_print_select_groups(
|
||||
false,
|
||||
'AR',
|
||||
$return_all_group,
|
||||
'ag_group',
|
||||
$ag_group,
|
||||
'this.form.submit();',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
$filterTable->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AR',
|
||||
$return_all_group,
|
||||
'ag_group',
|
||||
$ag_group,
|
||||
'this.form.submit();',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
$filterTable->data[0][1] = __('Recursion');
|
||||
$filterTable->data[1][1] = html_print_checkbox_switch(
|
||||
'recursion',
|
||||
1,
|
||||
$recursion,
|
||||
true,
|
||||
false,
|
||||
'this.form.submit()'
|
||||
$filterTable->data[0][1] = html_print_label_input_block(
|
||||
__('Recursion'),
|
||||
'<div class="mrgn_top_10px">'.html_print_checkbox_switch(
|
||||
'recursion',
|
||||
1,
|
||||
$recursion,
|
||||
true,
|
||||
false,
|
||||
'this.form.submit()'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$filterTable->data[0][2] = __('Show agents');
|
||||
$filterTable->data[1][2] = html_print_select(
|
||||
$showAgentFields,
|
||||
'disabled',
|
||||
$disabled,
|
||||
'this.form.submit()',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
$filterTable->data[0][2] = html_print_label_input_block(
|
||||
__('Show agents'),
|
||||
html_print_select(
|
||||
$showAgentFields,
|
||||
'disabled',
|
||||
$disabled,
|
||||
'this.form.submit()',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
)
|
||||
);
|
||||
|
||||
$filterTable->data[0][3] = __('Operating System');
|
||||
$filterTable->data[1][3] = html_print_select(
|
||||
$fields,
|
||||
'os',
|
||||
$os,
|
||||
'this.form.submit()',
|
||||
'All',
|
||||
0,
|
||||
true
|
||||
$filterTable->data[0][3] = html_print_label_input_block(
|
||||
__('Operating System'),
|
||||
html_print_select(
|
||||
$fields,
|
||||
'os',
|
||||
$os,
|
||||
'this.form.submit()',
|
||||
'All',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
)
|
||||
);
|
||||
|
||||
$filterTable->data[0][4] = __('Free search');
|
||||
$filterTable->data[0][4] .= ui_print_help_tip(
|
||||
__('Search filter by alias, name, description, IP address or custom fields content'),
|
||||
true
|
||||
);
|
||||
$filterTable->data[1][4] = html_print_input_text(
|
||||
'search',
|
||||
$search,
|
||||
'',
|
||||
12,
|
||||
255,
|
||||
true
|
||||
$filterTable->data[0][4] = html_print_label_input_block(
|
||||
__('Free search').ui_print_help_tip(
|
||||
__('Search filter by alias, name, description, IP address or custom fields content'),
|
||||
true
|
||||
),
|
||||
html_print_input_text(
|
||||
'search',
|
||||
$search,
|
||||
'',
|
||||
12,
|
||||
255,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$filterTable->cellstyle[1][5] = 'vertical-align: bottom';
|
||||
$filterTable->data[1][5] = html_print_submit_button(
|
||||
$filterTable->colspan[1][0] = 5;
|
||||
$filterTable->data[1][0] = html_print_submit_button(
|
||||
__('Filter'),
|
||||
'srcbutton',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'class' => 'float-right',
|
||||
'mode' => 'secondary mini',
|
||||
'class' => 'float-right mrgn_right_10px',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
// Print filter table.
|
||||
echo '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>';
|
||||
html_print_table($filterTable);
|
||||
echo '</form>';
|
||||
$form = '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>';
|
||||
ui_toggle(
|
||||
$form.html_print_table($filterTable, true).'</form>',
|
||||
'<span class="subsection_header_title">'.__('Filter').'</span>',
|
||||
__('Filter'),
|
||||
'filter',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content no_border',
|
||||
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
|
||||
// Data table.
|
||||
$selected = true;
|
||||
@ -765,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),
|
||||
],
|
||||
@ -837,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
|
||||
@ -856,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
|
||||
@ -878,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(
|
||||
|
@ -1071,30 +1071,53 @@ if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === tr
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
$modalCreateModule = '<form name="create_module_form" method="post">';
|
||||
$input_type = html_print_input_hidden('edit_module', 1, true);
|
||||
$input_type .= html_print_select(
|
||||
policies_type_modules_availables($sec2),
|
||||
'moduletype',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'max-width:300px;'
|
||||
// Form table for Module creation.
|
||||
$createModuleTable = new stdClass();
|
||||
$createModuleTable->id = 'module_creation_modal';
|
||||
$createModuleTable->class = 'filter-table-adv';
|
||||
$createModuleTable->data = [];
|
||||
|
||||
$createModuleTable->data[0][] = html_print_label_input_block(
|
||||
__('Select module type'),
|
||||
html_print_select(
|
||||
policies_type_modules_availables($sec2),
|
||||
'moduletype',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'max-width:300px;'
|
||||
)
|
||||
);
|
||||
|
||||
$modalCreateModule .= $input_type;
|
||||
$createModuleTable->data[1][] = html_print_label_input_block(
|
||||
'',
|
||||
html_print_anchor(
|
||||
[
|
||||
'href' => 'https://pandorafms.com/Library/Library/',
|
||||
'class' => 'color-black-grey invert_filter',
|
||||
'content' => __('Get more modules on Monitoring Library'),
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$createModuleFormTable = html_print_input_hidden('edit_module', 1, true);
|
||||
$createModuleFormTable .= html_print_table($createModuleTable, true);
|
||||
// Form definition.
|
||||
$modalCreateModule = '<form name="create_module_form" method="post">';
|
||||
$modalCreateModule .= $createModuleFormTable;
|
||||
$modalCreateModule .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'class' => 'action-buttons-right-forced',
|
||||
'content' => html_print_submit_button(
|
||||
__('Create'),
|
||||
'create_module',
|
||||
'modal_button_create',
|
||||
false,
|
||||
[
|
||||
'icon' => 'next',
|
||||
@ -1119,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,
|
||||
|
@ -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'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ $table_simple->rowclass['captions_module_n_type'] = 'field_half_width pdd_t_10px
|
||||
$table_simple->rowclass['module_n_type'] = 'field_half_width';
|
||||
$table_simple->data['captions_module_n_type'][0] = html_print_input_hidden('id_module_type_hidden', $id_module_type, true);
|
||||
$table_simple->data['captions_module_n_type'][0] .= __('Module group');
|
||||
$table_simple->data['captions_module_n_type'][1] = __('Type').ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help');
|
||||
$table_simple->data['captions_module_n_type'][1] = __('Type').ui_print_help_icon($help_type, true, '', '', '', 'module_type_help');
|
||||
// Module group and Type.
|
||||
$table_simple->rowclass['module_n_type'] = 'field_half_width';
|
||||
$table_simple->data['module_n_type'][0] .= html_print_select_from_sql(
|
||||
@ -444,79 +444,76 @@ $tableBasicThresholds->data = [];
|
||||
$tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width pdd_t_10px';
|
||||
$tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width';
|
||||
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').' ';
|
||||
if ($edit_module === false && (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['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['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>';
|
||||
|
||||
if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) {
|
||||
$basicThresholdsIntervalWarning = [];
|
||||
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
|
||||
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
|
||||
'warning_inverse_string',
|
||||
1,
|
||||
$warning_inverse,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$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->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
|
||||
);
|
||||
$basicThresholdsIntervalWarning = [];
|
||||
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
|
||||
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
|
||||
'warning_inverse_string',
|
||||
1,
|
||||
$warning_inverse,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
|
||||
$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->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['switch_warning_threshold'][0] .= html_print_div(
|
||||
@ -531,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').' ';
|
||||
if ($edit_module === false && (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 ($edit_module === false && 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';
|
||||
@ -621,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
|
||||
@ -1437,7 +1432,7 @@ if (isset($module_macros)) {
|
||||
$table_macros->data[$macro_count][2] = __('Value');
|
||||
$table_macros->data[$macro_count][3] = html_print_input_text('module_macro_values[]', $macro_value, '', 50, 60, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
|
||||
if (!$disabledBecauseInPolicy) {
|
||||
$table_macros->data[$macro_count][4] = '<a href="javascript: delete_macro('.$macro_count.');">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
|
||||
$table_macros->data[$macro_count][4] = '<a href="javascript: delete_macro('.$macro_count.');">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
}
|
||||
|
||||
$macro_count++;
|
||||
@ -1446,7 +1441,7 @@ if (isset($module_macros)) {
|
||||
}
|
||||
|
||||
if (!$disabledBecauseInPolicy) {
|
||||
$table_macros->data[$macro_count][0] = '<span>'.__('Custom macros').'</span> <a href="javascript:add_macro();">'.html_print_image('images/add.png', true, ['class' => 'invert_filter']).'</a>';
|
||||
$table_macros->data[$macro_count][0] = '<span>'.__('Custom macros').'</span> <a href="javascript:add_macro();">'.html_print_image('images/fail@svg.svg', true, ['style' => 'rotate:45deg', 'class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
|
||||
$table_macros->colspan[$macro_count][0] = 5;
|
||||
}
|
||||
@ -1460,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] .= " <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] = '';
|
||||
@ -1535,14 +1553,15 @@ $table_relations->data[-1][1] = '';
|
||||
$table_relations->data[-1][2] = '';
|
||||
$table_relations->data[-1][3] = '<a id="disable_updates_button" class="alpha50" href="">';
|
||||
$table_relations->data[-1][3] .= html_print_image(
|
||||
'images/lock_mc.png',
|
||||
true
|
||||
'images/policy@svg.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
).'</a>';
|
||||
$table_relations->data[-1][4] = '<a id="delete_relation_button" href="">';
|
||||
$table_relations->data[-1][4] .= html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
).'</a>';
|
||||
|
||||
|
||||
@ -1558,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(
|
||||
@ -1598,15 +1620,15 @@ if ($id_agent_module) {
|
||||
$table_relations->data[$relations_count][2] = ($module_relation['type'] === 'direct') ? __('Direct') : __('Failover');
|
||||
// Lock relationship updates.
|
||||
$table_relations->data[$relations_count][3] = '<a id="disable_updates_button" class="'.$disabled_update_class.'"href="javascript: change_lock_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image(
|
||||
'images/lock_mc.png',
|
||||
'images/policy@svg.svg',
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
).'</a>';
|
||||
// Delete relationship.
|
||||
$table_relations->data[$relations_count][4] = '<a id="delete_relation_button" href="javascript: delete_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
).'</a>';
|
||||
$relations_count++;
|
||||
}
|
||||
@ -1621,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();
|
||||
@ -1905,77 +1932,50 @@ $(document).ready (function () {
|
||||
|
||||
$('.switch_radio_button label').on('click', function(){
|
||||
var thisLabel = $(this).attr('for');
|
||||
$('#'+thisLabel).attr('checked', 'checked');
|
||||
$('#'+thisLabel).siblings().attr('checked', false);
|
||||
$('#'+thisLabel).prop('checked', true);
|
||||
$('#'+thisLabel).siblings().prop('checked', false);
|
||||
|
||||
if ($('#radius-warning_inverse').prop('checked') === true) {
|
||||
//$('#percentage_warning').hide();
|
||||
$("#svg_dinamic").show();
|
||||
}
|
||||
|
||||
if ($('#radius-critical_inverse').prop('checked') === true) {
|
||||
//$('#percentage_critical').hide();
|
||||
if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true) {
|
||||
$("#svg_dinamic").hide();
|
||||
} else {
|
||||
paint_graph_values();
|
||||
$("#svg_dinamic").show();
|
||||
}
|
||||
|
||||
if ($('#radius-percentage_warning').prop('checked') === true) {
|
||||
//$('#warning_inverse').hide();
|
||||
$("#svg_dinamic").hide();
|
||||
$('#radius-warning_inverse').hide();
|
||||
$('#label-radius-warning_inverse').hide();
|
||||
}
|
||||
|
||||
if ($('#radius-warning_inverse').prop('checked') === true) {
|
||||
$('#radius-percentage_warning').hide();
|
||||
$('#label-radius-percentage_warning').hide();
|
||||
}
|
||||
|
||||
if ($('#radius-normal_warning').prop('checked') === true) {
|
||||
$('#radius-warning_inverse').show();
|
||||
$('#label-radius-warning_inverse').show();
|
||||
$('#radius-percentage_warning').show();
|
||||
$('#label-radius-percentage_warning').show();
|
||||
}
|
||||
|
||||
|
||||
if ($('#radius-percentage_critical').prop('checked') === true) {
|
||||
//$('#critical_inverse').hide();
|
||||
$("#svg_dinamic").hide();
|
||||
$('#radius-critical_inverse').hide();
|
||||
$('#label-radius-critical_inverse').hide();
|
||||
}
|
||||
|
||||
$('#radius-warning_inverse').change (function() {
|
||||
paint_graph_values();
|
||||
if ($('#radius-warning_inverse').prop('checked') === true){
|
||||
$('#radius-percentage_warning').prop('checked', false);
|
||||
$('#percentage_warning').attr('onClick', 'return false;');
|
||||
$('#percentage_warning>em').addClass('color_666');
|
||||
} else {
|
||||
$('#percentage_warning').removeAttr('onClick');
|
||||
$('#percentage_warning>em').removeClass('color_666');
|
||||
}
|
||||
});
|
||||
if ($('#radius-critical_inverse').prop('checked') === true) {
|
||||
$('#radius-percentage_critical').hide();
|
||||
$('#label-radius-percentage_critical').hide();
|
||||
}
|
||||
|
||||
$('#radius-critical_inverse').change (function() {
|
||||
paint_graph_values();
|
||||
|
||||
if ($('#radius-critical_inverse').prop('checked') === true){
|
||||
$('#radius-percentage_critical').prop('checked', false);
|
||||
$('#percentage_critical').attr('onClick', 'return false;');
|
||||
$('#percentage_critical>em').addClass('color_666');
|
||||
} else {
|
||||
$('#percentage_critical').removeAttr('onClick');
|
||||
$('#percentage_critical>em').removeClass('color_666');
|
||||
}
|
||||
});
|
||||
|
||||
$('#radius-percentage_warning').change (function() {
|
||||
paint_graph_values();
|
||||
if ($('#radius-percentage_warning').prop('checked') === true){
|
||||
$('#radius-warning_inverse').prop('checked', false);
|
||||
$('#warning_inverse').attr('onClick', 'return false;');
|
||||
$('#warning_inverse>em').addClass('color_666');
|
||||
} else {
|
||||
$('#warning_inverse').removeAttr('onClick');
|
||||
$('#warning_inverse>em').removeClass('color_666');
|
||||
}
|
||||
});
|
||||
|
||||
$('#radius-percentage_critical').change (function() {
|
||||
paint_graph_values();
|
||||
if ($('#radius-percentage_critical').prop('checked') === true){
|
||||
$('#radius-critical_inverse').prop('checked', false);
|
||||
$('#critical_inverse').attr('onClick', 'return false;');
|
||||
$('#critical_inverse>em').addClass('color_666');
|
||||
} else {
|
||||
$('#critical_inverse').removeAttr('onClick');
|
||||
$('#critical_inverse>em').removeClass('color_666');
|
||||
}
|
||||
});
|
||||
if ($('#radius-normal_critical').prop('checked') === true) {
|
||||
$('#radius-critical_inverse').show();
|
||||
$('#label-radius-critical_inverse').show();
|
||||
$('#radius-percentage_critical').show();
|
||||
$('#label-radius-percentage_critical').show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -2035,7 +2035,7 @@ function change_modules_autocomplete_input () {
|
||||
var id_agent = parseInt($("#hidden-autocomplete_id_agent").val());
|
||||
var module_autocomplete = $("#module_autocomplete");
|
||||
var load_icon = '<?php html_print_image('images/spinner.gif', false); ?>';
|
||||
var error_icon = '<?php html_print_image('images/error_red.png', false); ?>';
|
||||
var error_icon = '<?php html_print_image('images/error-red@svg.svg', false, ['class' => 'main_menu_icon invert_filter']); ?>';
|
||||
if (!module_autocomplete.hasClass('working')) {
|
||||
module_autocomplete.addClass('working');
|
||||
module_autocomplete.html(load_icon);
|
||||
@ -2062,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');
|
||||
@ -2086,8 +2087,8 @@ function add_new_relation () {
|
||||
var button = $("#button-add_relation");
|
||||
var iconPlaceholder = $("#add_relation_status");
|
||||
var load_icon = '<?php html_print_image('images/spinner.gif', false, ['style' => 'vertical-align:middle;']); ?>';
|
||||
var suc_icon = '<?php html_print_image('images/ok.png', false, ['style' => 'vertical-align:middle;']); ?>';
|
||||
var error_icon = '<?php html_print_image('images/error_red.png', false, ['style' => 'vertical-align:middle;']); ?>';
|
||||
var suc_icon = '<?php html_print_image('images/validate.svg', false, ['class' => 'main_menu_icon invert_filter', 'style' => 'vertical-align:middle;']); ?>';
|
||||
var error_icon = '<?php html_print_image('images/error-red@svg.svg', false, ['class' => 'main_menu_icon invert_filter', 'style' => 'vertical-align:middle;']); ?>';
|
||||
|
||||
if (!button.hasClass('working')) {
|
||||
button.addClass('working');
|
||||
@ -2124,17 +2125,17 @@ 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/lock_mc.png', true, ['class' => 'invert_filter']); ?>' +
|
||||
'<?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/cross.png', true, ['class' => 'invert_filter']); ?>' +
|
||||
'<?php echo html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']); ?>' +
|
||||
'</a>' +
|
||||
'</td>' +
|
||||
'</tr>';
|
||||
@ -2234,91 +2235,66 @@ function validate_post_process() {
|
||||
}
|
||||
}
|
||||
|
||||
//function paint graph
|
||||
//function paint graph.
|
||||
function paint_graph_values(){
|
||||
//Parse integrer
|
||||
var min_w = parseFloat($('#text-min_warning').val());
|
||||
if(min_w == '0.00'){ min_w = 0; }
|
||||
var max_w = parseFloat($('#text-max_warning').val());
|
||||
if(max_w == '0.00'){ max_w = 0; }
|
||||
var min_c = parseFloat($('#text-min_critical').val());
|
||||
if(min_c =='0.00'){ min_c = 0; }
|
||||
var max_c = parseFloat($('#text-max_critical').val());
|
||||
if(max_c =='0.00'){ max_c = 0; }
|
||||
var inverse_w = $('input:radio[name=warning_inverse]:checked').val();
|
||||
if(!inverse_w){ inverse_w = 0; }
|
||||
var inverse_c = $('input:radio[name=critical_inverse]:checked').val();
|
||||
if(!inverse_c){ inverse_c = 0; }
|
||||
if(min_w == '0.00' || isNaN(min_w)){ min_w = 0; }
|
||||
|
||||
//inicialiced error
|
||||
var max_w = parseFloat($('#text-max_warning').val());
|
||||
if(max_w == '0.00' || isNaN(max_w)){ max_w = 0; }
|
||||
|
||||
var min_c = parseFloat($('#text-min_critical').val());
|
||||
if(min_c =='0.00' || isNaN(min_c)){ min_c = 0; }
|
||||
|
||||
var max_c = parseFloat($('#text-max_critical').val());
|
||||
if(max_c =='0.00' || isNaN(max_c)){ max_c = 0; }
|
||||
|
||||
var inverse_w = $('input:radio[value=warning_inverse]:checked').val();
|
||||
if(!inverse_w){ inverse_w = 0; }
|
||||
|
||||
var inverse_c = $('input:radio[value=critical_inverse]:checked').val();
|
||||
if(!inverse_c){ inverse_c = 0; }
|
||||
|
||||
//inicialiced error.
|
||||
var error_w = 0;
|
||||
var error_c = 0;
|
||||
//messages legend
|
||||
|
||||
//messages legend.
|
||||
var legend_normal = '<?php echo __('Normal Status'); ?>';
|
||||
var legend_warning = '<?php echo __('Warning Status'); ?>';
|
||||
var legend_critical = '<?php echo __('Critical Status'); ?>';
|
||||
//messages error
|
||||
|
||||
//messages error.
|
||||
var message_error_warning = '<?php echo __('Please introduce a maximum warning higher than the minimun warning'); ?>';
|
||||
var message_error_critical = '<?php echo __('Please introduce a maximum critical higher than the minimun critical'); ?>';
|
||||
var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>';
|
||||
|
||||
|
||||
//Percentage selector
|
||||
var percentage_w = $('#checkbox-percentage_warning').prop('checked');
|
||||
var percentage_c = $('#checkbox-percentage_critical').prop('checked');
|
||||
|
||||
if(percentage_w == true || percentage_c == true) {
|
||||
d3.select("#svg_dinamic rect").remove();
|
||||
//create svg
|
||||
var svg = d3.select("#svg_dinamic");
|
||||
svg.selectAll("g").remove();
|
||||
if (percentage_w === true) {
|
||||
if(max_w < 0 || min_w < 0) {
|
||||
paint_graph_status(0,0,0,0,0,0,1,0,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage);
|
||||
} else {
|
||||
$("#text-max_warning").removeClass("input_error");
|
||||
$("#text-min_warning").removeClass("input_error");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(percentage_c === true) {
|
||||
if(max_c < 0 || min_c < 0) {
|
||||
paint_graph_status(0,0,0,0,0,0,0,1,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage);
|
||||
} else {
|
||||
$("#text-min-critical").removeClass("input_error");
|
||||
$("#text-max_critical").removeClass("input_error");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
} else {
|
||||
$('#svg_dinamic').show();
|
||||
}
|
||||
|
||||
//if haven't error
|
||||
if(max_w == 0 || max_w > min_w){
|
||||
if(max_c == 0 || max_c > min_c){
|
||||
paint_graph_status(min_w, max_w, min_c, max_c, inverse_w,
|
||||
inverse_c, error_w, error_c,
|
||||
legend_normal, legend_warning, legend_critical,
|
||||
message_error_warning, message_error_critical);
|
||||
paint_graph_status(
|
||||
min_w, max_w, min_c, max_c, inverse_w,
|
||||
inverse_c, error_w, error_c,
|
||||
legend_normal, legend_warning, legend_critical,
|
||||
message_error_warning, message_error_critical
|
||||
);
|
||||
} else {
|
||||
error_c = 1;
|
||||
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
|
||||
legend_normal, legend_warning, legend_critical,
|
||||
message_error_warning, message_error_critical);
|
||||
paint_graph_status(
|
||||
0,0,0,0,0,0, error_w, error_c,
|
||||
legend_normal, legend_warning, legend_critical,
|
||||
message_error_warning, message_error_critical
|
||||
);
|
||||
}
|
||||
} else {
|
||||
error_w = 1;
|
||||
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
|
||||
legend_normal, legend_warning, legend_critical,
|
||||
message_error_warning, message_error_critical);
|
||||
paint_graph_status(
|
||||
0,0,0,0,0,0, error_w, error_c,
|
||||
legend_normal, legend_warning, legend_critical,
|
||||
message_error_warning, message_error_critical
|
||||
);
|
||||
}
|
||||
}
|
||||
/* End of relationship javascript */
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -1452,7 +1452,7 @@ $table->data['module'][1] = "
|
||||
<td class='cell_delete_button' style='text-align: right; width:10%;' id=''>".'<a class="link_delete"
|
||||
onclick="if(!confirm(\''.__('Are you sure?').'\')) return false;"
|
||||
href="">'.html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
|
@ -809,10 +809,10 @@ foreach ($commands as $command) {
|
||||
if (is_user_admin($config['id_user']) === true) {
|
||||
$data['action'] = '<span class="inline_flex">';
|
||||
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&copy_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset.'"
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).'</a>';
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
|
||||
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset_delete.'"
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
$data['action'] .= '</span>';
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -672,14 +672,14 @@ foreach ($simple_alerts as $alert) {
|
||||
'[…]',
|
||||
''
|
||||
);
|
||||
$data[2] .= ' <a class="template_details patatas"
|
||||
$data[2] .= ' <a class="template_details"
|
||||
href="'.ui_get_full_url(false, false, false, false).'ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$alert['id_alert_template'].'">';
|
||||
$data[2] .= html_print_image(
|
||||
'images/zoom.png',
|
||||
'images/details.svg',
|
||||
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> ';
|
||||
@ -753,11 +753,11 @@ foreach ($simple_alerts as $alert) {
|
||||
'delete',
|
||||
'images/delete.svg',
|
||||
1,
|
||||
'padding:0px; margin-left:5px; margin-right:5px;',
|
||||
'padding:0px; margin-left:5px; margin-right:5px; width: 22px;',
|
||||
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);
|
||||
@ -766,13 +766,13 @@ foreach ($simple_alerts as $alert) {
|
||||
$data[3] .= '</form>';
|
||||
$data[3] .= html_print_input_image(
|
||||
'update_action',
|
||||
'images/config.png',
|
||||
'images/edit.svg',
|
||||
1,
|
||||
'padding:0px;',
|
||||
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'].'\')',
|
||||
]
|
||||
);
|
||||
@ -913,7 +913,7 @@ foreach ($simple_alerts as $alert) {
|
||||
'enable',
|
||||
'images/lightbulb_off.png',
|
||||
1,
|
||||
'padding:0px',
|
||||
'padding:0px; width: 22px; height: 22px;',
|
||||
true,
|
||||
['class' => 'filter_none main_menu_icon']
|
||||
);
|
||||
@ -923,7 +923,7 @@ foreach ($simple_alerts as $alert) {
|
||||
'disable',
|
||||
'images/lightbulb.png',
|
||||
1,
|
||||
'padding:0px;',
|
||||
'padding:0px; width: 22px; height: 22px;',
|
||||
true,
|
||||
['class' => 'main_menu_icon']
|
||||
);
|
||||
@ -941,7 +941,7 @@ foreach ($simple_alerts as $alert) {
|
||||
'standby_off',
|
||||
'images/bell.png',
|
||||
1,
|
||||
'padding:0px;',
|
||||
'padding:0px; width: 22px; height: 22px;',
|
||||
true,
|
||||
['class' => 'invert_filter main_menu_icon']
|
||||
);
|
||||
@ -951,7 +951,7 @@ foreach ($simple_alerts as $alert) {
|
||||
'standby_on',
|
||||
'images/bell_pause.png',
|
||||
1,
|
||||
'padding:0px;',
|
||||
'padding:0px; width: 22px; height: 22px;',
|
||||
true,
|
||||
['class' => 'invert_filter main_menu_icon']
|
||||
);
|
||||
@ -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] .= ' <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] .= ' <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>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1053,7 +1055,7 @@ foreach ($simple_alerts as $alert) {
|
||||
$data[4] .= '<form class="view_alert_form display_in" method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_view">';
|
||||
$data[4] .= html_print_input_image(
|
||||
'view_alert',
|
||||
'images/operation.png',
|
||||
'images/details.svg',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
|
@ -478,17 +478,17 @@ if ($standbyoff_alert) {
|
||||
|
||||
|
||||
$searchFlag = true;
|
||||
if (!is_metaconsole()) {
|
||||
if (is_metaconsole() === false) {
|
||||
// The tabs will be shown only with manage alerts permissions
|
||||
if (check_acl($config['id_user'], 0, 'LW') || check_acl($config['id_user'], 0, 'LM')) {
|
||||
$buttons = [
|
||||
'list' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('List alerts'), 'class' => 'invert_filter']).'</a>',
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/logs@svg.svg', true, ['title' => __('List alerts'), 'class' => 'main_menu_icon invert_filter']).'</a>',
|
||||
],
|
||||
'builder' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">'.html_print_image('images/pencil.png', true, ['title' => __('Builder alert'), 'class' => 'invert_filter']).'</a>',
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">'.html_print_image('images/edit.svg', true, ['title' => __('Builder alert'), 'class' => 'main_menu_icon invert_filter']).'</a>',
|
||||
],
|
||||
];
|
||||
|
||||
@ -497,44 +497,48 @@ if (!is_metaconsole()) {
|
||||
$buttons = '';
|
||||
}
|
||||
|
||||
if ($tab == 'list') {
|
||||
ui_print_standard_header(
|
||||
__('Alerts'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Manage alerts'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('List'),
|
||||
],
|
||||
]
|
||||
);
|
||||
} else {
|
||||
ui_print_standard_header(
|
||||
__('Alerts'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Manage alerts'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Create'),
|
||||
],
|
||||
]
|
||||
);
|
||||
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' => __('List'),
|
||||
],
|
||||
]
|
||||
);
|
||||
} else {
|
||||
ui_print_standard_header(
|
||||
__('Alerts'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Manage alerts'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Create'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
alerts_meta_print_header();
|
||||
|
@ -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) {
|
||||
@ -450,7 +450,7 @@ foreach ($templates as $template) {
|
||||
$data[4] .= html_print_input_hidden('source_id', $template['id'], true);
|
||||
$data[4] .= html_print_input_image(
|
||||
'dup',
|
||||
'images/copy.png',
|
||||
'images/copy.svg',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
|
@ -61,13 +61,19 @@ if ($default_action != 0) {
|
||||
}
|
||||
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
ui_print_standard_header(
|
||||
__('Alert details'),
|
||||
'images/op_alerts.png',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
''
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Alerts'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// TABLE DETAILS.
|
||||
|
@ -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(
|
||||
|
@ -262,10 +262,7 @@ if ($is_management_allowed === true) {
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
),
|
||||
[
|
||||
'type' => 'form_action',
|
||||
'right_content' => $tablePagination,
|
||||
]
|
||||
[ 'right_content' => $tablePagination ]
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
69
pandora_console/godmode/consoles/consoles.php
Normal file
69
pandora_console/godmode/consoles/consoles.php
Normal 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,
|
||||
]
|
||||
);
|
@ -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>';
|
||||
|
@ -778,7 +778,7 @@ $table->data[12][0] = html_print_label_input_block(
|
||||
if (!is_metaconsole()) {
|
||||
$table->data[12][1] = html_print_label_input_block(
|
||||
__('Module search'),
|
||||
'<div class="w100p">'.html_print_autocomplete_modules(
|
||||
'<div class="w100p module-search">'.html_print_autocomplete_modules(
|
||||
'module_search',
|
||||
$text_module,
|
||||
false,
|
||||
|
@ -59,6 +59,14 @@ if ($delete) {
|
||||
}
|
||||
|
||||
if ($result !== false) {
|
||||
db_process_sql_delete(
|
||||
'tfavmenu_user',
|
||||
[
|
||||
'id_element' => $id_filter,
|
||||
'section' => 'Events',
|
||||
'id_user' => $config['id_user'],
|
||||
]
|
||||
);
|
||||
$result = true;
|
||||
} else {
|
||||
$result = false;
|
||||
@ -186,7 +194,7 @@ foreach ($filters as $filter) {
|
||||
) {
|
||||
$table->cellclass[][6] = 'table_action_buttons';
|
||||
$data[6] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'href='index.php?sec=geventos&sec2=godmode/events/events§ion=filter&delete=1&id=".$filter['id_filter'].'&offset=0&pure='.$config['pure']."'>".html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
|
@ -295,7 +295,8 @@ foreach ($extensions as $file => $extension) {
|
||||
$data[] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file,
|
||||
'image' => 'images/cross.png',
|
||||
'image' => 'images/delete.svg',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'title' => __('Delete'),
|
||||
'onClick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
|
||||
],
|
||||
|
@ -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>';
|
||||
|
||||
@ -698,11 +710,11 @@ echo '</form>';
|
||||
<td><a id="delete_row" href="none">
|
||||
<?php
|
||||
html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
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/cross.png', 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/cross.png', 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/config.png', true, ['class' => 'invert_filter']); ?></a>');
|
||||
var $removeBtn = $('<a class="delete_row" href="javascript:;"><?php echo html_print_image('images/cross.png', 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); ?>;
|
||||
|
@ -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%';
|
||||
|
@ -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,
|
||||
@ -714,6 +714,14 @@ if ($is_management_allowed === true
|
||||
);
|
||||
|
||||
if ($result && (!$usedGroup['return'])) {
|
||||
db_process_sql_delete(
|
||||
'tfavmenu_user',
|
||||
[
|
||||
'id_element' => $id_group,
|
||||
'section' => 'Groups',
|
||||
'id_user' => $config['id_user'],
|
||||
]
|
||||
);
|
||||
ui_print_success_message(__('Group successfully deleted'));
|
||||
} else {
|
||||
ui_print_error_message(
|
||||
@ -733,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 {
|
||||
/*
|
||||
@ -898,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 {
|
||||
@ -907,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'];
|
||||
}
|
||||
@ -918,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']),
|
||||
],
|
||||
@ -979,7 +985,7 @@ if ($tab == 'tree') {
|
||||
true,
|
||||
'offset',
|
||||
false,
|
||||
'pagination-bottom'
|
||||
''
|
||||
);
|
||||
} else {
|
||||
ui_print_info_message(
|
||||
@ -1031,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();
|
||||
|
@ -72,8 +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' => 'Groups',
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -181,7 +187,7 @@ try {
|
||||
[
|
||||
'id' => 'list_agents_tactical',
|
||||
'class' => 'info_table',
|
||||
'style' => 'width: 100%',
|
||||
'style' => 'width: 99%',
|
||||
'columns' => $columns,
|
||||
'column_names' => $columnNames,
|
||||
'return' => true,
|
||||
@ -190,6 +196,7 @@ try {
|
||||
'method' => 'getAgentsByGroup',
|
||||
'id_group' => $id_group,
|
||||
],
|
||||
'dom_elements' => 'lpfti',
|
||||
'no_sortable_columns' => [-1],
|
||||
'order' => [
|
||||
'field' => 'alias',
|
||||
|
@ -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>';
|
||||
|
||||
|
@ -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>';
|
||||
|
||||
|
@ -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>';
|
||||
|
||||
|
@ -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>';
|
||||
|
||||
|
@ -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>';
|
||||
|
||||
|
@ -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>';
|
||||
|
@ -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>';
|
||||
|
||||
|
@ -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>';
|
||||
|
||||
|
@ -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>';
|
||||
|
||||
|
@ -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>';
|
||||
|
@ -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>';
|
||||
|
||||
|
@ -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>';
|
||||
|
||||
|
@ -556,7 +556,7 @@ echo sprintf(
|
||||
);
|
||||
echo '</div>';
|
||||
|
||||
attachActionButton('edit_users', 'update', '100%');
|
||||
attachActionButton('edit_users', 'update', '100%', false, $SelectAction);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
|
@ -216,11 +216,11 @@ if ($option == '') {
|
||||
|
||||
$alertstab = [
|
||||
'text' => '<a href="'.$url.'&tab=massive_alerts">'.html_print_image(
|
||||
'images/bell.png',
|
||||
'images/alert@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Alerts operations'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $tab == 'massive_alerts',
|
||||
@ -228,11 +228,11 @@ $alertstab = [
|
||||
|
||||
$userstab = [
|
||||
'text' => '<a href="'.$url.'&tab=massive_users">'.html_print_image(
|
||||
'images/user.png',
|
||||
'images/user.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Users operations'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $tab == 'massive_users',
|
||||
@ -240,11 +240,11 @@ $userstab = [
|
||||
|
||||
$agentstab = [
|
||||
'text' => '<a href="'.$url.'&tab=massive_agents">'.html_print_image(
|
||||
'images/agent.png',
|
||||
'images/agents@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Agents operations'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $tab == 'massive_agents',
|
||||
@ -252,11 +252,11 @@ $agentstab = [
|
||||
|
||||
$modulestab = [
|
||||
'text' => '<a href="'.$url.'&tab=massive_modules">'.html_print_image(
|
||||
'images/module.png',
|
||||
'images/modules@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Modules operations'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $tab == 'massive_modules',
|
||||
@ -264,11 +264,11 @@ $modulestab = [
|
||||
|
||||
$pluginstab = [
|
||||
'text' => '<a href="'.$url.'&tab=massive_plugins">'.html_print_image(
|
||||
'images/plugin.png',
|
||||
'images/plugins@svg.svg',
|
||||
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').' » '.$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':
|
||||
|
@ -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§ion=net']['text'] = __('Netflow');
|
||||
$sub2['godmode/setup/setup§ion=net']['refr'] = 0;
|
||||
}
|
||||
|
||||
if ((bool) $config['activate_sflow'] === true) {
|
||||
$sub2['godmode/setup/setup§ion=sflow']['text'] = __('Sflow');
|
||||
$sub2['godmode/setup/setup§ion=sflow']['refr'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$sub2['godmode/setup/setup§ion=ehorus']['text'] = __('eHorus');
|
||||
@ -383,6 +395,9 @@ if ($access_console_node === true) {
|
||||
$sub2['godmode/setup/setup§ion=external_tools']['text'] = __('External Tools');
|
||||
$sub2['godmode/setup/setup§ion=external_tools']['refr'] = 0;
|
||||
|
||||
$sub2['godmode/setup/setup§ion=welcome_tips']['text'] = __('Welcome Tips');
|
||||
$sub2['godmode/setup/setup§ion=welcome_tips']['refr'] = 0;
|
||||
|
||||
if ((bool) $config['activate_gis'] === true) {
|
||||
$sub2['godmode/setup/setup§ion=gis']['text'] = __('Map conections GIS');
|
||||
}
|
||||
|
@ -45,18 +45,18 @@ if (! check_acl($config['id_user'], 0, 'AR')) {
|
||||
if (check_acl($config['id_user'], 0, 'PM') && enterprise_installed()) {
|
||||
$buttons['setup'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=general&sec2=godmode/setup/setup&section=module_library">'.html_print_image('images/gm_setup.png', true, ['title' => __('Setup'), 'class' => 'invert_filter']).'</a>',
|
||||
'text' => '<a href="index.php?sec=general&sec2=godmode/setup/setup&section=module_library">'.html_print_image('images/configuration@svg.svg', true, ['title' => __('Setup'), 'class' => 'main_menu_icon invert_filter']).'</a>',
|
||||
];
|
||||
}
|
||||
|
||||
$buttons['categories'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gmodule_library&sec2=godmode/module_library/module_library_view&tab=categories">'.html_print_image('images/list.png', true, ['title' => __('Categories'), 'class' => 'invert_filter']).'</a>',
|
||||
'text' => '<a href="index.php?sec=gmodule_library&sec2=godmode/module_library/module_library_view&tab=categories">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Categories'), 'class' => 'main_menu_icon invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
$buttons['view'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gmodule_library&sec2=godmode/module_library/module_library_view">'.html_print_image('images/eye_show.png', true, ['title' => __('View'), 'class' => 'invert_filter']).'</a>',
|
||||
'text' => '<a href="index.php?sec=gmodule_library&sec2=godmode/module_library/module_library_view">'.html_print_image('images/see-details@svg.svg', true, ['title' => __('View'), 'class' => 'main_menu_icon invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user