Merge branch 'develop' into ent-9771-discovery-2-0-sistema-de-extensiones-disco-para-el-discovery

This commit is contained in:
Daniel Cebrian 2023-04-12 18:28:55 +02:00
commit 60700000fe
40 changed files with 158 additions and 55 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.770-230411
Version: 7.0NG.770-230412
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.770-230411"
pandora_version="7.0NG.770-230412"
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.770';
use constant AGENT_BUILD => '230411';
use constant AGENT_BUILD => '230412';
# 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.770
%define release 230411
%define release 230412
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.770
%define release 230411
%define release 230412
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.770"
PI_BUILD="230411"
PI_BUILD="230412"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230411}
{230412}
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.770 Build 230411")
#define PANDORA_VERSION ("7.0NG.770 Build 230412")
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.770(Build 230411))"
VALUE "ProductVersion", "(7.0NG.770(Build 230412))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.770-230411
Version: 7.0NG.770-230412
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.770-230411"
pandora_version="7.0NG.770-230412"
package_pear=0
package_pandora=1

View File

@ -1184,6 +1184,11 @@ html_print_div(
}
});
var show_dialog_create = "<?php echo get_parameter('show_dialog_create', 0); ?>";
if (show_dialog_create !== '0'){
$('#button-create_module').click();
}
});

View File

