Merge branch 'develop' into 'ent-4289-8282-RWORKS-Poder-escoger-el-servidor-que-ejecute-una-CronJob'

# Conflicts:
#   pandora_console/extras/mr/62.sql
This commit is contained in:
Alejandro Campos 2023-03-28 14:09:33 +00:00
commit e909686ddc
347 changed files with 15184 additions and 10823 deletions

View File

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

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # 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, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (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 # 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 # 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 # Foundation; either version 2 of the Licence or any later version

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,11 +19,11 @@
<choice id="com.pandorafms.pandorafms_src" visible="false"> <choice id="com.pandorafms.pandorafms_src" visible="false">
<pkg-ref id="com.pandorafms.pandorafms_src"/> <pkg-ref id="com.pandorafms.pandorafms_src"/>
</choice> </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"> <choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/> <pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
</choice> </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()" /> <!-- <installation-check script="check()" />
<script> <script>
<![CDATA[ <![CDATA[

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # 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, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,21 +6,22 @@
# #
# (c) A. Kevin Rojas <kevin.rojas@pandorafms.com> # (c) A. Kevin Rojas <kevin.rojas@pandorafms.com>
# #
# Edited in 2023 by Alejandro Sánchez <alejandro.sanchez@pandorafms.com>
#
# TO DO LIST: # TO DO LIST:
# - Enable child services detection (Windows) # - Enable child services detection (Windows)
# - Make CPU/Memory usage available for child services (Windows) # - Make CPU/Memory usage available for child services (Windows)
# #
################################################### ###################################################
try: try:
from sys import argv from sys import argv
from sys import stderr from sys import stderr
from sys import exit from sys import exit
import psutil
from subprocess import Popen from subprocess import Popen
from subprocess import PIPE from subprocess import PIPE
from subprocess import DEVNULL from subprocess import DEVNULL
from subprocess import getstatusoutput from subprocess import getstatusoutput
import psutil
except ModuleNotFoundError as err: except ModuleNotFoundError as err:
print("{} error: {}. Exiting...".format(argv[0], err), file=stderr) print("{} error: {}. Exiting...".format(argv[0], err), file=stderr)
exit(1) exit(1)
@ -28,99 +29,100 @@ except ModuleNotFoundError as err:
module_list = [] module_list = []
VERSION = "1.2" VERSION = "1.2"
def win_service(servicelist, option=False, memcpu=False):
######################################################################################### modules_default = []
# Powershell class modules_percentage=[]
######################################################################################### ## take all services
class PSCheck: services=psutil.win_service_iter()
@staticmethod for service in services:
def check_service(servicename, option=False, memcpu=False): if service.name() in servicelist:
"""Check services with powershell by parsing their DisplayName. Returns a dict\ serv=service.as_dict()
list with the name of the service and a boolean with its status.\n if serv['status']=='running':
Requires service name (case insensitive).""" value=1
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})
else: else:
return (None) value=0
@staticmethod ## create module for each service
def getchildren(servicename, memcpu=False): parent = build_module("Service " + str(serv['name']) + " - Status", value,"generic_proc")
"""Gets Dependent services of a given Windows service""" modules_default +=parent
pschild = Popen(["powershell", "Get-Service", "-Name '" + str(servicename) +
"' -DS", "|", "Select-Object", "-ExpandProperty", "Name"], # memory and cpu percentage
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True) if memcpu:
children = pschild.communicate()[0].strip() ## process
kids = [] srv_pid = service.pid()
for child in (children.split("\n") if children != "" else []): process = psutil.Process(srv_pid)
status = PSCheck.getstatus(child) proc_name = process.name()
kids += service_module(str(child), status, "Service " + str(servicename) + " - Status") ##cpu
if status: value_cpu=process.cpu_percent(interval=0.5)
if memcpu: parent = build_module("Service " + str(proc_name) + " - CPU usage", value_cpu,"generic_data")
kidsusage = get_memcpu(str(child)) parent[0].update([("unit","%"),("module_parent",str(serv['name']))])
for usage in kidsusage: modules_percentage +=parent
kids += usage ##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: else:
next next
return kids 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)
@staticmethod for m in modules:
def getstatus(servicename): print_module(m, 1)
"""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
######################################################################################### def build_module(name, value, module_type, parent=None):
# Services creation
#########################################################################################
def service_module(name, value, parent=None):
#print ("service_module BEGIN "+str(now(0,1))) #print ("service_module BEGIN "+str(now(0,1)))
module = [{ module = [{
"name" : "Service "+ name + " - Status", "name" : name ,
"type" : "generic_proc", "type" : module_type,
"value" : value, "value" : value,
"module_parent" : parent, "module_parent" : parent,
}] }]
@ -167,74 +169,6 @@ def proc_percentbyname(procname): ############# 03/03/2020
next next
#print ("proc_percentbyname END "+str(now(0,1))) #print ("proc_percentbyname END "+str(now(0,1)))
return [sum(memory),sum(cpu)] 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 # print_module function
######################################################################################### #########################################################################################
@ -356,6 +290,7 @@ def main():
service_list = ["MySQL", "postgresql", "pgsql", "oracle", "MSSQL", "IISADMIN", service_list = ["MySQL", "postgresql", "pgsql", "oracle", "MSSQL", "IISADMIN",
"apache", "nginx", "W3svc", "NTDS", "Netlogon", "DNS", "MSExchangeADTopology", "apache", "nginx", "W3svc", "NTDS", "Netlogon", "DNS", "MSExchangeADTopology",
"MSExchangeServiceHost", "MSExchangeSA", "MSExchangeTransport"] "MSExchangeServiceHost", "MSExchangeSA", "MSExchangeTransport"]
discover(OS, service_list) discover(OS, service_list)
elif psutil.LINUX: elif psutil.LINUX:
OS = "Linux" OS = "Linux"

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (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 # 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 # 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 # Foundation; either version 2 of the Licence or any later version

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -115,11 +115,11 @@ function pandora_files_repo_godmode()
} }
// Header tabs. // 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['godmode'] = 1;
$godmode['active'] = 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; $operation['operation'] = 1;
$onheader = [ $onheader = [
@ -226,10 +226,10 @@ function pandora_files_repo_operation()
// Header tabs. // Header tabs.
$onheader = []; $onheader = [];
if (check_acl($config['id_user'], 0, 'PM')) { 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; $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['operation'] = 1;
$operation['active'] = 1; $operation['active'] = 1;
@ -240,7 +240,28 @@ function pandora_files_repo_operation()
} }
// Header. // 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.'/'; $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php'; include_once $full_extensions_dir.'files_repo/functions_files_repo.php';

View File

@ -133,9 +133,12 @@ if (!empty($files)) {
); );
$data[4] .= "<a href=\"$config_url\">"; $data[4] .= "<a href=\"$config_url\">";
$data[4] .= html_print_image( $data[4] .= html_print_image(
'images/config.png', 'images/edit.svg',
true, true,
['title' => __('Edit')] [
'title' => __('Edit'),
'class' => 'main_menu_icon invert_filter',
]
); );
// Edit image // Edit image
$data[4] .= '</a>'; $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] .= " <a href=\"$delete_url\" onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\">";
$data[4] .= html_print_image( $data[4] .= html_print_image(
'images/cross.png', 'images/delete.svg',
true, true,
[ [
'title' => __('Delete'), 'title' => __('Delete'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
); );
// Delete image // Delete image

View File

@ -140,25 +140,26 @@ function quickShell()
ui_print_error_message(__('WebService engine has not been started, please check documentation.')); ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
$wiz->printForm( $wiz->printForm(
[ [
'form' => [ 'form' => [
'method' => 'POST', 'method' => 'POST',
'action' => '#', 'action' => '#',
], 'id' => 'retry_form',
'inputs' => [
[
'class' => 'w100p',
'arguments' => [
'name' => 'submit',
'label' => __('Retry'),
'type' => 'submit',
'attributes' => ['icon' => 'next'],
'return' => true,
],
],
], ],
] ]
); );
html_print_action_buttons(
html_print_submit_button(
__('Retry'),
'submit',
false,
[
'icon' => 'next',
'form' => 'retry_form',
],
true
)
);
return; return;
} }
@ -168,6 +169,7 @@ function quickShell()
'action' => '#', 'action' => '#',
'class' => 'wizard', 'class' => 'wizard',
'method' => 'post', 'method' => 'post',
'id' => 'connect_form',
], ],
'inputs' => [ 'inputs' => [
[ [
@ -198,19 +200,24 @@ function quickShell()
'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);", 'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);",
], ],
], ],
[
'arguments' => [
'type' => 'submit',
'label' => __('Connect'),
'attributes' => ['icon' => 'cog'],
],
],
], ],
], ],
false, false,
true true
); );
html_print_action_buttons(
html_print_submit_button(
__('Connect'),
'submit',
false,
[
'icon' => 'cog',
'form' => 'connect_form',
],
true
)
);
return; return;
} }
@ -434,84 +441,95 @@ function quickShellSettings()
} }
// Form. Using old style. // Form. Using old style.
echo '<fieldset>'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Quickshell').'</legend>'; echo '<legend>'.__('Quickshell').'</legend>';
$t = new StdClass(); $t = new StdClass();
$t->data = []; $t->data = [];
$t->width = '100%'; $t->width = '100%';
$t->class = 'databox filters'; $t->class = 'filter-table-adv';
$t->data = []; $t->data = [];
$t->style = []; $t->style = [];
$t->style[0] = 'font-weight: bold; width: 40%;'; $t->style[0] = 'width: 50%;';
$t->data[0][0] = __('Gotty path'); $t->data[0][] = html_print_label_input_block(
$t->data[0][1] = html_print_input_text( __('Gotty path'),
'gotty', html_print_input_text(
$config['gotty'], 'gotty',
'', $config['gotty'],
30, '',
100, 30,
true 100,
true
)
); );
$t->data[1][0] = __('Gotty host'); $t->data[0][] = html_print_label_input_block(
$t->data[1][1] = html_print_input_text( __('Gotty host'),
'gotty_host', html_print_input_text(
$config['gotty_host'], 'gotty_host',
'', $config['gotty_host'],
30, '',
100, 30,
true 100,
true
)
); );
$t->data[2][0] = __('Gotty ssh port'); $t->data[1][] = html_print_label_input_block(
$t->data[2][1] = html_print_input_text( __('Gotty ssh port'),
'gotty_ssh_port', html_print_input_text(
$config['gotty_ssh_port'], 'gotty_ssh_port',
'', $config['gotty_ssh_port'],
30, '',
100, 30,
true 100,
true
)
); );
$t->data[3][0] = __('Gotty telnet port'); $t->data[1][] = html_print_label_input_block(
$t->data[3][1] = html_print_input_text( __('Gotty telnet port'),
'gotty_telnet_port', html_print_input_text(
$config['gotty_telnet_port'], 'gotty_telnet_port',
'', $config['gotty_telnet_port'],
30, '',
100, 30,
true 100,
true
)
); );
$hidden = new StdClass(); $hidden = new stdClass();
$hidden->data = []; $hidden->data = [];
$hidden->width = '100%'; $hidden->width = '100%';
$hidden->class = 'databox filters'; $hidden->class = 'filter-table-adv';
$hidden->data = []; $hidden->data = [];
$hidden->style[0] = 'font-weight: bold;width: 40%;'; $hidden->style[0] = 'width: 50%;';
$hidden->data[0][0] = __('Gotty user'); $hidden->data[0][] = html_print_label_input_block(
$hidden->data[0][1] = html_print_input_text( __('Gotty user'),
'gotty_user', html_print_input_text(
$config['gotty_user'], 'gotty_user',
'', $config['gotty_user'],
30, '',
100, 30,
true 100,
true
)
); );
$hidden->data[1][0] = __('Gotty password'); $hidden->data[0][] = html_print_label_input_block(
$hidden->data[1][1] = html_print_input_password( __('Gotty password'),
'gotty_pass', html_print_input_password(
io_output_password($config['gotty_pass']), 'gotty_pass',
'', io_output_password($config['gotty_pass']),
30, '',
100, 30,
true 100,
true
)
); );
$hidden->data[1][1] .= ui_print_reveal_password('gotty_pass', true);
html_print_table($t); html_print_table($t);

View File

@ -14,6 +14,15 @@ CREATE TABLE IF NOT EXISTS `tconsole` (
ALTER TABLE `tuser_task_scheduled` ADD COLUMN `id_console` BIGINT NOT NULL DEFAULT 0; 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` = '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` = 'solaris@os.svg' WHERE `id_os` = 2;
UPDATE tconfig_os SET `icon_name` = 'aix@os.svg' WHERE `id_os` = 3; UPDATE tconfig_os SET `icon_name` = 'aix@os.svg' WHERE `id_os` = 3;
@ -169,4 +178,17 @@ INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`, `filename`, `path`) VALUES
(20, 'zoom_en_graficas.png', 'images/tips/'), (20, 'zoom_en_graficas.png', 'images/tips/'),
(22, 'politica_de_pass.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; COMMIT;

View File

@ -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"'; $search_bar .= '<input id="keywords" name="keywords"';
if (!isset($config['search_keywords'])) { if (!isset($config['search_keywords'])) {
$search_bar .= "value='".__('Enter keywords to search')."'"; $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 .= "value='".$config['search_keywords']."'";
} }
$search_bar .= 'type="search" onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" $search_bar .= 'type="search" onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" onkeyup="showinterpreter()" class="search_input"/>';
onkeyup="showinterpreter()" class="search_input"/>';
$search_bar .= '<div id="result_order" class="result_order"></div>';
// $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"';
$search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />"; $search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />";
$search_bar .= '</form>'; $search_bar .= '</form>';
$header_searchbar = '<div id="header_searchbar">'.$search_bar.'</div>'; $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. // User.
// $headerUserImage = (is_user_admin($config['id_user']) === true) ? 'images/header_user_admin_green.png' : 'images/header_user_green.png';
$headerUser = []; $headerUser = [];
$headerUser[] = html_print_image( $headerUser[] = html_print_image(
'images/edit_user@header.svg', 'images/edit_user@header.svg',

View File

@ -27,10 +27,27 @@ require_once __DIR__.'/../include/functions_ui.php';
require_once __DIR__.'/../include/functions.php'; require_once __DIR__.'/../include/functions.php';
require_once __DIR__.'/../include/functions_html.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']) { if ($config['visual_animation']) {
// form#login_form, div.login_data {
echo '<style> echo '<style>
div.container_login { div.container_login {
animation: container_login 3s ease; animation: container_login 3s ease;
} }
@ -120,7 +137,13 @@ if (empty($config['background_opacity']) === false) {
$opacity = 30; $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. // Get alternative custom in case of db fail.
$custom_fields = [ $custom_fields = [
@ -147,7 +170,7 @@ foreach ($custom_fields as $field) {
$docs_logo = ui_get_docs_logo(); $docs_logo = ui_get_docs_logo();
$support_logo = ui_get_support_logo(); $support_logo = ui_get_support_logo();
echo '<div id="login_body" '.$login_body_style.'>'; 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>'; echo '<div id="list_icon_docs_support"><ul>';
@ -185,12 +208,12 @@ echo '</div>';
echo '<div class="container_login">'; echo '<div class="container_login">';
echo '<div class="login_page">'; 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.'">'; echo '<a href="'.$logo_link.'">';
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
if (!isset($config['custom_logo_login'])) { if (!isset($config['custom_logo_login'])) {
html_print_image( html_print_image(
'enterprise/images/custom_logo_login/login_logo.png', 'enterprise/images/custom_logo_login/Pandora-FMS-1.png',
false, false,
[ [
'class' => 'login_logo', 'class' => 'login_logo',
@ -215,13 +238,13 @@ if (is_metaconsole() === true) {
} }
} else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { } else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (!isset($config['custom_logo_login'])) { 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 { } 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); 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 { } else {
if (empty($config['custom_logo_login']) === true) { 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 { } 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); 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>'; echo '</div>';
} else { } else {
echo '<div class="login_nick">'; echo '<div class="login_nick '.$style_theme.'">';
html_print_input_text_extended( html_print_input_text_extended(
'nick', 'nick',
'', '',
@ -307,10 +330,11 @@ switch ($login_screen) {
'', '',
false, false,
'', '',
'autocomplete="off" placeholder="'.__('User').'"' 'autocomplete="off" class="input" placeholder=" "'
); );
echo '<label for="nick" class="placeholder">'.__('User').'</label>';
echo '</div>'; echo '</div>';
echo '<div class="login_pass">'; echo '<div class="login_pass '.$style_theme.'">';
html_print_input_text_extended( html_print_input_text_extended(
'pass', 'pass',
'', '',
@ -320,20 +344,18 @@ switch ($login_screen) {
'', '',
false, false,
'', '',
'autocomplete="off" placeholder="'.__('Password').'"', 'autocomplete="off" class="input " placeholder=" " style="background-image: url(images/enable.svg);"',
false, false,
true true
); );
echo '<label for="pass" class="placeholder">'.__('Password').'</label>';
echo '</div>'; echo '</div>';
echo '<div class="login_button">'; echo '<div class="login_button">';
html_print_submit_button( html_print_submit_button(
__('Login'), __('Let&#39;s go'),
'login_button', 'login_button',
false, false,
[ ['fixed_id' => 'submit-login_button']
'fixed_id' => 'submit-login_button',
'icon' => 'signin',
]
); );
echo '</div>'; 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>';
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>';
echo '<div class="login_button">'; echo '<div class="login_button">';
// html_print_submit_button(__('Check code').'&nbsp;&nbsp;>', 'login_button', false, 'class="next_login"'); // html_print_submit_button(__('Check code').'&nbsp;&nbsp;>', 'login_button', false, 'class="next_login"');
html_print_submit_button(__('Check code').'&nbsp;&nbsp;>', 'login_button', false, [ 'fixed_id' => 'submit-login_button', 'class' => 'next_login']); html_print_submit_button(
__('Check code'),
'login_button',
false,
[
'fixed_id' => 'submit-login_button',
'class' => 'next_login',
]
);
echo '</div>'; echo '</div>';
break; break;
@ -425,78 +468,79 @@ html_print_csrf_hidden();
echo '</form></div>'; echo '</form></div>';
echo '<div class="login_data">'; 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 class ="text_banner_login">';
echo '<div><span class="span1">'; echo '<div><span class="span1">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title1_login']) { if ($config['custom_title1_login']) {
echo io_safe_output($config['custom_title1_login']); echo io_safe_output($config['custom_title1_login']);
} else { } else {
echo __('WELCOME TO %s', get_product_name()); echo __('ONE TOOL TO RULE THEM ALL');
} }
} else { } else {
echo __('WELCOME TO %s', get_product_name()); echo __('ONE TOOL TO RULE THEM ALL');
} }
echo '</span></div>'; echo '</span></div>';
echo '<div><span class="span2">'; echo '<div><span class="span2">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title2_login']) { if ($config['custom_title2_login']) {
echo io_safe_output($config['custom_title2_login']); echo io_safe_output($config['custom_title2_login']);
} else {
echo __('NEXT GENERATION');
} }
} else {
echo __('NEXT GENERATION');
} }
echo '</span></div>'; echo '</span></div>';
echo '</div>'; echo '</div>';
echo '<div class ="img_banner_login">'; echo '</div>';
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 '</div>'; echo '</div>';
echo '</div>'; echo '</div>';

View File

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

View File

@ -61,79 +61,110 @@ ui_print_warning_message(
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filter-table-adv mrgn_top_15px pdd_t_0px_important';
$table->data = []; $table->data = [];
$table->cellpadding = 0; $table->cellpadding = 0;
$table->cellspacing = 0; $table->cellspacing = 0;
$table->head[0] = __('Agent position'); $table->head[0] = __('Agent position');
$table->head_colspan[0] = 4; $table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align:center'; $table->headstyle[0] = 'text-align:center';
$table->style[0] = 'font-weight: bold; '; $table->size[0] = '50%';
$table->style[2] = 'font-weight: bold; '; $table->size[2] = '50%';
$table->data[1][0] = __('Latitude: '); $table->data[1][0] = html_print_label_input_block(
$table->data[1][1] = html_print_input_text_extended( __('Latitude: '),
'latitude', html_print_input_text_extended(
$agentData['stored_latitude'], 'latitude',
'text-latitude', $agentData['stored_latitude'],
'', 'text-latitude',
20, '',
20, 20,
false, 20,
'', false,
[ '',
'onchange' => 'setIgnoreGISDataEnabled()', [
'onkeyup' => 'setIgnoreGISDataEnabled()', 'onchange' => 'setIgnoreGISDataEnabled()',
], 'onkeyup' => 'setIgnoreGISDataEnabled()',
true ],
true
)
); );
$table->data[1][2] = __('Longitude: '); $table->data[1][1] = html_print_label_input_block(
$table->data[1][3] = html_print_input_text_extended( __('Longitude: '),
'longitude', html_print_input_text_extended(
$agentData['stored_longitude'], 'longitude',
'text-longitude', $agentData['stored_longitude'],
'', 'text-longitude',
20, '',
20, 20,
false, 20,
'', false,
[ '',
'onchange' => 'setIgnoreGISDataEnabled()', [
'onkeyup' => 'setIgnoreGISDataEnabled()', 'onchange' => 'setIgnoreGISDataEnabled()',
], 'onkeyup' => 'setIgnoreGISDataEnabled()',
true ],
true
)
); );
$table->data[2][0] = __('Altitude: '); $table->data[2][0] = html_print_label_input_block(
$table->data[2][1] = html_print_input_text_extended( __('Altitude: '),
'altitude', html_print_input_text_extended(
$agentData['stored_altitude'], 'altitude',
'text-altitude', $agentData['stored_altitude'],
'', 'text-altitude',
10, '',
10, 10,
false, 10,
'', false,
[ '',
'onchange' => 'setIgnoreGISDataEnabled()', [
'onkeyup' => 'setIgnoreGISDataEnabled()', 'onchange' => 'setIgnoreGISDataEnabled()',
], 'onkeyup' => 'setIgnoreGISDataEnabled()',
true ],
true
)
); );
$table->data[2][2] = __('Ignore new GIS data:'); $table->data[2][1] = html_print_label_input_block(
$table->data[2][3] = __('Yes').' '.html_print_radio_button_extended('update_gis_data', 0, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true); __('Ignore new GIS data: '),
$table->data[2][3] .= __('No').' '.html_print_radio_button_extended('update_gis_data', 1, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true); '<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; $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_input_hidden('update_gis', 1);
html_print_table($table); html_print_table($table);
echo '<div class="action-buttons float-left" style="width: '.$table->width.';">'; html_print_action_buttons(
html_print_submit_button(__('Update'), '', false, 'class="sub upd"'); html_print_submit_button(
echo '</div>'; __('Update'),
'',
false,
['icon' => 'wand'],
true
)
);
echo '</form>'; echo '</form>';
?> ?>
<script type="text/javascript"> <script type="text/javascript">

View File

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

View File

@ -196,29 +196,52 @@ foreach ($nps as $row) {
$filterTable = new stdClass(); $filterTable = new stdClass();
$filterTable->width = '100%'; $filterTable->width = '100%';
$filterTable->class = 'fixed_filter_bar'; $filterTable->class = 'filter-table-adv';
$filterTable->size[0] = '100%';
$filterTable->data = []; $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[0][0] = html_print_label_input_block(
$filterTable->data[1][1] = html_print_div( __('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', 'class' => 'float-right',
'content' => html_print_submit_button( 'icon' => 'wand',
__('Assign'), 'mode' => 'mini',
'crt',
false,
[
'icon' => 'wand',
'mode' => 'secondary mini',
],
true
),
], ],
true 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 = '<form 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 .= 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>'; $outputFilterTable .= '</form>';
echo $outputFilterTable; echo $outputFilterTable;

View File

@ -808,7 +808,7 @@ if ($id_agente) {
$pure = (int) get_parameter('pure'); $pure = (int) get_parameter('pure');
if ($pure === 0) { if ($pure === 0) {
ui_print_standard_header( ui_print_standard_header(
__('Agent setup view'), __('Agent setup view').' ( '.strtolower(agents_get_alias($id_agente)).' )',
'images/agent.png', 'images/agent.png',
false, false,
$helper, $helper,

View File

@ -57,14 +57,33 @@ if ($id_field) {
$combo_values = $field['combo_values'] ? $field['combo_values'] : ''; $combo_values = $field['combo_values'] ? $field['combo_values'] : '';
$is_combo_enable = $config['is_combo_enable']; $is_combo_enable = $config['is_combo_enable'];
$is_link_enabled = $field['is_link_enabled']; $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 { } else {
ui_print_page_header(__('Create agent custom field'), 'images/custom_field.png', false, '', true, ''); $header_title = __('Create agent custom field');
} }
$table = new stdClass(); ui_print_standard_header(
$table->class = 'databox'; $header_title,
$table->id = 'configure_field'; '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 "<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>'; 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 "<p class='center bolder'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
echo '</div>'; 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 = [];
$table->data[0][0] = __('Name'); $table->data[0][0] = html_print_label_input_block(
$table->data[1][0] = html_print_input_text( __('Name'),
'name', html_print_input_text(
$name, 'name',
'', $name,
35, '',
100, 35,
true 100,
true
)
); );
$table->data[2][0] = __('Pass type').ui_print_help_tip( $table->data[0][1] = html_print_label_input_block(
__('The fields with pass type enabled will be displayed like html input type pass in html'), __('Display on front').ui_print_help_tip(
true __('The fields with display on front enabled will be displayed into the agent details'),
); 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'), html_print_checkbox_switch(
true 'display_on_front',
); 1,
$table->data[2][2] = __('Link type'); $display_on_front,
true
$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[1][0] = html_print_label_input_block(
$table->cellstyle[4][1] = 'display: none;'; __('Link type'),
$table->cellstyle[5][1] = 'display: none;'; html_print_checkbox_switch_extended(
'is_link_enabled',
$table->data[4][1] = __('Combo values').ui_print_help_tip( 1,
__('Set values separated by comma'), $is_link_enabled,
true false,
); '',
$table->data[5][1] = html_print_textarea( '',
'combo_values', true
3, )
65,
io_safe_output($combo_values),
'',
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); html_print_table($table);
if ($id_field > 0) { if ($id_field > 0) {
@ -195,64 +230,66 @@ echo '</form>';
$(document).ready (function () { $(document).ready (function () {
if($('input[type=hidden][name=update_field]').val() == 1 && $('#textarea_combo_values').val() != ''){ if($('input[type=hidden][name=update_field]').val() == 1 && $('#textarea_combo_values').val() != ''){
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true); $('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) { $('input[type=checkbox][name=is_password_type]').change(function (e) {
dialog_message("#message_set_password"); dialog_message("#message_set_password");
$('input[type=checkbox][name=is_password_type]').prop('checked', false); $('input[type=checkbox][name=is_password_type]').prop('checked', false);
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true); $('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show(); $('#configure_field-3').show();
e.preventDefault(); 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)){ $('input[type=checkbox][name=is_combo_enable]').change(function (e) {
dialog_message("#message_set_combo"); if($('#textarea_combo_values').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true); dialog_message("#message_set_combo");
$('#configure_field-4').show(); $('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
e.preventDefault(); $('#configure_field-3').show();
} e.preventDefault();
}); }
});
} else {
$('#configure_field-3').hide();
} }
if ($('input[type=checkbox][name=is_link_enabled]').is(":checked") === true) { if ($('input[type=checkbox][name=is_link_enabled]').is(":checked") === true) {
$('#configure_field-1').hide(); $('#configure_field-2').hide();
$('#configure_field-3').hide();
} else { } else {
$('#configure_field-1').show(); $('#configure_field-2').show();
$('#configure_field-3').show();
} }
$('input[type=checkbox][name=is_link_enabled]').change(function () { $('input[type=checkbox][name=is_link_enabled]').change(function () {
if( $(this).is(":checked") ){ if( $('input[type=checkbox][name=is_link_enabled]').prop('checked') ){
$('#configure_field-1').hide(); $('#configure_field-2').hide();
$('#configure_field-3').hide(); $('#configure_field-3').hide();
} else{ } else{
$('#configure_field-1').show(); $('#configure_field-2').show();
$('#configure_field-3').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 () { $('input[type=checkbox][name=is_combo_enable]').change(function () {
if( $(this).is(":checked") ){ if( $('input[type=checkbox][name=is_combo_enable]').prop('checked') ){
$('#configure_field-4').show(); $('#configure_field-3').show();
dialog_message("#message_no_set_password"); dialog_message("#message_no_set_password");
$('#configure_field-1').hide(); $('#configure_field-1').hide();
$('#configure_field-5').hide();
} }
else{ else{
$('#configure_field-4').hide(); $('#configure_field-3').hide();
$('#configure_field-1').show(); $('#configure_field-1').show();
$('#configure_field-5').show();
} }
}); });
$('input[type=checkbox][name=is_password_type]').change(function () { $('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"); dialog_message("#message_no_set_combo");
$('#configure_field-3').hide(); $('#configure_field-3').hide();
$('#configure_field-5').hide();
} }
else{ else{
$('#configure_field-3').show(); if($('input[type=checkbox][name=is_combo_enable]').prop('checked') === true) {
$('#configure_field-5').show(); $('#configure_field-3').show();
}
} }
}); });
}); });

View File

@ -174,7 +174,7 @@ foreach ($fields as $field) {
$data[1] = $field['name']; $data[1] = $field['name'];
$data[2] = html_print_image( $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, true,
['class' => 'main_menu_icon invert_filter'] ['class' => 'main_menu_icon invert_filter']
); );

View File

@ -180,14 +180,26 @@ if ($load_inventory_module) {
$form_buttons = ''; $form_buttons = '';
if ($load_inventory_module) { if ($load_inventory_module) {
$form_buttons .= html_print_input_hidden('id_agent_module_inventory', $id_agent_module_inventory, true); $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 { } 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( echo ui_get_inventory_module_add_form(
'index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente, '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, $load_inventory_module,
$id_os, $id_os,
$target, $target,
@ -213,10 +225,10 @@ if (db_get_num_rows($sql) == 0) {
} else { } else {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox info_table max_floating_element_size';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
$table->styleTable = 'margin-top: 20px;'; $table->styleTable = '';
$table->head[0] = "<span title='".__('Policy')."'>".__('P.').'</span>'; $table->head[0] = "<span title='".__('Policy')."'>".__('P.').'</span>';
$table->head[1] = __('Name'); $table->head[1] = __('Name');
$table->head[2] = __('Description'); $table->head[2] = __('Description');
@ -235,7 +247,7 @@ if (db_get_num_rows($sql) == 0) {
if ($id_policy) { if ($id_policy) {
$policy = policies_get_policy($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] = '<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>'; $data[0] .= '</a>';
} else { } else {
$data[0] = ''; $data[0] = '';
@ -247,15 +259,15 @@ if (db_get_num_rows($sql) == 0) {
$data[4] = human_time_description_raw($row['interval']); $data[4] = human_time_description_raw($row['interval']);
// Delete module // 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] = '<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>&nbsp;&nbsp;'; $data[5] .= '</b></a>&nbsp;&nbsp;';
// Update module // 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] .= '<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>&nbsp;&nbsp;'; $data[5] .= '</b></a>&nbsp;&nbsp;';
// Force refresh module // 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] .= '<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); array_push($table->data, $data);
} }

View File

@ -302,93 +302,122 @@ foreach ($pre_fields as $key => $value) {
// Filter table. // Filter table.
$filterTable = new stdClass(); $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->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[0][0] = html_print_label_input_block(
$filterTable->data[1][0] = html_print_select_groups( __('Group'),
false, html_print_select_groups(
'AR', false,
$return_all_group, 'AR',
'ag_group', $return_all_group,
$ag_group, 'ag_group',
'this.form.submit();', $ag_group,
'', 'this.form.submit();',
0, '',
true, 0,
false, true,
true, false,
'', true,
false '',
false
)
); );
$filterTable->data[0][1] = __('Recursion'); $filterTable->data[0][1] = html_print_label_input_block(
$filterTable->data[1][1] = html_print_checkbox_switch( __('Recursion'),
'recursion', '<div class="mrgn_top_10px">'.html_print_checkbox_switch(
1, 'recursion',
$recursion, 1,
true, $recursion,
false, true,
'this.form.submit()' false,
'this.form.submit()'
).'</div>'
); );
$filterTable->data[0][2] = __('Show agents'); $filterTable->data[0][2] = html_print_label_input_block(
$filterTable->data[1][2] = html_print_select( __('Show agents'),
$showAgentFields, html_print_select(
'disabled', $showAgentFields,
$disabled, 'disabled',
'this.form.submit()', $disabled,
'', 'this.form.submit()',
0, '',
true 0,
true,
false,
true,
'w100p',
false,
'width: 100%'
)
); );
$filterTable->data[0][3] = __('Operating System'); $filterTable->data[0][3] = html_print_label_input_block(
$filterTable->data[1][3] = html_print_select( __('Operating System'),
$fields, html_print_select(
'os', $fields,
$os, 'os',
'this.form.submit()', $os,
'All', 'this.form.submit()',
0, 'All',
true 0,
true,
false,
true,
'w100p',
false,
'width: 100%'
)
); );
$filterTable->data[0][4] = __('Free search'); $filterTable->data[0][4] = html_print_label_input_block(
$filterTable->data[0][4] .= ui_print_help_tip( __('Free search').ui_print_help_tip(
__('Search filter by alias, name, description, IP address or custom fields content'), __('Search filter by alias, name, description, IP address or custom fields content'),
true true
); ),
$filterTable->data[1][4] = html_print_input_text( html_print_input_text(
'search', 'search',
$search, $search,
'', '',
12, 12,
255, 255,
true true
)
); );
$filterTable->cellstyle[1][5] = 'vertical-align: bottom'; $filterTable->colspan[1][0] = 5;
$filterTable->data[1][5] = html_print_submit_button( $filterTable->data[1][0] = html_print_submit_button(
__('Filter'), __('Filter'),
'srcbutton', 'srcbutton',
false, false,
[ [
'icon' => 'search', 'icon' => 'search',
'class' => 'float-right', 'class' => 'float-right mrgn_right_10px',
'mode' => 'secondary mini', 'mode' => 'mini',
], ],
true true
); );
// Print filter table. // Print filter table.
echo '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>'; $form = '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>';
html_print_table($filterTable); ui_toggle(
echo '</form>'; $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. // Data table.
$selected = true; $selected = true;
@ -765,7 +794,7 @@ if ($agents !== false) {
// Agent name column (1). Agent name. // Agent name column (1). Agent name.
$agentNameColumn = html_print_anchor( $agentNameColumn = html_print_anchor(
[ [
'href' => ui_get_full_url($agentNameUrl), 'href' => ui_get_full_url($agentViewUrl),
'title' => $agent['nombre'], 'title' => $agent['nombre'],
'content' => ui_print_truncate_text($agent['alias'], 'agent_medium').implode('', $additionalDataAgentName), 'content' => ui_print_truncate_text($agent['alias'], 'agent_medium').implode('', $additionalDataAgentName),
], ],
@ -837,7 +866,6 @@ if ($agents !== false) {
// Operating System icon column. // Operating System icon column.
$osIconColumn = html_print_div( $osIconColumn = html_print_div(
[ [
'class' => 'main_menu_icon invert_filter',
'content' => ui_print_os_icon($agent['id_os'], false, true), 'content' => ui_print_os_icon($agent['id_os'], false, true),
], ],
true true
@ -856,7 +884,6 @@ if ($agents !== false) {
// Group icon and name column. // Group icon and name column.
$agentGroupIconColumn = html_print_div( $agentGroupIconColumn = html_print_div(
[ [
'class' => 'main_menu_icon invert_filter',
'content' => ui_print_group_icon($agent['id_grupo'], true), 'content' => ui_print_group_icon($agent['id_grupo'], true),
], ],
true true
@ -878,12 +905,12 @@ if ($agents !== false) {
$agentDisableEnableTitle = __('Enable agent'); $agentDisableEnableTitle = __('Enable agent');
$agentDisableEnableAction = 'enable_agent'; $agentDisableEnableAction = 'enable_agent';
$agentDisableEnableCaption = __('You are going to enable a cluster agent. Are you sure?'); $agentDisableEnableCaption = __('You are going to enable a cluster agent. Are you sure?');
$agentDisableEnableIcon = 'change-pause.svg'; $agentDisableEnableIcon = 'change-active.svg';
} else { } else {
$agentDisableEnableTitle = __('Disable agent'); $agentDisableEnableTitle = __('Disable agent');
$agentDisableEnableAction = 'disable_agent'; $agentDisableEnableAction = 'disable_agent';
$agentDisableEnableCaption = __('You are going to disable a cluster agent. Are you sure?'); $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( $agentActionButtons[] = html_print_menu_button(

View File

@ -1071,30 +1071,53 @@ if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === tr
echo '</form>'; echo '</form>';
} }
$modalCreateModule = '<form name="create_module_form" method="post">'; // Form table for Module creation.
$input_type = html_print_input_hidden('edit_module', 1, true); $createModuleTable = new stdClass();
$input_type .= html_print_select( $createModuleTable->id = 'module_creation_modal';
policies_type_modules_availables($sec2), $createModuleTable->class = 'filter-table-adv';
'moduletype', $createModuleTable->data = [];
'',
'', $createModuleTable->data[0][] = html_print_label_input_block(
'', __('Select module type'),
'', html_print_select(
true, policies_type_modules_availables($sec2),
false, 'moduletype',
false, '',
'', '',
false, '',
'max-width:300px;' '',
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( $modalCreateModule .= html_print_div(
[ [
'class' => 'action-buttons', 'class' => 'action-buttons-right-forced',
'content' => html_print_submit_button( 'content' => html_print_submit_button(
__('Create'), __('Create'),
'create_module', 'modal_button_create',
false, false,
[ [
'icon' => 'next', 'icon' => 'next',
@ -1119,7 +1142,6 @@ html_print_div(
<script type="text/javascript"> <script type="text/javascript">
function create_module_dialog(){ function create_module_dialog(){
console.log('Entra');
$('#modal').dialog({ $('#modal').dialog({
title: '<?php echo __('Create Module'); ?>', title: '<?php echo __('Create Module'); ?>',
resizable: true, resizable: true,

View File

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

View File

@ -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->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] = 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'][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. // Module group and Type.
$table_simple->rowclass['module_n_type'] = 'field_half_width'; $table_simple->rowclass['module_n_type'] = 'field_half_width';
$table_simple->data['module_n_type'][0] .= html_print_select_from_sql( $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['caption_warning_threshold'] = 'field_half_width pdd_t_10px';
$tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width'; $tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').'&nbsp;'; $tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').'&nbsp;';
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( $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(
html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'), 'min_warning',
html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'), $min_warning,
html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'), '',
], 10,
[ 'class' => 'margin-top-10' ], 255,
true 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) { $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_switch_radio_button(
$basicThresholdsIntervalWarning = []; [
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>'; html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'),
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch( html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'),
'warning_inverse_string', html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'),
1, ],
$warning_inverse, [ 'class' => 'margin-top-10' ],
true, true
$disabledBecauseInPolicy );
);
$tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width'; $basicThresholdsIntervalWarning = [];
$tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div( $basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
[ $basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
'class' => 'margin-top-10', 'warning_inverse_string',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;', 1,
'content' => implode('', $basicThresholdsIntervalWarning), $warning_inverse,
], true,
true $disabledBecauseInPolicy
); );
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>'; $tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text( $tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div(
'str_warning', [
str_replace('"', '', $str_warning), 'class' => 'margin-top-10',
'', 'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
10, 'content' => implode('', $basicThresholdsIntervalWarning),
1024, ],
true, true
$disabledBecauseInPolicy || $edit === false, );
false,
'', $tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>';
$classdisabledBecauseInPolicy $tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
).'</span>'; 'str_warning',
} str_replace('"', '', $str_warning),
'',
10,
1024,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div( $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['caption_critical_threshold'] = 'field_half_width pdd_t_10px';
$tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width'; $tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').'&nbsp;'; $tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').'&nbsp;';
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['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>'; $tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text( 'min_critical',
'min_critical', $min_critical,
$min_critical, '',
'', 10,
10, 255,
255, true,
true, $disabledBecauseInPolicy || $edit === false,
$disabledBecauseInPolicy || $edit === false, false,
false, '',
'', $classdisabledBecauseInPolicy
$classdisabledBecauseInPolicy );
); $tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text(
$tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text( 'max_critical',
'max_critical', $max_critical,
$max_critical, '',
'', 10,
10, 255,
255, true,
true, $disabledBecauseInPolicy || $edit === false,
$disabledBecauseInPolicy || $edit === false, false,
false, '',
'', $classdisabledBecauseInPolicy
$classdisabledBecauseInPolicy ).'</span>';
).'</span>';
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch_radio_button( $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', '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', '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'), html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), $percentage_critical, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'),
], ],
[ 'class' => 'margin-top-10' ], [ 'class' => 'margin-top-10' ],
true 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'; $basicThresholdsIntervalCritical = [];
$tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div( $basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
[ $basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
'class' => 'margin-top-10', 'critical_inverse_string',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;', 1,
'content' => implode('', $basicThresholdsIntervalCritical), $critical_inverse,
], true,
true $disabledBecauseInPolicy
); );
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div( $tableBasicThresholds->rowclass['caption_switch_critical_inverse_string'] = 'field_half_width';
[ $tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div(
'id' => 'percentage_critical', [
'content' => $divPercentageContent, 'class' => 'margin-top-10',
], 'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
true 'content' => implode('', $basicThresholdsIntervalCritical),
); ],
true
);
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>'; $tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div(
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text( [
'str_critical', 'id' => 'percentage_critical',
str_replace('"', '', $str_critical), 'content' => $divPercentageContent,
'', ],
10, true
1024, );
true,
$disabledBecauseInPolicy, $tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>';
false, $tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'', 'str_critical',
$classdisabledBecauseInPolicy str_replace('"', '', $str_critical),
); '',
} 10,
1024,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
);
$table_simple->rowstyle['thresholds_table'] = 'margin-top: 15px;height: 340px;width: 100%'; $table_simple->rowstyle['thresholds_table'] = 'margin-top: 15px;height: 340px;width: 100%';
$table_simple->cellclass['thresholds_table'][0] = 'table_section half_section_left'; $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->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'); $table_simple->data['caption_historical_data'][0] = __('Historical data');
if ($disabledBecauseInPolicy) { if ($disabledBecauseInPolicy) {
// If is disabled, we send a hidden in his place and print a false // 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][2] = __('Value');
$table_macros->data[$macro_count][3] = html_print_input_text('module_macro_values[]', $macro_value, '', 50, 60, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy); $table_macros->data[$macro_count][3] = html_print_input_text('module_macro_values[]', $macro_value, '', 50, 60, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
if (!$disabledBecauseInPolicy) { 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++; $macro_count++;
@ -1446,7 +1441,7 @@ if (isset($module_macros)) {
} }
if (!$disabledBecauseInPolicy) { 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; $table_macros->colspan[$macro_count][0] = 5;
} }
@ -1460,17 +1455,14 @@ html_print_input_hidden('module_macro_count', $macro_count);
$table_new_relations = new stdClass(); $table_new_relations = new stdClass();
$table_new_relations->id = 'module_new_relations'; $table_new_relations->id = 'module_new_relations';
$table_new_relations->width = '100%'; $table_new_relations->width = '100%';
$table_new_relations->class = 'no-class'; $table_new_relations->class = 'no-class filter-table-adv';
$table_new_relations->data = []; $table_new_relations->data = [];
$table_new_relations->style = []; $table_new_relations->style = [];
$table_new_relations->style[0] = 'width: 10%; font-weight: bold;'; $table_new_relations->size[0] = '25%';
$table_new_relations->style[1] = 'width: 25%; text-align: center;'; $table_new_relations->size[1] = '25%';
$table_new_relations->style[2] = 'width: 10%; font-weight: bold;'; $table_new_relations->size[2] = '25%';
$table_new_relations->style[3] = 'width: 25%; text-align: center;'; $table_new_relations->size[3] = '25%';
$table_new_relations->style[4] = 'width: 10%; font-weight: bold;';
$table_new_relations->style[5] = 'width: 25%; text-align: center;';
$table_new_relations->data[0][0] = __('Agent');
$params = []; $params = [];
$params['return'] = true; $params['return'] = true;
$params['show_helptip'] = true; $params['show_helptip'] = true;
@ -1479,36 +1471,50 @@ $params['use_hidden_input_idagent'] = true;
$params['print_hidden_input_idagent'] = true; $params['print_hidden_input_idagent'] = true;
$params['hidden_input_idagent_id'] = 'hidden-autocomplete_id_agent'; $params['hidden_input_idagent_id'] = 'hidden-autocomplete_id_agent';
$params['javascript_function_action_after_select_js_call'] = 'change_modules_autocomplete_input();'; $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][0] = html_print_label_input_block(
$table_new_relations->data[0][2] = __('Module'); __('Agent'),
$table_new_relations->data[0][3] = "<div id='module_autocomplete'></div>"; ui_print_agent_autocomplete_input($params)
);
$table_new_relations->data[0][1] = html_print_label_input_block(
__('Module'),
"<div id='module_autocomplete'></div>"
);
$array_rel_type = []; $array_rel_type = [];
$array_rel_type['direct'] = __('Direct'); $array_rel_type['direct'] = __('Direct');
$array_rel_type['failover'] = __('Failover'); $array_rel_type['failover'] = __('Failover');
$table_new_relations->data[0][4] = __('Rel. type');
$table_new_relations->data[0][5] = html_print_select( $table_new_relations->data[0][2] = html_print_label_input_block(
$array_rel_type, __('Rel. type'),
'relation_type', html_print_select(
'', $array_rel_type,
'', 'relation_type',
'', '',
0, '',
true, '',
false, 0,
true, true,
'' false,
true,
''
)
); );
$table_new_relations->data[0][6] = html_print_button( $table_new_relations->data[0][3] = html_print_label_input_block(
__('Add relationship'), '&nbsp;',
'add_relation', '<div class="inline_line">'.html_print_button(
false, __('Add relationship'),
'javascript: add_new_relation();', 'add_relation',
'class="sub add"', false,
true 'javascript: add_new_relation();',
[
'class' => 'w150px secondary',
'icon' => 'plus',
],
true
)."<div id='add_relation_status' class='inline_line'></div></div>"
); );
$table_new_relations->data[0][6] .= "&nbsp;&nbsp;<div id='add_relation_status' class='inline_line'></div>";
// Relationship list. // Relationship list.
$table_relations = new stdClass(); $table_relations = new stdClass();
@ -1535,14 +1541,15 @@ $table_relations->data[-1][1] = '';
$table_relations->data[-1][2] = ''; $table_relations->data[-1][2] = '';
$table_relations->data[-1][3] = '<a id="disable_updates_button" class="alpha50" href="">'; $table_relations->data[-1][3] = '<a id="disable_updates_button" class="alpha50" href="">';
$table_relations->data[-1][3] .= html_print_image( $table_relations->data[-1][3] .= html_print_image(
'images/lock_mc.png', 'images/policy@svg.svg',
true true,
['class' => 'main_menu_icon invert_filter']
).'</a>'; ).'</a>';
$table_relations->data[-1][4] = '<a id="delete_relation_button" href="">'; $table_relations->data[-1][4] = '<a id="delete_relation_button" href="">';
$table_relations->data[-1][4] .= html_print_image( $table_relations->data[-1][4] .= html_print_image(
'images/cross.png', 'images/delete.svg',
true, true,
['class' => 'invert_filter'] ['class' => 'main_menu_icon invert_filter']
).'</a>'; ).'</a>';
@ -1598,15 +1605,15 @@ if ($id_agent_module) {
$table_relations->data[$relations_count][2] = ($module_relation['type'] === 'direct') ? __('Direct') : __('Failover'); $table_relations->data[$relations_count][2] = ($module_relation['type'] === 'direct') ? __('Direct') : __('Failover');
// Lock relationship updates. // 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( $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, true,
['class' => 'invert_filter'] ['class' => 'main_menu_icon invert_filter']
).'</a>'; ).'</a>';
// Delete relationship. // 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( $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, true,
['class' => 'invert_filter'] ['class' => 'main_menu_icon invert_filter']
).'</a>'; ).'</a>';
$relations_count++; $relations_count++;
} }
@ -1621,6 +1628,11 @@ ui_require_jquery_file('json');
/* <![CDATA[ */ /* <![CDATA[ */
$(document).ready (function () { $(document).ready (function () {
var disabledBecauseInPolicy = <?php echo '\''.((empty($disabledBecauseInPolicy) === true) ? '0' : '1').'\''; ?>; 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 () { $("#right").click (function () {
jQuery.each($("select[name='id_tag_available[]'] option:selected"), function (key, value) { jQuery.each($("select[name='id_tag_available[]'] option:selected"), function (key, value) {
tag_name = $(value).html(); tag_name = $(value).html();
@ -1905,77 +1917,50 @@ $(document).ready (function () {
$('.switch_radio_button label').on('click', function(){ $('.switch_radio_button label').on('click', function(){
var thisLabel = $(this).attr('for'); var thisLabel = $(this).attr('for');
$('#'+thisLabel).attr('checked', 'checked'); $('#'+thisLabel).prop('checked', true);
$('#'+thisLabel).siblings().attr('checked', false); $('#'+thisLabel).siblings().prop('checked', false);
if ($('#radius-warning_inverse').prop('checked') === true) { if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true) {
//$('#percentage_warning').hide(); $("#svg_dinamic").hide();
$("#svg_dinamic").show(); } else {
} paint_graph_values();
if ($('#radius-critical_inverse').prop('checked') === true) {
//$('#percentage_critical').hide();
$("#svg_dinamic").show(); $("#svg_dinamic").show();
} }
if ($('#radius-percentage_warning').prop('checked') === true) { if ($('#radius-percentage_warning').prop('checked') === true) {
//$('#warning_inverse').hide(); $('#radius-warning_inverse').hide();
$("#svg_dinamic").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) { if ($('#radius-percentage_critical').prop('checked') === true) {
//$('#critical_inverse').hide(); $('#radius-critical_inverse').hide();
$("#svg_dinamic").hide(); $('#label-radius-critical_inverse').hide();
} }
$('#radius-warning_inverse').change (function() { if ($('#radius-critical_inverse').prop('checked') === true) {
paint_graph_values(); $('#radius-percentage_critical').hide();
if ($('#radius-warning_inverse').prop('checked') === true){ $('#label-radius-percentage_critical').hide();
$('#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');
}
});
$('#radius-critical_inverse').change (function() { if ($('#radius-normal_critical').prop('checked') === true) {
paint_graph_values(); $('#radius-critical_inverse').show();
$('#label-radius-critical_inverse').show();
if ($('#radius-critical_inverse').prop('checked') === true){ $('#radius-percentage_critical').show();
$('#radius-percentage_critical').prop('checked', false); $('#label-radius-percentage_critical').show();
$('#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');
}
});
}); });
@ -2035,7 +2020,7 @@ function change_modules_autocomplete_input () {
var id_agent = parseInt($("#hidden-autocomplete_id_agent").val()); var id_agent = parseInt($("#hidden-autocomplete_id_agent").val());
var module_autocomplete = $("#module_autocomplete"); var module_autocomplete = $("#module_autocomplete");
var load_icon = '<?php html_print_image('images/spinner.gif', false); ?>'; 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')) { if (!module_autocomplete.hasClass('working')) {
module_autocomplete.addClass('working'); module_autocomplete.addClass('working');
module_autocomplete.html(load_icon); module_autocomplete.html(load_icon);
@ -2086,8 +2071,8 @@ function add_new_relation () {
var button = $("#button-add_relation"); var button = $("#button-add_relation");
var iconPlaceholder = $("#add_relation_status"); var iconPlaceholder = $("#add_relation_status");
var load_icon = '<?php html_print_image('images/spinner.gif', false, ['style' => 'vertical-align:middle;']); ?>'; 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 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.png', false, ['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')) { if (!button.hasClass('working')) {
button.addClass('working'); button.addClass('working');
@ -2129,12 +2114,12 @@ function add_new_relation () {
'<td id="module_relations-' + relationsCount + '-2">' + relation_type + '</td>' + '<td id="module_relations-' + relationsCount + '-2">' + relation_type + '</td>' +
'<td id="module_relations-' + relationsCount + '-3" class="w10p center">' + '<td id="module_relations-' + relationsCount + '-3" class="w10p center">' +
'<a id="disable_updates_button" class="alpha50" href="javascript: change_lock_relation(' + relationsCount + ', ' + data + ');">' + '<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>' + '</a>' +
'</td>' + '</td>' +
'<td id="module_relations-' + relationsCount + '-4" class="w10p center">' + '<td id="module_relations-' + relationsCount + '-4" class="w10p center">' +
'<a id="delete_relation_button" href="javascript: delete_relation(' + relationsCount + ', ' + data + ');">' + '<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>' + '</a>' +
'</td>' + '</td>' +
'</tr>'; '</tr>';
@ -2234,91 +2219,66 @@ function validate_post_process() {
} }
} }
//function paint graph //function paint graph.
function paint_graph_values(){ function paint_graph_values(){
//Parse integrer
var min_w = parseFloat($('#text-min_warning').val()); var min_w = parseFloat($('#text-min_warning').val());
if(min_w == '0.00'){ min_w = 0; } if(min_w == '0.00' || isNaN(min_w)){ 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; }
//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_w = 0;
var error_c = 0; var error_c = 0;
//messages legend
//messages legend.
var legend_normal = '<?php echo __('Normal Status'); ?>'; var legend_normal = '<?php echo __('Normal Status'); ?>';
var legend_warning = '<?php echo __('Warning Status'); ?>'; var legend_warning = '<?php echo __('Warning Status'); ?>';
var legend_critical = '<?php echo __('Critical 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_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_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'); ?>'; 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 haven't error
if(max_w == 0 || max_w > min_w){ if(max_w == 0 || max_w > min_w){
if(max_c == 0 || max_c > min_c){ if(max_c == 0 || max_c > min_c){
paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, paint_graph_status(
inverse_c, error_w, error_c, min_w, max_w, min_c, max_c, inverse_w,
legend_normal, legend_warning, legend_critical, inverse_c, error_w, error_c,
message_error_warning, message_error_critical); legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical
);
} else { } else {
error_c = 1; error_c = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c, paint_graph_status(
legend_normal, legend_warning, legend_critical, 0,0,0,0,0,0, error_w, error_c,
message_error_warning, message_error_critical); legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical
);
} }
} else { } else {
error_w = 1; error_w = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c, paint_graph_status(
legend_normal, legend_warning, legend_critical, 0,0,0,0,0,0, error_w, error_c,
message_error_warning, message_error_critical); legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical
);
} }
} }
/* End of relationship javascript */
/* ]]> */ /* ]]> */
</script> </script>

View File

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

View File

@ -42,8 +42,6 @@ if (empty($edit_module)) {
} }
$data = []; $data = [];
$data[0] = __('Target IP').' '.ui_print_help_icon('wmi_module_tab', true);
if ($page == 'enterprise/godmode/policies/policy_modules') { if ($page == 'enterprise/godmode/policies/policy_modules') {
if ($ip_target != 'auto' && $ip_target != '') { if ($ip_target != 'auto' && $ip_target != '') {
$custom_ip_target = $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['force_pri'] = __('Force primary key');
$target_ip_values['custom'] = __('Custom'); $target_ip_values['custom'] = __('Custom');
$data[1] = html_print_select( $inputs = html_print_select(
$target_ip_values, $target_ip_values,
'ip_target', 'ip_target',
$ip_target, $ip_target,
@ -72,109 +70,171 @@ if ($page == 'enterprise/godmode/policies/policy_modules') {
false, false,
'', '',
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 { } else {
if ($ip_target == 'auto') { if ($ip_target == 'auto') {
$ip_target = agents_get_address($id_agente); $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[0] = html_print_label_input_block(
$data[3] = html_print_input_text( __('Target IP').' <span class="help_icon_15px">'.ui_print_help_icon('wmi_module_tab', true),
'tcp_send', $inputs,
$tcp_send, [
'', 'label_class' => 'font-title-font',
5, 'div_class' => 'w100p mrgn_right_20px',
20, ]
true, );
$disabledBecauseInPolicy,
false, $data[2] = html_print_label_input_block(
'', __('Namespace').ui_print_help_tip(__('Optional. WMI namespace. If unsure leave blank.'), true),
$classdisabledBecauseInPolicy 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'); push_table_simple($data, 'target_ip');
$data = []; $data = [];
$data[0] = __('Username'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text( __('Username'),
'plugin_user', html_print_input_text(
$plugin_user, 'plugin_user',
'', $plugin_user,
15, '',
60, 15,
true, 60,
$disabledBecauseInPolicy, true,
false, $disabledBecauseInPolicy,
'', false,
$classdisabledBecauseInPolicy '',
$classdisabledBecauseInPolicy.' w100p'
),
[
'label_class' => 'font-title-font',
'div_class' => 'w100p display-grid mrgn_right_20px',
]
); );
$data[2] = __('Password');
$data[3] = html_print_input_password( $data[2] = html_print_label_input_block(
'plugin_pass', __('Password'),
'', html_print_input_password(
'', 'plugin_pass',
15, '',
60, '',
true, 15,
$disabledBecauseInPolicy, 60,
false, true,
$classdisabledBecauseInPolicy, $disabledBecauseInPolicy,
'new-password' 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'); push_table_simple($data, 'user_pass');
$data = []; $data = [];
$data[0] = __('WMI query'); $data[0] = html_print_label_input_block(
$data[1] = html_print_input_text( __('WMI query'),
'snmp_oid', html_print_input_text(
$snmp_oid, 'snmp_oid',
'', $snmp_oid,
35, '',
255, 35,
true, 255,
$disabledBecauseInPolicy, true,
false, $disabledBecauseInPolicy,
'', false,
$classdisabledBecauseInPolicy '',
$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'); push_table_simple($data, 'wmi_query');
$data = []; $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[0] = html_print_label_input_block(
$data[1] = html_print_input_text( __('Field number').ui_print_help_tip(__('Column number to retrieve from the WQL query result (starting from zero).'), true),
'snmp_community', html_print_input_text(
$snmp_community, 'tcp_port',
'', $tcp_port,
20, '',
60, 5,
true, 15,
$disabledBecauseInPolicy, true,
false, $disabledBecauseInPolicy,
'', false,
$classdisabledBecauseInPolicy '',
); $classdisabledBecauseInPolicy.' mrgn_right_20px'
$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', 'label_class' => 'font-title-font',
$tcp_port, 'div_class' => 'w50p display-grid',
'', ]
5,
15,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
); );
$table_simple->rowclass['key_field'] = 'w100p mrgn_top_10px';
push_table_simple($data, 'key_field'); push_table_simple($data, 'key_field');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
@ -191,11 +251,6 @@ $(document).ready (function () {
$("#text-custom_ip_target").hide(); $("#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> </script>

View File

@ -1452,7 +1452,7 @@ $table->data['module'][1] = "
<td class='cell_delete_button' style='text-align: right; width:10%;' id=''>".'<a class="link_delete" <td class='cell_delete_button' style='text-align: right; width:10%;' id=''>".'<a class="link_delete"
onclick="if(!confirm(\''.__('Are you sure?').'\')) return false;" onclick="if(!confirm(\''.__('Are you sure?').'\')) return false;"
href="">'.html_print_image( href="">'.html_print_image(
'images/cross.png', 'images/delete.svg',
true, true,
[ [
'border' => '0', 'border' => '0',

View File

@ -809,10 +809,10 @@ foreach ($commands as $command) {
if (is_user_admin($config['id_user']) === true) { if (is_user_admin($config['id_user']) === true) {
$data['action'] = '<span class="inline_flex">'; $data['action'] = '<span class="inline_flex">';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset.'" $data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;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.'" $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>'; $data['action'] .= '</span>';
} }
} }

View File

@ -123,7 +123,7 @@ $table->data[1][0] = html_print_label_input_block(
'w100p', 'w100p',
false, false,
'width: 100%;' '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']); $own_info = get_user_info($config['id_user']);
@ -162,7 +162,7 @@ $table->data[1][1] = html_print_label_input_block(
'w100p', 'w100p',
false, false,
'width: 100%;' '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( $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) { 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); html_print_table($table);
} }
@ -216,6 +216,26 @@ if (isset($step) === false) {
true 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_action_buttons($actionButtons, ['right_content' => $pagination]);
html_print_input_hidden('create_alert', 1); html_print_input_hidden('create_alert', 1);

View File

@ -672,14 +672,14 @@ foreach ($simple_alerts as $alert) {
'[&hellip;]', '[&hellip;]',
'' ''
); );
$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'].'">'; 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( $data[2] .= html_print_image(
'images/zoom.png', 'images/details.svg',
true, true,
[ [
'id' => 'template-details-'.$alert['id_alert_template'], '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> '; $data[2] .= '</a> ';
@ -753,11 +753,11 @@ foreach ($simple_alerts as $alert) {
'delete', 'delete',
'images/delete.svg', 'images/delete.svg',
1, 1,
'padding:0px; margin-left:5px; margin-right:5px;', 'padding:0px; margin-left:5px; margin-right:5px; width: 22px;',
true, true,
[ [
'title' => __('Delete action'), '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); $data[3] .= html_print_input_hidden('delete_action', 1, true);
@ -766,13 +766,13 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</form>'; $data[3] .= '</form>';
$data[3] .= html_print_input_image( $data[3] .= html_print_input_image(
'update_action', 'update_action',
'images/config.png', 'images/edit.svg',
1, 1,
'padding:0px;', 'padding:0px;',
true, true,
[ [
'title' => __('Update action'), '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'].'\')', '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', 'enable',
'images/lightbulb_off.png', 'images/lightbulb_off.png',
1, 1,
'padding:0px', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'filter_none main_menu_icon'] ['class' => 'filter_none main_menu_icon']
); );
@ -923,7 +923,7 @@ foreach ($simple_alerts as $alert) {
'disable', 'disable',
'images/lightbulb.png', 'images/lightbulb.png',
1, 1,
'padding:0px;', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'main_menu_icon'] ['class' => 'main_menu_icon']
); );
@ -941,7 +941,7 @@ foreach ($simple_alerts as $alert) {
'standby_off', 'standby_off',
'images/bell.png', 'images/bell.png',
1, 1,
'padding:0px;', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'invert_filter main_menu_icon'] ['class' => 'invert_filter main_menu_icon']
); );
@ -951,7 +951,7 @@ foreach ($simple_alerts as $alert) {
'standby_on', 'standby_on',
'images/bell_pause.png', 'images/bell_pause.png',
1, 1,
'padding:0px;', 'padding:0px; width: 22px; height: 22px;',
true, true,
['class' => 'invert_filter main_menu_icon'] ['class' => 'invert_filter main_menu_icon']
); );
@ -1053,7 +1053,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] .= '<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( $data[4] .= html_print_input_image(
'view_alert', 'view_alert',
'images/operation.png', 'images/details.svg',
1, 1,
'', '',
true, true,

View File

@ -478,17 +478,17 @@ if ($standbyoff_alert) {
$searchFlag = true; $searchFlag = true;
if (!is_metaconsole()) { if (is_metaconsole() === false) {
// The tabs will be shown only with manage alerts permissions // 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')) { if (check_acl($config['id_user'], 0, 'LW') || check_acl($config['id_user'], 0, 'LM')) {
$buttons = [ $buttons = [
'list' => [ 'list' => [
'active' => false, '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' => [ 'builder' => [
'active' => false, '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 = ''; $buttons = '';
} }
if ($tab == 'list') { if ($_GET['sec2'] !== 'operation/cluster/cluster') {
ui_print_standard_header( if ($tab !== 'alert') {
__('Alerts'), if ($tab === 'list') {
'images/gm_alerts.png', ui_print_standard_header(
false, __('Alerts'),
'', 'images/gm_alerts.png',
true, false,
$buttons, '',
[ true,
[ $buttons,
'link' => '', [
'label' => __('Manage alerts'), [
], 'link' => '',
[ 'label' => __('Manage alerts'),
'link' => '', ],
'label' => __('List'), [
], 'link' => '',
] 'label' => __('List'),
); ],
} else { ]
ui_print_standard_header( );
__('Alerts'), } else {
'images/gm_alerts.png', ui_print_standard_header(
false, __('Alerts'),
'', 'images/gm_alerts.png',
true, false,
$buttons, '',
[ true,
[ $buttons,
'link' => '', [
'label' => __('Manage alerts'), [
], 'link' => '',
[ 'label' => __('Manage alerts'),
'link' => '', ],
'label' => __('Create'), [
], 'link' => '',
] 'label' => __('Create'),
); ],
]
);
}
}
} }
} else { } else {
alerts_meta_print_header(); alerts_meta_print_header();

View File

@ -122,24 +122,24 @@ $sec = (is_metaconsole() === true) ? 'advanced' : 'galertas';
// case delete_templete action is performed. // case delete_templete action is performed.
if (!$delete_template) { if (!$delete_template) {
// Header. // Header.
if (is_metaconsole() === true) { ui_print_standard_header(
alerts_meta_print_header(); __('Alerts'),
} else { 'images/gm_alerts.png',
ui_print_standard_header( false,
__('Alerts'), '',
'images/gm_alerts.png', true,
false, [],
'', [
true,
[],
[ [
[ 'link' => '',
'link' => '', 'label' => __('Alerts'),
'label' => __('Alert templates'), ],
], [
] 'link' => '',
); 'label' => __('Alert templates'),
} ],
]
);
} }
if ($update_template) { 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_hidden('source_id', $template['id'], true);
$data[4] .= html_print_input_image( $data[4] .= html_print_input_image(
'dup', 'dup',
'images/copy.png', 'images/copy.svg',
1, 1,
'', '',
true, true,

View File

@ -61,13 +61,19 @@ if ($default_action != 0) {
} }
// Header. // Header.
ui_print_page_header( ui_print_standard_header(
__('Alert details'), __('Alert details'),
'images/op_alerts.png', 'images/op_alerts.png',
false, false,
'', '',
false, false,
'' [],
[
[
'link' => '',
'label' => __('Alerts'),
],
]
); );
// TABLE DETAILS. // TABLE DETAILS.

View File

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

View File

@ -262,10 +262,7 @@ if ($is_management_allowed === true) {
[ 'icon' => 'next' ], [ 'icon' => 'next' ],
true true
), ),
[ [ 'right_content' => $tablePagination ]
'type' => 'form_action',
'right_content' => $tablePagination,
]
); );
echo '</form>'; echo '</form>';

View File

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

View File

@ -778,7 +778,7 @@ $table->data[12][0] = html_print_label_input_block(
if (!is_metaconsole()) { if (!is_metaconsole()) {
$table->data[12][1] = html_print_label_input_block( $table->data[12][1] = html_print_label_input_block(
__('Module search'), __('Module search'),
'<div class="w100p">'.html_print_autocomplete_modules( '<div class="w100p module-search">'.html_print_autocomplete_modules(
'module_search', 'module_search',
$text_module, $text_module,
false, false,

View File

@ -59,6 +59,14 @@ if ($delete) {
} }
if ($result !== false) { if ($result !== false) {
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_filter,
'section' => 'Events',
'id_user' => $config['id_user'],
]
);
$result = true; $result = true;
} else { } else {
$result = false; $result = false;
@ -186,7 +194,7 @@ foreach ($filters as $filter) {
) { ) {
$table->cellclass[][6] = 'table_action_buttons'; $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&section=filter&delete=1&id=".$filter['id_filter'].'&offset=0&pure='.$config['pure']."'>".html_print_image( $data[6] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'href='index.php?sec=geventos&sec2=godmode/events/events&section=filter&delete=1&id=".$filter['id_filter'].'&offset=0&pure='.$config['pure']."'>".html_print_image(
'images/cross.png', 'images/delete.svg',
true, true,
[ [
'title' => __('Delete'), 'title' => __('Delete'),

View File

@ -295,7 +295,8 @@ foreach ($extensions as $file => $extension) {
$data[] = html_print_menu_button( $data[] = html_print_menu_button(
[ [
'href' => 'index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file, 'href' => 'index.php?sec=godmode/extensions&amp;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'), 'title' => __('Delete'),
'onClick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;', 'onClick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
], ],

View File

@ -84,7 +84,7 @@ $buttons['gis_maps_list'] = [
true, true,
[ [
'title' => __('GIS Maps list'), 'title' => __('GIS Maps list'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
).'</a>', ).'</a>',
]; ];
@ -96,19 +96,30 @@ if ($idMap) {
true, true,
[ [
'title' => __('View GIS'), 'title' => __('View GIS'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
).'</a>', ).'</a>',
]; ];
} }
ui_print_page_header( // Header.
ui_print_standard_header(
__('GIS Maps builder'), __('GIS Maps builder'),
'images/gm_gis.png', 'images/gm_gis.png',
false, false,
'configure_gis_map_edit', 'configure_gis_map_edit',
true, false,
$buttons $buttons,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('GIS Maps'),
],
]
); );
switch ($action) { 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( <a href='javascript: addConnectionMap();'>".html_print_image(
'images/add.png', 'images/add.png',
true, true,
['class' => 'invert_filter'] ['class' => 'invert_filter main_menu_icon']
)."</a> )."</a>
<input type='hidden' name='map_connection_list' value='' id='map_connection_list' /> <input type='hidden' name='map_connection_list' value='' id='map_connection_list' />
<input type='hidden' name='layer_list' value='' id='layer_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 = [];
$params['return'] = true; $params['return'] = true;
@ -628,7 +639,7 @@ $params['javascript_is_function_select'] = true;
// Filter by group. // Filter by group.
$params['disabled_javascript_on_blur_function'] = false; $params['disabled_javascript_on_blur_function'] = false;
$agent_for_group_input = ui_print_agent_autocomplete_input($params); $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> $table->data[1][1] .= '<tr><td colspan="4"><hr /></td></tr>
<tr> <tr>
@ -660,21 +671,19 @@ $table->data[1][1] .= '<tr>
html_print_table($table); html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
switch ($action) { switch ($action) {
case 'save_new': case 'save_new':
case 'edit_map': case 'edit_map':
case 'update_saved': case 'update_saved':
if (empty($invalidFields) === true) { 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 { } 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; break;
case 'new_map': 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; break;
default: default:
@ -682,7 +691,10 @@ switch ($action) {
break; break;
} }
echo '</div>'; html_print_action_buttons(
$action_button,
['type' => 'form_action']
);
echo '</form>'; echo '</form>';
@ -698,11 +710,11 @@ echo '</form>';
<td><a id="delete_row" href="none"> <td><a id="delete_row" href="none">
<?php <?php
html_print_image( html_print_image(
'images/cross.png', 'images/delete.svg',
false, false,
[ [
'alt' => '', '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 $layerFormVisibleCheckbox = $("input#checkbox-layer_visible_form");
var $layerFormAgentsFromGroupSelect = $("#layer_group_form"); var $layerFormAgentsFromGroupSelect = $("#layer_group_form");
var $layerFormAgentInput = $("input#text-agent_alias"); 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 $layerFormAgentsListItems = $("tr.agents_list_item");
var $layerFormGroupsListItems = $("tr.groups_list_item"); var $layerFormGroupsListItems = $("tr.groups_list_item");
@ -1005,7 +1017,7 @@ function getAgentRow (layerId, agentId, agentAlias) {
var $deleteCol = $("<td />"); var $deleteCol = $("<td />");
var $agentAlias = $("<span class=\"agent_alias\" data-agent-id=\"" + agentId + "\">" + agentAlias + "</span>"); 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) { $removeBtn.click(function (event) {
var $layerRow = $("tr#layer_row_" + layerId); var $layerRow = $("tr#layer_row_" + layerId);
@ -1061,7 +1073,7 @@ function getGroupRow (layerId, groupId, groupName, agentId, agentAlias) {
+ "<i>" + agentAlias + "</i>" + "<i>" + agentAlias + "</i>"
+ ")" + ")"
+ "</span>"); + "</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) { $removeBtn.click(function (event) {
var $layerRow = $("tr#layer_row_" + layerId); var $layerRow = $("tr#layer_row_" + layerId);
@ -1139,8 +1151,8 @@ function getLayerRow (layerId, layerData) {
var $layerName = $("<span class=\"layer_name\">" + layerData.name + "</span>"); var $layerName = $("<span class=\"layer_name\">" + layerData.name + "</span>");
var $sortUpBtn = $("<a class=\"up_arrow\" href=\"javascript:;\" />"); var $sortUpBtn = $("<a class=\"up_arrow\" href=\"javascript:;\" />");
var $sortDownBtn = $("<a class=\"down_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 $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/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>');
$sortUpBtn.click(moveLayerRowUpOnClick); $sortUpBtn.click(moveLayerRowUpOnClick);
$sortDownBtn.click(moveLayerRowDownOnClick); $sortDownBtn.click(moveLayerRowDownOnClick);
@ -1231,9 +1243,9 @@ function onLayerGroupIdChange (event) {
// Bind events // Bind events
$("form#form_setup").submit(onFormSubmit); $("form#form_setup").submit(onFormSubmit);
$("input#button-add_agent").click(addAgentClick); $("button#button-add_agent").click(addAgentClick);
$("select#layer_group_id").change(onLayerGroupIdChange); $("select#layer_group_id").change(onLayerGroupIdChange);
$("input#button-add_group").click(addGroupClick); $("button#button-add_group").click(addGroupClick);
// Populate layer list // Populate layer list
var layers = <?php echo json_encode($layer_list); ?>; var layers = <?php echo json_encode($layer_list); ?>;

View File

@ -118,7 +118,7 @@ if (is_metaconsole() === true) {
// Data before table. // 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 = new stdClass();
$table->width = '100%'; $table->width = '100%';

View File

@ -445,7 +445,7 @@ if ($is_management_allowed === true
if ($aviable_name === true) { if ($aviable_name === true) {
$values = [ $values = [
'nombre' => $name, 'nombre' => $name,
'icon' => empty($icon) ? '' : substr($icon, 0, -4), 'icon' => $icon,
'parent' => $id_parent, 'parent' => $id_parent,
'disabled' => $alerts_disabled, 'disabled' => $alerts_disabled,
'custom_id' => $custom_id, 'custom_id' => $custom_id,
@ -513,7 +513,7 @@ if ($is_management_allowed === true && $update_group === true) {
if ($aviable_name === true) { if ($aviable_name === true) {
$values = [ $values = [
'nombre' => $name, 'nombre' => $name,
'icon' => empty($icon) ? '' : substr($icon, 0, -4), 'icon' => $icon,
'parent' => ($id_parent == -1) ? 0 : $id_parent, 'parent' => ($id_parent == -1) ? 0 : $id_parent,
'disabled' => !$alerts_enabled, 'disabled' => !$alerts_enabled,
'custom_id' => $custom_id, 'custom_id' => $custom_id,
@ -714,6 +714,14 @@ if ($is_management_allowed === true
); );
if ($result && (!$usedGroup['return'])) { 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')); ui_print_success_message(__('Group successfully deleted'));
} else { } else {
ui_print_error_message( ui_print_error_message(
@ -733,12 +741,11 @@ if ($is_management_allowed === true
// Credential store is loaded previously in this document to avoid // Credential store is loaded previously in this document to avoid
// process group tree - list forms. // process group tree - list forms.
ui_print_spinner(__('Loading'));
if ($tab == 'tree') { if ($tab == 'tree') {
/* /*
* Group tree view. * Group tree view.
*/ */
ui_print_spinner(__('Loading'));
echo "<div id='tree-controller-recipient'></div>"; echo "<div id='tree-controller-recipient'></div>";
} else { } else {
/* /*
@ -898,7 +905,6 @@ if ($tab == 'tree') {
foreach ($groups as $key => $group) { foreach ($groups as $key => $group) {
$url_edit = 'index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo']; $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()) { if (is_metaconsole()) {
$url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups'; $url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups';
} else { } else {
@ -907,7 +913,7 @@ if ($tab == 'tree') {
$table->data[$key][0] = $group['id_grupo']; $table->data[$key][0] = $group['id_grupo'];
if ($is_management_allowed === true) { 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 { } else {
$table->data[$key][1] = $group['nombre']; $table->data[$key][1] = $group['nombre'];
} }
@ -918,7 +924,7 @@ if ($tab == 'tree') {
true, true,
[ [
'style' => '', 'style' => '',
'class' => 'bot', 'class' => 'bot main_menu_icon invert_filter',
'alt' => io_safe_input($group['nombre']), 'alt' => io_safe_input($group['nombre']),
'title' => io_safe_input($group['nombre']), 'title' => io_safe_input($group['nombre']),
], ],
@ -979,7 +985,7 @@ if ($tab == 'tree') {
true, true,
'offset', 'offset',
false, false,
'pagination-bottom' ''
); );
} else { } else {
ui_print_info_message( ui_print_info_message(
@ -1031,6 +1037,7 @@ $tab = 'group_edition';
<script type="text/javascript"> <script type="text/javascript">
var treeController = TreeController.getController(); var treeController = TreeController.getController();
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0) if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
treeController.recipient.empty(); treeController.recipient.empty();

View File

@ -72,8 +72,14 @@ if (is_metaconsole() === false) {
], ],
[ [
'link' => '', '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', 'id' => 'list_agents_tactical',
'class' => 'info_table', 'class' => 'info_table',
'style' => 'width: 100%', 'style' => 'width: 99%',
'columns' => $columns, 'columns' => $columns,
'column_names' => $columnNames, 'column_names' => $columnNames,
'return' => true, 'return' => true,
@ -190,6 +196,7 @@ try {
'method' => 'getAgentsByGroup', 'method' => 'getAgentsByGroup',
'id_group' => $id_group, 'id_group' => $id_group,
], ],
'dom_elements' => 'lpfti',
'no_sortable_columns' => [-1], 'no_sortable_columns' => [-1],
'order' => [ 'order' => [
'field' => 'alias', 'field' => 'alias',

View File

@ -270,7 +270,7 @@ $agents_with_templates_json = json_encode($agents_with_templates_json);
echo "<input type='hidden' id='hidden-agents_with_templates' value='$agents_with_templates_json'>"; 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>'; echo '</form>';

View File

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

View File

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

View File

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

View File

@ -298,7 +298,7 @@ $agents_with_templates_json = json_encode($agents_with_templates_json);
echo "<input type='hidden' id='hidden-agents_with_templates' value='".$agents_with_templates_json."'>"; 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>'; echo '</form>';

View File

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

View File

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

View File

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

View File

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

View File

@ -1257,7 +1257,7 @@ echo '<h3 class="error invisible" id="message"> </h3>';
html_print_input_hidden('id_agente', $id_agente); 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. // Shown and hide div.
echo '</div></form>'; echo '</div></form>';

View File

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

View File

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

View File

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

View File

@ -216,11 +216,11 @@ if ($option == '') {
$alertstab = [ $alertstab = [
'text' => '<a href="'.$url.'&tab=massive_alerts">'.html_print_image( 'text' => '<a href="'.$url.'&tab=massive_alerts">'.html_print_image(
'images/bell.png', 'images/alert@svg.svg',
true, true,
[ [
'title' => __('Alerts operations'), 'title' => __('Alerts operations'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
).'</a>', ).'</a>',
'active' => $tab == 'massive_alerts', 'active' => $tab == 'massive_alerts',
@ -228,11 +228,11 @@ $alertstab = [
$userstab = [ $userstab = [
'text' => '<a href="'.$url.'&tab=massive_users">'.html_print_image( 'text' => '<a href="'.$url.'&tab=massive_users">'.html_print_image(
'images/user.png', 'images/user.svg',
true, true,
[ [
'title' => __('Users operations'), 'title' => __('Users operations'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
).'</a>', ).'</a>',
'active' => $tab == 'massive_users', 'active' => $tab == 'massive_users',
@ -240,11 +240,11 @@ $userstab = [
$agentstab = [ $agentstab = [
'text' => '<a href="'.$url.'&tab=massive_agents">'.html_print_image( 'text' => '<a href="'.$url.'&tab=massive_agents">'.html_print_image(
'images/agent.png', 'images/agents@svg.svg',
true, true,
[ [
'title' => __('Agents operations'), 'title' => __('Agents operations'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
).'</a>', ).'</a>',
'active' => $tab == 'massive_agents', 'active' => $tab == 'massive_agents',
@ -252,11 +252,11 @@ $agentstab = [
$modulestab = [ $modulestab = [
'text' => '<a href="'.$url.'&tab=massive_modules">'.html_print_image( 'text' => '<a href="'.$url.'&tab=massive_modules">'.html_print_image(
'images/module.png', 'images/modules@svg.svg',
true, true,
[ [
'title' => __('Modules operations'), 'title' => __('Modules operations'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
).'</a>', ).'</a>',
'active' => $tab == 'massive_modules', 'active' => $tab == 'massive_modules',
@ -264,11 +264,11 @@ $modulestab = [
$pluginstab = [ $pluginstab = [
'text' => '<a href="'.$url.'&tab=massive_plugins">'.html_print_image( 'text' => '<a href="'.$url.'&tab=massive_plugins">'.html_print_image(
'images/plugin.png', 'images/plugins@svg.svg',
true, true,
[ [
'title' => __('Plugins operations'), 'title' => __('Plugins operations'),
'class' => 'invert_filter', 'class' => 'invert_filter main_menu_icon',
] ]
).'</a>', ).'</a>',
'active' => $tab == 'massive_plugins', 'active' => $tab == 'massive_plugins',
@ -306,22 +306,62 @@ $onheader['snmp'] = $snmptab;
$onheader['satellite'] = $satellitetab; $onheader['satellite'] = $satellitetab;
$onheader['services'] = $servicestab; $onheader['services'] = $servicestab;
// Header. // Header.
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
ui_print_page_header( ui_print_standard_header(
__('Bulk operations').' &raquo; '.$options[$option], __('Bulk operations').' - '.$options[$option],
'images/gm_massive_operations.png', 'images/gm_massive_operations.png',
false, false,
$help_header, $help_header,
true,
$onheader,
false, false,
'massivemodal' [
$agentstab,
$modulestab,
$pluginstab,
$userstab,
$alertstab,
$policiestab,
$snmptab,
$satellitetab,
$servicestab,
],
[
[
'link' => '',
'label' => __('Configuration'),
],
[
'link' => '',
'label' => __('Bulk operations'),
],
]
); );
} else { } 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. // Checks if the PHP configuration is correctly.
if ((get_cfg_var('max_execution_time') != 0) if ((get_cfg_var('max_execution_time') != 0)
|| (get_cfg_var('max_input_time') != -1) || (get_cfg_var('max_input_time') != -1)
@ -403,29 +443,26 @@ if (is_management_allowed() === false) {
); );
} }
echo '<br />'; $tip = '';
echo '<form method="post" id="form_options" action="'.$url.'">'; if ($option === 'edit_agents' || $option === 'edit_modules') {
echo '<table border="0"><tr><td>'; $tip = ui_print_help_tip(__('The blank fields will not be updated'), true);
echo __('Action'); }
echo '</td><td>';
html_print_select( $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, $options,
'option', 'option',
$option, $option,
'this.form.submit()', 'this.form.submit()',
'', '',
0, 0,
false, true,
false, false,
false false
); ).$tip;
if ($option === 'edit_agents' || $option === 'edit_modules') {
ui_print_help_tip(__('The blank fields will not be updated'));
}
echo '</td></tr></table>'; $SelectAction .= '</form>';
echo '</form>';
echo '<br />';
switch ($option) { switch ($option) {
case 'delete_alerts': case 'delete_alerts':

View File

@ -371,6 +371,11 @@ if ($access_console_node === true) {
$sub2['godmode/setup/setup&section=net']['text'] = __('Netflow'); $sub2['godmode/setup/setup&section=net']['text'] = __('Netflow');
$sub2['godmode/setup/setup&section=net']['refr'] = 0; $sub2['godmode/setup/setup&section=net']['refr'] = 0;
} }
if ((bool) $config['activate_sflow'] === true) {
$sub2['godmode/setup/setup&section=sflow']['text'] = __('Sflow');
$sub2['godmode/setup/setup&section=sflow']['refr'] = 0;
}
} }
$sub2['godmode/setup/setup&section=ehorus']['text'] = __('eHorus'); $sub2['godmode/setup/setup&section=ehorus']['text'] = __('eHorus');

View File

@ -45,18 +45,18 @@ if (! check_acl($config['id_user'], 0, 'AR')) {
if (check_acl($config['id_user'], 0, 'PM') && enterprise_installed()) { if (check_acl($config['id_user'], 0, 'PM') && enterprise_installed()) {
$buttons['setup'] = [ $buttons['setup'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=general&sec2=godmode/setup/setup&amp;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&amp;section=module_library">'.html_print_image('images/configuration@svg.svg', true, ['title' => __('Setup'), 'class' => 'main_menu_icon invert_filter']).'</a>',
]; ];
} }
$buttons['categories'] = [ $buttons['categories'] = [
'active' => false, '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'] = [ $buttons['view'] = [
'active' => false, '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>',
]; ];

View File

@ -104,7 +104,7 @@ function generateExtraFields($extra_fields, $protocol)
'class' => 'float-right', 'class' => 'float-right',
'style' => $cntFields <= 1 ? 'opacity: 0.5;' : '', 'style' => $cntFields <= 1 ? 'opacity: 0.5;' : '',
'content' => html_print_image( 'content' => html_print_image(
'images/cross.png', 'images/delete.svg',
true, true,
[ [
'title' => __('Remove last macro oid'), 'title' => __('Remove last macro oid'),

View File

@ -266,7 +266,7 @@ foreach ($result as $row) {
$table->cellclass[][3] = 'table_action_buttons'; $table->cellclass[][3] = 'table_action_buttons';
$data[3] = html_print_input_image( $data[3] = html_print_input_image(
'delete_profile', 'delete_profile',
'images/cross.png', 'images/delete.svg',
$row['id_np'], $row['id_np'],
'', '',
true, true,
@ -286,7 +286,7 @@ foreach ($result as $row) {
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
); );
$data[3] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&delete_profile=1&delete_profile='.$row['id_np'].'" '.'onclick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>'; $data[3] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&delete_profile=1&delete_profile='.$row['id_np'].'" '.'onclick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>';
$data[3] .= '<a onclick="blockResubmit($(this))" href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&export_profile='.$row['id_np'].'">'.html_print_image('images/csv.png', true, ['title' => __('Export to CSV'), 'class' => 'invert_filter']).'</a>'; $data[3] .= '<a onclick="blockResubmit($(this))" href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&export_profile='.$row['id_np'].'">'.html_print_image('images/csv.png', true, ['title' => __('Export to CSV'), 'class' => 'invert_filter']).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
@ -297,7 +297,7 @@ if (!empty($table->data)) {
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
ui_pagination($count_network_templates, false, $offset); ui_pagination($count_network_templates, false, $offset);
html_print_table($table); html_print_table($table);
ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, 'pagination-bottom'); ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, '');
echo "<div class='pdd_l_5px right'>"; echo "<div class='pdd_l_5px right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>'; echo '</div>';

View File

@ -1,16 +1,31 @@
<?php <?php
/**
* Netflow Filter view
*
* @category Netflow
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// 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; 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.
global $config; global $config;
require_once $config['homedir'].'/include/functions_ui.php'; require_once $config['homedir'].'/include/functions_ui.php';
@ -30,35 +45,29 @@ if (! check_acl($config['id_user'], 0, 'AW')) {
$pure = get_parameter('pure', 0); $pure = get_parameter('pure', 0);
// Header // Header.
if (! defined('METACONSOLE')) { ui_print_standard_header(
ui_print_page_header( __('Manage Filters'),
__('Manage Netflow Filter'), 'images/gm_netflow.png',
'images/gm_netflow.png', false,
false, '',
'', true,
true [],
); [
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
if ($is_windows) {
ui_print_error_message(__('Not supported in Windows systems'));
}
} else {
$nav_bar = [
[ [
'link' => 'index.php?sec=main', 'link' => '',
'text' => __('Main'), 'label' => __('Resources'),
], ],
[ [
'link' => 'index.php?sec=netf&sec2=godmode/netflow/nf_edit', 'link' => '',
'text' => __('Netflow filters'), 'label' => __('Netflow filters'),
], ],
]; ]
);
ui_meta_print_page_header($nav_bar); $is_windows = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
if ($is_windows === true) {
ui_meta_print_header(__('Netflow filters')); ui_print_error_message(__('Not supported in Windows systems'));
} }
$delete = (bool) get_parameter('delete'); $delete = (bool) get_parameter('delete');
@ -190,30 +199,36 @@ foreach ($filters as $filter) {
if (check_acl_restricted_all($config['id_user'], $filter['id_group'], 'AW')) { if (check_acl_restricted_all($config['id_user'], $filter['id_group'], 'AW')) {
$table->cellclass[][3] = 'table_action_buttons'; $table->cellclass[][3] = 'table_action_buttons';
$data[3] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;' $data[3] = '<a onclick="if(confirm(\''.__('Are you sure?').'\')) return true; else return false;" href="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&delete=1&id='.$filter['id_sg'].'&offset=0&pure='.$pure.'">';
href='".$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&delete=1&id='.$filter['id_sg']."&offset=0&pure=$pure'>".html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>'; $data[3] .= html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'main_menu_icon invert_filter']);
$data[3] .= '</a>';
} }
array_push($table->data, $data); array_push($table->data, $data);
} }
if (isset($data)) { $buttons = html_print_submit_button(
echo "<form method='post' action='".$config['homeurl']."index.php?sec=netf&sec2=godmode/netflow/nf_edit&pure=$pure'>"; __('Create filter'),
'crt',
false,
['icon' => 'wand'],
true
);
if (empty($filters) === false) {
echo '<form id="multiple_delete" method="POST" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&pure='.$pure.'">';
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table($table); html_print_table($table);
echo "<div class='right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>';
echo '</form>'; echo '</form>';
$buttons .= html_print_submit_button(__('Delete'), 'delete_btn', false, ['icon' => 'delete', 'mode' => 'secondary', 'form' => 'multiple_delete'], true);
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined filters') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no defined filters') ]);
} }
echo '<form method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form&pure='.$pure.'">'; echo '<form method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form&pure='.$pure.'">';
echo "<div class='mrgn_right_5px right'>"; html_print_action_buttons(
html_print_submit_button(__('Create filter'), 'crt', false, 'class="sub wand"'); $buttons
echo '</div>'; );
echo '</form>'; echo '</form>';
?> ?>
@ -221,27 +236,14 @@ echo '</form>';
<script type="text/javascript"> <script type="text/javascript">
$( document ).ready(function() { $( document ).ready(function() {
$('[id^=checkbox-all_delete]').change(function() {
$('[id^=checkbox-delete_multiple]').change(function(){ if ($("input[name=all_delete]").prop("checked")) {
if($(this).parent().parent().hasClass('checkselected')){ $(".custom_checkbox_input").prop("checked", true);
$(this).parent().parent().removeClass('checkselected');
} }
else{ else {
$(this).parent().parent().addClass('checkselected'); $(".custom_checkbox_input").prop("checked", false);
} }
}); });
$('[id^=checkbox-all_delete]').change(function(){
if ($("#checkbox-all_delete").prop("checked")) {
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
$(".check_delete").prop("checked", true);
}
else{
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
$(".check_delete").prop("checked", false);
}
});
}); });

View File

@ -1,16 +1,31 @@
<?php <?php
/**
* Netflow Filter Editor.
*
* @category Netflow
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// 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; 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.
global $config; global $config;
require_once $config['homedir'].'/include/functions_ui.php'; require_once $config['homedir'].'/include/functions_ui.php';
@ -46,40 +61,28 @@ if ($id) {
} }
} }
// Header // Header Buttons.
if (! defined('METACONSOLE')) { $buttons = [];
$buttons['edit']['text'] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit">'.html_print_image('images/list.png', true, ['title' => __('Filter list')]).'</a>'; $buttons[] = ['text' => '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Filter list')]).'</a>'];
$buttons[] = ['text' => '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit_form">'.html_print_image('images/plus@svg.svg', true, ['title' => __('Add filter')]).'</a>'];
// Header Caption.
$headerTitle = ($id) ? __('Update filter') : __('Create filter');
$buttons['add']['text'] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit_form">'.html_print_image('images/add_mc.png', true, ['title' => __('Add filter')]).'</a>'; // Header.
ui_print_standard_header(
ui_print_page_header( $headerTitle,
__('Netflow Filter'), 'images/gm_netflow.png',
'images/gm_netflow.png', false,
false, '',
'', true,
true, $buttons,
$buttons [
);
} else {
$nav_bar = [
[ [
'link' => 'index.php?sec=main', 'link' => '',
'text' => __('Main'), 'label' => __('Netflow'),
], ],
[ ],
'link' => 'index.php?sec=netf&sec2=godmode/netflow/nf_edit', );
'text' => __('Netflow filters'),
],
[
'link' => 'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form',
'text' => __('Add filter'),
],
];
ui_meta_print_page_header($nav_bar);
ui_meta_print_header(__('Netflow filters'));
}
if ($id) { if ($id) {
$filter = netflow_filter_get_filter($id); $filter = netflow_filter_get_filter($id);
@ -127,7 +130,7 @@ if ($update) {
'advanced_filter' => $advanced_filter, 'advanced_filter' => $advanced_filter,
]; ];
// Save filter args // Save filter args.
$values['filter_args'] = netflow_get_filter_arguments($values, true); $values['filter_args'] = netflow_get_filter_arguments($values, true);
$result = db_process_sql_update('tnetflow_filter', $values, ['id_sg' => $id]); $result = db_process_sql_update('tnetflow_filter', $values, ['id_sg' => $id]);
@ -172,83 +175,8 @@ if ($create) {
} }
} }
$table = new stdClass();
$table->id = 'table1';
$table->width = '100%';
$table->border = 0;
$table->cellspacing = 0;
$table->cellpadding = 0;
$table->class = 'databox filters';
$table->style[0] = 'font-weight: bold';
if (defined('METACONSOLE')) {
if ($id) {
$table->head[0] = __('Update filter');
} else {
$table->head[0] = __('Create filter');
}
$table->head_colspan[0] = 5;
$table->headstyle[0] = 'text-align: center';
}
$table->data = [];
$table->data[0][0] = '<b>'.__('Name').'</b>';
$table->data[0][1] = html_print_input_text('name', $name, false, 20, 80, true);
$own_info = get_user_info($config['id_user']); $own_info = get_user_info($config['id_user']);
$table->data[1][0] = '<b>'.__('Group').'</b>'; $filter_type = (empty($advanced_filter) === false) ? 1 : 0;
// Fix: Netflow filters have to check RW ACL
$table->data[1][1] = html_print_select_groups(
$config['id_user'],
'RW',
$own_info['is_admin'],
'assign_group',
$assign_group,
'',
'',
-1,
true,
false,
false,
'',
false,
false,
false,
false,
'id_grupo',
false,
false,
false,
'250px'
);
if ($advanced_filter != '') {
$filter_type = 1;
} else {
$filter_type = 0;
}
$table->data[2][0] = '<b>'.__('Filter:').'</b>';
$table->data[2][1] = __('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'class="mrgn_right_40px"', true);
$table->data[2][1] .= __('Advanced').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'class="mrgn_right_40px"', true);
$table->data[3][0] = __('Dst Ip').ui_print_help_tip(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true);
$table->data[3][1] = html_print_input_text('ip_dst', $ip_dst, false, 40, 80, true);
$table->data[4][0] = __('Src Ip').ui_print_help_tip(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true);
$table->data[4][1] = html_print_input_text('ip_src', $ip_src, false, 40, 80, true);
$table->data[5][0] = __('Dst Port').ui_print_help_tip(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true);
$table->data[5][1] = html_print_input_text('dst_port', $dst_port, false, 40, 80, true);
$table->data[6][0] = __('Src Port').ui_print_help_tip(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true);
$table->data[6][1] = html_print_input_text('src_port', $src_port, false, 40, 80, true);
$table->data[7][1] = html_print_textarea('advanced_filter', 4, 40, $advanced_filter, '', true);
$table->data[8][0] = '<b>'.__('Aggregate by').'</b>';
$aggregate_list = [ $aggregate_list = [
'srcip' => __('Src Ip Address'), 'srcip' => __('Src Ip Address'),
'dstip' => __('Dst Ip Address'), 'dstip' => __('Dst Ip Address'),
@ -256,27 +184,194 @@ $aggregate_list = [
'dstport' => __('Dst Port'), 'dstport' => __('Dst Port'),
]; ];
$table->data[8][1] = html_print_select($aggregate_list, 'aggregate', $aggregate, '', '', 0, true, false, true, '', false);
echo '<form method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form&pure='.$pure.'">'; $table = new stdClass();
html_print_table($table); $table->id = 'table1';
echo '<div class="action-buttons" style="width: '.$table->width.'">'; $table->width = '100%';
$table->class = 'databox filter-table-adv';
$table->size = [];
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
$table->data['first_line'][] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$name,
false,
20,
80,
true
)
);
$table->data['first_line'][] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
$config['id_user'],
'RW',
$own_info['is_admin'],
'assign_group',
$assign_group,
'',
'',
-1,
true,
false,
false,
'',
false,
false,
false,
false,
'id_grupo',
false,
false,
false,
'250px'
)
);
$table->data['filter_line'][] = html_print_label_input_block(
__('Filter'),
html_print_div(
[
'class' => 'flex',
'content' => html_print_div(
[
'class' => 'flex-row-end',
'content' => __('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'class="mrgn_right_40px"', true),
],
true
).html_print_div(
[
'class' => 'flex-row-end',
'content' => __('Advanced').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'class="mrgn_right_40px"', true),
],
true
),
],
true
),
);
$table->data['filter_line'][] = html_print_label_input_block(
__('Aggregate by'),
html_print_select(
$aggregate_list,
'aggregate',
$aggregate,
'',
'',
0,
true,
false,
true,
'',
false
)
);
$table->data['ip_line'][] = html_print_label_input_block(
__('Dst Ip'),
html_print_input_text(
'ip_dst',
$ip_dst,
false,
40,
80,
true
).ui_print_input_placeholder(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true)
);
$table->data['ip_line'][] = html_print_label_input_block(
__('Src Ip'),
html_print_input_text(
'ip_src',
$ip_src,
false,
40,
80,
true
).ui_print_input_placeholder(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true)
);
$table->data['ports_line'][] = html_print_label_input_block(
__('Dst Port'),
html_print_input_text(
'dst_port',
$dst_port,
false,
40,
80,
true
).ui_print_input_placeholder(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true)
);
$table->data['ports_line'][] = html_print_label_input_block(
__('Src Port'),
html_print_input_text(
'src_port',
$src_port,
false,
40,
80,
true
).ui_print_input_placeholder(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true)
);
$table->colspan['advanced_filters'][] = 2;
$table->data['advanced_filters'][] = html_print_label_input_block(
__('Advanced filters'),
html_print_textarea('advanced_filter', 4, 40, $advanced_filter, '', true, 'w50p')
);
$hiddens = '';
if ($id) { if ($id) {
html_print_input_hidden('update', 1); $buttonTitle = __('Update');
html_print_input_hidden('id', $id); $hiddens .= html_print_input_hidden('update', 1, true);
html_print_submit_button(__('Update'), 'crt', false, 'class="sub upd"'); $hiddens .= html_print_input_hidden('id', $id, true);
} else { } else {
html_print_input_hidden('create', 1); $buttonTitle = __('Create');
html_print_submit_button(__('Create'), 'crt', false, 'class="sub wand"'); $hiddens .= html_print_input_hidden('create', 1, true);
} }
echo '</div>'; echo '<form class="max_floating_element_size" id="nf_edit_form" method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form&pure='.$pure.'">';
echo $hiddens;
html_print_table($table);
echo '</form>'; echo '</form>';
html_print_action_buttons(
html_print_submit_button(
$buttonTitle,
'crt',
false,
[
'icon' => 'upd',
'form' => 'nf_edit_form',
],
true
)
);
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){
var filter_type = <?php echo $filter_type; ?>;
if (filter_type == 0) {
displayNormalFilter ();
}
else {
displayAdvancedFilter ();
}
});
function displayAdvancedFilter () { function displayAdvancedFilter () {
console.log('papapa advanced filter');
// Erase the normal filter // Erase the normal filter
document.getElementById("text-ip_dst").value = ''; document.getElementById("text-ip_dst").value = '';
document.getElementById("text-ip_src").value = ''; document.getElementById("text-ip_src").value = '';
@ -284,34 +379,32 @@ echo '</form>';
document.getElementById("text-src_port").value = ''; document.getElementById("text-src_port").value = '';
// Hide the normal filter // Hide the normal filter
document.getElementById("table1-3").style.display = 'none'; //document.getElementById("table1-3").style.display = 'none';
document.getElementById("table1-4").style.display = 'none'; //document.getElementById("table1-4").style.display = 'none';
document.getElementById("table1-5").style.display = 'none'; //document.getElementById("table1-5").style.display = 'none';
document.getElementById("table1-6").style.display = 'none'; //document.getElementById("table1-6").style.display = 'none';
$("#table1-ip_line").css("display", "none");
$("#table1-ports_line").css("display", "none");
// Show the advanced filter // Show the advanced filter
document.getElementById("table1-7").style.display = ''; $("#table1-advanced_filters").css("display", "table-row");
//document.getElementById("table1-7").style.display = '';
}; };
function displayNormalFilter () { function displayNormalFilter () {
console.log('papapa normal filter');
// Erase the advanced filter // Erase the advanced filter
document.getElementById("textarea_advanced_filter").value = ''; document.getElementById("textarea_advanced_filter").value = '';
// Hide the advanced filter // Hide the advanced filter
document.getElementById("table1-7").style.display = 'none'; //document.getElementById("table1-7").style.display = 'none';
$("#table1-advanced_filters").css("display", "none");
// Show the normal filter // Show the normal filter
$("#table1-ip_line").css("display", "table-row");
$("#table1-ports_line").css("display", "table-row");
/*
document.getElementById("table1-3").style.display = ''; document.getElementById("table1-3").style.display = '';
document.getElementById("table1-4").style.display = ''; document.getElementById("table1-4").style.display = '';
document.getElementById("table1-5").style.display = ''; document.getElementById("table1-5").style.display = '';
document.getElementById("table1-6").style.display = ''; document.getElementById("table1-6").style.display = '';
*/
}; };
var filter_type = <?php echo $filter_type; ?>;
if (filter_type == 0) {
displayNormalFilter ();
}
else {
displayAdvancedFilter ();
}
</script> </script>

View File

@ -30,7 +30,7 @@ $buttons['report_items']['active'] = true;
$buttons['report_items']['text'] = '<a href="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$id.'">'.html_print_image('images/god6.png', true, ['title' => __('Report items')]).'</a>'; $buttons['report_items']['text'] = '<a href="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$id.'">'.html_print_image('images/god6.png', true, ['title' => __('Report items')]).'</a>';
$buttons['edit_report']['active'] = false; $buttons['edit_report']['active'] = false;
$buttons['edit_report']['text'] = '<a href="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_report_form&id='.$id.'">'.html_print_image('images/config.png', true, ['title' => __('Edit report')]).'</a>'; $buttons['edit_report']['text'] = '<a href="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_report_form&id='.$id.'">'.html_print_image('images/edit.svg', true, ['title' => __('Edit report')]).'</a>';
// Header // Header
if (! defined('METACONSOLE')) { if (! defined('METACONSOLE')) {
@ -260,7 +260,7 @@ foreach ($reports_item as $item) {
} }
$data[5] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;' $data[5] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'
href='".$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_item_list&delete=1&id_rc='.$item['id_rc'].'&id='.$id."&offset=0'>".html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>'.html_print_checkbox_extended('delete_multiple[]', $item['id_rc'], false, false, '', 'class="check_delete"', true); href='".$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_item_list&delete=1&id_rc='.$item['id_rc'].'&id='.$id."&offset=0'>".html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>'.html_print_checkbox_extended('delete_multiple[]', $item['id_rc'], false, false, '', 'class="check_delete"', true);
array_push($table->data, $data); array_push($table->data, $data);
} }

View File

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

View File

@ -189,6 +189,14 @@ if ($delete_layout || $copy_layout) {
'tlayout', 'tlayout',
['id' => $id_layout] ['id' => $id_layout]
); );
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_layout,
'section' => 'Visual_Console',
'id_user' => $config['id_user'],
]
);
$auditMessage = ((bool) $result === true) ? 'Delete visual console' : 'Fail try to delete visual console'; $auditMessage = ((bool) $result === true) ? 'Delete visual console' : 'Fail try to delete visual console';
db_pandora_audit( db_pandora_audit(

View File

@ -115,6 +115,7 @@ $exception_condition_value = 10;
$modulegroup = 0; $modulegroup = 0;
$period = SECONDS_1DAY; $period = SECONDS_1DAY;
$search = ''; $search = '';
$full_text = 0;
$log_number = 1000; $log_number = 1000;
// Added support for projection graphs. // Added support for projection graphs.
$period_pg = SECONDS_5DAY; $period_pg = SECONDS_5DAY;
@ -316,6 +317,7 @@ switch ($action) {
$source = $es['source']; $source = $es['source'];
$search = $es['search']; $search = $es['search'];
$log_number = empty($es['log_number']) ? $log_number : $es['log_number']; $log_number = empty($es['log_number']) ? $log_number : $es['log_number'];
$full_text = empty($es['full_text']) ? 0 : $es['full_text'];
break; break;
case 'simple_graph': case 'simple_graph':
@ -1047,17 +1049,6 @@ $class = 'databox filters';
?> ?>
<table id="table_item_edit_reporting" class="<?php echo $class; ?>" id="" border="0" cellpadding="4" cellspacing="4" width="100%"> <table id="table_item_edit_reporting" class="<?php echo $class; ?>" id="" border="0" cellpadding="4" cellspacing="4" width="100%">
<?php
if (defined('METACONSOLE')) {
echo '<thead>
<tr>
<th align=center colspan=5>
'.__('Item Editor').'
</th>
</tr>
</thead>';
}
?>
<tbody> <tbody>
<tr id="row_type" class="datos"> <tr id="row_type" class="datos">
<td class="bolder w220px"> <td class="bolder w220px">
@ -1324,6 +1315,14 @@ $class = 'databox filters';
<td > <td >
<?php <?php
html_print_input_text('search', $search, '', 40, 100); html_print_input_text('search', $search, '', 40, 100);
html_print_checkbox(
'full_text',
1,
$full_text,
false,
false
);
ui_print_help_tip(__('Full context'), false);
?> ?>
</td> </td>
</tr> </tr>
@ -4272,7 +4271,7 @@ function print_SLA_list($width, $action, $idItem=null)
echo '</td>'; echo '</td>';
echo '<td class="sla_list_action_col center">'; echo '<td class="sla_list_action_col center">';
echo '<a href="javascript: deleteSLARow('.$item['id'].');">'; echo '<a href="javascript: deleteSLARow('.$item['id'].');">';
echo html_print_image('images/cross.png', true, ['class' => 'invert_filter']); echo html_print_image('images/delete.svg', true, ['class' => 'invert_filter']);
echo '</a>'; echo '</a>';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
@ -4313,7 +4312,7 @@ function print_SLA_list($width, $action, $idItem=null)
<a class="delete_button" href="javascript: deleteSLARow(0);"> <a class="delete_button" href="javascript: deleteSLARow(0);">
<?php <?php
html_print_image( html_print_image(
'images/cross.png', 'images/delete.svg',
false, false,
['class' => 'invert_filter'] ['class' => 'invert_filter']
); );
@ -4739,7 +4738,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
<td>'.printSmallFont($nameAgentFailover).$server_name_element.'</td> <td>'.printSmallFont($nameAgentFailover).$server_name_element.'</td>
<td>'.printSmallFont($nameModuleFailover).'</td> <td>'.printSmallFont($nameModuleFailover).'</td>
<td class="center"> <td class="center">
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a> <a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter']).'</a>
</td> </td>
</tr>'; </tr>';
} else { } else {
@ -4747,7 +4746,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
<td>'.printSmallFont($nameAgent).$server_name_element.'</td> <td>'.printSmallFont($nameAgent).$server_name_element.'</td>
<td>'.printSmallFont($nameModule).'</td> <td>'.printSmallFont($nameModule).'</td>
<td class="center"> <td class="center">
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a> <a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter']).'</a>
</td> </td>
</tr>'; </tr>';
} }
@ -4757,7 +4756,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
<td>'.printSmallFont($nameModule).'</td> <td>'.printSmallFont($nameModule).'</td>
<td>'.printSmallFont($operation[$item['operation']]).'</td> <td>'.printSmallFont($operation[$item['operation']]).'</td>
<td class="center"> <td class="center">
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a> <a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter']).'</a>
</td> </td>
</tr>'; </tr>';
} }
@ -4795,7 +4794,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
<a class="delete_button" href="javascript: deleteGeneralRow(0);"> <a class="delete_button" href="javascript: deleteGeneralRow(0);">
<?php <?php
html_print_image( html_print_image(
'images/cross.png', 'images/delete.svg',
false, false,
['class' => 'invert_filter'] ['class' => 'invert_filter']
); );

View File

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

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