Merge branch 'ent-9662-second-round' of brutus.artica.es:artica/pandorafms into ent-9662-second-round

This commit is contained in:
Pablo Aragon 2023-03-15 11:30:40 +01:00
commit 00a5e8e84b
60 changed files with 1046 additions and 632 deletions

View File

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

View File

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

View File

@ -1023,7 +1023,7 @@ my $Sem = undef;
my $ThreadSem = undef;
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
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.769
%define release 230314
%define release 230315
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.769
%define release 230314
%define release 230315
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.769"
PI_BUILD="230314"
PI_BUILD="230315"
OS_NAME=`uname -s`
FORCE=0

View File

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

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230314}
{230315}
ViewReadme
{Yes}

View File

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

View File

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

View File

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

View File

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

View File

@ -157,4 +157,13 @@ INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`, `filename`, `path`) VALUES
ALTER TABLE `tusuario` ADD COLUMN `show_tips_startup` TINYINT UNSIGNED NOT NULL DEFAULT 1;
CREATE TABLE IF NOT EXISTS `tfavmenu_user` (
`id` INT NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(255) NOT NULL,
`id_element` TEXT,
`url` TEXT NOT NULL,
`label` VARCHAR(255) NOT NULL,
`section` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`));
COMMIT;

View File

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

View File

