mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
Merge branch 'develop' into ent-10633-pantalla-de-timeout
This commit is contained in:
commit
1b0477bd1f
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-agent-unix
|
package: pandorafms-agent-unix
|
||||||
Version: 7.0NG.769-230314
|
Version: 7.0NG.769-230315
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -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-230314"
|
pandora_version="7.0NG.769-230315"
|
||||||
|
|
||||||
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
|
||||||
|
@ -1023,7 +1023,7 @@ my $Sem = undef;
|
|||||||
my $ThreadSem = undef;
|
my $ThreadSem = undef;
|
||||||
|
|
||||||
use constant AGENT_VERSION => '7.0NG.769';
|
use constant AGENT_VERSION => '7.0NG.769';
|
||||||
use constant AGENT_BUILD => '230314';
|
use constant AGENT_BUILD => '230315';
|
||||||
|
|
||||||
# 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;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
%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.769
|
||||||
%define release 230314
|
%define release 230315
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
%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.769
|
||||||
%define release 230314
|
%define release 230315
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.769"
|
PI_VERSION="7.0NG.769"
|
||||||
PI_BUILD="230314"
|
PI_BUILD="230315"
|
||||||
OS_NAME=`uname -s`
|
OS_NAME=`uname -s`
|
||||||
|
|
||||||
FORCE=0
|
FORCE=0
|
||||||
|
@ -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"
|
||||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
Version
|
Version
|
||||||
{230314}
|
{230315}
|
||||||
|
|
||||||
ViewReadme
|
ViewReadme
|
||||||
{Yes}
|
{Yes}
|
||||||
|
@ -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 230314")
|
#define PANDORA_VERSION ("7.0NG.769 Build 230315")
|
||||||
|
|
||||||
string pandora_path;
|
string pandora_path;
|
||||||
string pandora_dir;
|
string pandora_dir;
|
||||||
|
@ -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 230314))"
|
VALUE "ProductVersion", "(7.0NG.769(Build 230315))"
|
||||||
VALUE "FileVersion", "1.0.0.0"
|
VALUE "FileVersion", "1.0.0.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-console
|
package: pandorafms-console
|
||||||
Version: 7.0NG.769-230314
|
Version: 7.0NG.769-230315
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -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-230314"
|
pandora_version="7.0NG.769-230315"
|
||||||
|
|
||||||
package_pear=0
|
package_pear=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -155,6 +155,8 @@ 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` (
|
CREATE TABLE IF NOT EXISTS `tfavmenu_user` (
|
||||||
`id` INT NOT NULL AUTO_INCREMENT,
|
`id` INT NOT NULL AUTO_INCREMENT,
|
||||||
`id_user` VARCHAR(255) NOT NULL,
|
`id_user` VARCHAR(255) NOT NULL,
|
||||||
|
@ -407,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',
|
||||||
|
@ -406,9 +406,9 @@ $filterTable->data[1][0] = html_print_submit_button(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// 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\'>';
|
||||||
ui_toggle(
|
ui_toggle(
|
||||||
html_print_table($filterTable, true),
|
$form.html_print_table($filterTable, true).'</form>',
|
||||||
'<span class="subsection_header_title">'.__('Filter').'</span>',
|
'<span class="subsection_header_title">'.__('Filter').'</span>',
|
||||||
__('Filter'),
|
__('Filter'),
|
||||||
'filter',
|
'filter',
|
||||||
@ -418,7 +418,6 @@ ui_toggle(
|
|||||||
'white-box-content no_border',
|
'white-box-content no_border',
|
||||||
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
|
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
|
||||||
);
|
);
|
||||||
echo '</form>';
|
|
||||||
|
|
||||||
// Data table.
|
// Data table.
|
||||||
$selected = true;
|
$selected = true;
|
||||||
|
@ -1071,27 +1071,50 @@ 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',
|
'create_module',
|
||||||
|
@ -444,7 +444,8 @@ $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').' ';
|
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').' ';
|
||||||
if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
|
||||||
|
if ((isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
||||||
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
|
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
|
||||||
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
|
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
|
||||||
'min_warning',
|
'min_warning',
|
||||||
@ -482,7 +483,7 @@ if ($edit_module === false && (isset($stringTypeModule) === false || $stringType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) {
|
if (isset($stringTypeModule) === true && $stringTypeModule === true) {
|
||||||
$basicThresholdsIntervalWarning = [];
|
$basicThresholdsIntervalWarning = [];
|
||||||
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
|
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
|
||||||
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
|
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
|
||||||
@ -531,7 +532,7 @@ $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').' ';
|
$tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').' ';
|
||||||
if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
if ((isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
||||||
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
|
$tableBasicThresholds->data['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',
|
||||||
@ -569,7 +570,7 @@ if ($edit_module === false && (isset($stringTypeModule) === false || $stringType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) {
|
if (isset($stringTypeModule) === true && $stringTypeModule === true) {
|
||||||
$basicThresholdsIntervalCritical = [];
|
$basicThresholdsIntervalCritical = [];
|
||||||
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
|
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
|
||||||
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
|
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
|
||||||
@ -1906,77 +1907,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');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -2235,91 +2209,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>
|
||||||
|
@ -672,7 +672,7 @@ foreach ($simple_alerts as $alert) {
|
|||||||
'[…]',
|
'[…]',
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
$data[2] .= ' <a class="template_details patatas"
|
$data[2] .= ' <a class="template_details"
|
||||||
href="'.ui_get_full_url(false, false, false, false).'ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$alert['id_alert_template'].'">';
|
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/details.svg',
|
'images/details.svg',
|
||||||
|
@ -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.
|
||||||
|
@ -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,25 @@ 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' => __('Netflow'),
|
||||||
],
|
],
|
||||||
[
|
],
|
||||||
'link' => 'index.php?sec=netf&sec2=godmode/netflow/nf_edit',
|
);
|
||||||
'text' => __('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 +195,37 @@ 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/delete.svg', 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
|
||||||
|
);
|
||||||
|
|
||||||
|
// hd($filters);
|
||||||
|
if (empty($filters) === false) {
|
||||||
|
echo '<form id="multiple_delete" method="POST" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&pure='.$pure.'">';
|
||||||
html_print_input_hidden('multiple_delete', 1);
|
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 +233,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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
@ -875,7 +875,7 @@ if (defined('METACONSOLE')) {
|
|||||||
],
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$form .= html_print_input_hidden('action', 'filter', true);
|
$form .= html_print_input_hidden('action', 'sort_items', true);
|
||||||
$form .= '</form>';
|
$form .= '</form>';
|
||||||
|
|
||||||
ui_toggle($form, __('Sort items'), '', '', false);
|
ui_toggle($form, __('Sort items'), '', '', false);
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User creation / update.
|
* User creation / update.
|
||||||
*
|
*
|
||||||
@ -60,7 +59,7 @@ if ($enterprise_include === true) {
|
|||||||
$id = get_parameter('id', get_parameter('id_user', ''));
|
$id = get_parameter('id', get_parameter('id_user', ''));
|
||||||
// Check if we are the same user for edit or we have a proper profile for edit users.
|
// Check if we are the same user for edit or we have a proper profile for edit users.
|
||||||
if ($id !== $config['id_user']) {
|
if ($id !== $config['id_user']) {
|
||||||
if ((is_centralized() === true) || (bool) check_acl($config['id_user'], 0, 'UM') === false) {
|
if ((bool) check_acl($config['id_user'], 0, 'UM') === false) {
|
||||||
db_pandora_audit(
|
db_pandora_audit(
|
||||||
AUDIT_LOG_ACL_VIOLATION,
|
AUDIT_LOG_ACL_VIOLATION,
|
||||||
'Trying to access User Management'
|
'Trying to access User Management'
|
||||||
@ -996,28 +995,19 @@ if (!users_is_admin() && $config['id_user'] !== $id && $new_user === false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_metaconsole() === true) {
|
|
||||||
html_print_div(
|
|
||||||
[
|
|
||||||
'class' => 'user_form_title',
|
|
||||||
'content' => ((bool) $id === true) ? sprintf('%s [ %s ]', __('Update User'), $id) : __('Create User'),
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$new_user) {
|
if (!$new_user) {
|
||||||
$user_id = '<div class="label_select_simple"><p class="edit_user_labels">'.__('User ID').': </p>';
|
$user_id = '<div class="label_select_simple"><p class="edit_user_labels">'.__('User ID').': </p>';
|
||||||
$user_id .= '<span>'.$id.'</span>';
|
$user_id .= '<span>'.$id.'</span>';
|
||||||
$user_id .= html_print_input_hidden('id_user', $id, true);
|
$user_id .= html_print_input_hidden('id_user', $id, true);
|
||||||
$user_id .= '</div>';
|
$user_id .= '</div>';
|
||||||
|
|
||||||
$apiTokenContentElements[] = '<span style="height: 15px;font-size: 14px;">'.__('API Token').'</span>';
|
$apiTokenContentElements[] = '<span style="line-height: 15px; height: 15px;font-size: 14px;">'.__('API Token').'</span>';
|
||||||
$apiTokenContentElements[] = html_print_button(
|
$apiTokenContentElements[] = html_print_button(
|
||||||
__('Renew'),
|
__('Renew'),
|
||||||
'renew_api_token',
|
'renew_api_token',
|
||||||
false,
|
false,
|
||||||
sprintf(
|
sprintf(
|
||||||
'javascript:renewAPIToken(\'%s\', \'%s\', \'%s\')',
|
'javascript:renewAPIToken("%s", "%s", "%s")',
|
||||||
__('Warning'),
|
__('Warning'),
|
||||||
__('The API token will be renewed. After this action, the last token you were using will not work. Are you sure?'),
|
__('The API token will be renewed. After this action, the last token you were using will not work. Are you sure?'),
|
||||||
'user_profile_form',
|
'user_profile_form',
|
||||||
@ -1033,7 +1023,7 @@ if (!$new_user) {
|
|||||||
'show_api_token',
|
'show_api_token',
|
||||||
false,
|
false,
|
||||||
sprintf(
|
sprintf(
|
||||||
'javascript:showAPIToken(\'%s\', \'%s\')',
|
'javascript:showAPIToken("%s", "%s")',
|
||||||
__('API Token'),
|
__('API Token'),
|
||||||
base64_encode(__('Your API Token is:').' <br><span class="font_12pt bolder">'.users_get_API_token($id).'</span><br> '.__('Please, avoid share this string with others.')),
|
base64_encode(__('Your API Token is:').' <br><span class="font_12pt bolder">'.users_get_API_token($id).'</span><br> '.__('Please, avoid share this string with others.')),
|
||||||
),
|
),
|
||||||
@ -1282,8 +1272,9 @@ if (is_metaconsole() === false) {
|
|||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
$array_filters = get_filters_custom_fields_view(0, true);
|
$array_filters = get_filters_custom_fields_view(0, true);
|
||||||
|
|
||||||
$search_custom_fields_view = '<div class="label_select"><p class="edit_user_labels">'.__('Search custom field view').' '.ui_print_help_tip(__('Load by default the selected view in custom field view'), true).'</p>';
|
$searchCustomFieldView = [];
|
||||||
$search_custom_fields_view .= html_print_select(
|
$searchCustomFieldView[] = __('Search custom field view');
|
||||||
|
$searchCustomFieldView[] = html_print_select(
|
||||||
$array_filters,
|
$array_filters,
|
||||||
'default_custom_view',
|
'default_custom_view',
|
||||||
$user_info['default_custom_view'],
|
$user_info['default_custom_view'],
|
||||||
@ -1295,7 +1286,10 @@ if (is_metaconsole() === true) {
|
|||||||
true,
|
true,
|
||||||
'',
|
'',
|
||||||
false
|
false
|
||||||
).'</div>';
|
).ui_print_input_placeholder(
|
||||||
|
__('Load by default the selected view in custom field view'),
|
||||||
|
true
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$values = [
|
$values = [
|
||||||
@ -1377,6 +1371,8 @@ $home_screen .= html_print_input_text(
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$home_screen = '';
|
||||||
|
|
||||||
$size_pagination = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Block size for pagination').'</p>';
|
$size_pagination = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Block size for pagination').'</p>';
|
||||||
$size_pagination .= html_print_input_text(
|
$size_pagination .= html_print_input_text(
|
||||||
'block_size',
|
'block_size',
|
||||||
@ -1395,19 +1391,20 @@ if ($id === $config['id_user']) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enterprise_installed() && is_metaconsole() === true) {
|
if (enterprise_installed() === true && is_metaconsole() === true) {
|
||||||
$user_info_metaconsole_access = 'only_console';
|
$user_info_metaconsole_access = 'only_console';
|
||||||
if (isset($user_info['metaconsole_access'])) {
|
if (isset($user_info['metaconsole_access'])) {
|
||||||
$user_info_metaconsole_access = $user_info['metaconsole_access'];
|
$user_info_metaconsole_access = $user_info['metaconsole_access'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO review help tips on meta.
|
|
||||||
$meta_access = '<div class="label_select"><p class="edit_user_labels">'.__('Metaconsole access').' './* ui_print_help_icon('meta_access', true). */ '</p>';
|
|
||||||
$metaconsole_accesses = [
|
$metaconsole_accesses = [
|
||||||
'basic' => __('Basic'),
|
'basic' => __('Basic'),
|
||||||
'advanced' => __('Advanced'),
|
'advanced' => __('Advanced'),
|
||||||
];
|
];
|
||||||
$meta_access .= html_print_select(
|
|
||||||
|
$outputMetaAccess = [];
|
||||||
|
$outputMetaAccess[] = __('Metaconsole access');
|
||||||
|
$outputMetaAccess[] = html_print_select(
|
||||||
$metaconsole_accesses,
|
$metaconsole_accesses,
|
||||||
'metaconsole_access',
|
'metaconsole_access',
|
||||||
$user_info_metaconsole_access,
|
$user_info_metaconsole_access,
|
||||||
@ -1417,51 +1414,9 @@ if (enterprise_installed() && is_metaconsole() === true) {
|
|||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
false
|
false
|
||||||
).'</div>';
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
$not_login = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Not Login').'</p>';
|
|
||||||
$not_login .= ui_print_help_tip(
|
|
||||||
__('The user with not login set only can access to API.'),
|
|
||||||
true
|
|
||||||
);
|
|
||||||
$not_login .= html_print_checkbox_switch(
|
|
||||||
'not_login',
|
|
||||||
1,
|
|
||||||
$user_info['not_login'],
|
|
||||||
true
|
|
||||||
).'</div>';
|
|
||||||
|
|
||||||
$local_user = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Local user').'</p>';
|
|
||||||
$local_user .= ui_print_help_tip(
|
|
||||||
__('The user with local authentication enabled will always use local authentication.'),
|
|
||||||
true
|
|
||||||
);
|
|
||||||
$local_user .= html_print_checkbox_switch(
|
|
||||||
'local_user',
|
|
||||||
1,
|
|
||||||
$user_info['local_user'],
|
|
||||||
true
|
|
||||||
).'</div>';
|
|
||||||
|
|
||||||
$session_time = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Session Time');
|
|
||||||
$session_time .= ui_print_help_tip(
|
|
||||||
__('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'),
|
|
||||||
true
|
|
||||||
).'</p>';
|
|
||||||
$session_time .= html_print_input_text(
|
|
||||||
'session_time',
|
|
||||||
$user_info['session_time'],
|
|
||||||
'',
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
true.false,
|
|
||||||
false,
|
|
||||||
'',
|
|
||||||
'class="input_line_small"'
|
|
||||||
).'</div>';
|
|
||||||
*/
|
|
||||||
$user_groups = implode(',', array_keys((users_get_groups($id, 'AR', $display_all_group))));
|
$user_groups = implode(',', array_keys((users_get_groups($id, 'AR', $display_all_group))));
|
||||||
|
|
||||||
if (empty($user_groups) === false) {
|
if (empty($user_groups) === false) {
|
||||||
@ -1582,31 +1537,6 @@ if (empty($doubleAuthElementsContent) === false) {
|
|||||||
$doubleAuthentication = '';
|
$doubleAuthentication = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
if (isset($double_authentication)) {
|
|
||||||
$double_authentication .= '</div>';
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$autorefresh_list_out = [];
|
$autorefresh_list_out = [];
|
||||||
if (is_metaconsole() === false || is_centralized() === true) {
|
if (is_metaconsole() === false || is_centralized() === true) {
|
||||||
$autorefresh_list_out['operation/agentes/estado_agente'] = 'Agent detail';
|
$autorefresh_list_out['operation/agentes/estado_agente'] = 'Agent detail';
|
||||||
@ -1665,31 +1595,32 @@ if (isset($autorefresh_list) === false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
enterprise_include_once('include/functions_metaconsole.php');
|
enterprise_include_once('include/functions_metaconsole.php');
|
||||||
|
|
||||||
$access_node = db_get_value('metaconsole_access_node', 'tusuario', 'id_user', $id);
|
$access_node = db_get_value('metaconsole_access_node', 'tusuario', 'id_user', $id);
|
||||||
|
|
||||||
$metaconsole_agents_manager = '<div class="label_select_simple" id="metaconsole_agents_manager_div"><p class="edit_user_labels">'.__('Enable agents managment').'</p>';
|
$metaconsoleAgentManager = [];
|
||||||
$metaconsole_agents_manager .= html_print_checkbox_switch(
|
$metaconsoleAgentManager[] = __('Enable agents managment');
|
||||||
|
$metaconsoleAgentManager[] = html_print_checkbox_switch(
|
||||||
'metaconsole_agents_manager',
|
'metaconsole_agents_manager',
|
||||||
1,
|
1,
|
||||||
$user_info['metaconsole_agents_manager'],
|
$user_info['metaconsole_agents_manager'],
|
||||||
true
|
true
|
||||||
).'</div>';
|
);
|
||||||
|
|
||||||
$metaconsole_access_node = '<div class="label_select_simple" id="metaconsole_access_node_div"><p class="edit_user_labels">'.__('Enable node access').ui_print_help_tip(__('With this option enabled, the user will can access to nodes console'), true).'</p>';
|
$metaconsoleAgentManager[] = __('Enable node access').ui_print_help_tip(
|
||||||
$metaconsole_access_node .= html_print_checkbox(
|
__('With this option enabled, the user will can access to nodes console'),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
$metaconsoleAgentManager[] = html_print_checkbox_switch(
|
||||||
'metaconsole_access_node',
|
'metaconsole_access_node',
|
||||||
1,
|
1,
|
||||||
$access_node,
|
$access_node,
|
||||||
true
|
true
|
||||||
).'</div>';
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo '<div class="max_floating_element_size">';
|
echo '<div class="max_floating_element_size">';
|
||||||
echo '<form id="user_profile_form" name="user_profile_form" method="post" autocomplete="off" action="#">';
|
echo '<form id="user_profile_form" name="user_profile_form" method="post" autocomplete="off" action="#">';
|
||||||
|
|
||||||
@ -1701,137 +1632,8 @@ if (!$id) {
|
|||||||
$user_id_create = $user_id;
|
$user_id_create = $user_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_metaconsole() === true) {
|
// User management form.
|
||||||
$access_or_pagination = $meta_access;
|
require_once 'user_management.php';
|
||||||
if ($id != '' && !$is_err) {
|
|
||||||
$div_user_info = '<div class="edit_user_info_left">'.$avatar.$user_id_create.'</div>
|
|
||||||
<div class="edit_user_info_right">'.$user_id_update_view.$full_name.$new_pass.$new_pass_confirm.$own_pass_confirm.$global_profile.'</div>';
|
|
||||||
} else {
|
|
||||||
$div_user_info = '<div class="edit_user_info_left">'.$avatar.'</div>
|
|
||||||
<div class="edit_user_info_right">'.$user_id_create.$user_id_update_view.$full_name.$new_pass.$new_pass_confirm.$global_profile.'</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<div id="user_form">
|
|
||||||
<div class="user_edit_first_row">
|
|
||||||
<div class="edit_user_info white_box">'.$div_user_info.'</div>
|
|
||||||
<div class="edit_user_autorefresh white_box"><p class="bolder">Extra info</p>'.$email.$phone.$not_login.$local_user.$session_time.'</div>
|
|
||||||
</div>
|
|
||||||
<div class="user_edit_second_row white_box">
|
|
||||||
<div class="edit_user_options">'.$language.$access_or_pagination.$skin.$default_event_filter.$double_authentication.'</div>
|
|
||||||
|
|
||||||
<div class="edit_user_timezone">'.$timezone;
|
|
||||||
|
|
||||||
echo $search_custom_fields_view.$metaconsole_agents_manager.$metaconsole_access_node;
|
|
||||||
|
|
||||||
$autorefresh_show = '<p class="edit_user_labels">'._('Autorefresh').ui_print_help_tip(
|
|
||||||
__('This will activate autorefresh in selected pages'),
|
|
||||||
true
|
|
||||||
).'</p>';
|
|
||||||
$select_out = html_print_select(
|
|
||||||
$autorefresh_list_out,
|
|
||||||
'autorefresh_list_out[]',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
'width:100%'
|
|
||||||
);
|
|
||||||
$arrows = ' ';
|
|
||||||
$select_in = html_print_select(
|
|
||||||
$autorefresh_list,
|
|
||||||
'autorefresh_list[]',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
'width:100%'
|
|
||||||
);
|
|
||||||
|
|
||||||
$table_ichanges = '<div class="autorefresh_select">
|
|
||||||
<div class="autorefresh_select_list_out">
|
|
||||||
<p class="autorefresh_select_text">'.__('Full list of pages').': </p>
|
|
||||||
<div>'.$select_out.'</div>
|
|
||||||
</div>
|
|
||||||
<div class="autorefresh_select_arrows" style="display:grid">
|
|
||||||
<a href="javascript:">'.html_print_image(
|
|
||||||
'images/darrowright_green.png',
|
|
||||||
true,
|
|
||||||
[
|
|
||||||
'id' => 'right_autorefreshlist',
|
|
||||||
'alt' => __('Push selected pages into autorefresh list'),
|
|
||||||
'title' => __('Push selected pages into autorefresh list'),
|
|
||||||
]
|
|
||||||
).'</a>
|
|
||||||
<a href="javascript:">'.html_print_image(
|
|
||||||
'images/darrowleft_green.png',
|
|
||||||
true,
|
|
||||||
[
|
|
||||||
'id' => 'left_autorefreshlist',
|
|
||||||
'alt' => __('Pop selected pages out of autorefresh list'),
|
|
||||||
'title' => __('Pop selected pages out of autorefresh list'),
|
|
||||||
]
|
|
||||||
).'</a>
|
|
||||||
</div>
|
|
||||||
<div class="autorefresh_select_list">
|
|
||||||
<p class="autorefresh_select_text">'.__('List of pages with autorefresh').': </p>
|
|
||||||
<div>'.$select_in.'</div>
|
|
||||||
</div>
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
$autorefresh_show .= $table_ichanges;
|
|
||||||
|
|
||||||
// Time autorefresh.
|
|
||||||
$times = get_refresh_time_array();
|
|
||||||
$time_autorefresh = '<div class="label_select"><p class="edit_user_labels">'.__('Time autorefresh');
|
|
||||||
$time_autorefresh .= ui_print_help_tip(
|
|
||||||
__('Interval of autorefresh of the elements, by default they are 30 seconds, needing to enable the autorefresh first'),
|
|
||||||
true
|
|
||||||
).'</p>';
|
|
||||||
$time_autorefresh .= html_print_select(
|
|
||||||
$times,
|
|
||||||
'time_autorefresh',
|
|
||||||
$user_info['time_autorefresh'],
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false
|
|
||||||
).'</div>';
|
|
||||||
|
|
||||||
|
|
||||||
echo '</div>
|
|
||||||
</div>
|
|
||||||
<div class="edit_user_autorefresh white_box">'.$autorefresh_show.$time_autorefresh.'</div>
|
|
||||||
<div class="user_edit_third_row white_box">
|
|
||||||
<div class="edit_user_comments">'.$comments.'</div>
|
|
||||||
</div>';
|
|
||||||
|
|
||||||
if (empty($ehorus) === false) {
|
|
||||||
html_print_div(
|
|
||||||
[
|
|
||||||
'class' => 'user_edit_third_row white_box',
|
|
||||||
'content' => $ehorus,
|
|
||||||
],
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$access_or_pagination = $size_pagination;
|
|
||||||
// WIP: Only for node.
|
|
||||||
include_once 'user_management.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ((bool) $config['admin_can_add_user'] === true) {
|
if ((bool) $config['admin_can_add_user'] === true) {
|
||||||
html_print_csrf_hidden();
|
html_print_csrf_hidden();
|
||||||
@ -1912,7 +1714,7 @@ if (is_metaconsole() === false) {
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Set up the picker to update target timezone and country select lists.
|
// Set up the picker to update target timezone and country select lists.
|
||||||
$('#timezone-image').timezonePicker({
|
$('#timezone-image').timezonePicker({
|
||||||
target: '#timezone',
|
target: '#timezone1',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Optionally an auto-detect button to trigger JavaScript geolocation.
|
// Optionally an auto-detect button to trigger JavaScript geolocation.
|
||||||
@ -1934,23 +1736,13 @@ if (is_metaconsole() === false) {
|
|||||||
var json_profile = $('#hidden-json_profile');
|
var json_profile = $('#hidden-json_profile');
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
// Set up the picker to update target timezone and country select lists.
|
|
||||||
$('#timezone-image').timezonePicker({
|
|
||||||
target: '#timezone1',
|
|
||||||
});
|
|
||||||
|
|
||||||
// Optionally an auto-detect button to trigger JavaScript geolocation.
|
|
||||||
$('#timezone-detect').click(function() {
|
|
||||||
$('#timezone-image').timezonePicker('detectLocation');
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#right_autorefreshlist").click(function() {
|
$("#right_autorefreshlist").click(function() {
|
||||||
jQuery.each($("select[name='autorefresh_list_out[]'] option:selected"), function(key, value) {
|
jQuery.each($("select[name='autorefresh_list_out[]'] option:selected"), function(key, value) {
|
||||||
imodule_name = $(value).html();
|
imodule_name = $(value).html();
|
||||||
if (imodule_name != <?php echo "'".__('None')."'"; ?>) {
|
if (imodule_name != <?php echo "'".__('None')."'"; ?>) {
|
||||||
id_imodule = $(value).attr('value');
|
id_imodule = $(value).attr('value');
|
||||||
$("select[name='autorefresh_list[]']").append($("<option></option>").val(id_imodule).html('<i>' + imodule_name + '</i>'));
|
$("select[name='autorefresh_list[]'] option").each(function() { $(this).attr("selected", true) });
|
||||||
|
$("select[name='autorefresh_list[]']").append($("<option></option>").val(id_imodule).html('<i>' + imodule_name + '</i>').attr("selected", true));
|
||||||
$("#autorefresh_list_out").find("option[value='" + id_imodule + "']").remove();
|
$("#autorefresh_list_out").find("option[value='" + id_imodule + "']").remove();
|
||||||
$("#autorefresh_list").find("option[value='']").remove();
|
$("#autorefresh_list").find("option[value='']").remove();
|
||||||
$("#autorefresh_list").find("option[value='0']").remove();
|
$("#autorefresh_list").find("option[value='0']").remove();
|
||||||
|
@ -395,8 +395,6 @@ if ($delete_user === true) {
|
|||||||
__('There was a problem deleting the user from %s', io_safe_input($server['server_name']))
|
__('There was a problem deleting the user from %s', io_safe_input($server['server_name']))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Refresh:1');
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ui_print_error_message(__('There was a problem deleting the user'));
|
ui_print_error_message(__('There was a problem deleting the user'));
|
||||||
@ -463,43 +461,72 @@ if (($filter_group == 0) && ($filter_search == '')) {
|
|||||||
|
|
||||||
$filterTable = new stdClass();
|
$filterTable = new stdClass();
|
||||||
$filterTable->width = '100%';
|
$filterTable->width = '100%';
|
||||||
$filterTable->class = 'fixed_filter_bar';
|
$filterTable->class = 'filter-table-adv';
|
||||||
$filterTable->rowclass[0] = '';
|
$filterTable->rowclass[0] = '';
|
||||||
$filterTable->cellstyle[0][0] = 'width:0';
|
$filterTable->cellstyle[0][0] = 'width:0';
|
||||||
$filterTable->cellstyle[0][1] = 'width:0';
|
$filterTable->cellstyle[0][1] = 'width:0';
|
||||||
$filterTable->data[0][0] = __('Group');
|
$filterTable->data[0][] = html_print_label_input_block(
|
||||||
$filterTable->data[1][0] = html_print_select_groups(
|
__('Group'),
|
||||||
false,
|
html_print_select_groups(
|
||||||
'AR',
|
false,
|
||||||
true,
|
'AR',
|
||||||
'filter_group',
|
true,
|
||||||
$filter_group,
|
'filter_group',
|
||||||
'',
|
$filter_group,
|
||||||
'',
|
'',
|
||||||
0,
|
'',
|
||||||
true
|
0,
|
||||||
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
$filterTable->data[0][1] = __('Search').ui_print_help_tip(__('Search by username, fullname or email'), true);
|
|
||||||
$filterTable->data[1][1] = html_print_input_text(
|
$filterTable->data[0][] = html_print_label_input_block(
|
||||||
'filter_search',
|
|
||||||
$filter_search,
|
|
||||||
__('Search by username, fullname or email'),
|
|
||||||
30,
|
|
||||||
90,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
$filterTable->cellstyle[1][2] = 'vertical-align: bottom';
|
|
||||||
$filterTable->data[1][2] = html_print_submit_button(
|
|
||||||
__('Search'),
|
__('Search'),
|
||||||
'search',
|
html_print_input_text(
|
||||||
false,
|
'filter_search',
|
||||||
|
$filter_search,
|
||||||
|
__('Search by username, fullname or email'),
|
||||||
|
30,
|
||||||
|
90,
|
||||||
|
true
|
||||||
|
).ui_print_input_placeholder(
|
||||||
|
__('Search by username, fullname or email'),
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$form_filter = "<form method='post'>";
|
||||||
|
$form_filter .= html_print_table($filterTable, true);
|
||||||
|
$form_filter .= html_print_div(
|
||||||
[
|
[
|
||||||
'icon' => 'search',
|
'class' => 'action-buttons-right-forced',
|
||||||
'class' => 'float-right',
|
'content' => html_print_submit_button(
|
||||||
'mode' => 'secondary mini',
|
__('Search'),
|
||||||
|
'search',
|
||||||
|
false,
|
||||||
|
[
|
||||||
|
'icon' => 'search',
|
||||||
|
'class' => 'float-right',
|
||||||
|
'mode' => 'secondary mini',
|
||||||
|
],
|
||||||
|
true
|
||||||
|
),
|
||||||
],
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
$form_filter .= '</form>';
|
||||||
|
|
||||||
|
ui_toggle(
|
||||||
|
$form_filter,
|
||||||
|
'<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'
|
||||||
|
);
|
||||||
|
|
||||||
$is_management_allowed = true;
|
$is_management_allowed = true;
|
||||||
if (is_metaconsole() === false && is_management_allowed() === false) {
|
if (is_metaconsole() === false && is_management_allowed() === false) {
|
||||||
@ -520,20 +547,6 @@ if (is_metaconsole() === false && is_management_allowed() === false) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (is_metaconsole() === true) {
|
|
||||||
$filterTable->width = '96%';
|
|
||||||
$form_filter = "<form class='filters_form' method='post'>";
|
|
||||||
$form_filter .= html_print_table($filterTable, true);
|
|
||||||
$form_filter .= '</form>';
|
|
||||||
ui_toggle($form_filter, __('Show Options'));
|
|
||||||
} else {
|
|
||||||
$form_filter = "<form method='post'>";
|
|
||||||
$form_filter .= html_print_table($filterTable, true);
|
|
||||||
$form_filter .= '</form>';
|
|
||||||
echo $form_filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Urls to sort the table.
|
// Urls to sort the table.
|
||||||
$url_up_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=up&pure='.$pure;
|
$url_up_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=up&pure='.$pure;
|
||||||
$url_down_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=down&pure='.$pure;
|
$url_down_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=down&pure='.$pure;
|
||||||
|
@ -325,53 +325,55 @@ if ($new_user === false) {
|
|||||||
|
|
||||||
$userManagementTable->data['passwordManage_table'] = html_print_table($passwordManageTable, true);
|
$userManagementTable->data['passwordManage_table'] = html_print_table($passwordManageTable, true);
|
||||||
|
|
||||||
|
if (users_is_admin() === true) {
|
||||||
|
$userManagementTable->rowclass['captions_loginErrorUser'] = 'field_half_width w50p';
|
||||||
|
$userManagementTable->cellclass['captions_loginErrorUser'][0] = 'wrap';
|
||||||
|
$userManagementTable->cellclass['captions_loginErrorUser'][1] = 'wrap';
|
||||||
|
$notLoginCheckContent = [];
|
||||||
|
$notLoginCheckContent[] = '<span>'.__('Not Login').'</span>';
|
||||||
|
$notLoginCheckContent[] = html_print_checkbox_switch(
|
||||||
|
'not_login',
|
||||||
|
1,
|
||||||
|
$user_info['not_login'],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
$userManagementTable->rowclass['captions_loginErrorUser'] = 'field_half_width w50p';
|
$userManagementTable->data['captions_loginErrorUser'][0] = html_print_div(
|
||||||
$userManagementTable->cellclass['captions_loginErrorUser'][0] = 'wrap';
|
[
|
||||||
$userManagementTable->cellclass['captions_loginErrorUser'][1] = 'wrap';
|
'class' => 'margin-top-10',
|
||||||
$notLoginCheckContent = [];
|
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
||||||
$notLoginCheckContent[] = '<span>'.__('Not Login').'</span>';
|
'content' => implode('', $notLoginCheckContent),
|
||||||
$notLoginCheckContent[] = html_print_checkbox_switch(
|
],
|
||||||
'not_login',
|
true
|
||||||
1,
|
);
|
||||||
$user_info['not_login'],
|
$userManagementTable->data['captions_loginErrorUser'][0] .= ui_print_input_placeholder(
|
||||||
true
|
__('The user with not login set only can access to API.'),
|
||||||
);
|
true
|
||||||
|
);
|
||||||
|
|
||||||
$userManagementTable->data['captions_loginErrorUser'][0] = html_print_div(
|
$localUserCheckContent = [];
|
||||||
[
|
$localUserCheckContent[] = '<span>'.__('Local User').'</span>';
|
||||||
'class' => 'margin-top-10',
|
$localUserCheckContent[] = html_print_checkbox_switch(
|
||||||
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
'local_user',
|
||||||
'content' => implode('', $notLoginCheckContent),
|
1,
|
||||||
],
|
$user_info['local_user'],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$userManagementTable->data['captions_loginErrorUser'][0] .= ui_print_input_placeholder(
|
|
||||||
__('The user with not login set only can access to API.'),
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
$localUserCheckContent = [];
|
$userManagementTable->data['captions_loginErrorUser'][1] = html_print_div(
|
||||||
$localUserCheckContent[] = '<span>'.__('Local User').'</span>';
|
[
|
||||||
$localUserCheckContent[] = html_print_checkbox_switch(
|
'class' => 'margin-top-10',
|
||||||
'local_user',
|
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
||||||
1,
|
'content' => implode('', $localUserCheckContent),
|
||||||
$user_info['local_user'],
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
$userManagementTable->data['captions_loginErrorUser'][1] .= ui_print_input_placeholder(
|
||||||
|
__('The user with local authentication enabled will always use local authentication.'),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$userManagementTable->data['captions_loginErrorUser'][1] = html_print_div(
|
|
||||||
[
|
|
||||||
'class' => 'margin-top-10',
|
|
||||||
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
|
||||||
'content' => implode('', $localUserCheckContent),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
);
|
|
||||||
$userManagementTable->data['captions_loginErrorUser'][1] .= ui_print_input_placeholder(
|
|
||||||
__('The user with local authentication enabled will always use local authentication.'),
|
|
||||||
true
|
|
||||||
);
|
|
||||||
$userManagementTable->data['show_tips_startup'][0] = html_print_checkbox_switch('show_tips_startup', 1, ($user_info['show_tips_startup'] === null) ? true : $user_info['show_tips_startup'], true);
|
$userManagementTable->data['show_tips_startup'][0] = html_print_checkbox_switch('show_tips_startup', 1, ($user_info['show_tips_startup'] === null) ? true : $user_info['show_tips_startup'], true);
|
||||||
$userManagementTable->data['show_tips_startup'][1] = '<span>'.__('Show usage tips at startup').'</span>';
|
$userManagementTable->data['show_tips_startup'][1] = '<span>'.__('Show usage tips at startup').'</span>';
|
||||||
|
|
||||||
@ -551,10 +553,10 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh
|
|||||||
// Title for Language and Appearance.
|
// Title for Language and Appearance.
|
||||||
$userManagementTable->data['title_lookAndFeel'] = html_print_subtitle_table(__('Language and Appearance'));
|
$userManagementTable->data['title_lookAndFeel'] = html_print_subtitle_table(__('Language and Appearance'));
|
||||||
// Language and color scheme.
|
// Language and color scheme.
|
||||||
$userManagementTable->rowclass['captions_lang_colorscheme'] = 'field_half_width';
|
$userManagementTable->rowclass['line1_looknfeel'] = 'field_half_width';
|
||||||
$userManagementTable->rowclass['fields_lang_colorscheme'] = 'field_half_width';
|
$userManagementTable->rowclass['line2_looknfeel'] = 'field_half_width';
|
||||||
$userManagementTable->data['captions_lang_colorscheme'][0] = __('Language');
|
$userManagementTable->data['line1_looknfeel'][0] = __('Language');
|
||||||
$userManagementTable->data['fields_lang_colorscheme'][0] = html_print_select_from_sql(
|
$userManagementTable->data['line2_looknfeel'][0] = html_print_select_from_sql(
|
||||||
'SELECT id_language, name FROM tlanguage',
|
'SELECT id_language, name FROM tlanguage',
|
||||||
'language',
|
'language',
|
||||||
$user_info['language'],
|
$user_info['language'],
|
||||||
@ -564,8 +566,15 @@ $userManagementTable->data['fields_lang_colorscheme'][0] = html_print_select_fro
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$userManagementTable->data['captions_lang_colorscheme'][1] = __('User color scheme');
|
if (is_metaconsole() === true) {
|
||||||
$userManagementTable->data['fields_lang_colorscheme'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true);
|
if (users_is_admin() === true) {
|
||||||
|
$userManagementTable->data['line1_looknfeel'][1] = $outputMetaAccess[0];
|
||||||
|
$userManagementTable->data['line2_looknfeel'][1] = $outputMetaAccess[1];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$userManagementTable->data['line1_looknfeel'][1] = __('User color scheme');
|
||||||
|
$userManagementTable->data['line2_looknfeel'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true);
|
||||||
|
}
|
||||||
|
|
||||||
$userManagementTable->rowclass['captions_blocksize_eventfilter'] = 'field_half_width';
|
$userManagementTable->rowclass['captions_blocksize_eventfilter'] = 'field_half_width';
|
||||||
$userManagementTable->rowclass['fields_blocksize_eventfilter'] = 'field_half_width';
|
$userManagementTable->rowclass['fields_blocksize_eventfilter'] = 'field_half_width';
|
||||||
@ -591,41 +600,55 @@ $userManagementTable->data['fields_blocksize_eventfilter'][1] = html_print_selec
|
|||||||
false,
|
false,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
if (is_metaconsole() === false) {
|
||||||
|
// Home screen table.
|
||||||
|
$homeScreenTable = new stdClass();
|
||||||
|
$homeScreenTable->class = 'w100p table_section full_section';
|
||||||
|
$homeScreenTable->id = 'home_screen_table';
|
||||||
|
$homeScreenTable->style = [];
|
||||||
|
$homeScreenTable->rowclass = [];
|
||||||
|
$homeScreenTable->data = [];
|
||||||
|
// Home screen.
|
||||||
|
$homeScreenTable->data['captions_homescreen'][0] = __('Home screen');
|
||||||
|
$homeScreenTable->colspan['captions_homescreen'][0] = 2;
|
||||||
|
$homeScreenTable->rowclass['captions_homescreen'] = 'field_half_width';
|
||||||
|
$homeScreenTable->rowclass['fields_homescreen'] = 'field_half_width flex';
|
||||||
|
$homeScreenTable->data['fields_homescreen'][0] = html_print_select(
|
||||||
|
$homeScreenValues,
|
||||||
|
'section',
|
||||||
|
io_safe_output($user_info['section']),
|
||||||
|
'show_data_section();',
|
||||||
|
'',
|
||||||
|
-1,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
$homeScreenTable->data['fields_homescreen'][1] = html_print_div(
|
||||||
|
[
|
||||||
|
'class' => 'w100p',
|
||||||
|
'content' => $customHomeScreenDataField,
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
// Home screen table.
|
$userManagementTable->rowclass['homescreen_table'] = 'w100p';
|
||||||
$homeScreenTable = new stdClass();
|
$userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true);
|
||||||
$homeScreenTable->class = 'w100p table_section full_section';
|
}
|
||||||
$homeScreenTable->id = 'home_screen_table';
|
|
||||||
$homeScreenTable->style = [];
|
|
||||||
$homeScreenTable->rowclass = [];
|
|
||||||
$homeScreenTable->data = [];
|
|
||||||
|
|
||||||
// Home screen.
|
if (is_metaconsole() === true && users_is_admin() === true) {
|
||||||
$homeScreenTable->data['captions_homescreen'][0] = __('Home screen');
|
$userManagementTable->rowclass['search_custom1_looknfeel'] = 'field_half_width';
|
||||||
$homeScreenTable->colspan['captions_homescreen'][0] = 2;
|
$userManagementTable->rowclass['search_custom2_looknfeel'] = 'field_half_width flex-column';
|
||||||
$homeScreenTable->rowclass['captions_homescreen'] = 'field_half_width';
|
$userManagementTable->data['search_custom1_looknfeel'][0] = $searchCustomFieldView[0];
|
||||||
$homeScreenTable->rowclass['fields_homescreen'] = 'field_half_width flex';
|
$userManagementTable->data['search_custom2_looknfeel'][0] = $searchCustomFieldView[1];
|
||||||
$homeScreenTable->data['fields_homescreen'][0] = html_print_select(
|
|
||||||
$homeScreenValues,
|
|
||||||
'section',
|
|
||||||
io_safe_output($user_info['section']),
|
|
||||||
'show_data_section();',
|
|
||||||
'',
|
|
||||||
-1,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
$homeScreenTable->data['fields_homescreen'][1] = html_print_div(
|
|
||||||
[
|
|
||||||
'class' => 'w100p',
|
|
||||||
'content' => $customHomeScreenDataField,
|
|
||||||
],
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
$userManagementTable->rowclass['homescreen_table'] = 'w100p';
|
$userManagementTable->rowclass['agent_manager1_looknfeel'] = 'field_half_width';
|
||||||
$userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true);
|
$userManagementTable->rowclass['agent_manager2_looknfeel'] = 'field_half_width flex-column';
|
||||||
|
$userManagementTable->data['agent_manager1_looknfeel'][0] = $metaconsoleAgentManager[0];
|
||||||
|
$userManagementTable->data['agent_manager1_looknfeel'][1] = $metaconsoleAgentManager[2];
|
||||||
|
$userManagementTable->data['agent_manager2_looknfeel'][0] = $metaconsoleAgentManager[1];
|
||||||
|
$userManagementTable->data['agent_manager2_looknfeel'][1] = $metaconsoleAgentManager[3];
|
||||||
|
}
|
||||||
|
|
||||||
// Timezone.
|
// Timezone.
|
||||||
$userManagementTable->rowclass['captions_timezone'] = 'field_half_width';
|
$userManagementTable->rowclass['captions_timezone'] = 'field_half_width';
|
||||||
@ -639,14 +662,15 @@ $userManagementTable->data['fields_timezone'][0] .= ui_print_input_placeholder(
|
|||||||
__('The timezone must be that of the associated server.'),
|
__('The timezone must be that of the associated server.'),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
if (is_metaconsole() === false) {
|
||||||
$userManagementTable->data['fields_timezone'][1] = html_print_div(
|
$userManagementTable->data['fields_timezone'][1] = html_print_div(
|
||||||
[
|
[
|
||||||
'id' => 'timezone-picker',
|
'id' => 'timezone-picker',
|
||||||
'content' => implode('', $timezoneContent),
|
'content' => implode('', $timezoneContent),
|
||||||
],
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Title for Language and Appearance.
|
// Title for Language and Appearance.
|
||||||
$userManagementTable->data['title_additionalSettings'] = html_print_subtitle_table(__('Additional settings'));
|
$userManagementTable->data['title_additionalSettings'] = html_print_subtitle_table(__('Additional settings'));
|
||||||
@ -743,3 +767,19 @@ html_print_table($userManagementTable);
|
|||||||
if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) {
|
if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) {
|
||||||
profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true));
|
profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!--
|
||||||
|
<script>
|
||||||
|
paint_qrcode(
|
||||||
|
"
|
||||||
|
<?php
|
||||||
|
// echo ui_get_full_url('mobile/index.php?page=agent&id='.$id_agente);
|
||||||
|
?>
|
||||||
|
",
|
||||||
|
"#qr_code_agent_view",
|
||||||
|
128,
|
||||||
|
128
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
-->
|
@ -731,7 +731,7 @@ class DiscoveryTaskList extends HTML
|
|||||||
case DISCOVERY_CLOUD_AZURE_COMPUTE:
|
case DISCOVERY_CLOUD_AZURE_COMPUTE:
|
||||||
// Discovery Applications MySQL.
|
// Discovery Applications MySQL.
|
||||||
$data[6] = html_print_image(
|
$data[6] = html_print_image(
|
||||||
'images/plugin@svg.svg',
|
'images/plugins@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'title' => __('Discovery Cloud Azure Compute'),
|
'title' => __('Discovery Cloud Azure Compute'),
|
||||||
@ -744,7 +744,7 @@ class DiscoveryTaskList extends HTML
|
|||||||
case DISCOVERY_CLOUD_AWS_EC2:
|
case DISCOVERY_CLOUD_AWS_EC2:
|
||||||
// Discovery Applications MySQL.
|
// Discovery Applications MySQL.
|
||||||
$data[6] = html_print_image(
|
$data[6] = html_print_image(
|
||||||
'images/plugin@svg.svg',
|
'images/plugins@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'title' => __('Discovery Cloud AWS EC2'),
|
'title' => __('Discovery Cloud AWS EC2'),
|
||||||
@ -856,7 +856,7 @@ class DiscoveryTaskList extends HTML
|
|||||||
} else {
|
} else {
|
||||||
// APP or external script recon task.
|
// APP or external script recon task.
|
||||||
$data[6] = html_print_image(
|
$data[6] = html_print_image(
|
||||||
'images/plugin@svg.svg',
|
'images/plugins@svg.svg',
|
||||||
true,
|
true,
|
||||||
['class' => 'main_menu_icon invert_filter']
|
['class' => 'main_menu_icon invert_filter']
|
||||||
).' ';
|
).' ';
|
||||||
|
@ -27,8 +27,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Begin.
|
// Begin.
|
||||||
require_once 'config.php';
|
|
||||||
|
|
||||||
require_once __DIR__.'/config.php';
|
require_once __DIR__.'/config.php';
|
||||||
require_once __DIR__.'/functions.php';
|
require_once __DIR__.'/functions.php';
|
||||||
require_once __DIR__.'/functions_db.php';
|
require_once __DIR__.'/functions_db.php';
|
||||||
@ -87,7 +85,7 @@ if (check_login(false) === false) {
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Access is not granted</h1>
|
<h1>Access is not granted</h1>
|
||||||
<div id="container-chart-generator-item" style="display:none; margin:0px;">
|
<div id="container-chart-generator-item" style="display:none; margin:0px;width:100px;height:100px;">
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
@ -246,6 +244,9 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'slicebar':
|
case 'slicebar':
|
||||||
|
// TO-DO Cambiar esto para que se pase por POST, NO SE PUEDE PASAR POR GET.
|
||||||
|
$params['graph_data'] = json_decode(io_safe_output($config[$params['tokem_config']]), true);
|
||||||
|
delete_config_token($params['tokem_config']);
|
||||||
echo flot_slicesbar_graph(
|
echo flot_slicesbar_graph(
|
||||||
$params['graph_data'],
|
$params['graph_data'],
|
||||||
$params['period'],
|
$params['period'],
|
||||||
|
@ -1329,7 +1329,7 @@ class AgentWizard extends HTML
|
|||||||
$table->rowstyle[$i] = 'color:#ccc;';
|
$table->rowstyle[$i] = 'color:#ccc;';
|
||||||
$data[0] .= ' ';
|
$data[0] .= ' ';
|
||||||
$data[0] .= html_print_image(
|
$data[0] .= html_print_image(
|
||||||
'images/error.png',
|
'images/alert-warning@svg.svg',
|
||||||
true,
|
true,
|
||||||
['title' => $msgError]
|
['title' => $msgError]
|
||||||
);
|
);
|
||||||
@ -1347,7 +1347,7 @@ class AgentWizard extends HTML
|
|||||||
// Img Server.
|
// Img Server.
|
||||||
if ($this->serverType == SERVER_TYPE_ENTERPRISE_SATELLITE) {
|
if ($this->serverType == SERVER_TYPE_ENTERPRISE_SATELLITE) {
|
||||||
$img_server = html_print_image(
|
$img_server = html_print_image(
|
||||||
'images/satellite.png',
|
'images/satellite@os.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'title' => __('Enterprise Satellite server'),
|
'title' => __('Enterprise Satellite server'),
|
||||||
@ -1357,7 +1357,7 @@ class AgentWizard extends HTML
|
|||||||
} else {
|
} else {
|
||||||
if ($module['execution_type'] == EXECUTION_TYPE_PLUGIN) {
|
if ($module['execution_type'] == EXECUTION_TYPE_PLUGIN) {
|
||||||
$img_server = html_print_image(
|
$img_server = html_print_image(
|
||||||
'images/plugin.png',
|
'images/plugins@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'title' => __('Plugin server'),
|
'title' => __('Plugin server'),
|
||||||
@ -1367,7 +1367,7 @@ class AgentWizard extends HTML
|
|||||||
} else {
|
} else {
|
||||||
if ($this->protocol === 'wmi') {
|
if ($this->protocol === 'wmi') {
|
||||||
$img_server = html_print_image(
|
$img_server = html_print_image(
|
||||||
'images/wmi.png',
|
'images/WMI@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'title' => __('WMI server'),
|
'title' => __('WMI server'),
|
||||||
@ -1376,7 +1376,7 @@ class AgentWizard extends HTML
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$img_server = html_print_image(
|
$img_server = html_print_image(
|
||||||
'images/op_network.png',
|
'images/network@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'title' => __('Network server'),
|
'title' => __('Network server'),
|
||||||
@ -4090,7 +4090,7 @@ class AgentWizard extends HTML
|
|||||||
$blockTitle .= '<b>'.$block['name'];
|
$blockTitle .= '<b>'.$block['name'];
|
||||||
$blockTitle .= ' ';
|
$blockTitle .= ' ';
|
||||||
$blockTitle .= html_print_image(
|
$blockTitle .= html_print_image(
|
||||||
'images/tip_help.png',
|
'images/info@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'title' => __('Modules selected'),
|
'title' => __('Modules selected'),
|
||||||
@ -4110,7 +4110,7 @@ class AgentWizard extends HTML
|
|||||||
|
|
||||||
$blockTitle .= ' ';
|
$blockTitle .= ' ';
|
||||||
$blockTitle .= html_print_image(
|
$blockTitle .= html_print_image(
|
||||||
'images/tip_help.png',
|
'images/info@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'title' => __('Modules selected'),
|
'title' => __('Modules selected'),
|
||||||
@ -4205,6 +4205,9 @@ class AgentWizard extends HTML
|
|||||||
$table->size[4] = '140px';
|
$table->size[4] = '140px';
|
||||||
$table->size[5] = '3%';
|
$table->size[5] = '3%';
|
||||||
|
|
||||||
|
$table->align = [];
|
||||||
|
$table->align[1] = 'center';
|
||||||
|
|
||||||
// If is needed show current value, we must correct the table.
|
// If is needed show current value, we must correct the table.
|
||||||
if ($showCurrentValue === true) {
|
if ($showCurrentValue === true) {
|
||||||
// Correct headers.
|
// Correct headers.
|
||||||
@ -4273,7 +4276,7 @@ class AgentWizard extends HTML
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
$md5IdBlock,
|
$md5IdBlock.' w100p',
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
@ -4293,8 +4296,9 @@ class AgentWizard extends HTML
|
|||||||
1,
|
1,
|
||||||
20,
|
20,
|
||||||
$module['description'],
|
$module['description'],
|
||||||
'form=\'form-create-modules\' class=\'min-height-50px\'',
|
'form=\'form-create-modules\'',
|
||||||
true
|
true,
|
||||||
|
'w100p'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4703,8 +4707,6 @@ class AgentWizard extends HTML
|
|||||||
'toggle_class' => '',
|
'toggle_class' => '',
|
||||||
'container_class' => 'white-box-content',
|
'container_class' => 'white-box-content',
|
||||||
'main_class' => $class,
|
'main_class' => $class,
|
||||||
'img_a' => 'images/arrow_down_green.png',
|
|
||||||
'img_b' => 'images/arrow_right_green.png',
|
|
||||||
'clean' => false,
|
'clean' => false,
|
||||||
'reverseImg' => $reverseImg,
|
'reverseImg' => $reverseImg,
|
||||||
'switch' => $buttonSwitch,
|
'switch' => $buttonSwitch,
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* Pandora build version and version
|
* Pandora build version and version
|
||||||
*/
|
*/
|
||||||
$build_version = 'PC230314';
|
$build_version = 'PC230315';
|
||||||
$pandora_version = 'v7.0NG.769';
|
$pandora_version = 'v7.0NG.769';
|
||||||
|
|
||||||
// Do not overwrite default timezone set if defined.
|
// Do not overwrite default timezone set if defined.
|
||||||
|
@ -3548,6 +3548,18 @@ function update_config_token($cfgtoken, $cfgvalue)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function delete_config_token($cfgtoken)
|
||||||
|
{
|
||||||
|
$delete = db_process_sql(sprintf('DELETE FROM tconfig WHERE token = "%s"', $cfgtoken));
|
||||||
|
|
||||||
|
if ($delete) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_number_of_mr($package, $ent, $offline)
|
function get_number_of_mr($package, $ent, $offline)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
@ -4275,6 +4287,7 @@ function generator_chart_to_pdf(
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset($data['data']['graph_data']);
|
||||||
// If not install chromium avoid 500 convert tu images no data to show.
|
// If not install chromium avoid 500 convert tu images no data to show.
|
||||||
$chromium_dir = io_safe_output($config['chromium_path']);
|
$chromium_dir = io_safe_output($config['chromium_path']);
|
||||||
$result_ejecution = exec($chromium_dir.' --version');
|
$result_ejecution = exec($chromium_dir.' --version');
|
||||||
|
@ -2668,7 +2668,7 @@ function events_print_type_img(
|
|||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'alert_recovered':
|
case 'alert_recovered':
|
||||||
$icon = 'images/alert@svg.svg';
|
$style .= ' alert_module_background_state icon_background_normal ';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'alert_manual_validation':
|
case 'alert_manual_validation':
|
||||||
@ -4356,7 +4356,7 @@ function events_page_details($event, $server_id=0)
|
|||||||
|
|
||||||
$graph_params_str = http_build_query($graph_params);
|
$graph_params_str = http_build_query($graph_params);
|
||||||
|
|
||||||
$link = "winopeng_var('".$url.'?'.$graph_params_str."','".$win_handle."', 800, 480)";
|
$link = 'winopeng_var("'.$url.'?'.$graph_params_str.'","'.$win_handle.'", 800, 480)';
|
||||||
$data[1] = html_print_button(__('View graph'), 'view_graph_button', false, $link, ['mode' => 'link'], true);
|
$data[1] = html_print_button(__('View graph'), 'view_graph_button', false, $link, ['mode' => 'link'], true);
|
||||||
$table_details->data[] = $data;
|
$table_details->data[] = $data;
|
||||||
}
|
}
|
||||||
|
@ -1153,6 +1153,27 @@ function modules_get_raw_data($id_agent_module, $date_init, $date_end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function module_get_min_max_tagente_datos($id_agent_module, $date_init, $date_end)
|
||||||
|
{
|
||||||
|
$table = modules_get_table_data($id_agent_module, null);
|
||||||
|
|
||||||
|
$datelimit = ($date_init - $date_end);
|
||||||
|
$search_in_history_db = db_search_in_history_db($datelimit);
|
||||||
|
|
||||||
|
$data = db_get_all_rows_sql(
|
||||||
|
'
|
||||||
|
SELECT max(datos) as max, min(datos) as min
|
||||||
|
FROM '.$table.'
|
||||||
|
WHERE id_agente_modulo = '.$id_agent_module.'
|
||||||
|
AND utimestamp >= '.$date_init.'
|
||||||
|
AND utimestamp <= '.$date_end,
|
||||||
|
$search_in_history_db
|
||||||
|
);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function modules_get_agent_groups($id_agent_module)
|
function modules_get_agent_groups($id_agent_module)
|
||||||
{
|
{
|
||||||
$return = false;
|
$return = false;
|
||||||
|
@ -191,15 +191,9 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
|
|||||||
$table->id = 'table_profiles';
|
$table->id = 'table_profiles';
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->class = 'info_table';
|
$table->class = 'info_table';
|
||||||
if (is_metaconsole() === true) {
|
|
||||||
$table->head_colspan[0] = 0;
|
echo '<div id="edit_user_profiles" class="floating_form white_box">';
|
||||||
$table->width = '100%';
|
echo '<p class="subsection_header_title padding-lft-10">'.$title.'</p>';
|
||||||
$table->class = 'databox_tactical data';
|
|
||||||
$table->title = $title;
|
|
||||||
} else {
|
|
||||||
echo '<div id="edit_user_profiles" class="floating_form white_box">';
|
|
||||||
echo '<p class="subsection_header_title padding-lft-10">'.$title.'</p>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
$table->head = [];
|
$table->head = [];
|
||||||
@ -405,9 +399,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
|
|||||||
array_push($table->data, $data);
|
array_push($table->data, $data);
|
||||||
html_print_table($table, $return);
|
html_print_table($table, $return);
|
||||||
|
|
||||||
if (is_metaconsole() === false) {
|
echo '</div>';
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($table);
|
unset($table);
|
||||||
}
|
}
|
||||||
|
@ -1053,17 +1053,17 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
|
|||||||
$table1->head = [];
|
$table1->head = [];
|
||||||
if ($item['show_summary_group']) {
|
if ($item['show_summary_group']) {
|
||||||
$table1->head[0] = __('Status');
|
$table1->head[0] = __('Status');
|
||||||
$table1->head[1] = __('Count');
|
$table1->head[1] = __('Type');
|
||||||
$table1->head[2] = __('Name');
|
$table1->head[2] = __('Count');
|
||||||
$table1->head[3] = __('Type');
|
$table1->head[3] = __('Name');
|
||||||
$table1->head[4] = __('Agent');
|
$table1->head[4] = __('Agent');
|
||||||
$table1->head[5] = __('Severity');
|
$table1->head[5] = __('Severity');
|
||||||
$table1->head[6] = __('Val. by');
|
$table1->head[6] = __('Val. by');
|
||||||
$table1->head[7] = __('Timestamp');
|
$table1->head[7] = __('Timestamp');
|
||||||
} else {
|
} else {
|
||||||
$table1->head[0] = __('Status');
|
$table1->head[0] = __('Status');
|
||||||
$table1->head[1] = __('Name');
|
$table1->head[1] = __('Type');
|
||||||
$table1->head[2] = __('Type');
|
$table1->head[2] = __('Name');
|
||||||
$table1->head[3] = __('Agent');
|
$table1->head[3] = __('Agent');
|
||||||
$table1->head[4] = __('Severity');
|
$table1->head[4] = __('Severity');
|
||||||
$table1->head[5] = __('Val. by');
|
$table1->head[5] = __('Val. by');
|
||||||
@ -1077,15 +1077,15 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
|
|||||||
foreach ($item['data'] as $k => $event) {
|
foreach ($item['data'] as $k => $event) {
|
||||||
// First pass along the class of this row.
|
// First pass along the class of this row.
|
||||||
if ($item['show_summary_group']) {
|
if ($item['show_summary_group']) {
|
||||||
$table1->cellclass[$k][1] = get_priority_class($event['criticity']);
|
|
||||||
$table1->cellclass[$k][2] = get_priority_class($event['criticity']);
|
$table1->cellclass[$k][2] = get_priority_class($event['criticity']);
|
||||||
|
$table1->cellclass[$k][3] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$k][4] = get_priority_class($event['criticity']);
|
$table1->cellclass[$k][4] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$k][5] = get_priority_class($event['criticity']);
|
$table1->cellclass[$k][5] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$k][6] = get_priority_class($event['criticity']);
|
$table1->cellclass[$k][6] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$k][7] = get_priority_class($event['criticity']);
|
$table1->cellclass[$k][7] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$k][8] = get_priority_class($event['criticity']);
|
$table1->cellclass[$k][8] = get_priority_class($event['criticity']);
|
||||||
} else {
|
} else {
|
||||||
$table1->cellclass[$k][1] = get_priority_class($event['criticity']);
|
$table1->cellclass[$k][2] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$k][3] = get_priority_class($event['criticity']);
|
$table1->cellclass[$k][3] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$k][4] = get_priority_class($event['criticity']);
|
$table1->cellclass[$k][4] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$k][5] = get_priority_class($event['criticity']);
|
$table1->cellclass[$k][5] = get_priority_class($event['criticity']);
|
||||||
@ -1125,6 +1125,8 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$data[] = events_print_type_img($event['event_type'], true);
|
||||||
|
|
||||||
if ($item['show_summary_group']) {
|
if ($item['show_summary_group']) {
|
||||||
$data[] = $event['event_rep'];
|
$data[] = $event['event_rep'];
|
||||||
}
|
}
|
||||||
@ -1136,8 +1138,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$data[] = events_print_type_img($event['event_type'], true);
|
|
||||||
|
|
||||||
if (empty($event['alias']) === false) {
|
if (empty($event['alias']) === false) {
|
||||||
$alias = $event['alias'];
|
$alias = $event['alias'];
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
@ -1313,20 +1313,20 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
|
|||||||
$table1->class = 'info_table';
|
$table1->class = 'info_table';
|
||||||
$table1->data = [];
|
$table1->data = [];
|
||||||
$table1->head = [];
|
$table1->head = [];
|
||||||
$table1->align = [];
|
$table1->align = 'left';
|
||||||
$table1->align[2] = 'center';
|
|
||||||
if ($show_summary_group) {
|
if ($show_summary_group) {
|
||||||
$table1->head[0] = __('Status');
|
$table1->head[0] = __('Status');
|
||||||
$table1->head[1] = __('Event name');
|
$table1->head[1] = __('Type');
|
||||||
$table1->head[2] = __('Type');
|
$table1->head[2] = __('Event name');
|
||||||
$table1->head[3] = __('Severity');
|
$table1->head[3] = __('Severity');
|
||||||
$table1->head[4] = __('Count');
|
$table1->head[4] = __('Count');
|
||||||
$table1->head[5] = __('Timestamp');
|
$table1->head[5] = __('Timestamp');
|
||||||
$table1->style[0] = 'text-align: center;';
|
$table1->style[0] = 'text-align: center;';
|
||||||
} else {
|
} else {
|
||||||
$table1->head[0] = __('Status');
|
$table1->head[0] = __('Status');
|
||||||
$table1->head[1] = __('Event name');
|
$table1->head[1] = __('Type');
|
||||||
$table1->head[2] = __('Type');
|
$table1->head[2] = __('Event name');
|
||||||
$table1->head[3] = __('Severity');
|
$table1->head[3] = __('Severity');
|
||||||
$table1->head[4] = __('Timestamp');
|
$table1->head[4] = __('Timestamp');
|
||||||
$table1->style[0] = 'text-align: center;';
|
$table1->style[0] = 'text-align: center;';
|
||||||
@ -1344,14 +1344,13 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
|
|||||||
foreach ($item_data as $i => $event) {
|
foreach ($item_data as $i => $event) {
|
||||||
$data = [];
|
$data = [];
|
||||||
if ($show_summary_group) {
|
if ($show_summary_group) {
|
||||||
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
|
|
||||||
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
|
||||||
} else {
|
} else {
|
||||||
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
|
||||||
@ -1386,8 +1385,9 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
|
|||||||
'id' => 'status_img_'.$event['id_evento'],
|
'id' => 'status_img_'.$event['id_evento'],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$data[1] = io_safe_output($event['evento']);
|
|
||||||
$data[2] = events_print_type_img($event['event_type'], true);
|
$data[1] = events_print_type_img($event['event_type'], true);
|
||||||
|
$data[2] = io_safe_output($event['evento']);
|
||||||
$data[3] = get_priority_name($event['criticity']);
|
$data[3] = get_priority_name($event['criticity']);
|
||||||
if ($show_summary_group) {
|
if ($show_summary_group) {
|
||||||
$data[4] = $event['event_rep'];
|
$data[4] = $event['event_rep'];
|
||||||
@ -2178,7 +2178,7 @@ function reporting_html_agent_module($table, $item)
|
|||||||
if ($module === null) {
|
if ($module === null) {
|
||||||
$table_data .= '<td></td>';
|
$table_data .= '<td></td>';
|
||||||
} else {
|
} else {
|
||||||
$table_data .= "<td class='center'>";
|
$table_data .= '<td style="text-align: left;">';
|
||||||
if (isset($row['show_type']) === true && $row['show_type'] === '1') {
|
if (isset($row['show_type']) === true && $row['show_type'] === '1') {
|
||||||
$table_data .= $module;
|
$table_data .= $module;
|
||||||
} else {
|
} else {
|
||||||
@ -2657,12 +2657,12 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
|
|||||||
|
|
||||||
$table1->head = [];
|
$table1->head = [];
|
||||||
$table1->head[0] = __('Status');
|
$table1->head[0] = __('Status');
|
||||||
|
$table1->head[3] = __('Type');
|
||||||
if ($item['show_summary_group']) {
|
if ($item['show_summary_group']) {
|
||||||
$table1->head[1] = __('Count');
|
$table1->head[1] = __('Count');
|
||||||
}
|
}
|
||||||
|
|
||||||
$table1->head[2] = __('Name');
|
$table1->head[2] = __('Name');
|
||||||
$table1->head[3] = __('Type');
|
|
||||||
$table1->head[4] = __('Severity');
|
$table1->head[4] = __('Severity');
|
||||||
$table1->head[5] = __('Val. by');
|
$table1->head[5] = __('Val. by');
|
||||||
$table1->head[6] = __('Timestamp');
|
$table1->head[6] = __('Timestamp');
|
||||||
@ -2672,14 +2672,14 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
|
|||||||
|
|
||||||
foreach ($item['data'] as $i => $event) {
|
foreach ($item['data'] as $i => $event) {
|
||||||
if ($item['show_summary_group']) {
|
if ($item['show_summary_group']) {
|
||||||
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
|
|
||||||
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
|
||||||
|
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][7] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][7] = get_priority_class($event['criticity']);
|
||||||
} else {
|
} else {
|
||||||
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
||||||
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
|
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
|
||||||
@ -2716,6 +2716,8 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$data[] = events_print_type_img($event['type'], true);
|
||||||
|
|
||||||
if ($item['show_summary_group']) {
|
if ($item['show_summary_group']) {
|
||||||
$data[] = $event['count'];
|
$data[] = $event['count'];
|
||||||
}
|
}
|
||||||
@ -2727,8 +2729,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$data[] = events_print_type_img($event['type'], true);
|
|
||||||
|
|
||||||
$data[] = get_priority_name($event['criticity']);
|
$data[] = get_priority_name($event['criticity']);
|
||||||
if (empty($event['validated_by']) && $event['status'] == EVENT_VALIDATE) {
|
if (empty($event['validated_by']) && $event['status'] == EVENT_VALIDATE) {
|
||||||
$data[] = '<i>'.__('System').'</i>';
|
$data[] = '<i>'.__('System').'</i>';
|
||||||
@ -3919,6 +3919,8 @@ function reporting_html_value(
|
|||||||
if ($item['visual_format'] != 2) {
|
if ($item['visual_format'] != 2) {
|
||||||
$table1 = new stdClass();
|
$table1 = new stdClass();
|
||||||
$table1->width = '100%';
|
$table1->width = '100%';
|
||||||
|
$table1->headstyle[0] = 'text-align:left';
|
||||||
|
$table1->headstyle[1] = 'text-align:left';
|
||||||
switch ($item['type']) {
|
switch ($item['type']) {
|
||||||
case 'max_value':
|
case 'max_value':
|
||||||
$table1->head = [
|
$table1->head = [
|
||||||
|
@ -3885,6 +3885,7 @@ function ui_print_datatable(array $parameters)
|
|||||||
$("div.dataTables_paginate").hide();
|
$("div.dataTables_paginate").hide();
|
||||||
$("div.dataTables_info").hide();
|
$("div.dataTables_info").hide();
|
||||||
$("div.dataTables_length").hide();
|
$("div.dataTables_length").hide();
|
||||||
|
$("div.dt-buttons").hide();
|
||||||
|
|
||||||
if (dt_'.$table_id.'.page.info().pages > 1) {
|
if (dt_'.$table_id.'.page.info().pages > 1) {
|
||||||
$(".dataTables_paginate.paging_simple_numbers").show()
|
$(".dataTables_paginate.paging_simple_numbers").show()
|
||||||
@ -3895,6 +3896,7 @@ function ui_print_datatable(array $parameters)
|
|||||||
$("div.dataTables_paginate").show();
|
$("div.dataTables_paginate").show();
|
||||||
$("div.dataTables_info").show();
|
$("div.dataTables_info").show();
|
||||||
$("div.dataTables_length").show();
|
$("div.dataTables_length").show();
|
||||||
|
$("div.dt-buttons").show();
|
||||||
|
|
||||||
if (dt_'.$table_id.'.page.info().pages == 1) {
|
if (dt_'.$table_id.'.page.info().pages == 1) {
|
||||||
$(".dataTables_paginate.paging_simple_numbers").hide()
|
$(".dataTables_paginate.paging_simple_numbers").hide()
|
||||||
@ -7086,20 +7088,6 @@ function ui_query_result_editor($name='default')
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$editorSubContainer .= html_print_div(
|
|
||||||
[
|
|
||||||
'class' => 'action-buttons edit-button',
|
|
||||||
'content' => html_print_submit_button(
|
|
||||||
__('Execute query'),
|
|
||||||
'execute_query',
|
|
||||||
false,
|
|
||||||
['icon' => 'next'],
|
|
||||||
true
|
|
||||||
),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
$editorContainer = html_print_div(
|
$editorContainer = html_print_div(
|
||||||
[
|
[
|
||||||
'id' => $name.'_editor_container',
|
'id' => $name.'_editor_container',
|
||||||
@ -7157,6 +7145,11 @@ function ui_query_result_editor($name='default')
|
|||||||
'content' => ui_get_full_url(false, false, false, false),
|
'content' => ui_get_full_url(false, false, false, false),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$buttons = html_print_submit_button(__('Execute query'), 'execute_query', false, ['icon' => 'update'], true);
|
||||||
|
html_print_action_buttons(
|
||||||
|
$buttons
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -730,8 +730,9 @@ function flot_slicesbar_graph(
|
|||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if ($ttl == 2) {
|
if ($ttl == 2) {
|
||||||
|
$tokem_config = uniqid('slicebar');
|
||||||
$params = [
|
$params = [
|
||||||
'graph_data' => $graph_data,
|
'tokem_config' => $tokem_config,
|
||||||
'period' => $period,
|
'period' => $period,
|
||||||
'width' => $width,
|
'width' => $width,
|
||||||
'height' => $height,
|
'height' => $height,
|
||||||
@ -752,7 +753,10 @@ function flot_slicesbar_graph(
|
|||||||
'return_img_base_64' => true,
|
'return_img_base_64' => true,
|
||||||
'date_to' => $date_to,
|
'date_to' => $date_to,
|
||||||
'server_id' => $server_id,
|
'server_id' => $server_id,
|
||||||
|
'backgroundColor' => '#f6f7fb',
|
||||||
];
|
];
|
||||||
|
// TO-DO Cambiar esto para que se pase por POST, NO SE PUEDE PASAR POR GET.
|
||||||
|
update_config_token($tokem_config, json_encode($graph_data));
|
||||||
|
|
||||||
$graph = '<img src="data:image/png;base64,';
|
$graph = '<img src="data:image/png;base64,';
|
||||||
$graph .= generator_chart_to_pdf('slicebar', $params);
|
$graph .= generator_chart_to_pdf('slicebar', $params);
|
||||||
|
@ -9,7 +9,7 @@ view.renderer.setShowGutter(false);
|
|||||||
view.setReadOnly(true);
|
view.setReadOnly(true);
|
||||||
view.setShowPrintMargin(false);
|
view.setShowPrintMargin(false);
|
||||||
|
|
||||||
$("#submit-execute_query").click(function() {
|
$("#button-execute_query").click(function() {
|
||||||
view.setValue("");
|
view.setValue("");
|
||||||
let text;
|
let text;
|
||||||
let selectText = editor.getSelectedText();
|
let selectText = editor.getSelectedText();
|
||||||
|
@ -316,6 +316,10 @@ class AvgSumMaxMinModule extends Widget
|
|||||||
$values['unit'] = $decoder['unit'];
|
$values['unit'] = $decoder['unit'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($decoder['layout']) === true) {
|
||||||
|
$values['layout'] = $decoder['layout'];
|
||||||
|
}
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -501,6 +505,18 @@ class AvgSumMaxMinModule extends Widget
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Layout.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
|
||||||
|
'arguments' => [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'name' => 'layout',
|
||||||
|
'type' => 'switch',
|
||||||
|
'value' => $values['layout'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
return $inputs;
|
return $inputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -525,6 +541,7 @@ class AvgSumMaxMinModule extends Widget
|
|||||||
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
|
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
|
||||||
$values['text_color'] = \get_parameter('text_color', 0);
|
$values['text_color'] = \get_parameter('text_color', 0);
|
||||||
$values['unit'] = \get_parameter_switch('unit');
|
$values['unit'] = \get_parameter_switch('unit');
|
||||||
|
$values['layout'] = \get_parameter_switch('layout');
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
@ -601,13 +618,13 @@ class AvgSumMaxMinModule extends Widget
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
$rows = modules_get_min_max_data($id_module, $to);
|
$rows = module_get_min_max_tagente_datos($id_module, $to, $now);
|
||||||
|
|
||||||
$data = $rows[0]['max'];
|
$data = $rows[0]['max'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
$rows = modules_get_min_max_data($id_module, $to);
|
$rows = module_get_min_max_tagente_datos($id_module, $to, $now);
|
||||||
|
|
||||||
$data = $rows[0]['min'];
|
$data = $rows[0]['min'];
|
||||||
break;
|
break;
|
||||||
@ -621,11 +638,22 @@ class AvgSumMaxMinModule extends Widget
|
|||||||
$sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 40;
|
$sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 40;
|
||||||
$sizeValue = (isset($this->values['sizeValue']) === true) ? $this->values['sizeValue'] : 40;
|
$sizeValue = (isset($this->values['sizeValue']) === true) ? $this->values['sizeValue'] : 40;
|
||||||
|
|
||||||
$output .= '<div class="container-center">';
|
$uuid = uniqid();
|
||||||
|
|
||||||
|
$output .= '<div class="container-center" id="container-'.$uuid.'">';
|
||||||
|
|
||||||
|
$orientation = '';
|
||||||
|
if ((int) $this->values['layout'] === 1) {
|
||||||
|
$orientation = 'flex';
|
||||||
|
} else {
|
||||||
|
$orientation = 'grid';
|
||||||
|
}
|
||||||
|
|
||||||
// General div.
|
// General div.
|
||||||
$output .= '<div class="container-icon">';
|
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
|
||||||
|
|
||||||
// Div value.
|
// Div value.
|
||||||
$output .= '<div style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;'.$text_color.'">';
|
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="font-size:'.$sizeValue.'px;'.$text_color.'">';
|
||||||
|
|
||||||
if (is_numeric($data) === true) {
|
if (is_numeric($data) === true) {
|
||||||
$dataDatos = remove_right_zeros(
|
$dataDatos = remove_right_zeros(
|
||||||
@ -651,11 +679,22 @@ class AvgSumMaxMinModule extends Widget
|
|||||||
|
|
||||||
if (empty($label) === false) {
|
if (empty($label) === false) {
|
||||||
// Div Label.
|
// Div Label.
|
||||||
$output .= '<div style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;'.$text_color.'">'.$label.'</div>';
|
$output .= '<div class="pdd_l_15px pdd_r_15px" style="font-size:'.$sizeLabel.'px;'.$text_color.'">'.$label.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
|
$output .= '<script>
|
||||||
|
var containerWidth = document.querySelector("#container-'.$uuid.'").offsetWidth;
|
||||||
|
var generalWidth = document.querySelector("#general-'.$uuid.'").offsetWidth;
|
||||||
|
|
||||||
|
if (generalWidth >= containerWidth) {
|
||||||
|
$("#container-'.$uuid.'").css("align-items", "flex-start");
|
||||||
|
} else {
|
||||||
|
$("#container-'.$uuid.'").css("align-items", "center");
|
||||||
|
}
|
||||||
|
</script>';
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,6 +305,10 @@ class ModuleIconWidget extends Widget
|
|||||||
$values['imageSrc'] = $decoder['imageSrc'];
|
$values['imageSrc'] = $decoder['imageSrc'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($decoder['layout']) === true) {
|
||||||
|
$values['layout'] = $decoder['layout'];
|
||||||
|
}
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -482,6 +486,18 @@ class ModuleIconWidget extends Widget
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Layout.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
|
||||||
|
'arguments' => [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'name' => 'layout',
|
||||||
|
'type' => 'switch',
|
||||||
|
'value' => $values['layout'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
return $inputs;
|
return $inputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,6 +520,7 @@ class ModuleIconWidget extends Widget
|
|||||||
$values['sizeValue'] = \get_parameter('sizeValue', 0);
|
$values['sizeValue'] = \get_parameter('sizeValue', 0);
|
||||||
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
|
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
|
||||||
$values['sizeIcon'] = \get_parameter_switch('sizeIcon');
|
$values['sizeIcon'] = \get_parameter_switch('sizeIcon');
|
||||||
|
$values['layout'] = \get_parameter_switch('layout');
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
@ -533,39 +550,84 @@ class ModuleIconWidget extends Widget
|
|||||||
$this->values['moduleId']
|
$this->values['moduleId']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$unit = \modules_get_unit($this->values['moduleId']);
|
||||||
|
|
||||||
$icon = $this->values['imageSrc'];
|
$icon = $this->values['imageSrc'];
|
||||||
$label = $this->values['label'];
|
$label = $this->values['label'];
|
||||||
$sizeLabel = (($this->values['sizeLabel'] !== 0) ? $this->values['sizeLabel'] : 20);
|
$sizeLabel = (($this->values['sizeLabel'] !== 0) ? $this->values['sizeLabel'] : 20);
|
||||||
$sizeValue = (($this->values['sizeValue'] !== 0) ? $this->values['sizeValue'] : 20);
|
$sizeValue = (($this->values['sizeValue'] !== 0) ? $this->values['sizeValue'] : 20);
|
||||||
$sizeIcon = (($this->values['sizeIcon'] !== 0) ? $this->values['sizeIcon'] : 100);
|
$sizeIcon = (($this->values['sizeIcon'] !== 0) ? $this->values['sizeIcon'] : 100);
|
||||||
|
|
||||||
$output .= '<div class="container-center">';
|
$uuid = uniqid();
|
||||||
|
|
||||||
|
$output .= '<div class="container-center" id="container-'.$uuid.'">';
|
||||||
|
|
||||||
|
$orientation = '';
|
||||||
|
if ((int) $this->values['layout'] === 1) {
|
||||||
|
$orientation = 'flex aligni_center';
|
||||||
|
} else {
|
||||||
|
$orientation = 'grid';
|
||||||
|
}
|
||||||
|
|
||||||
// General div.
|
// General div.
|
||||||
$output .= '<div class="container-icon">';
|
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
|
||||||
|
|
||||||
|
$sql = 'SELECT min_warning,
|
||||||
|
max_warning,
|
||||||
|
min_critical,
|
||||||
|
max_critical,
|
||||||
|
str_warning,
|
||||||
|
str_critical
|
||||||
|
FROM tagente_modulo
|
||||||
|
WHERE id_agente_modulo = '.(int) $this->values['moduleId'];
|
||||||
|
$sql_data = db_get_row_sql($sql);
|
||||||
|
|
||||||
|
$last = modules_get_last_value($this->values['moduleId']);
|
||||||
|
|
||||||
|
$color_icon = '_ok';
|
||||||
|
if (($last >= $sql_data['min_warning']) && ($last < $sql_data['max_warning'])) {
|
||||||
|
$color_icon = '_warning';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($last >= $sql_data['max_warning']) {
|
||||||
|
$color_icon = '_bad';
|
||||||
|
}
|
||||||
|
|
||||||
// Div image.
|
// Div image.
|
||||||
$output .= '<div style="flex: 0 1 '.$sizeIcon.'px;">';
|
$style_icon = 'flex: 0 1 '.$sizeIcon.'px;';
|
||||||
|
|
||||||
|
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 0 1 '.$sizeIcon.'px;">';
|
||||||
$output .= html_print_image(
|
$output .= html_print_image(
|
||||||
'images/console/icons/'.$icon.'.png',
|
'images/console/icons/'.$icon.$color_icon.'.png',
|
||||||
true,
|
true,
|
||||||
['width' => $sizeIcon]
|
['width' => $sizeIcon]
|
||||||
);
|
);
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
// Div value.
|
// Div value.
|
||||||
$output .= '<div style="flex: 0 1 10px; font-size:'.$sizeValue.'px;">';
|
$output .= '<div class="mrgn_btn_15px" style="flex: 0 1 10px; font-size:'.$sizeValue.'px;">';
|
||||||
$output .= remove_right_zeros(
|
$output .= remove_right_zeros(
|
||||||
number_format($data_module, $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])
|
number_format($data_module, $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])
|
||||||
);
|
).$unit;
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
if (empty($label) === false) {
|
if (empty($label) === false) {
|
||||||
// Div Label.
|
// Div Label.
|
||||||
$output .= '<div style="flex: 1; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
|
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
|
$output .= '<script>
|
||||||
|
var containerWidth = document.querySelector("#container-'.$uuid.'").offsetWidth;
|
||||||
|
var generalWidth = document.querySelector("#general-'.$uuid.'").offsetWidth;
|
||||||
|
|
||||||
|
if (generalWidth >= containerWidth) {
|
||||||
|
$("#container-'.$uuid.'").css("align-items", "flex-start");
|
||||||
|
} else {
|
||||||
|
$("#container-'.$uuid.'").css("align-items", "center");
|
||||||
|
}
|
||||||
|
</script>';
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,6 +300,10 @@ class ModuleStatusWidget extends Widget
|
|||||||
$values['imageSrc'] = $decoder['imageSrc'];
|
$values['imageSrc'] = $decoder['imageSrc'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($decoder['layout']) === true) {
|
||||||
|
$values['layout'] = $decoder['layout'];
|
||||||
|
}
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,6 +465,18 @@ class ModuleStatusWidget extends Widget
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Layout.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
|
||||||
|
'arguments' => [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'name' => 'layout',
|
||||||
|
'type' => 'switch',
|
||||||
|
'value' => $values['layout'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
return $inputs;
|
return $inputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -483,6 +499,7 @@ class ModuleStatusWidget extends Widget
|
|||||||
$values['sizeValue'] = \get_parameter('sizeValue', 0);
|
$values['sizeValue'] = \get_parameter('sizeValue', 0);
|
||||||
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
|
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
|
||||||
$values['sizeIcon'] = \get_parameter_switch('sizeIcon');
|
$values['sizeIcon'] = \get_parameter_switch('sizeIcon');
|
||||||
|
$values['layout'] = \get_parameter_switch('layout');
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
@ -538,12 +555,22 @@ class ModuleStatusWidget extends Widget
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '<div class="container-center">';
|
$uuid = uniqid();
|
||||||
|
|
||||||
|
$output .= '<div class="container-center" id="container-'.$uuid.'">';
|
||||||
|
|
||||||
|
$orientation = '';
|
||||||
|
if ((int) $this->values['layout'] === 1) {
|
||||||
|
$orientation = 'flex aligni_center';
|
||||||
|
} else {
|
||||||
|
$orientation = 'grid';
|
||||||
|
}
|
||||||
|
|
||||||
// General div.
|
// General div.
|
||||||
$output .= '<div class="container-icon">';
|
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
|
||||||
|
|
||||||
// Div image.
|
// Div image.
|
||||||
$output .= '<div style="flex: 0 1 '.$sizeIcon.'px;">';
|
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 0 1 '.$sizeIcon.'px;">';
|
||||||
$output .= html_print_image(
|
$output .= html_print_image(
|
||||||
'images/console/icons/'.$icon,
|
'images/console/icons/'.$icon,
|
||||||
true,
|
true,
|
||||||
@ -553,11 +580,22 @@ class ModuleStatusWidget extends Widget
|
|||||||
|
|
||||||
if (empty($label) === false) {
|
if (empty($label) === false) {
|
||||||
// Div Label.
|
// Div Label.
|
||||||
$output .= '<div style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
|
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
|
$output .= '<script>
|
||||||
|
var containerWidth = document.querySelector("#container-'.$uuid.'").offsetWidth;
|
||||||
|
var generalWidth = document.querySelector("#general-'.$uuid.'").offsetWidth;
|
||||||
|
|
||||||
|
if (generalWidth >= containerWidth) {
|
||||||
|
$("#container-'.$uuid.'").css("align-items", "flex-start");
|
||||||
|
} else {
|
||||||
|
$("#container-'.$uuid.'").css("align-items", "center");
|
||||||
|
}
|
||||||
|
</script>';
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,6 +284,10 @@ class ModuleValueWidget extends Widget
|
|||||||
$values['sizeLabel'] = $decoder['sizeLabel'];
|
$values['sizeLabel'] = $decoder['sizeLabel'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($decoder['layout']) === true) {
|
||||||
|
$values['layout'] = $decoder['layout'];
|
||||||
|
}
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,6 +389,18 @@ class ModuleValueWidget extends Widget
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Layout.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
|
||||||
|
'arguments' => [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'name' => 'layout',
|
||||||
|
'type' => 'switch',
|
||||||
|
'value' => $values['layout'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
return $inputs;
|
return $inputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,6 +421,7 @@ class ModuleValueWidget extends Widget
|
|||||||
$values['moduleId'] = \get_parameter('moduleId', 0);
|
$values['moduleId'] = \get_parameter('moduleId', 0);
|
||||||
$values['sizeValue'] = \get_parameter('sizeValue', 0);
|
$values['sizeValue'] = \get_parameter('sizeValue', 0);
|
||||||
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
|
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
|
||||||
|
$values['layout'] = \get_parameter_switch('layout');
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
@ -422,6 +439,7 @@ class ModuleValueWidget extends Widget
|
|||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
$id_module = $this->values['moduleId'];
|
$id_module = $this->values['moduleId'];
|
||||||
|
$unit = modules_get_unit($this->values['moduleId']);
|
||||||
|
|
||||||
$data_module = \modules_get_last_value($id_module);
|
$data_module = \modules_get_last_value($id_module);
|
||||||
|
|
||||||
@ -429,11 +447,41 @@ class ModuleValueWidget extends Widget
|
|||||||
$sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 40;
|
$sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 40;
|
||||||
$sizeValue = (isset($this->values['sizeValue']) === true) ? $this->values['sizeValue'] : 40;
|
$sizeValue = (isset($this->values['sizeValue']) === true) ? $this->values['sizeValue'] : 40;
|
||||||
|
|
||||||
$output .= '<div class="container-center">';
|
$sql = 'SELECT min_warning,
|
||||||
|
max_warning,
|
||||||
|
min_critical,
|
||||||
|
max_critical,
|
||||||
|
str_warning,
|
||||||
|
str_critical
|
||||||
|
FROM tagente_modulo
|
||||||
|
WHERE id_agente_modulo = '.(int) $this->values['moduleId'];
|
||||||
|
$sql_data = db_get_row_sql($sql);
|
||||||
|
|
||||||
|
$last = modules_get_last_value($this->values['moduleId']);
|
||||||
|
|
||||||
|
if (($last >= $sql_data['min_warning']) && ($last < $sql_data['max_warning'])) {
|
||||||
|
$color = COL_WARNING;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($last >= $sql_data['max_warning']) {
|
||||||
|
$color = COL_CRITICAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
$uuid = uniqid();
|
||||||
|
$output .= '<div class="container-center" id="container-'.$uuid.'">';
|
||||||
|
|
||||||
|
$orientation = '';
|
||||||
|
if ((int) $this->values['layout'] === 1) {
|
||||||
|
$orientation = 'flex';
|
||||||
|
} else {
|
||||||
|
$orientation = 'grid';
|
||||||
|
}
|
||||||
|
|
||||||
// General div.
|
// General div.
|
||||||
$output .= '<div class="container-icon">';
|
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
|
||||||
|
|
||||||
// Div value.
|
// Div value.
|
||||||
$output .= '<div style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
|
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px; color: '.$color.'">';
|
||||||
|
|
||||||
if (is_numeric($data_module) === true) {
|
if (is_numeric($data_module) === true) {
|
||||||
$dataDatos = remove_right_zeros(
|
$dataDatos = remove_right_zeros(
|
||||||
@ -443,7 +491,7 @@ class ModuleValueWidget extends Widget
|
|||||||
$config['decimal_separator'],
|
$config['decimal_separator'],
|
||||||
$config['thousand_separator']
|
$config['thousand_separator']
|
||||||
)
|
)
|
||||||
);
|
).$unit;
|
||||||
} else {
|
} else {
|
||||||
$dataDatos = trim($data_module);
|
$dataDatos = trim($data_module);
|
||||||
}
|
}
|
||||||
@ -454,11 +502,22 @@ class ModuleValueWidget extends Widget
|
|||||||
|
|
||||||
if (empty($label) === false) {
|
if (empty($label) === false) {
|
||||||
// Div Label.
|
// Div Label.
|
||||||
$output .= '<div style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
|
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
|
$output .= '<script>
|
||||||
|
var containerWidth = document.querySelector("#container-'.$uuid.'").offsetWidth;
|
||||||
|
var generalWidth = document.querySelector("#general-'.$uuid.'").offsetWidth;
|
||||||
|
|
||||||
|
if (generalWidth >= containerWidth) {
|
||||||
|
$("#container-'.$uuid.'").css("align-items", "flex-start");
|
||||||
|
} else {
|
||||||
|
$("#container-'.$uuid.'").css("align-items", "center");
|
||||||
|
}
|
||||||
|
</script>';
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,10 +282,10 @@ class OsQuickReportWidget extends Widget
|
|||||||
$table->head = [];
|
$table->head = [];
|
||||||
$table->head[0] = __('OS');
|
$table->head[0] = __('OS');
|
||||||
$table->head[1] = __('OS name');
|
$table->head[1] = __('OS name');
|
||||||
$table->head[2] = ucfirst(__('total agents'));
|
$table->head[2] = ucfirst(__('total'));
|
||||||
$table->head[3] = ucfirst(__('normal agents'));
|
$table->head[3] = ucfirst(__('normal'));
|
||||||
$table->head[4] = ucfirst(__('critical agents'));
|
$table->head[4] = ucfirst(__('critical'));
|
||||||
$table->head[5] = ucfirst(__('unknown agents'));
|
$table->head[5] = ucfirst(__('unknown'));
|
||||||
|
|
||||||
$table->headstyle = [];
|
$table->headstyle = [];
|
||||||
$table->headstyle[0] = 'text-align:center;background-color: '.$values['background'];
|
$table->headstyle[0] = 'text-align:center;background-color: '.$values['background'];
|
||||||
@ -296,12 +296,12 @@ class OsQuickReportWidget extends Widget
|
|||||||
$table->headstyle[5] = 'text-align:center;background-color: '.$values['background'];
|
$table->headstyle[5] = 'text-align:center;background-color: '.$values['background'];
|
||||||
|
|
||||||
$table->style = [];
|
$table->style = [];
|
||||||
$table->style[0] = 'background-color: '.$values['background'];
|
$table->style[0] = 'background-color: '.$values['background'].';';
|
||||||
$table->style[1] = 'background-color: '.$values['background'];
|
$table->style[1] = 'background-color: '.$values['background'].';';
|
||||||
$table->style[2] = 'font-size: 22px;background-color: '.$values['background'];
|
$table->style[2] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
|
||||||
$table->style[3] = 'font-size: 22px;background-color: '.$values['background'];
|
$table->style[3] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
|
||||||
$table->style[4] = 'font-size: 22px;background-color: '.$values['background'];
|
$table->style[4] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
|
||||||
$table->style[5] = 'font-size: 22px;background-color: '.$values['background'];
|
$table->style[5] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
|
||||||
|
|
||||||
foreach ($result as $id => $os) {
|
foreach ($result as $id => $os) {
|
||||||
$data = [];
|
$data = [];
|
||||||
|
@ -418,7 +418,7 @@ class SingleGraphWidget extends Widget
|
|||||||
'dashboard' => true,
|
'dashboard' => true,
|
||||||
];
|
];
|
||||||
|
|
||||||
$output = '<div class="container-center">';
|
$output = '<div class="container-center widget-mrgn-0px">';
|
||||||
$output .= \grafico_modulo_sparse($params);
|
$output .= \grafico_modulo_sparse($params);
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
return $output;
|
return $output;
|
||||||
|
@ -289,6 +289,10 @@ class SLAPercentWidget extends Widget
|
|||||||
$values['period'] = $decoder['period'];
|
$values['period'] = $decoder['period'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($decoder['layout']) === true) {
|
||||||
|
$values['layout'] = $decoder['layout'];
|
||||||
|
}
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,6 +408,18 @@ class SLAPercentWidget extends Widget
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Layout.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
|
||||||
|
'arguments' => [
|
||||||
|
'wrapper' => 'div',
|
||||||
|
'name' => 'layout',
|
||||||
|
'type' => 'switch',
|
||||||
|
'value' => $values['layout'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
return $inputs;
|
return $inputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -425,6 +441,7 @@ class SLAPercentWidget extends Widget
|
|||||||
$values['period'] = \get_parameter('period', 0);
|
$values['period'] = \get_parameter('period', 0);
|
||||||
$values['sizeValue'] = \get_parameter('sizeValue', '');
|
$values['sizeValue'] = \get_parameter('sizeValue', '');
|
||||||
$values['sizeLabel'] = \get_parameter('sizeLabel', '');
|
$values['sizeLabel'] = \get_parameter('sizeLabel', '');
|
||||||
|
$values['layout'] = \get_parameter_switch('layout');
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
@ -494,21 +511,42 @@ class SLAPercentWidget extends Widget
|
|||||||
$sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 30;
|
$sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 30;
|
||||||
$sizeValue = (isset($this->values['sizeValue']) === true) ? $this->values['sizeValue'] : 30;
|
$sizeValue = (isset($this->values['sizeValue']) === true) ? $this->values['sizeValue'] : 30;
|
||||||
|
|
||||||
$output .= '<div class="container-center">';
|
$uuid = uniqid();
|
||||||
|
|
||||||
|
$output .= '<div class="container-center" id="container-'.$uuid.'">';
|
||||||
|
|
||||||
|
$orientation = '';
|
||||||
|
if ((int) $this->values['layout'] === 1) {
|
||||||
|
$orientation = 'flex';
|
||||||
|
} else {
|
||||||
|
$orientation = 'grid';
|
||||||
|
}
|
||||||
|
|
||||||
// General div.
|
// General div.
|
||||||
$output .= '<div class="container-icon">';
|
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
|
||||||
// Div value.
|
// Div value.
|
||||||
$output .= '<div style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
|
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
|
||||||
$output .= $sla_array['sla_fixed'].'%';
|
$output .= $sla_array['sla_fixed'].'%';
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
if (empty($label) === false) {
|
if (empty($label) === false) {
|
||||||
// Div Label.
|
// Div Label.
|
||||||
$output .= '<div style="flex: 1 1; font-size:'.$sizeLabel.'px; text-align: left;">'.$label.'</div>';
|
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1; font-size:'.$sizeLabel.'px; text-align: left;">'.$label.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
|
$output .= '<script>
|
||||||
|
var containerWidth = document.querySelector("#container-'.$uuid.'").offsetWidth;
|
||||||
|
var generalWidth = document.querySelector("#general-'.$uuid.'").offsetWidth;
|
||||||
|
|
||||||
|
if (generalWidth >= containerWidth) {
|
||||||
|
$("#container-'.$uuid.'").css("align-items", "flex-start");
|
||||||
|
} else {
|
||||||
|
$("#container-'.$uuid.'").css("align-items", "center");
|
||||||
|
}
|
||||||
|
</script>';
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -835,3 +835,11 @@ form.modal-dashboard
|
|||||||
border: 0px;
|
border: 0px;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.widget-mrgn-0px > div.parent_graph {
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.widget-mrgn-0px > div.parent_graph > div[id^="graph_"] {
|
||||||
|
width: calc(100% + 14px) !important;
|
||||||
|
}
|
||||||
|
@ -482,6 +482,11 @@ div.multi-response-buttons {
|
|||||||
-webkit-mask: url(../../images/modules@svg.svg) no-repeat center / contain;
|
-webkit-mask: url(../../images/modules@svg.svg) no-repeat center / contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.alert_module_background_state {
|
||||||
|
mask: url(../../images/alert@svg.svg) no-repeat center / contain;
|
||||||
|
-webkit-mask: url(../../images/alert@svg.svg) no-repeat center / contain;
|
||||||
|
}
|
||||||
|
|
||||||
.icon_background_critical {
|
.icon_background_critical {
|
||||||
background-color: #e63c52;
|
background-color: #e63c52;
|
||||||
}
|
}
|
||||||
|
@ -9306,7 +9306,7 @@ div.stat-win-spinner img {
|
|||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
margin-right: 5px !important;
|
margin-right: 5px !important;
|
||||||
margin-top: -4px;
|
margin-top: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select2-results
|
.select2-results
|
||||||
@ -11665,6 +11665,9 @@ div.ui-dialog-buttonset > button.ui-button.ui-corner-all.ui-widget:active {
|
|||||||
border-color: #0d312f;
|
border-color: #0d312f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div#menu_full > div#menu_tabs > ul.tabs_ul {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
.icon_connection_check {
|
.icon_connection_check {
|
||||||
width: 65px !important;
|
width: 65px !important;
|
||||||
height: 65px !important;
|
height: 65px !important;
|
||||||
|
@ -131,7 +131,7 @@
|
|||||||
<div style='padding-bottom: 50px'>
|
<div style='padding-bottom: 50px'>
|
||||||
<?php
|
<?php
|
||||||
$version = '7.0NG.769';
|
$version = '7.0NG.769';
|
||||||
$build = '230314';
|
$build = '230315';
|
||||||
$banner = "v$version Build $build";
|
$banner = "v$version Build $build";
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||||
*
|
*
|
||||||
* ============================================================================
|
* ============================================================================
|
||||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
|
||||||
* Please see http://pandorafms.org for full contribution list
|
* Please see http://pandorafms.org for full contribution list
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
@ -125,48 +125,31 @@ $draw = get_parameter('draw_button', '');
|
|||||||
$save = get_parameter('save_button', '');
|
$save = get_parameter('save_button', '');
|
||||||
$update = get_parameter('update_button', '');
|
$update = get_parameter('update_button', '');
|
||||||
|
|
||||||
if (is_metaconsole() === false) {
|
// Header.
|
||||||
// Header.
|
ui_print_standard_header(
|
||||||
ui_print_standard_header(
|
__('Netflow live view'),
|
||||||
__('Netflow live view'),
|
'images/op_netflow.png',
|
||||||
'images/op_netflow.png',
|
false,
|
||||||
false,
|
'',
|
||||||
'',
|
false,
|
||||||
false,
|
[],
|
||||||
[],
|
[
|
||||||
[
|
[
|
||||||
[
|
'link' => '',
|
||||||
'link' => '',
|
'label' => __('Monitoring'),
|
||||||
'label' => __('Monitoring'),
|
],
|
||||||
],
|
[
|
||||||
[
|
'link' => '',
|
||||||
'link' => '',
|
'label' => __('Network'),
|
||||||
'label' => __('Network'),
|
],
|
||||||
],
|
]
|
||||||
]
|
);
|
||||||
);
|
|
||||||
|
|
||||||
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
|
$is_windows = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
|
||||||
if ($is_windows) {
|
if ($is_windows === true) {
|
||||||
ui_print_error_message(__('Not supported in Windows systems'));
|
ui_print_error_message(__('Not supported in Windows systems'));
|
||||||
} else {
|
|
||||||
netflow_print_check_version_error();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$nav_bar = [
|
netflow_print_check_version_error();
|
||||||
[
|
|
||||||
'link' => 'index.php?sec=main',
|
|
||||||
'text' => __('Main'),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'link' => 'index.php?sec=netf&sec2=operation/netflow/nf_live_view',
|
|
||||||
'text' => __('Netflow live view'),
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
ui_meta_print_page_header($nav_bar);
|
|
||||||
|
|
||||||
ui_meta_print_header(__('Netflow live view'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save user defined filter.
|
// Save user defined filter.
|
||||||
@ -390,6 +373,7 @@ if (empty($filter['advanced_filter']) === false) {
|
|||||||
|
|
||||||
$filterTable = new stdClass();
|
$filterTable = new stdClass();
|
||||||
$filterTable->id = '';
|
$filterTable->id = '';
|
||||||
|
$filterTable->width = '100%';
|
||||||
$filterTable->class = 'filter-table-adv';
|
$filterTable->class = 'filter-table-adv';
|
||||||
$filterTable->size = [];
|
$filterTable->size = [];
|
||||||
$filterTable->size[0] = '33%';
|
$filterTable->size[0] = '33%';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.769
|
%define version 7.0NG.769
|
||||||
%define release 230314
|
%define release 230315
|
||||||
|
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.769
|
%define version 7.0NG.769
|
||||||
%define release 230314
|
%define release 230315
|
||||||
|
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.769
|
%define version 7.0NG.769
|
||||||
%define release 230314
|
%define release 230315
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name apache2
|
%define httpd_name apache2
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-server
|
package: pandorafms-server
|
||||||
Version: 7.0NG.769-230314
|
Version: 7.0NG.769-230315
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -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-230314"
|
pandora_version="7.0NG.769-230315"
|
||||||
|
|
||||||
package_cpan=0
|
package_cpan=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -46,7 +46,7 @@ our @EXPORT = qw(
|
|||||||
|
|
||||||
# version: Defines actual version of Pandora Server for this module only
|
# version: Defines actual version of Pandora Server for this module only
|
||||||
my $pandora_version = "7.0NG.769";
|
my $pandora_version = "7.0NG.769";
|
||||||
my $pandora_build = "230314";
|
my $pandora_build = "230315";
|
||||||
our $VERSION = $pandora_version." ".$pandora_build;
|
our $VERSION = $pandora_version." ".$pandora_build;
|
||||||
|
|
||||||
# Setup hash
|
# Setup hash
|
||||||
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
|||||||
|
|
||||||
# version: Defines actual version of Pandora Server for this module only
|
# version: Defines actual version of Pandora Server for this module only
|
||||||
my $pandora_version = "7.0NG.769";
|
my $pandora_version = "7.0NG.769";
|
||||||
my $pandora_build = "230314";
|
my $pandora_build = "230315";
|
||||||
our $VERSION = $pandora_version." ".$pandora_build;
|
our $VERSION = $pandora_version." ".$pandora_build;
|
||||||
|
|
||||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
%global __os_install_post %{nil}
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_server
|
%define name pandorafms_server
|
||||||
%define version 7.0NG.769
|
%define version 7.0NG.769
|
||||||
%define release 230314
|
%define release 230315
|
||||||
|
|
||||||
Summary: Pandora FMS Server
|
Summary: Pandora FMS Server
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
%global __os_install_post %{nil}
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_server
|
%define name pandorafms_server
|
||||||
%define version 7.0NG.769
|
%define version 7.0NG.769
|
||||||
%define release 230314
|
%define release 230315
|
||||||
|
|
||||||
Summary: Pandora FMS Server
|
Summary: Pandora FMS Server
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.769"
|
PI_VERSION="7.0NG.769"
|
||||||
PI_BUILD="230314"
|
PI_BUILD="230315"
|
||||||
|
|
||||||
MODE=$1
|
MODE=$1
|
||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||||||
use PandoraFMS::DB;
|
use PandoraFMS::DB;
|
||||||
|
|
||||||
# version: define current version
|
# version: define current version
|
||||||
my $version = "7.0NG.769 Build 230314";
|
my $version = "7.0NG.769 Build 230315";
|
||||||
|
|
||||||
# Pandora server configuration
|
# Pandora server configuration
|
||||||
my %conf;
|
my %conf;
|
||||||
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||||||
Encode::Locale::decode_argv;
|
Encode::Locale::decode_argv;
|
||||||
|
|
||||||
# version: define current version
|
# version: define current version
|
||||||
my $version = "7.0NG.769 Build 230314";
|
my $version = "7.0NG.769 Build 230315";
|
||||||
|
|
||||||
# save program name for logging
|
# save program name for logging
|
||||||
my $progname = basename($0);
|
my $progname = basename($0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user