@ -227,7 +227,7 @@ if (is_ajax()) {
'field'.$i.'_value',
'text/plain',
'',
$content_type == 'text/plain',
'',
$is_management_allowed,
'',
'',
@ -239,7 +239,7 @@ if (is_ajax()) {
'field'.$i.'_value',
'text/html',
'',
$content_type == 'text/html',
'text/html',
$is_management_allowed,
'',
'',

View File

@ -712,7 +712,6 @@ $(document).ready (function () {
old_recovery_value =
$("[name=field" + i + "_recovery_value]").val();
}
// Replace the old column with the new
$table_macros_field.replaceWith(field_row);
if (old_value != '' || old_recovery_value != '') {
@ -720,12 +719,14 @@ $(document).ready (function () {
if (inputType == 'radio') {
if(old_value == 'text/plain'){
if ($("[name=field" + i + "_value]").val() == 'text/plain') {
$("[name=field" + i + "_value]").attr('checked','checked');
$("[name=field" + i + "_value][value='text/plain']").attr('checked','checked');
$("[name=field" + i + "_value][value='text/html']").removeAttr("checked")
}
}
else{
if($("[name=field" + i + "_value]").val() == 'text/html') {
$("[name=field" + i + "_value]").attr('checked','checked');
$("[name=field" + i + "_value]").val()
if ($("[name=field" + i + "_value]").val() == 'text/html') {
$("[name=field" + i + "_value][value='text/html']").attr('checked','checked');
}
}
if(old_recovery_value == 'text/plain'){

View File

@ -120,6 +120,16 @@ if (is_metaconsole() === true) {
// Data before table.
$files = list_files(((is_metaconsole() === true) ? '../../' : '').'images/', '@groups.svg', 1, 0);
$files_old = list_files('images/groups_small/', 'png', 1, 0);
foreach ($files_old as $key => $f) {
// Remove from the list the non-desired .png files.
if (strpos($f, '.bad.png') !== false || strpos($f, '.default.png') !== false || strpos($f, '.ok.png') !== false || strpos($f, '.warning.png') !== false) {
unset($files_old[$key]);
}
}
$files = array_merge($files, $files_old);
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filter-table-adv';
@ -133,10 +143,19 @@ $table->data[0][0] = html_print_label_input_block(
html_print_input_text('name', $name, '', 35, 100, true)
);
$extension = pathinfo($icon, PATHINFO_EXTENSION);
if (empty($extension) === true) {
$icon .= '.png';
}
$input_icon = html_print_select($files, 'icon', $icon, '', 'None', '', true, false, true, '', false, 'width: 100%;');
$input_icon .= ' <span id="icon_preview" class="mrgn_lft_05em">';
if (empty($icon) === false) {
$input_icon .= html_print_image('images/'.$icon, true);
if (empty($extension) === true || $extension === 'png') {
$input_icon .= html_print_image('images/groups_small/'.$icon, true);
} else {
$input_icon .= html_print_image('images/'.$icon, true);
}
}
$input_icon .= '</span>';
@ -304,12 +323,17 @@ echo '</form>';
function icon_changed () {
var inputs = [];
var data = this.value;
var extension = data.split('.').pop();
$('#icon_preview').fadeOut ('normal', function () {
$('#icon_preview').empty ();
if (data != "") {
var params = [];
params.push("get_image_path=1");
params.push("img_src=images/" + data);
if (extension === 'png') {
params.push("img_src=images/groups_small/" + data);
} else {
params.push("img_src=images/" + data);
}
params.push("page=include/ajax/skins.ajax");
params.push("only_src=1");
jQuery.ajax ({

View File

@ -920,8 +920,19 @@ if ($tab == 'tree') {
}
if ($group['icon'] != '') {
$extension = pathinfo($group['icon'], PATHINFO_EXTENSION);
if (empty($extension) === true) {
$group['icon'] .= '.png';
}
if (empty($extension) === true || $extension === 'png') {
$path = 'images/groups_small/'.$group['icon'];
} else {
$path = 'images/'.$group['icon'];
}
$table->data[$key][2] = html_print_image(
'images/'.$group['icon'],
$path,
true,
[
'style' => '',

View File

@ -116,6 +116,22 @@ function get_list_os_icons_dir()
}
}
$items2 = scandir($config['homedir'].'/images/os_icons');
foreach ($items2 as $item2) {
if (strstr($item2, '_small.png') || strstr($item2, '_small.gif')
|| strstr($item2, '_small.jpg')
) {
continue;
}
if (strstr($item2, '.png') || strstr($item2, '.gif')
|| strstr($item2, '.jpg')
) {
$return[$item2] = $item2;
}
}
return $return;
}
@ -124,10 +140,15 @@ function get_list_os_icons_dir()
<script type="text/javascript">
function show_icon_OS() {
var extension = $("#icon").val().split('.').pop();
var params = [];
params.push("get_image_path=1");
params.push('img_src=images/' + $("#icon").val());
if (extension !== 'svg') {
params.push('img_src=images/os_icons/' + $("#icon").val());
} else {
params.push('img_src=images/' + $("#icon").val());
}
params.push("page=include/ajax/skins.ajax");
jQuery.ajax ({
data: params.join ("&"),

View File

@ -970,7 +970,7 @@ foreach ($info as $user_id => $user_info) {
*/
$userListActionButtons[] = html_print_menu_button(
[
'href' => ui_get_full_url(
'href' => ui_get_full_url(
sprintf(
'index.php?sec=%s&amp;sec2=godmode/users/user_list&user_del=1&pure=%s&delete_user=%s',
$sec,
@ -978,8 +978,9 @@ foreach ($info as $user_id => $user_info) {
$user_info['id_user']
)
),
'image' => 'images/delete.svg',
'title' => __('Delete'),
'image' => 'images/delete.svg',
'title' => __('Delete'),
'onClick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
],
true
);

View File

@ -1361,7 +1361,7 @@ class AgentWizard extends HTML
true,
[
'title' => __('Plugin server'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
);
} else {
@ -1371,7 +1371,7 @@ class AgentWizard extends HTML
true,
[
'title' => __('WMI server'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
);
} else {
@ -1380,7 +1380,7 @@ class AgentWizard extends HTML
true,
[
'title' => __('Network server'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
);
}
@ -4096,16 +4096,16 @@ class AgentWizard extends HTML
'title' => __('Modules selected'),
'alt' => __('Modules selected'),
'id' => 'image-info-modules-'.$idBlock,
'class' => 'hidden',
'class' => 'hidden main_menu_icon',
]
);
$blockTitle .= '</b>';
}
} else {
$blockTitle = '<b>'.$block['name'];
$classImg = '';
$classImg = 'main_menu_icon ';
if ($activeModules === 0) {
$classImg = 'hidden';
$classImg .= 'hidden';
}
$blockTitle .= '&nbsp;&nbsp;';

View File

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

View File

@ -445,6 +445,15 @@ function groups_get_icon($id_group)
} else {
$icon = (string) db_get_value('icon', 'tgrupo', 'id_grupo', (int) $id_group);
$extension = pathinfo($icon, PATHINFO_EXTENSION);
if (empty($extension) === true) {
$icon .= '.png';
}
if (empty($extension) === true || $extension === 'png') {
$icon = 'groups_small/'.$icon;
}
if (empty($icon) === true) {
$icon = 'unknown@groups.svg';
}

View File

@ -5986,8 +5986,14 @@ function reporting_get_events($data, $links=false)
$table_events->size[2] = '10%';
$table_events->size[3] = '10%';
$event_view = '<fieldset class="tactical_set">
<legend>'.__('Important Events by Criticity').'</legend>'.html_print_table($table_events, true).'</fieldset>';
$tooltip = ui_print_help_tip(
__(
"Event count corresponds to events within the last hour"
),
true
);
$event_view = '<fieldset class="tactical_set"><legend>'.__('Important Events by Criticity').$tooltip.'</legend>'.html_print_table($table_events, true).'</fieldset>';
}
return $event_view;

View File

@ -944,12 +944,12 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
true
);
} else {
$buttons_act .= '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$ent.'&tab=module">';
$buttons_act .= '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$ent.'&tab=module&show_dialog_create=1">';
$buttons_act .= html_print_submit_button(
__('Go to module creation'),
'upd_button',
false,
['class' => 'secondary mini'],
['class' => 'secondary mini no_decoration'],
true
);
@ -958,7 +958,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
__('Go to agent edition'),
'upd_button',
false,
['class' => 'secondary mini'],
['class' => 'secondary mini no_decoration'],
true
);
}

View File

@ -713,6 +713,10 @@ function ui_print_group_icon($id_group, $return=false, $path='', $style='', $lin
$output = '';
$icon = ($id_group > 0) ? (string) db_get_value('icon', 'tgrupo', 'id_grupo', (int) $id_group) : 'unknown@groups.svg';
$extension = pathinfo($icon, PATHINFO_EXTENSION);
if (empty($extension) === true) {
$icon .= '.png';
}
// Don't show link in metaconsole.
if (is_metaconsole() === true) {
@ -756,10 +760,14 @@ function ui_print_group_icon($id_group, $return=false, $path='', $style='', $lin
}
}
$icon = (str_contains($icon, '.svg') === true) ? $icon : $icon.'.svg';
$icon = (str_contains($icon, '.svg') === true || str_contains($icon, '.png') === true) ? $icon : $icon.'.svg';
$folder = '';
if (str_contains($icon, '.png')) {
$folder = 'groups_small/';
}
$output .= html_print_image(
'images/'.$icon,
'images/'.$folder.$icon,
true,
[
'style' => $style,
@ -876,6 +884,17 @@ function ui_print_os_icon(
$no_in_meta = (is_metaconsole() === false);
$icon = (string) db_get_value('icon_name', 'tconfig_os', 'id_os', (int) $id_os);
$extension = pathinfo($icon, PATHINFO_EXTENSION);
if (empty($extension) === true) {
$icon .= '.png';
}
if (empty($extension) === true || $extension === 'png'
|| $extension === 'jpg' || $extension === 'gif' && $subfolder === '.'
) {
$subfolder = 'os_icons';
}
$os_name = get_os_name($id_os);
if (empty($icon) === true) {
if ($only_src) {
@ -6944,7 +6963,7 @@ function ui_get_favicon()
global $config;
if (empty($config['custom_favicon'])) {
return (!is_metaconsole()) ? 'images/pandora.ico' : '/images/favicon_meta.ico';
return (!is_metaconsole()) ? 'images/pandora.ico' : '/images/custom_favicon/favicon_meta.ico';
}
return 'images/custom_favicon/'.$config['custom_favicon'];

View File

@ -652,13 +652,19 @@ var TreeController = {
typeof element.icon != "undefined" &&
element.icon.length > 0
) {
var extension = element.icon.split(".").pop();
$content.append(
'<div class="node-icon"><div class="node-icon-container"><img src="' +
(controller.baseURL.length > 0 ? controller.baseURL : "") +
(controller.baseURL.indexOf("meta") !== -1
? "../../images/"
: "images/") +
element.icon +
(extension === "png" || extension === element.icon
? "groups_small/"
: "") +
(extension === element.icon
? element.icon + ".png"
: element.icon) +
'" class="invert_filter"/></div></div>'
);
} else if (

View File

@ -241,7 +241,7 @@ table tbody tr td h4 {
a {
color: #3f3f3f;
text-decoration: none;
text-decoration: none !important;
}
a:hover {

View File

@ -1315,7 +1315,7 @@ if ($searchPage) {
true,
$sec2,
]
) === ENTERPRISE_NOT_HOOK
) == false
) {
include 'general/noaccess.php';
} else {

View File

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

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.770
%define release 230411
%define release 230412
# 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.770
%define release 230411
%define release 230412
# 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.770
%define release 230411
%define release 230412
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.770-230411
Version: 7.0NG.770-230412
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.770-230411"
pandora_version="7.0NG.770-230412"
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.770";
my $pandora_build = "230411";
my $pandora_build = "230412";
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.770";
my $pandora_build = "230411";
my $pandora_build = "230412";
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.770
%define release 230411
%define release 230412
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.770
%define release 230411
%define release 230412
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.770"
PI_BUILD="230411"
PI_BUILD="230412"
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.770 Build 230411";
my $version = "7.0NG.770 Build 230412";
# 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.770 Build 230411";
my $version = "7.0NG.770 Build 230412";
# save program name for logging
my $progname = basename($0);