@ -444,7 +444,8 @@ $tableBasicThresholds->data = [];
$tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width pdd_t_10px';
$tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').'&nbsp;';
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['warning_threshold'][0] .= html_print_input_text(
'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[] = '<span>'.__('Inverse interval').'</span>';
$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['critical_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').'&nbsp;';
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['critical_threshold'][0] .= html_print_input_text(
'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[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
@ -1906,77 +1907,50 @@ $(document).ready (function () {
$('.switch_radio_button label').on('click', function(){
var thisLabel = $(this).attr('for');
$('#'+thisLabel).attr('checked', 'checked');
$('#'+thisLabel).siblings().attr('checked', false);
$('#'+thisLabel).prop('checked', true);
$('#'+thisLabel).siblings().prop('checked', false);
if ($('#radius-warning_inverse').prop('checked') === true) {
//$('#percentage_warning').hide();
$("#svg_dinamic").show();
}
if ($('#radius-critical_inverse').prop('checked') === true) {
//$('#percentage_critical').hide();
if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true) {
$("#svg_dinamic").hide();
} else {
paint_graph_values();
$("#svg_dinamic").show();
}
if ($('#radius-percentage_warning').prop('checked') === true) {
//$('#warning_inverse').hide();
$("#svg_dinamic").hide();
$('#radius-warning_inverse').hide();
$('#label-radius-warning_inverse').hide();
}
if ($('#radius-warning_inverse').prop('checked') === true) {
$('#radius-percentage_warning').hide();
$('#label-radius-percentage_warning').hide();
}
if ($('#radius-normal_warning').prop('checked') === true) {
$('#radius-warning_inverse').show();
$('#label-radius-warning_inverse').show();
$('#radius-percentage_warning').show();
$('#label-radius-percentage_warning').show();
}
if ($('#radius-percentage_critical').prop('checked') === true) {
//$('#critical_inverse').hide();
$("#svg_dinamic").hide();
$('#radius-critical_inverse').hide();
$('#label-radius-critical_inverse').hide();
}
$('#radius-warning_inverse').change (function() {
paint_graph_values();
if ($('#radius-warning_inverse').prop('checked') === true){
$('#radius-percentage_warning').prop('checked', false);
$('#percentage_warning').attr('onClick', 'return false;');
$('#percentage_warning>em').addClass('color_666');
} else {
$('#percentage_warning').removeAttr('onClick');
$('#percentage_warning>em').removeClass('color_666');
}
});
if ($('#radius-critical_inverse').prop('checked') === true) {
$('#radius-percentage_critical').hide();
$('#label-radius-percentage_critical').hide();
}
$('#radius-critical_inverse').change (function() {
paint_graph_values();
if ($('#radius-critical_inverse').prop('checked') === true){
$('#radius-percentage_critical').prop('checked', false);
$('#percentage_critical').attr('onClick', 'return false;');
$('#percentage_critical>em').addClass('color_666');
} else {
$('#percentage_critical').removeAttr('onClick');
$('#percentage_critical>em').removeClass('color_666');
}
});
$('#radius-percentage_warning').change (function() {
paint_graph_values();
if ($('#radius-percentage_warning').prop('checked') === true){
$('#radius-warning_inverse').prop('checked', false);
$('#warning_inverse').attr('onClick', 'return false;');
$('#warning_inverse>em').addClass('color_666');
} else {
$('#warning_inverse').removeAttr('onClick');
$('#warning_inverse>em').removeClass('color_666');
}
});
$('#radius-percentage_critical').change (function() {
paint_graph_values();
if ($('#radius-percentage_critical').prop('checked') === true){
$('#radius-critical_inverse').prop('checked', false);
$('#critical_inverse').attr('onClick', 'return false;');
$('#critical_inverse>em').addClass('color_666');
} else {
$('#critical_inverse').removeAttr('onClick');
$('#critical_inverse>em').removeClass('color_666');
}
});
if ($('#radius-normal_critical').prop('checked') === true) {
$('#radius-critical_inverse').show();
$('#label-radius-critical_inverse').show();
$('#radius-percentage_critical').show();
$('#label-radius-percentage_critical').show();
}
});
@ -2235,91 +2209,66 @@ function validate_post_process() {
}
}
//function paint graph
//function paint graph.
function paint_graph_values(){
//Parse integrer
var min_w = parseFloat($('#text-min_warning').val());
if(min_w == '0.00'){ min_w = 0; }
var max_w = parseFloat($('#text-max_warning').val());
if(max_w == '0.00'){ max_w = 0; }
var min_c = parseFloat($('#text-min_critical').val());
if(min_c =='0.00'){ min_c = 0; }
var max_c = parseFloat($('#text-max_critical').val());
if(max_c =='0.00'){ max_c = 0; }
var inverse_w = $('input:radio[name=warning_inverse]:checked').val();
if(!inverse_w){ inverse_w = 0; }
var inverse_c = $('input:radio[name=critical_inverse]:checked').val();
if(!inverse_c){ inverse_c = 0; }
if(min_w == '0.00' || isNaN(min_w)){ min_w = 0; }
//inicialiced error
var max_w = parseFloat($('#text-max_warning').val());
if(max_w == '0.00' || isNaN(max_w)){ max_w = 0; }
var min_c = parseFloat($('#text-min_critical').val());
if(min_c =='0.00' || isNaN(min_c)){ min_c = 0; }
var max_c = parseFloat($('#text-max_critical').val());
if(max_c =='0.00' || isNaN(max_c)){ max_c = 0; }
var inverse_w = $('input:radio[value=warning_inverse]:checked').val();
if(!inverse_w){ inverse_w = 0; }
var inverse_c = $('input:radio[value=critical_inverse]:checked').val();
if(!inverse_c){ inverse_c = 0; }
//inicialiced error.
var error_w = 0;
var error_c = 0;
//messages legend
//messages legend.
var legend_normal = '<?php echo __('Normal Status'); ?>';
var legend_warning = '<?php echo __('Warning Status'); ?>';
var legend_critical = '<?php echo __('Critical Status'); ?>';
//messages error
//messages error.
var message_error_warning = '<?php echo __('Please introduce a maximum warning higher than the minimun warning'); ?>';
var message_error_critical = '<?php echo __('Please introduce a maximum critical higher than the minimun critical'); ?>';
var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>';
//Percentage selector
var percentage_w = $('#checkbox-percentage_warning').prop('checked');
var percentage_c = $('#checkbox-percentage_critical').prop('checked');
if(percentage_w == true || percentage_c == true) {
d3.select("#svg_dinamic rect").remove();
//create svg
var svg = d3.select("#svg_dinamic");
svg.selectAll("g").remove();
if (percentage_w === true) {
if(max_w < 0 || min_w < 0) {
paint_graph_status(0,0,0,0,0,0,1,0,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage);
} else {
$("#text-max_warning").removeClass("input_error");
$("#text-min_warning").removeClass("input_error");
}
}
if(percentage_c === true) {
if(max_c < 0 || min_c < 0) {
paint_graph_status(0,0,0,0,0,0,0,1,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage);
} else {
$("#text-min-critical").removeClass("input_error");
$("#text-max_critical").removeClass("input_error");
}
}
return;
} else {
$('#svg_dinamic').show();
}
//if haven't error
if(max_w == 0 || max_w > min_w){
if(max_c == 0 || max_c > min_c){
paint_graph_status(min_w, max_w, min_c, max_c, inverse_w,
inverse_c, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
paint_graph_status(
min_w, max_w, min_c, max_c, inverse_w,
inverse_c, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical
);
} else {
error_c = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
paint_graph_status(
0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical
);
}
} else {
error_w = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
paint_graph_status(
0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical
);
}
}
/* End of relationship javascript */
/* ]]> */
</script>

View File

@ -59,6 +59,14 @@ if ($delete) {
}
if ($result !== false) {
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_filter,
'section' => 'Events',
'id_user' => $config['id_user'],
]
);
$result = true;
} else {
$result = false;

View File

@ -714,6 +714,14 @@ if ($is_management_allowed === true
);
if ($result && (!$usedGroup['return'])) {
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_group,
'section' => 'Tactic_group',
'id_user' => $config['id_user'],
]
);
ui_print_success_message(__('Group successfully deleted'));
} else {
ui_print_error_message(

View File

@ -74,6 +74,12 @@ if (is_metaconsole() === false) {
'link' => '',
'label' => __('Tactic group'),
],
],
[
'id_element' => $id_group,
'url' => 'gagent&sec2=godmode/groups/tactical&id_group='.$id_group,
'label' => groups_get_name($id_group),
'section' => 'Tactic_group',
]
);
}

View File

@ -1,16 +1,31 @@
<?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;
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);
// Header
if (! defined('METACONSOLE')) {
ui_print_page_header(
__('Manage Netflow Filter'),
'images/gm_netflow.png',
false,
'',
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 = [
// Header.
ui_print_standard_header(
__('Manage Filters'),
'images/gm_netflow.png',
false,
'',
true,
[],
[
[
'link' => 'index.php?sec=main',
'text' => __('Main'),
'link' => '',
'label' => __('Netflow'),
],
[
'link' => 'index.php?sec=netf&sec2=godmode/netflow/nf_edit',
'text' => __('Netflow filters'),
],
];
],
);
ui_meta_print_page_header($nav_bar);
ui_meta_print_header(__('Netflow filters'));
$is_windows = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
if ($is_windows === true) {
ui_print_error_message(__('Not supported in Windows systems'));
}
$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')) {
$table->cellclass[][3] = 'table_action_buttons';
$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'>".html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>';
$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.'">';
$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);
}
if (isset($data)) {
echo "<form method='post' action='".$config['homeurl']."index.php?sec=netf&sec2=godmode/netflow/nf_edit&pure=$pure'>";
$buttons = html_print_submit_button(
__('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_table($table);
echo "<div class='right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>';
echo '</form>';
$buttons .= html_print_submit_button(__('Delete'), 'delete_btn', false, ['icon' => 'delete', 'mode' => 'secondary', 'form' => 'multiple_delete'], true);
} else {
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 "<div class='mrgn_right_5px right'>";
html_print_submit_button(__('Create filter'), 'crt', false, 'class="sub wand"');
echo '</div>';
html_print_action_buttons(
$buttons
);
echo '</form>';
?>
@ -221,27 +233,14 @@ echo '</form>';
<script type="text/javascript">
$( document ).ready(function() {
$('[id^=checkbox-delete_multiple]').change(function(){
if($(this).parent().parent().hasClass('checkselected')){
$(this).parent().parent().removeClass('checkselected');
$('[id^=checkbox-all_delete]').change(function() {
if ($("input[name=all_delete]").prop("checked")) {
$(".custom_checkbox_input").prop("checked", true);
}
else{
$(this).parent().parent().addClass('checkselected');
else {
$(".custom_checkbox_input").prop("checked", false);
}
});
$('[id^=checkbox-all_delete]').change(function(){
if ($("#checkbox-all_delete").prop("checked")) {
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
$(".check_delete").prop("checked", true);
}
else{
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
$(".check_delete").prop("checked", false);
}
});
});

View File

@ -1,16 +1,31 @@
<?php
/**
* 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;
require_once $config['homedir'].'/include/functions_ui.php';
@ -46,40 +61,28 @@ if ($id) {
}
}
// Header
if (! defined('METACONSOLE')) {
$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>';
// Header Buttons.
$buttons = [];
$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>';
ui_print_page_header(
__('Netflow Filter'),
'images/gm_netflow.png',
false,
'',
true,
$buttons
);
} else {
$nav_bar = [
// Header.
ui_print_standard_header(
$headerTitle,
'images/gm_netflow.png',
false,
'',
true,
$buttons,
[
[
'link' => 'index.php?sec=main',
'text' => __('Main'),
'link' => '',
'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) {
$filter = netflow_filter_get_filter($id);
@ -127,7 +130,7 @@ if ($update) {
'advanced_filter' => $advanced_filter,
];
// Save filter args
// Save filter args.
$values['filter_args'] = netflow_get_filter_arguments($values, true);
$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']);
$table->data[1][0] = '<b>'.__('Group').'</b>';
// 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>';
$filter_type = (empty($advanced_filter) === false) ? 1 : 0;
$aggregate_list = [
'srcip' => __('Src Ip Address'),
'dstip' => __('Dst Ip Address'),
@ -256,27 +184,194 @@ $aggregate_list = [
'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.'">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
$table = new stdClass();
$table->id = 'table1';
$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) {
html_print_input_hidden('update', 1);
html_print_input_hidden('id', $id);
html_print_submit_button(__('Update'), 'crt', false, 'class="sub upd"');
$buttonTitle = __('Update');
$hiddens .= html_print_input_hidden('update', 1, true);
$hiddens .= html_print_input_hidden('id', $id, true);
} else {
html_print_input_hidden('create', 1);
html_print_submit_button(__('Create'), 'crt', false, 'class="sub wand"');
$buttonTitle = __('Create');
$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>';
html_print_action_buttons(
html_print_submit_button(
$buttonTitle,
'crt',
false,
[
'icon' => 'upd',
'form' => 'nf_edit_form',
],
true
)
);
?>
<script type="text/javascript">
$(document).ready(function(){
var filter_type = <?php echo $filter_type; ?>;
if (filter_type == 0) {
displayNormalFilter ();
}
else {
displayAdvancedFilter ();
}
});
function displayAdvancedFilter () {
console.log('papapa advanced filter');
// Erase the normal filter
document.getElementById("text-ip_dst").value = '';
document.getElementById("text-ip_src").value = '';
@ -284,34 +379,32 @@ echo '</form>';
document.getElementById("text-src_port").value = '';
// Hide the normal filter
document.getElementById("table1-3").style.display = 'none';
document.getElementById("table1-4").style.display = 'none';
document.getElementById("table1-5").style.display = 'none';
document.getElementById("table1-6").style.display = 'none';
//document.getElementById("table1-3").style.display = 'none';
//document.getElementById("table1-4").style.display = 'none';
//document.getElementById("table1-5").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
document.getElementById("table1-7").style.display = '';
$("#table1-advanced_filters").css("display", "table-row");
//document.getElementById("table1-7").style.display = '';
};
function displayNormalFilter () {
console.log('papapa normal filter');
// Erase the advanced filter
document.getElementById("textarea_advanced_filter").value = '';
// 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
$("#table1-ip_line").css("display", "table-row");
$("#table1-ports_line").css("display", "table-row");
/*
document.getElementById("table1-3").style.display = '';
document.getElementById("table1-4").style.display = '';
document.getElementById("table1-5").style.display = '';
document.getElementById("table1-6").style.display = '';
*/
};
var filter_type = <?php echo $filter_type; ?>;
if (filter_type == 0) {
displayNormalFilter ();
}
else {
displayAdvancedFilter ();
}
</script>

View File

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

View File

@ -875,7 +875,7 @@ if (defined('METACONSOLE')) {
],
true
);
$form .= html_print_input_hidden('action', 'filter', true);
$form .= html_print_input_hidden('action', 'sort_items', true);
$form .= '</form>';
ui_toggle($form, __('Sort items'), '', '', false);

View File

@ -176,6 +176,31 @@ if (is_metaconsole() === true) {
);
}
if (is_metaconsole() === true) {
$table->data['description'][0] = __('Description');
$table->data['description'][1] = html_print_textarea(
'description',
2,
80,
$description,
'',
true
);
} else {
$table->colspan[1][0] = 2;
$table->data[1][0] = html_print_label_input_block(
__('Description'),
html_print_textarea(
'description',
2,
1,
$description,
'',
true
)
);
}
if ($report_id_user == $config['id_user']
|| is_user_admin($config['id_user'])
) {
@ -222,7 +247,7 @@ if ($report_id_user == $config['id_user']
$table->data['access'][1] .= '</div>';
$table->data['access'][1] .= '</span>';
} else {
$table->data[1][0] = html_print_label_input_block(
$table->data[2][0] = html_print_label_input_block(
__('Write Access').ui_print_help_tip(
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
true
@ -244,7 +269,7 @@ if ($report_id_user == $config['id_user']
$options['div_class'] = '';
}
$table->data[1][1] = html_print_label_input_block(
$table->data[2][1] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
@ -277,7 +302,7 @@ if ($enterpriseEnable) {
true
);
} else {
$table->data[2][0] = html_print_label_input_block(
$table->data[2][1] = html_print_label_input_block(
__('Non interactive report'),
html_print_checkbox_switch(
'non_interactive',
@ -289,29 +314,6 @@ if ($enterpriseEnable) {
}
}
if (is_metaconsole() === true) {
$table->data['description'][0] = __('Description');
$table->data['description'][1] = html_print_textarea(
'description',
2,
80,
$description,
'',
true
);
} else {
$table->data[2][1] = html_print_label_input_block(
__('Description'),
html_print_textarea(
'description',
2,
1,
$description,
'',
true
)
);
}
if (enterprise_installed() === true) {
if (is_metaconsole() === true) {

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / star@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-star" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,16.5 L5.32783438,18.9563028 C4.83898979,19.2133036 4.23436264,19.0253571 3.97736183,18.5365125 C3.87502276,18.3418521 3.83970808,18.118884 3.87688493,17.9021263 L4.76918916,12.6995935 L4.76918916,12.6995935 L0.989327772,9.01513923 C0.593844194,8.62963801 0.585751887,7.99652475 0.971253099,7.60104117 C1.1247617,7.44355754 1.32590411,7.34107036 1.54354115,7.30944585 L6.76718111,6.55040653 L6.76718111,6.55040653 L9.10326392,1.81698575 C9.34768622,1.32173209 9.94731205,1.11839309 10.4425657,1.36281539 C10.6397783,1.46014562 10.7994058,1.61977315 10.8967361,1.81698575 L13.2328189,6.55040653 L13.2328189,6.55040653 L18.4564589,7.30944585 C19.0030037,7.38886347 19.3816852,7.89630632 19.3022676,8.44285118 C19.270643,8.66048821 19.1681559,8.86163062 19.0106722,9.01513923 L15.2308108,12.6995935 L15.2308108,12.6995935 L16.1231151,17.9021263 C16.2164761,18.4464628 15.8508883,18.9634187 15.3065518,19.0567797 C15.0897942,19.0939566 14.8668261,19.0586419 14.6721656,18.9563028 L10,16.5 L10,16.5 Z" id="Star" fill="#a6adb2"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / web@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-web" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,0 C4.4771525,0 0,4.4771525 0,10 C0,15.5228475 4.4771525,20 10,20 C15.5228475,20 20,15.5228475 20,10 C19.9945565,4.47940886 15.5205911,0.00544352451 10,0 Z M10.0288333,17.4971042 C10.0246667,17.4971042 10.0206042,17.4983125 10.0163333,17.4983125 C9.68185417,17.3901458 9.011375,16.3172917 8.56475,14.3237292 C9.04327083,14.3508125 9.52308333,14.375 10,14.375 C10.4774375,14.375 10.9581042,14.3508958 11.437375,14.3237292 C10.9950208,16.3143958 10.3361458,17.3863125 10.0288333,17.4971042 Z M10,11.875 C9.35577083,11.875 8.75960417,11.8472292 8.19702083,11.8032917 C8.15291667,11.2406875 8.125,10.6442292 8.125,10 C8.125,9.35577083 8.15277083,8.75960417 8.19670833,8.19702083 C8.7593125,8.15291667 9.35577083,8.125 10,8.125 C10.6442292,8.125 11.2403958,8.15277083 11.8029792,8.19670833 C11.8470833,8.7593125 11.875,9.35577083 11.875,10 C11.875,10.6442292 11.8472292,11.2403958 11.8032917,11.8029792 C11.2406875,11.8470833 10.6442292,11.875 10,11.875 Z M2.50289583,10.0288333 C2.50289583,10.0246667 2.5016875,10.0206042 2.5016875,10.0163333 C2.60985417,9.68185417 3.68270833,9.011375 5.67627083,8.56475 C5.64927083,9.04327083 5.625,9.52316667 5.625,10 C5.625,10.4774375 5.64910417,10.9581042 5.67627083,11.437375 C3.68560417,10.9950208 2.6136875,10.3361458 2.50289583,10.0288333 Z M9.97116667,2.50289583 C9.97533333,2.50289583 9.97939583,2.5016875 9.98366667,2.5016875 C10.3181458,2.60985417 10.988625,3.68270833 11.43525,5.67627083 C10.9567292,5.64927083 10.4768333,5.625 10,5.625 C9.5225625,5.625 9.04189583,5.64910417 8.562625,5.67627083 C9.00497917,3.68560417 9.66385417,2.6136875 9.97116667,2.50289583 Z M14.3237292,8.562625 C16.3143958,9.00497917 17.3862292,9.66385417 17.4971042,9.97116667 C17.4971042,9.97533333 17.4983125,9.97939583 17.4983125,9.98366667 C17.3901458,10.3181458 16.3172917,10.988625 14.3237292,11.43525 C14.3508125,10.9567292 14.375,10.4769167 14.375,10 C14.375,9.5225625 14.3508958,9.04189583 14.3237292,8.562625 Z M16.671,6.64397917 C15.8116964,6.34280615 14.9276165,6.11763659 14.0289375,5.9710625 C13.8823634,5.07238349 13.6571938,4.18830364 13.3560208,3.329 C14.7866526,4.05165344 15.9483466,5.21334744 16.671,6.64397917 L16.671,6.64397917 Z M6.64375,3.329 C6.34261768,4.18830554 6.11749674,5.07238609 5.97097917,5.9710625 C5.0723873,6.11755451 4.18838995,6.34264769 3.32916667,6.64375 C4.05172797,5.21324363 5.21327996,4.05163323 6.64375,3.329 L6.64375,3.329 Z M3.32916667,13.35625 C4.1884091,13.6574028 5.07243613,13.8825243 5.9710625,14.0290208 C6.11753664,14.9276164 6.34263021,15.8116153 6.64375,16.6708333 C5.21325958,15.948307 4.05169302,14.7867404 3.32916667,13.35625 Z M13.35625,16.6708333 C13.6573853,15.8115856 13.8825065,14.9275601 14.0290208,14.0289375 C14.9276665,13.8824423 15.8117189,13.6573493 16.671,13.35625 C15.9483668,14.78672 14.7867564,15.948272 13.35625,16.6708333 L13.35625,16.6708333 Z" id="Shape" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,82 @@
<?php
/**
* Fav menu
*
* @category Ajax library.
* @package Pandora FMS
* @subpackage Modules.
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
// Login check
check_login();
if (is_ajax() === false) {
exit;
}
$id_element = get_parameter('id_element', '');
$url = io_safe_output(get_parameter('url', ''));
$label = get_parameter('label', '');
$section = get_parameter('section', '');
$id_user = $config['id_user'];
$exist = db_get_row_filter(
'tfavmenu_user',
[
'url' => $url,
'id_user' => $config['id_user'],
],
['*']
);
$res = false;
$action = '';
if ($exist !== false) {
$res = db_process_sql_delete(
'tfavmenu_user',
[
'url' => $url,
'id_user' => $config['id_user'],
]
);
$action = 'delete';
} else {
$res = db_process_sql_insert(
'tfavmenu_user',
[
'id_element' => $id_element,
'url' => $url,
'label' => $label,
'section' => $section,
'id_user' => $id_user,
]
);
$action = 'create';
}
if ($res !== false) {
echo json_encode(['success' => true, 'action' => $action]);
} else {
echo json_encode(['success' => false, 'action' => $action]);
}

View File

@ -2074,6 +2074,14 @@ if (check_login()) {
if ($monitor_filters === false) {
echo 'error';
} else {
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id,
'section' => 'Modules',
'id_user' => $config['id_user'],
]
);
echo 'ok';
}
}

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC230314';
$build_version = 'PC230315';
$pandora_version = 'v7.0NG.769';
// Do not overwrite default timezone set if defined.

View File

@ -2769,6 +2769,16 @@ function agents_delete_agent($id_agents, $disableACL=false)
enterprise_include_once('include/functions_agents.php');
enterprise_hook('agent_delete_from_cache', [$id_agent]);
// Delete agent from fav menu.
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_agent,
'section' => 'Agents',
'id_user' => $config['id_user'],
]
);
// Break the loop on error.
if ((bool) $error === true) {
break;

View File

@ -221,6 +221,8 @@ function reports_update_report($id_report, $values)
*/
function reports_delete_report($id_report)
{
global $config;
$id_report = safe_int($id_report);
if (empty($id_report)) {
return false;
@ -231,6 +233,16 @@ function reports_delete_report($id_report)
return false;
}
// Delete report from fav menu.
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_report,
'section' => 'Reporting',
'id_user' => $config['id_user'],
]
);
@db_process_sql_delete('treport_content', ['id_report' => $id_report]);
return @db_process_sql_delete('treport', ['id_report' => $id_report]);
}

View File

@ -5014,7 +5014,8 @@ function ui_print_standard_header(
string $help='',
bool $godmode=false,
array $options=[],
array $breadcrumbs=[]
array $breadcrumbs=[],
array $fav_menu_config=[]
) {
// For standard breadcrumbs.
ui_require_css_file('discovery');
@ -5058,7 +5059,9 @@ function ui_print_standard_header(
'',
GENERIC_SIZE_TEXT,
'',
$headerInformation->printHeader(true)
$headerInformation->printHeader(true),
false,
$fav_menu_config
);
// }
if ($return !== true) {
@ -5099,7 +5102,8 @@ function ui_print_page_header(
$numChars=GENERIC_SIZE_TEXT,
$alias='',
$breadcrumbs='',
$hide_left_small=false
$hide_left_small=false,
$fav_menu_config=[]
) {
global $config;
@ -5163,6 +5167,17 @@ function ui_print_page_header(
}
}
if (is_array($fav_menu_config) === true && is_metaconsole() === false) {
if (count($fav_menu_config) > 0) {
$buffer .= ui_print_fav_menu(
$fav_menu_config['id_element'],
$fav_menu_config['url'],
$fav_menu_config['label'],
$fav_menu_config['section']
);
}
}
$buffer .= '</span>';
if (is_metaconsole() === true) {
@ -7089,20 +7104,6 @@ function ui_query_result_editor($name='default')
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(
[
'id' => $name.'_editor_container',
@ -7160,6 +7161,11 @@ function ui_query_result_editor($name='default')
'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
);
}
@ -7804,4 +7810,48 @@ function ui_print_status_div($status)
}
return $return;
}
function ui_print_fav_menu($id_element, $url, $label, $section)
{
global $config;
$label = io_safe_output($label);
if (strlen($label) > 18) {
$label = io_safe_input(substr($label, 0, 18).'...');
}
$fav = db_get_row_filter(
'tfavmenu_user',
[
'url' => $url,
'id_user' => $config['id_user'],
],
['*']
);
$config_fav_menu = [
'id_element' => $id_element,
'url' => $url,
'label' => $label,
'section' => $section,
];
$output = '<span class="fav-menu">';
$output .= html_print_input_image(
'fav-menu-action',
(($fav !== false) ? 'images/star_fav_menu.png' : 'images/star_dark.png'),
base64_encode(json_encode($config_fav_menu)),
'',
true,
[
'onclick' => 'favMenuAction(this)',
'class' => (($fav !== false) ? 'active' : ''),
]
);
$output .= '</span>';
$output .= '<div id="dialog-fav-menu">';
$output .= '<p><b>'.__('Title').'</b></p>';
$output .= html_print_input_text('label_fav_menu', '', '', 25, 255, true, false, true);
$output .= '</div>';
return $output;
}

View File

@ -9,7 +9,7 @@ view.renderer.setShowGutter(false);
view.setReadOnly(true);
view.setShowPrintMargin(false);
$("#submit-execute_query").click(function() {
$("#button-execute_query").click(function() {
view.setValue("");
let text;
let selectText = editor.getSelectedText();

View File

@ -834,3 +834,55 @@ function unblockSubmit(button) {
expireCookie("downloadReady");
attempts = 30;
}
function favMenuAction(e) {
var data = JSON.parse(atob(e.value));
if (data.label === "" && $(e).hasClass("active") === false) {
$("#dialog-fav-menu").dialog({
title: "Please choose a title",
width: 330,
buttons: [
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-next",
text: "Confirm",
click: function() {
data.label = $("#text-label_fav_menu").val();
if (data.label.length > 18) {
data.label = data.label.slice(0, 18) + "...";
}
$(e).val(btoa(JSON.stringify(data)));
favMenuAction(e);
$(this).dialog("close");
$("input[name='label_fav_menu']").val("");
}
}
]
});
return;
}
$.ajax({
method: "POST",
url: "ajax.php",
dataType: "json",
data: {
page: "include/ajax/fav_menu.ajax",
id_element: data["id_element"],
url: data["url"],
label: data["label"],
section: data["section"]
},
success: function(res) {
if (res.success) {
if (res.action === "create") {
$("#image-fav-menu-action1").attr("src", "images/star_fav_menu.png");
$("#image-fav-menu-action1").addClass("active");
} else {
$("#image-fav-menu-action1").attr("src", "images/star_dark.png");
$("#image-fav-menu-action1").removeClass("active");
}
}
}
});
}

View File

@ -568,6 +568,16 @@ class Manager implements PublicLogin
'tdashboard',
['id' => $this->dashboardId]
);
// Delete dashboard from fav menu.
\db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $this->dashboardId,
'section' => 'Dashboard_',
'id_user' => $config['id_user'],
]
);
}
// Audit.

View File

@ -315,3 +315,15 @@ div.ui-tooltip.ui-corner-all.ui-widget-shadow.ui-widget.ui-widget-content.uitool
bottom: -20px;
top: auto;
}
#dialog-fav-menu {
display: none;
}
#dialog-fav-menu p {
margin: 0px;
padding-top: 40px;
}
.fav-menu input {
padding: 0px;
max-width: 20px !important;
max-height: 20px;
}

View File

@ -248,6 +248,10 @@
background: url(../../images/menu/events.svg) no-repeat 50% 50%;
background-size: 18px;
}
.icon_fav-menu {
background: url(../../images/menu/fav_menu_gray.svg) no-repeat 50% 50%;
background-size: 18px;
}
/* users */
.icon_oper-users {
@ -700,3 +704,7 @@ ul li {
width: 215px !important;
height: auto !important;
}
.fav-menu {
margin-left: 9px;
}

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.769';
$build = '230314';
$build = '230315';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -548,6 +548,15 @@ else if ($update_networkmap || $copy_networkmap || $delete) {
$result = networkmap_delete_networkmap($id);
// Delete network map from fav menu.
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id,
'section' => 'Network_map',
'id_user' => $config['id_user'],
]
);
$result_txt = ui_print_result_message(
$result,
__('Succesfully deleted'),

View File

@ -2412,6 +2412,12 @@ if ($networkmap === false) {
'link' => '',
'label' => __('Network maps'),
],
],
[
'id_element' => $networkmap['id'],
'url' => 'operation/agentes/pandora_networkmap&tab=view&id_networkmap='.$networkmap['id'],
'label' => $networkmap['name'],
'section' => 'Network_map',
]
);
}

View File

@ -93,27 +93,6 @@ if (is_metaconsole() === false) {
}
}
// Header.
ui_print_standard_header(
__('Monitor detail').$subpage,
'images/agent.png',
false,
'',
true,
$buttons,
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Views'),
],
]
);
if (is_metaconsole() === false) {
if ($section == 'fields') {
include_once $config['homedir'].'/godmode/agentes/status_monitor_custom_fields.php';
@ -173,6 +152,13 @@ if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== ''
$autosearch = true;
}
// The execution has not been done manually.
$userRequest = (bool) get_parameter('uptbutton');
if ($userRequest === false) {
$autosearch = true;
$status = AGENT_MODULE_STATUS_NOT_NORMAL;
}
if (is_metaconsole() === false) {
$ag_group = (int) get_parameter('ag_group', 0);
} else {
@ -285,8 +271,79 @@ if ($loaded_filter['id_filter'] > 0) {
$ag_custom_fields = json_decode(io_safe_output($ag_custom_fields), true);
}
}
// Fav menu.
$fav_menu = [
'id_element' => $loaded_filter['id_filter'],
'url' => 'operation/agentes/status_monitor&pure=&load_filter=1&filter_id='.$loaded_filter['id_filter'],
'label' => $loaded_filter['id_name'],
'section' => 'Modules',
];
}
if (is_metaconsole() === false) {
$section = (string) get_parameter('section', 'view');
$buttons['fields'] = [
'active' => false,
'text' => '<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&section=fields">'.html_print_image(
'images/edit_columns@svg.svg',
true,
[
'title' => __('Custom fields'),
'class' => 'invert_filter main_menu_icon',
]
).'</a>',
'operation' => true,
];
$buttons['view'] = [
'active' => false,
'text' => '<a href="index.php?sec=view&sec2=operation/agentes/status_monitor">'.html_print_image(
'images/logs@svg.svg',
true,
[
'title' => __('View'),
'class' => 'invert_filter main_menu_icon',
]
).'</a>',
'operation' => true,
];
switch ($section) {
case 'fields':
$buttons['fields']['active'] = true;
$subpage = ' &raquo; '.__('Custom fields');
break;
default:
$buttons['view']['active'] = true;
break;
}
}
// Header.
ui_print_standard_header(
__('Monitor detail').$subpage,
'images/agent.png',
false,
'',
true,
$buttons,
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Views'),
],
],
(empty($fav_menu) === true) ? [] : $fav_menu
);
$all_groups = [];
// Agent group selector.
@ -2220,11 +2277,7 @@ if (empty($result) === false) {
$tablePagination = ui_pagination($count_modules, false, $offset, 0, true, 'offset', false);
}
} else {
if ($first_interaction) {
ui_print_info_message(['no_close' => true, 'message' => __('This group doesn\'t have any monitor')]);
} else {
ui_print_info_message(['no_close' => true, 'message' => __('Sorry no search parameters')]);
}
ui_print_info_message(['no_close' => true, 'message' => __('Sorry no search parameters')]);
}
if (is_metaconsole() !== true) {
@ -2464,4 +2517,4 @@ if( value_swtich != "") {
}else {
chkbox.checked = false;
}
</script>
</script>

View File

@ -1071,7 +1071,7 @@ if (is_ajax() === true) {
*/
$load_filter_id = (int) get_parameter('filter_id', 0);
$fav_menu = [];
if ($load_filter_id === 0) {
// Load user filter.
$loaded_filter = db_get_row_sql(
@ -1093,6 +1093,14 @@ if ($load_filter_id === 0) {
'id_filter',
$load_filter_id
);
// Fav menu
$fav_menu = [
'id_element' => $load_filter_id,
'url' => 'operation/events/events&pure=&load_filter=1&filter_id='.$load_filter_id,
'label' => $loaded_filter['id_name'],
'section' => 'Events',
];
}
// Do not load the user filter if we come from the 24h event graph.
@ -1583,7 +1591,8 @@ if ($pure) {
'link' => '',
'label' => __('Events'),
],
]
],
$fav_menu
);
}

View File

@ -606,6 +606,44 @@ if ($access_console_node === true) {
}
}
$favorite_menu = db_get_all_rows_sql(
sprintf(
'SELECT id_element, url, label, section
FROM tfavmenu_user
WHERE id_user = "%s"
ORDER BY section DESC',
$config['id_user']
)
);
// Favorite.
if ($favorite_menu !== false) {
$menu_operation['favorite']['text'] = __('Favorite');
$menu_operation['favorite']['id'] = 'fav-menu';
$section = '';
$sub = [];
$sub2 = [];
foreach ($favorite_menu as $key => $row) {
if ($row['section'] !== $section) {
$section = $row['section'];
$sub2 = [];
}
$sub[$section]['text'] = __(str_replace('_', ' ', $section));
$sub[$section]['type'] = 'direct';
$sub[$section]['subtype'] = 'nolink';
$sub[$section]['id'] = $row['section'];
$sub2[$row['url']]['text'] = io_safe_output($row['label']);
$sub[$section]['sub2'] = $sub2;
}
$menu_operation['favorite']['sub'] = $sub;
}
// Workspace.
$menu_operation['workspace']['text'] = __('Workspace');
$menu_operation['workspace']['sec2'] = 'operation/users/user_edit';

View File

@ -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
* This program is free software; you can redistribute it and/or
* 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', '');
$update = get_parameter('update_button', '');
if (is_metaconsole() === false) {
// Header.
ui_print_standard_header(
__('Netflow live view'),
'images/op_netflow.png',
false,
'',
false,
[],
// Header.
ui_print_standard_header(
__('Netflow live view'),
'images/op_netflow.png',
false,
'',
false,
[],
[
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Network'),
],
]
);
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Network'),
],
]
);
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
if ($is_windows) {
ui_print_error_message(__('Not supported in Windows systems'));
} else {
netflow_print_check_version_error();
}
$is_windows = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
if ($is_windows === true) {
ui_print_error_message(__('Not supported in Windows systems'));
} else {
$nav_bar = [
[
'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'));
netflow_print_check_version_error();
}
// Save user defined filter.
@ -390,6 +373,7 @@ if (empty($filter['advanced_filter']) === false) {
$filterTable = new stdClass();
$filterTable->id = '';
$filterTable->width = '100%';
$filterTable->class = 'filter-table-adv';
$filterTable->size = [];
$filterTable->size[0] = '33%';

View File

@ -221,6 +221,12 @@ ui_print_standard_header(
'link' => '',
'label' => __('Custom reports'),
],
],
[
'id_element' => $id_report,
'url' => 'operation/reporting/reporting_viewer&id='.$id_report,
'label' => reporting_get_name($id_report),
'section' => 'Reporting',
]
);

View File

@ -240,6 +240,12 @@ if (!$config['pure']) {
'link' => '',
'label' => __('Visual console'),
],
],
[
'id_element' => $visualConsoleId,
'url' => 'operation/visual_console/render_view&id='.$visualConsoleId,
'label' => $visualConsoleName,
'section' => 'Visual_Console',
]
);
}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.769
%define release 230314
%define release 230315
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.769
%define release 230314
%define release 230315
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.769
%define release 230314
%define release 230315
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -4246,3 +4246,15 @@ CREATE TABLE IF NOT EXISTS `twelcome_tip_file` (
REFERENCES `twelcome_tip` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-- ---------------------------------------------------------------------
-- Table `tfavmenu_user`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tfavmenu_user` (
`id` INT NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(255) NOT NULL,
`id_element` TEXT,
`url` TEXT NOT NULL,
`label` VARCHAR(255) NOT NULL,
`section` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`));

View File

@ -296,6 +296,12 @@ if ($publicLink === false) {
'link' => '',
'label' => __('Dashboard'),
],
],
[
'id_element' => $dashboardId,
'url' => 'operation/dashboard/dashboard&dashboardId='.$dashboardId,
'label' => $dashboardName,
'section' => 'Dashboard_',
]
);
} else {

View File

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

View File

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

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.769";
my $pandora_build = "230314";
my $pandora_build = "230315";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.769";
my $pandora_build = "230314";
my $pandora_build = "230315";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.769
%define release 230314
%define release 230315
Summary: Pandora FMS Server
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.769
%define release 230314
%define release 230315
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.769"
PI_BUILD="230314"
PI_BUILD="230315"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.769 Build 230314";
my $version = "7.0NG.769 Build 230315";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.769 Build 230314";
my $version = "7.0NG.769 Build 230315";
# save program name for logging
my $progname = basename($0);