Merge branch 'develop' into 'ent-10865-15337-15360-Macros-Custom-Fields-no-funcionan-en-modulos-SNMP'

# Conflicts:
#   pandora_console/extras/mr/64.sql
This commit is contained in:
Alejandro Campos 2023-05-24 09:20:14 +00:00
commit 988db793da
106 changed files with 3765 additions and 3632 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.771-230517 Version: 7.0NG.771-230524
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -1023,7 +1023,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.771'; use constant AGENT_VERSION => '7.0NG.771';
use constant AGENT_BUILD => '230517'; use constant AGENT_BUILD => '230524';
# 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;

View File

@ -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.771 %define version 7.0NG.771
%define release 230517 %define release 230524
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -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.771 %define version 7.0NG.771
%define release 230517 %define release 230524
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.771" PI_VERSION="7.0NG.771"
PI_BUILD="230517" PI_BUILD="230524"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{230517} {230524}
ViewReadme ViewReadme
{Yes} {Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.771-230517 Version: 7.0NG.771-230524
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -186,10 +186,6 @@ function pandora_realtime_graphs()
$table->data[] = $data; $table->data[] = $data;
if ($graph == 'snmp_interface' || $graph == 'snmp_module') {
echo snmp_browser_print_container(true, '100%', '60%', 'none');
}
// Print the relative path to AJAX calls. // Print the relative path to AJAX calls.
html_print_input_hidden('rel_path', get_parameter('rel_path', '')); html_print_input_hidden('rel_path', get_parameter('rel_path', ''));
@ -224,7 +220,7 @@ function pandora_realtime_graphs()
false, false,
'', '',
'white-box-content', 'white-box-content',
'box-flat white_table_graph' 'box-flat white_table_graph fixed_filter_bar'
); );
$chart[time()]['graph'] = '0'; $chart[time()]['graph'] = '0';
@ -266,6 +262,16 @@ function pandora_realtime_graphs()
] ]
); );
if ($graph == 'snmp_interface' || $graph == 'snmp_module') {
html_print_div(
[
'class' => 'white_box',
'id' => 'graph_snmp_interface',
'content' => snmp_browser_print_container(true, '100%', '60%', '', false, false),
]
);
}
// echo $canvas; // echo $canvas;
// Define a custom action to save // Define a custom action to save
// the OID selected in the SNMP browser to the form. // the OID selected in the SNMP browser to the form.

View File

@ -453,7 +453,7 @@ function resource_exportation_extension_main()
true true
) )
); );
$table->data[0][] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'report\');', ['mode' => 'link'], true); $table->data[0][] = html_print_button(__('Export'), '', false, 'export_to_ptr("report");', ['mode' => 'link'], true);
$table->data[1][] = html_print_label_input_block( $table->data[1][] = html_print_label_input_block(
__('Visual console'), __('Visual console'),
@ -465,7 +465,7 @@ function resource_exportation_extension_main()
true true
) )
); );
$table->data[1][] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'visual_console\');', ['mode' => 'link'], true); $table->data[1][] = html_print_button(__('Export'), '', false, 'export_to_ptr("visual_console");', ['mode' => 'link'], true);
if ($hook_enterprise === true) { if ($hook_enterprise === true) {
add_rows_for_enterprise($table->data); add_rows_for_enterprise($table->data);

View File

@ -2,8 +2,20 @@ START TRANSACTION;
ALTER TABLE `tnetwork_component` ADD COLUMN `target_ip` VARCHAR(255) NOT NULL DEFAULT ''; ALTER TABLE `tnetwork_component` ADD COLUMN `target_ip` VARCHAR(255) NOT NULL DEFAULT '';
UPDATE tnetwork_component UPDATE `tnetwork_component`
SET module_enabled=1 SET module_enabled=1
WHERE name='Cisco _nameOID_ power state'; WHERE name='Cisco _nameOID_ power state';
COMMIT; ALTER TABLE `tlayout_data`
ADD COLUMN `recursive_group` TINYINT NOT NULL DEFAULT '0' AFTER `fill_color`;
ALTER TABLE `tusuario`
ADD COLUMN `metaconsole_section` VARCHAR(255) NOT NULL DEFAULT 'Default' AFTER `data_section`;
ALTER TABLE `tusuario`
ADD COLUMN `metaconsole_data_section` VARCHAR(255) NOT NULL DEFAULT '' AFTER `metaconsole_section`;
ALTER TABLE `tusuario`
ADD COLUMN `metaconsole_default_event_filter` INT UNSIGNED NOT NULL DEFAULT 0 AFTER `default_event_filter`;
COMMIT;

View File

@ -1546,7 +1546,11 @@ if ($update_module === true || $create_module === true) {
} }
// Inverse string checkbox. // Inverse string checkbox.
if ($id_module_type === MODULE_TYPE_GENERIC_DATA_STRING || $id_module_type === MODULE_TYPE_ASYNC_STRING) { if ($id_module_type === MODULE_TYPE_GENERIC_DATA_STRING
|| $id_module_type === MODULE_TYPE_ASYNC_STRING
|| $id_module_type === MODULE_TYPE_REMOTE_TCP_STRING
|| $id_module_type === MODULE_TYPE_REMOTE_CMD_STRING
) {
// Warning inverse string checkbox. // Warning inverse string checkbox.
$warning_string_checkbox = get_parameter('warning_inverse_string'); $warning_string_checkbox = get_parameter('warning_inverse_string');
if (!empty($warning_string_checkbox) && $warning_string_checkbox === 'warning_inverse_string') { if (!empty($warning_string_checkbox) && $warning_string_checkbox === 'warning_inverse_string') {
@ -2024,10 +2028,10 @@ if ($create_module) {
// MODULE ENABLE/DISABLE // MODULE ENABLE/DISABLE
// =====================. // =====================.
if ($enable_module) { /*
if ($enable_module) {
$result = modules_change_disabled($enable_module, 0); $result = modules_change_disabled($enable_module, 0);
$module_name = modules_get_agentmodule_name($enable_module); $module_name = modules_get_agentmodule_name($enable_module);
// Write for conf disable if remote_config. // Write for conf disable if remote_config.
$configuration_data = enterprise_hook( $configuration_data = enterprise_hook(
'config_agents_get_module_from_conf', 'config_agents_get_module_from_conf',
@ -2041,10 +2045,8 @@ if ($enable_module) {
// Force Update when disabled for save disabled in conf. // Force Update when disabled for save disabled in conf.
$old_configuration_data = $configuration_data; $old_configuration_data = $configuration_data;
// Successfull action. // Successfull action.
$success_action = $result; $success_action = $result;
$success_action = $result; $success_action = $result;
if ($result === NOERR) { if ($result === NOERR) {
db_pandora_audit( db_pandora_audit(
@ -2057,9 +2059,11 @@ if ($enable_module) {
'Fail to enable #'.$enable_module.' | '.$module_name.' | '.io_safe_output($agent['alias']) 'Fail to enable #'.$enable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
); );
} }
} }
if ($disable_module) { if ($disable_module) {
hd($disable_module, true);
$result = modules_change_disabled($disable_module, 1); $result = modules_change_disabled($disable_module, 1);
$module_name = modules_get_agentmodule_name($disable_module); $module_name = modules_get_agentmodule_name($disable_module);
@ -2083,18 +2087,20 @@ if ($disable_module) {
if ($result === NOERR) { if ($result === NOERR) {
hd($disable_module, true);
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_MODULE_MANAGEMENT, AUDIT_LOG_MODULE_MANAGEMENT,
'Disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias']) 'Disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
); );
} else { } else {
hd($disable_module, true);
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_MODULE_MANAGEMENT, AUDIT_LOG_MODULE_MANAGEMENT,
'Fail to disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias']) 'Fail to disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
); );
} }
} }
*/
// Fix to stop the module from being added to the agent's conf // Fix to stop the module from being added to the agent's conf
// when an error occurred while updating or inserting. or enable disable module. // when an error occurred while updating or inserting. or enable disable module.
if ($update_module || $create_module if ($update_module || $create_module
@ -2521,10 +2527,10 @@ switch ($tab) {
}); });
// Change description when edit port // Change description when edit port
$( "#text-tcp_port" ).change(function() { /*$( "#text-tcp_port" ).change(function() {
$( "#textarea_description" ).text(`Checks port ${$( "#text-tcp_port" ).val()} is opened`); $( "#textarea_description" ).text(`Checks port ${$( "#text-tcp_port" ).val()} is opened`);
}); });*/
// Set the position and width of the subtab // Set the position and width of the subtab
/* /*
function agent_wizard_tab_setup() { function agent_wizard_tab_setup() {

View File

@ -840,8 +840,8 @@ if ($modules !== false) {
$linked = policies_is_module_linked($module['id_agente_modulo']); $linked = policies_is_module_linked($module['id_agente_modulo']);
$adopt = policies_is_module_adopt($module['id_agente_modulo']); $adopt = policies_is_module_adopt($module['id_agente_modulo']);
if ($linked !== false) { if ((bool) $linked !== false) {
if ($adopt === true) { if ((bool) $adopt === true) {
$img = 'images/policies_brick.png'; $img = 'images/policies_brick.png';
$title = '('.__('Adopted').') '.$policyInfo['name_policy']; $title = '('.__('Adopted').') '.$policyInfo['name_policy'];
} else { } else {
@ -849,7 +849,7 @@ if ($modules !== false) {
$title = $policyInfo['name_policy']; $title = $policyInfo['name_policy'];
} }
} else { } else {
if ($adopt === true) { if ((bool) $adopt === true) {
$img = 'images/policies_not_brick.png'; $img = 'images/policies_not_brick.png';
$title = '('.__('Unlinked').') ('.__('Adopted').') '.$policyInfo['name_policy']; $title = '('.__('Unlinked').') ('.__('Adopted').') '.$policyInfo['name_policy'];
} else { } else {
@ -1009,7 +1009,7 @@ if ($modules !== false) {
$data[8] .= html_print_menu_button( $data[8] .= html_print_menu_button(
[ [
'href' => 'index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$module['id_agente_modulo'], 'href' => 'index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$module['id_agente_modulo'],
'onClick' => "if (!confirm(\' '.__('Are you sure?').'\')) return false;", 'onClick' => 'javascript: if (!confirm(\''.__('Are you sure?').'\')) return false;',
'image' => 'images/delete.svg', 'image' => 'images/delete.svg',
'title' => __('Delete'), 'title' => __('Delete'),
], ],

View File

@ -509,7 +509,7 @@ $tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
10, 10,
1024, 1024,
true, true,
$disabledBecauseInPolicy || $edit === false, $disabledBecauseInPolicy,
false, false,
'', '',
$classdisabledBecauseInPolicy $classdisabledBecauseInPolicy
@ -1049,8 +1049,8 @@ $table_advanced->data['textarea_description_instructions'][1] = html_print_texta
$table_advanced->rowclass['caption_textarea_crit_warn_instructions'] = 'field_half_width pdd_t_10px'; $table_advanced->rowclass['caption_textarea_crit_warn_instructions'] = 'field_half_width pdd_t_10px';
$table_advanced->rowclass['textarea_crit_warn_instructions'] = 'field_half_width'; $table_advanced->rowclass['textarea_crit_warn_instructions'] = 'field_half_width';
$table_advanced->data['caption_textarea_crit_warn_instructions'][1] = __('Warning instructions');
$table_advanced->data['caption_textarea_crit_warn_instructions'][0] = __('Critical instructions'); $table_advanced->data['caption_textarea_crit_warn_instructions'][0] = __('Critical instructions');
$table_advanced->data['caption_textarea_crit_warn_instructions'][1] = __('Warning instructions');
$table_advanced->data['textarea_crit_warn_instructions'][0] = html_print_textarea( $table_advanced->data['textarea_crit_warn_instructions'][0] = html_print_textarea(
'critical_instructions', 'critical_instructions',
5, 5,

View File

@ -28,6 +28,7 @@
global $config; global $config;
require_once $config['homedir'].'/include/class/CredentialStore.class.php'; require_once $config['homedir'].'/include/class/CredentialStore.class.php';
require_once $config['homedir'].'/operation/snmpconsole/snmp_browser.php';
require_once $config['homedir'].'/include/functions_snmp_browser.php'; require_once $config['homedir'].'/include/functions_snmp_browser.php';
$snmp_browser_path = (is_metaconsole() === true) ? '../../' : ''; $snmp_browser_path = (is_metaconsole() === true) ? '../../' : '';
$snmp_browser_path .= 'include/javascript/pandora_snmp_browser.js'; $snmp_browser_path .= 'include/javascript/pandora_snmp_browser.js';
@ -310,7 +311,7 @@ $data[2] .= html_print_button(
__('SNMP Walk'), __('SNMP Walk'),
'snmp_walk', 'snmp_walk',
false, false,
'snmpBrowserWindow()', 'snmpBrowserWindow('.$id_agente.')',
[ 'mode' => 'link' ], [ 'mode' => 'link' ],
true true
); );

View File

@ -153,18 +153,24 @@ foreach ($password_fields as $k => $p) {
?> ?>
<script type="text/javascript"> <script type="text/javascript">
function changePluginSelect() { function changePluginSelect() {
if (flag_load_plugin_component) { if (typeof flag_load_plugin_component !== 'undefined' && flag_load_plugin_component) {
flag_load_plugin_component = false; flag_load_plugin_component = false;
return; return;
} }
const moduleId = <?php echo $id_agent_module; ?>;
load_plugin_description($("#id_plugin").val()); load_plugin_description($("#id_plugin").val());
load_plugin_macros_fields('simple-macro'); load_plugin_macros_fields('simple-macro', moduleId);
forced_title_callback(); forced_title_callback();
$('select#id_plugin').select2('close'); $('select#id_plugin').select2('close');
} }
$(document).ready(function () {
changePluginSelect();
});
</script> </script>

View File

@ -193,7 +193,7 @@ $actionButtons .= html_print_button(
__('Debug'), __('Debug'),
'btn_debugModule', 'btn_debugModule',
$disableDebug, $disableDebug,
'loadDebugWindow()', '',
[ [
'icon' => 'cog', 'icon' => 'cog',
'mode' => 'mini secondary ', 'mode' => 'mini secondary ',

View File

@ -1430,10 +1430,10 @@ ui_print_spinner('Loading');
$table = new stdClass(); $table = new stdClass();
$table->id = 'editor'; $table->id = 'editor';
$table->width = '100%'; $table->width = '100%';
$table->colspan['module'][1] = '5'; $table->colspan['module'][1] = '6';
$table->data = []; $table->data = [];
$table->data['module'] = []; $table->data['module'] = [];
$table->data['module'][0] = ''; // $table->data['module'][0] = '';
$table->data['module'][1] = '<h4>'.__('Modules').'</h4>'; $table->data['module'][1] = '<h4>'.__('Modules').'</h4>';
// List of modules, empty, it is populated by javascript. // List of modules, empty, it is populated by javascript.
@ -1457,7 +1457,7 @@ $table->data['module'][1] = "
[ [
'border' => '0', 'border' => '0',
'alt' => __('Delete'), 'alt' => __('Delete'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'."</td> ).'</a>'."</td>
</tr> </tr>
@ -1779,7 +1779,6 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
//Avoid freak states. //Avoid freak states.
if (action_in_progress) if (action_in_progress)
return; return;
//Check if the row editor module exists //Check if the row editor module exists
if ($('#loading_' + id_agent).length > 0) { if ($('#loading_' + id_agent).length > 0) {
//The row exists //The row exists
@ -1789,7 +1788,6 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
if ($('#module_editor_' + id_agent).length == 0) { if ($('#module_editor_' + id_agent).length == 0) {
$("#list-agent_" + id_agent).after( $("#list-agent_" + id_agent).after(
$("#loading-loading").clone().attr('id', 'loading_' + id_agent)); $("#loading-loading").clone().attr('id', 'loading_' + id_agent));
jQuery.post ('ajax.php', jQuery.post ('ajax.php',
{"page": "include/ajax/planned_downtime.ajax", {"page": "include/ajax/planned_downtime.ajax",
"get_modules_downtime": 1, "get_modules_downtime": 1,
@ -1799,15 +1797,15 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
function (data) { function (data) {
if (data['correct']) { if (data['correct']) {
//Check if the row editor module exists //Check if the row editor module exists
if ($('#loading_' + id_agent).length > 0) { if ($('#list-agent_' + id_agent).length > 0) {
//The row exists //The row exists
$('#loading_' + id_agent).remove(); //$('#loading_' + id_agent).remove();
$("#list-agent_" + id_agent).after( $("#list-agent_" + id_agent).after(
$("#editor-module").clone() $("#editor-module").clone()
.attr('id', 'module_editor_' + id_agent) .attr('id', 'module_editor_' + id_agent)
.hide()); .hide());
fill_row_editor(id_agent, data); fill_row_editor(id_agent, data);
} }
} }
@ -2039,7 +2037,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
var datetime_from = <?php echo json_encode(strtotime($once_date_from.' '.$once_time_from)); ?>; var datetime_from = <?php echo json_encode(strtotime($once_date_from.' '.$once_time_from)); ?>;
var datetime_now = <?php echo json_encode($utimestamp); ?>; var datetime_now = <?php echo json_encode($utimestamp); ?>;
var create = <?php echo json_encode($create); ?>; var create = <?php echo json_encode($create); ?>;
if (!create && (type_execution == 'periodically' || (type_execution == 'once' && datetime_from < datetime_now))) { if (!create && (type_execution == 'periodically' && (type_execution == 'once' && datetime_from < datetime_now))) {
$("input#submit-updbutton, input#submit-add_item, table#list a").click(function (e) { $("input#submit-updbutton, input#submit-add_item, table#list a").click(function (e) {
if (!confirm("<?php echo __('WARNING: If you edit this scheduled downtime, the data of future SLA reports may be altered'); ?>")) { if (!confirm("<?php echo __('WARNING: If you edit this scheduled downtime, the data of future SLA reports may be altered'); ?>")) {
e.preventDefault(); e.preventDefault();

View File

@ -133,7 +133,7 @@ if (is_ajax()) {
} }
} }
$style = ((int) $field_hidden === 1) ? '-webkit-text-security: disc;' : ''; $style = ((int) $field_hidden === 1) ? '-webkit-text-security: disc; font-family: text-security-disc;' : '';
if (!empty($field_value)) { if (!empty($field_value)) {
$field_value = io_safe_output($field_value); $field_value = io_safe_output($field_value);

View File

@ -1032,7 +1032,7 @@ foreach ($simple_alerts as $alert) {
$data[4] .= html_print_input_image( $data[4] .= html_print_input_image(
'update', 'update',
'images/builder.png', 'images/builder@svg.svg',
1, 1,
'', '',
true, true,

View File

@ -369,7 +369,7 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$selected, $selected,
!$is_management_allowed, !$is_management_allowed,
'cursor: \'pointer\'', 'cursor: \'pointer\'',
'class="hide_inputs"', ['input_class' => 'hide_inputs'],
true true
) )
); );
@ -413,16 +413,16 @@ $(document).ready (function () {
$(".hide_inputs").each(function(index) { $(".hide_inputs").each(function(index) {
var $input_in_row = $(this).closest('tr').find('.field_value'); var $input_in_row = $(this).closest('tr').find('.field_value');
if($(this).is(':checked')) { if($(this).is(':checked')) {
$input_in_row.prop('style', '-webkit-text-security: disc;'); $input_in_row.prop('style', '-webkit-text-security: disc; font-family: text-security-disc;');
} else { } else {
$input_in_row.prop('style', ''); $input_in_row.prop('style', '');
} }
}); });
$(".hide_inputs").click(function() { $(".hide_inputs").click(function() {
var $input_in_row = $(this).closest('tr').find('.field_value'); var $input_in_row = $(this).closest('tr').find('.field_value');
if($(this).is(':checked')) { if($(this).is(':checked')) {
$input_in_row.prop('style', '-webkit-text-security: disc;'); $input_in_row.prop('style', '-webkit-text-security: disc; font-family: text-security-disc;');
} else { } else {
$input_in_row.prop('style', ''); $input_in_row.prop('style', '');
} }

View File

@ -182,7 +182,7 @@ if ($delete_item) {
$buttons['graph_container'] = [ $buttons['graph_container'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image( 'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image(
'images/graph-container.png', 'images/graph-container@svg.svg',
true, true,
[ [
'title' => __('Graph container'), 'title' => __('Graph container'),

View File

@ -309,7 +309,7 @@ if ($edit_graph === true) {
'graph_editor' => [ 'graph_editor' => [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&edit_graph=1&id='.$id_graph.'">'.html_print_image( 'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&edit_graph=1&id='.$id_graph.'">'.html_print_image(
'images/builder.png', 'images/builder@svg.svg',
true, true,
[ [
'title' => __('Graph editor'), 'title' => __('Graph editor'),

View File

@ -95,7 +95,7 @@ $subsection = reporting_enterprise_add_graph_template_subsection('', $buttons);
$buttons['graph_container'] = [ $buttons['graph_container'] = [
'active' => true, 'active' => true,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image( 'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image(
'images/graph-container.png', 'images/graph-container.svg@svg',
true, true,
[ [
'title' => __('Graph container'), 'title' => __('Graph container'),

View File

@ -100,7 +100,7 @@ if ($enterpriseEnable) {
$buttons['graph_container'] = [ $buttons['graph_container'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image( 'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image(
'images/graph-container.png', 'images/graph-container@svg.svg',
true, true,
[ [
'title' => __('Graphs containers'), 'title' => __('Graphs containers'),

View File

@ -408,7 +408,6 @@ $(document).ready (function () {
}); });
$( "button[type=submit]" ).click(function( event ) { $( "button[type=submit]" ).click(function( event ) {
console.log('aaaaaaaaaaa');
if (parseInt($('input[name=width]').val()) < 1024){ if (parseInt($('input[name=width]').val()) < 1024){
alert('Default width is '+$('input[name=width]').val()+'px, smaller than minimum -> 1024px'); alert('Default width is '+$('input[name=width]').val()+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024'); $('input[name=width]').val('1024');

View File

@ -202,15 +202,6 @@ function visual_map_main() {
} }
} }
}); });
//Resize the view to adapt the screen size.
if ($("#main").length) {
//Console
$("#frame_view").height($("#main").height() - 75);
} else {
//Metaconsole
$("#frame_view").height($("#page").height() - 75);
}
} }
function cancel_button_palette_callback() { function cancel_button_palette_callback() {
@ -2426,10 +2417,10 @@ function loadFieldsFromDB(item) {
}); });
} }
function setAspectRatioBackground(side) { function setAspectRatioBackground(side, id) {
toggle_item_palette(); toggle_item_palette();
parameter = Array(); var parameter = Array();
parameter.push({ parameter.push({
name: "page", name: "page",
value: "include/ajax/visual_console_builder.ajax" value: "include/ajax/visual_console_builder.ajax"
@ -2440,18 +2431,20 @@ function setAspectRatioBackground(side) {
value: $("#background_img").attr("src") value: $("#background_img").attr("src")
}); });
parameter.push({ name: "id_visual_console", value: id });
jQuery.ajax({ jQuery.ajax({
url: "ajax.php", url: "ajax.php",
data: parameter, data: parameter,
type: "POST", type: "POST",
dataType: "json", dataType: "json",
success: function(data) { success: function(data) {
old_width = parseInt( var old_width = parseInt(
$("#background") $("#background")
.css("width") .css("width")
.replace("px", "") .replace("px", "")
); );
old_height = parseInt( var old_height = parseInt(
$("#background") $("#background")
.css("height") .css("height")
.replace("px", "") .replace("px", "")
@ -2464,8 +2457,12 @@ function setAspectRatioBackground(side) {
old_height = 768; old_height = 768;
} }
img_width = data[0]; var img_width = data[0];
img_height = data[1]; var img_height = data[1];
var ratio = 0;
var height = 0;
var width = 0;
if (side == "width") { if (side == "width") {
ratio = old_width / img_width; ratio = old_width / img_width;
@ -5821,14 +5818,14 @@ function deleteDB(idElement) {
} }
function activeToolboxButton(id, active) { function activeToolboxButton(id, active) {
if ($("input." + id + "[name=button_toolbox2]").length == 0) { if ($("button." + id + "[name=" + id + "]").length == 0) {
return; return;
} }
if (active) { if (active) {
$("input." + id + "[name=button_toolbox2]").removeAttr("disabled"); $("button." + id + "[name=" + id + "]").removeAttr("disabled");
} else { } else {
$("input." + id + "[name=button_toolbox2]").attr("disabled", true); $("button." + id + "[name=" + id + "]").attr("disabled", true);
} }
} }
@ -6446,9 +6443,9 @@ function eventsBackground() {
function move_elements_resize(original_width, original_height, width, height) { function move_elements_resize(original_width, original_height, width, height) {
jQuery.each($(".item"), function(key, value) { jQuery.each($(".item"), function(key, value) {
item = value; var item = value;
idItem = $(item).attr("id"); idItem = $(item).attr("id");
classItem = $(item) var classItem = $(item)
.attr("class") .attr("class")
.replace("item", "") .replace("item", "")
.replace("ui-draggable", "") .replace("ui-draggable", "")
@ -6456,22 +6453,22 @@ function move_elements_resize(original_width, original_height, width, height) {
.replace(/^\s+/g, "") .replace(/^\s+/g, "")
.replace(/\s+$/g, ""); .replace(/\s+$/g, "");
old_height = parseInt( var old_height = parseInt(
$(item) $(item)
.css("top") .css("top")
.replace("px", "") .replace("px", "")
); );
old_width = parseInt( var old_width = parseInt(
$(item) $(item)
.css("left") .css("left")
.replace("px", "") .replace("px", "")
); );
ratio_width = width / original_width; var ratio_width = width / original_width;
ratio_height = height / original_height; var ratio_height = height / original_height;
new_height = old_height * ratio_height; var new_height = old_height * ratio_height;
new_width = old_width * ratio_width; var new_width = old_width * ratio_width;
var values = {}; var values = {};

View File

@ -92,14 +92,14 @@ html_print_input_hidden('metaconsole', (is_metaconsole() === true) ? 1 : 0);
visual_map_editor_print_hack_translate_strings(); visual_map_editor_print_hack_translate_strings();
visual_map_editor_print_item_palette($visualConsole['id'], $background); visual_map_editor_print_item_palette($visualConsole['id'], $background);
if (is_metaconsole() === false) { if (is_metaconsole() === true) {
echo '<div id="frame_view" class="frame_view_meta">'; echo '<div id="frame_view" class="frame_view_meta">';
} else { } else {
echo '<div id="frame_view" class="frame_view_node mrgn_top_meta_35px">'; echo '<div id="frame_view" class="frame_view_node">';
} }
echo '<div id="background" class="" style="top:0px; echo '<div id="background" class="" style="top:0px;
margin: 0px auto;border: 1px lightgray solid; width: '.$widthBackground.'px; height: '.$heightBackground.'px;background-color: '.$visualConsole['background_color'].';">'; margin: 0px auto;border: 1px lightgray solid; width: '.$widthBackground.'px; height: '.$heightBackground.'px;background-color: '.$visualConsole['background_color'].';z-index:0;">';
echo "<div id='background_grid' echo "<div id='background_grid'
style='position: absolute; display: none; overflow: hidden; style='position: absolute; display: none; overflow: hidden;
background: url(".ui_get_full_url('images/console/background/white_boxed.jpg', false, false, false).'); background: url(".ui_get_full_url('images/console/background/white_boxed.jpg', false, false, false).');

View File

@ -833,7 +833,7 @@ $buttons['wizard'] = [
if ($config['legacy_vc']) { if ($config['legacy_vc']) {
$buttons['editor'] = [ $buttons['editor'] = [
'active' => false, 'active' => false,
'text' => '<a href="'.$url_base.$action.'&tab=editor&id_visual_console='.$idVisualConsole.'">'.html_print_image('images/builder.png', true, ['title' => __('Builder'), 'class' => 'invert_filter']).'</a>', 'text' => '<a href="'.$url_base.$action.'&tab=editor&id_visual_console='.$idVisualConsole.'">'.html_print_image('images/builder@svg.svg', true, ['title' => __('Builder'), 'class' => 'invert_filter']).'</a>',
]; ];
} }

View File

@ -167,19 +167,22 @@ foreach ($servers as $server) {
break; break;
} }
$data[6] = $server['threads'].' : '.$server['queued_modules']; $data[6] = '';
if ($server['queued_modules'] > 500) { if ($server['queued_modules'] > 500) {
$data[6] .= '&nbsp;&nbsp;<div class="inline"><a onclick="show_dialog();" >'.html_print_image( $data[6] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
'images/info-warning.svg', 'images/info-warning.svg',
true, true,
[ [
'width' => 16, 'width' => 16,
'heght' => 16, 'heght' => 16,
'class' => 'pulsate clickable', 'class' => 'pulsate clickable',
'style' => 'margin-left: -25px;',
] ]
).'</a></div>'; ).'</a></div>&nbsp;&nbsp;';
} }
$data[6] .= $server['threads'].' : '.$server['queued_modules'];
$data[7] = ui_print_timestamp($server['keepalive'], true); $data[7] = ui_print_timestamp($server['keepalive'], true);

View File

@ -24,7 +24,7 @@ global $config;
check_login(); check_login();
if ((bool) check_acl($config['id_user'], 0, 'PM') === true && is_user_admin($config['id_user']) === false) { if ((bool) check_acl($config['id_user'], 0, 'PM') === false && is_user_admin($config['id_user']) === false) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
'Trying to access Setup Management' 'Trying to access Setup Management'

View File

@ -70,6 +70,10 @@ html_print_input_hidden('update_config', 1);
$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control'])); $performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control']));
echo "<div id='dialog-legacy-vc' title='".__('Legacy visual console Information')."' class='invisible'>";
echo "<p class='center'>".__('Visual console in legacy mode will no longer be supported as of LTS 772').'</p>';
echo '</div>';
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// BEHAVIOUR CONFIGURATION // BEHAVIOUR CONFIGURATION
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
@ -2243,9 +2247,22 @@ $(document).ready (function () {
// Show the cache expiration conf or not. // Show the cache expiration conf or not.
$("input[name=legacy_vc]").change(function (e) { $("input[name=legacy_vc]").change(function (e) {
if ($(this).prop("checked") === true) { if ($(this).prop("checked") === true) {
$("select#vc_default_cache_expiration_select").closest("tr").hide(); $("select#vc_default_cache_expiration_select").closest("td").hide();
$("#dialog-legacy-vc").dialog({
modal: true,
width: 500,
buttons:[
{
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-next',
text: "<?php echo __('OK'); ?>",
click: function(){
$(this).dialog("close");
}
}
]
});
} else { } else {
$("select#vc_default_cache_expiration_select").closest("tr").show(); $("select#vc_default_cache_expiration_select").closest("td").show();
} }
}).change(); }).change();

View File

@ -69,6 +69,11 @@ $homeScreenValues = [
// This defines the working user. Beware with this, old code get confusses // This defines the working user. Beware with this, old code get confusses
// and operates with current logged user (dangerous). // and operates with current logged user (dangerous).
$id = get_parameter('id', get_parameter('id_user', '')); $id = get_parameter('id', get_parameter('id_user', ''));
if (empty($id) === true) {
$id = $config['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 ((bool) check_acl($config['id_user'], 0, 'UM') === false) { if ((bool) check_acl($config['id_user'], 0, 'UM') === false) {
@ -85,6 +90,13 @@ if ($id !== $config['id_user']) {
// ID given as parameter. // ID given as parameter.
$pure = get_parameter('pure', 0); $pure = get_parameter('pure', 0);
$user_info = get_user_info($id); $user_info = get_user_info($id);
if (is_metaconsole() === true) {
$user_info['section'] = $user_info['metaconsole_section'];
$user_info['data_section'] = $user_info['metaconsole_data_section'];
$user_info['default_event_filter'] = $user_info['metaconsole_default_event_filter'];
}
$is_err = false; $is_err = false;
if (is_ajax() === true) { if (is_ajax() === true) {
@ -677,6 +689,10 @@ if ($update_user) {
] ]
); );
$res3 = save_pass_history($id, $password_new); $res3 = save_pass_history($id, $password_new);
// Generate new API token.
$newToken = api_token_generate();
$res4 = update_user($id, ['api_token' => $newToken]);
} }
ui_print_result_message( ui_print_result_message(
@ -701,6 +717,10 @@ if ($update_user) {
'utimestamp' => time(), 'utimestamp' => time(),
] ]
); );
// Generate new API token.
$newToken = api_token_generate();
$res4 = update_user($id, ['api_token' => $newToken]);
} }
ui_print_result_message( ui_print_result_message(
@ -1453,6 +1473,10 @@ foreach ($event_filter_data as $filter) {
$event_filter[$filter['id_filter']] = $filter['id_name']; $event_filter[$filter['id_filter']] = $filter['id_name'];
} }
if (is_metaconsole() === true && empty($user_info['metaconsole_default_event_filter']) !== true) {
$user_info['default_event_filter'] = $user_info['metaconsole_default_event_filter'];
}
$default_event_filter = '<div class="label_select"><p class="edit_user_labels">'.__('Default event filter').'</p>'; $default_event_filter = '<div class="label_select"><p class="edit_user_labels">'.__('Default event filter').'</p>';
$default_event_filter .= html_print_select( $default_event_filter .= html_print_select(
$event_filter, $event_filter,

View File

@ -413,10 +413,11 @@ if ($delete_user === true) {
); );
} else if ($disable_user !== false) { } else if ($disable_user !== false) {
// CSRF Validator. // CSRF Validator.
if (html_print_csrf_error()) { /*
if (html_print_csrf_error()) {
return; return;
} }
*/
// Disable_user. // Disable_user.
$id_user = get_parameter('id', 0); $id_user = get_parameter('id', 0);

View File

@ -272,7 +272,7 @@ $passwordManageTable->data['fields_newpassword'][0] = html_print_input_text_exte
'password_new', 'password_new',
'', '',
'25', '25',
'45', '150',
$view_mode, $view_mode,
'', '',
[ [
@ -291,7 +291,7 @@ $passwordManageTable->data['fields_repeatpassword'][0] = html_print_input_text_e
'password_conf', 'password_conf',
'', '',
'20', '20',
'45', '150',
$view_mode, $view_mode,
'', '',
[ [
@ -311,7 +311,7 @@ if ($new_user === false) {
'own_password_confirm', 'own_password_confirm',
'', '',
'20', '20',
'45', '150',
$view_mode, $view_mode,
'', '',
[ [
@ -596,11 +596,15 @@ $userManagementTable->data['fields_blocksize_eventfilter'][0] = html_print_input
true true
); );
if (is_metaconsole() === true && empty($user_info['metaconsole_default_event_filter']) !== true) {
$user_info['default_event_filter'] = $user_info['metaconsole_default_event_filter'];
}
$userManagementTable->data['captions_blocksize_eventfilter'][1] = __('Event filter'); $userManagementTable->data['captions_blocksize_eventfilter'][1] = __('Event filter');
$userManagementTable->data['fields_blocksize_eventfilter'][1] = html_print_select( $userManagementTable->data['fields_blocksize_eventfilter'][1] = html_print_select(
$event_filter, $event_filter,
'default_event_filter', 'default_event_filter',
($user_info['default_event_filter'] ?? 0), [$user_info['default_event_filter']],
'', '',
'', '',
__('None'), __('None'),
@ -617,6 +621,11 @@ $homeScreenTable->style = [];
$homeScreenTable->rowclass = []; $homeScreenTable->rowclass = [];
$homeScreenTable->data = []; $homeScreenTable->data = [];
// Home screen. // Home screen.
if (is_metaconsole() === true && empty($user_info['metaconsole_data_section']) !== true) {
$user_info['data_section'] = $user_info['metaconsole_data_section'];
$user_info['section'] = $user_info['metaconsole_section'];
}
$homeScreenTable->data['captions_homescreen'][0] = __('Home screen'); $homeScreenTable->data['captions_homescreen'][0] = __('Home screen');
$homeScreenTable->colspan['captions_homescreen'][0] = 2; $homeScreenTable->colspan['captions_homescreen'][0] = 2;
$homeScreenTable->rowclass['captions_homescreen'] = 'field_half_width'; $homeScreenTable->rowclass['captions_homescreen'] = 'field_half_width';
@ -643,6 +652,17 @@ $homeScreenTable->data['fields_homescreen'][1] = html_print_div(
$userManagementTable->rowclass['homescreen_table'] = 'w100p'; $userManagementTable->rowclass['homescreen_table'] = 'w100p';
$userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true); $userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true);
$homeScreenTable->data['fields_homescreen'][1] = html_print_div(
[
'class' => 'w100p',
'content' => $customHomeScreenDataField,
],
true
);
$userManagementTable->rowclass['homescreen_table'] = 'w100p';
$userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true);
if (is_metaconsole() === true && users_is_admin() === true) { if (is_metaconsole() === true && users_is_admin() === true) {
$userManagementTable->rowclass['search_custom1_looknfeel'] = 'field_half_width'; $userManagementTable->rowclass['search_custom1_looknfeel'] = 'field_half_width';

BIN
pandora_console/images/builder.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 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/builder@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark/20/builder" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M11.2000009,9 C11.6418287,9 12.0000009,9.24624341 12.0000009,9.55 L12.0000009,18.625 C12.0000009,19.3444236 11.1963458,19.9348008 10.1725686,19.9949529 L10.0000009,20 C8.89543137,20 8.00000089,19.3843915 8.00000089,18.625 L8.00000089,9.55 C8.00000089,9.24624341 8.35817313,9 8.80000089,9 L11.2000009,9 Z M4.26666773,0 C4.58021643,0.000327502857 4.83365862,0.256429891 4.83333415,0.572021011 L4.83273845,1.1514049 C4.83209502,1.77722291 5.33889914,2.28507025 5.96471715,2.28571369 L5.9658822,2.28571429 C5.97463278,1.028388 6.98240281,0.00602907429 8.2306519,0 L17.2749359,0 C18.227663,0 19.0000009,0.778828069 19.0000009,1.73956118 L19.0000009,2.90444994 C19.0000009,3.21877749 18.7482417,3.47408731 18.4365385,3.47586469 C16.7044902,3.48574131 15.4517873,3.68716343 14.6784298,4.08013103 C13.8970625,4.47716869 13.4597945,5.60295629 13.3666256,7.45749383 C13.3513448,7.76145183 13.1024969,8 12.8006847,8 L8.89562156,8 C7.8879903,8 7.52254304,7.89465034 7.15382124,7.6965828 C6.78509944,7.49851526 6.49535873,7.20772989 6.29718553,6.8368584 C6.1461106,6.55412903 6.04847891,6.27306171 6.00847638,5.70526629 C5.95356666,5.71123749 5.88644204,5.71428571 5.80077411,5.71428571 C5.26339018,5.71428571 4.82759963,6.14962846 4.82704715,6.68701211 L4.82644971,7.2681156 C4.82618797,7.52268394 4.79983225,7.61497223 4.75041109,7.70800617 C4.70098993,7.80104006 4.62852471,7.87403851 4.53621487,7.92377851 C4.44390504,7.97351851 4.35235851,8 4.09991144,8 L2.72643507,8 C2.47383808,8 2.38224031,7.9734784 2.28989463,7.92367634 C2.19754894,7.87387434 2.12507551,7.80079189 2.0756885,7.70767023 C2.02630148,7.61454851 2.00000089,7.52218103 2.00000089,7.26746137 L2.00000089,0.732538629 C2.00000089,0.477818989 2.02630148,0.385451491 2.0756885,0.2923298 C2.12507551,0.199208109 2.19754894,0.126125657 2.28989463,0.0763236286 C2.38224031,0.0265216057 2.47383808,0 2.72643507,0 L4.26666773,0 Z" id="Shape" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,19 @@
<?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">
<title>Icons/Dark/20/graph container@svg</title>
<g id="Icons/Dark/20/graph-container" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g id="Group" transform="translate(2.000000, 2.000000)" stroke="#3F3F3F" stroke-width="2">
<g id="Group-2">
<polyline id="Path-4" points="0 0 0 16 16 16"></polyline>
<g id="Group-3" transform="translate(2.941811, 0.000000)">
<polyline id="Path" points="0 9.999897 4.0553112 5.0332489 7.05959702 7.04601669 13.0581894 -1.44328993e-15"></polyline>
<polyline id="Path-2" points="13.0581894 4 13.0581894 0 9.05818939 0"></polyline>
</g>
</g>
<line x1="7.03043747" y1="16" x2="7.03043747" y2="13.0441227" id="Path-75"></line>
<line x1="3.03043747" y1="16" x2="3.03043747" y2="13.0441227" id="Path-75-Copy"></line>
<line x1="11.0304375" y1="16" x2="11.0304375" y2="13.0441227" id="Path-75-Copy-2"></line>
<line x1="15.0304375" y1="16" x2="15.0304375" y2="13.0441227" id="Path-75-Copy-3"></line>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -38,6 +38,7 @@ if (check_login()) {
enterprise_include_once('include/functions_metaconsole.php'); enterprise_include_once('include/functions_metaconsole.php');
$get_plugin_macros = get_parameter('get_plugin_macros'); $get_plugin_macros = get_parameter('get_plugin_macros');
$get_module_macros = get_parameter('get_module_macros');
$search_modules = get_parameter('search_modules'); $search_modules = get_parameter('search_modules');
$get_module_detail = get_parameter('get_module_detail', 0); $get_module_detail = get_parameter('get_module_detail', 0);
$get_module_autocomplete_input = (bool) get_parameter( $get_module_autocomplete_input = (bool) get_parameter(
@ -118,6 +119,28 @@ if (check_login()) {
return; return;
} }
if ($get_module_macros && $get_module_macros > 0) {
if (https_is_running()) {
header('Content-type: application/json');
}
$module_id = $get_module_macros;
$module_macros = db_get_value(
'macros',
'tagente_modulo',
'id_agente_modulo',
$module_id
);
$macros = [];
$macros['base64'] = base64_encode($module_macros);
$macros['array'] = json_decode($module_macros, true);
echo json_encode($macros);
return;
}
if ($search_modules) { if ($search_modules) {
if (https_is_running()) { if (https_is_running()) {
header('Content-type: application/json'); header('Content-type: application/json');
@ -1058,8 +1081,8 @@ if (check_login()) {
$policyInfo = policies_info_module_policy($module['id_policy_module']); $policyInfo = policies_info_module_policy($module['id_policy_module']);
$adopt = policies_is_module_adopt($module['id_agente_modulo']); $adopt = policies_is_module_adopt($module['id_agente_modulo']);
if ($linked === true) { if ((bool) $linked === true) {
if ($adopt === true) { if ((bool) $adopt === true) {
$img = 'images/policies_brick.png'; $img = 'images/policies_brick.png';
$title = '('.__('Adopted').') '.$name_policy; $title = '('.__('Adopted').') '.$name_policy;
} else { } else {
@ -1067,7 +1090,7 @@ if (check_login()) {
$title = $name_policy; $title = $name_policy;
} }
} else { } else {
if ($adopt === true) { if ((bool) $adopt === true) {
$img = 'images/policies_not_brick.png'; $img = 'images/policies_not_brick.png';
$title = '('.__('Unlinked').') ('.__('Adopted').') '.$name_policy; $title = '('.__('Unlinked').') ('.__('Adopted').') '.$name_policy;
} else { } else {
@ -1159,7 +1182,6 @@ if (check_login()) {
$last_status_change_text = __('Time elapsed since last status change: '); $last_status_change_text = __('Time elapsed since last status change: ');
$last_status_change_text .= (empty($module['last_status_change']) === false) ? human_time_comparation($module['last_status_change']) : __('N/A'); $last_status_change_text .= (empty($module['last_status_change']) === false) ? human_time_comparation($module['last_status_change']) : __('N/A');
$data[4] .= ui_print_status_image($status, htmlspecialchars($title), true, false, false, true, $last_status_change_text);
if ($show_context_help_first_time === false) { if ($show_context_help_first_time === false) {
$show_context_help_first_time = true; $show_context_help_first_time = true;
@ -1168,6 +1190,8 @@ if (check_login()) {
} }
} }
$data[4] .= ui_print_status_image($status, htmlspecialchars($title), true, false, false, true, $last_status_change_text);
// Module thresholds. // Module thresholds.
$data[5] = ''; $data[5] = '';
if ((int) $module['id_tipo_modulo'] !== 25) { if ((int) $module['id_tipo_modulo'] !== 25) {

View File

@ -34,7 +34,7 @@ if ($get_image_path_status) {
$id_visual_console = get_parameter('id_visual_console', null); $id_visual_console = get_parameter('id_visual_console', null);
// WARNING: CHECK THE ENTIRE FUNCTIONALITY // WARNING: CHECK THE ENTIRE FUNCTIONALITY
// Visual console id required // Visual console id required.
if (empty($id_visual_console)) { if (empty($id_visual_console)) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
@ -1774,7 +1774,7 @@ switch ($action) {
break; break;
} }
// visual map element status check // Visual map element status check.
if ($get_element_status) { if ($get_element_status) {
$layoutData = db_get_row_filter( $layoutData = db_get_row_filter(
'tlayout_data', 'tlayout_data',

View File

@ -801,6 +801,34 @@ function update_user(string $id_user, array $values)
return false; return false;
} }
if (isset($values['section']) === true) {
$homeScreenValues = [
HOME_SCREEN_DEFAULT => __('Default'),
HOME_SCREEN_VISUAL_CONSOLE => __('Visual console'),
HOME_SCREEN_EVENT_LIST => __('Event list'),
HOME_SCREEN_GROUP_VIEW => __('Group view'),
HOME_SCREEN_TACTICAL_VIEW => __('Tactical view'),
HOME_SCREEN_ALERT_DETAIL => __('Alert detail'),
HOME_SCREEN_EXTERNAL_LINK => __('External link'),
HOME_SCREEN_OTHER => __('Other'),
HOME_SCREEN_DASHBOARD => __('Dashboard'),
];
if (array_key_exists($values['section'], $homeScreenValues) === true) {
$values['section'] = $homeScreenValues[$values['section']];
}
if (is_metaconsole() === true) {
$values['metaconsole_section'] = $values['section'];
$values['metaconsole_data_section'] = $values['data_section'];
$values['metaconsole_default_event_filter'] = $values['default_event_filter'];
unset($values['id_skin']);
unset($values['section']);
unset($values['data_section']);
unset($values['default_event_filter']);
}
}
$output = db_process_sql_update('tusuario', $values, ['id_user' => $id_user]); $output = db_process_sql_update('tusuario', $values, ['id_user' => $id_user]);
if (isset($values['is_admin']) === true && (bool) $values['is_admin'] === true) { if (isset($values['is_admin']) === true && (bool) $values['is_admin'] === true) {

View File

@ -526,12 +526,14 @@ class AgentDeployWizard
true true
); );
$mac_installer_link = 'http://firefly.pandorafms.com/pandorafms/latest/macOS/Pandora_FMS_MacOS_agent-7.0NG.dmg';
$mac_content_link = '<a class="green-link" style="font-size: 15px;" href="'.$mac_installer_link.'" target="_blank">'.__('Click to Download the agent').'</a>';
html_print_div( html_print_div(
[ [
'id' => 'mac_installer', 'id' => 'mac_installer',
'class' => 'white_table_flex agent_details_col', 'class' => 'white_table_flex agent_details_col',
'style' => 'margin-bottom: 20px', 'style' => 'margin-bottom: 20px',
'content' => $content.$mac_warn_box, 'content' => $content.$mac_warn_box.$mac_content_link,
] ]
); );

View File

@ -2333,7 +2333,7 @@ class AgentWizard extends HTML
} }
$tmp->id_plugin($infoMacros['server_plugin']); $tmp->id_plugin($infoMacros['server_plugin']);
$tmp->macros(json_encode($fieldsPlugin)); $tmp->macros(io_json_mb_encode($fieldsPlugin));
} }
} }
} }
@ -2507,7 +2507,7 @@ class AgentWizard extends HTML
} }
$tmp->id_plugin($infoMacros['server_plugin']); $tmp->id_plugin($infoMacros['server_plugin']);
$tmp->macros(json_encode($fieldsPlugin)); $tmp->macros(io_json_mb_encode($fieldsPlugin));
} }
$tmp->ip_target(io_safe_input($this->targetIp)); $tmp->ip_target(io_safe_input($this->targetIp));

View File

@ -1339,7 +1339,11 @@ class ModuleTemplates extends HTML
function filterGroupComponents(e){ function filterGroupComponents(e){
var selectedGroup = e.target.value; var selectedGroup = e.target.value;
var entireList = JSON.parse($('#hidden-group-components').val()); var entireList = JSON.parse($('#hidden-group-components').val());
var componentsToShow = entireList[selectedGroup]; if(typeof entireList[selectedGroup] !== 'undefined'){
var componentsToShow = entireList[selectedGroup].split(",");
} else {
var componentsToShow = [];
}
$('#add-modules-components').children().each(function(){ $('#add-modules-components').children().each(function(){
var id = $(this).val(); var id = $(this).val();
if (typeof componentsToShow === 'undefined' && selectedGroup != '0') { if (typeof componentsToShow === 'undefined' && selectedGroup != '0') {
@ -1348,7 +1352,7 @@ class ModuleTemplates extends HTML
$(this).css('display','block'); $(this).css('display','block');
} else { } else {
$(this).css('display','none'); $(this).css('display','none');
} }
}); });
} }

View File

@ -162,7 +162,7 @@ class WebServerModuleDebug extends Wizard
results.setReadOnly(true); results.setReadOnly(true);
results.setShowPrintMargin(false); results.setShowPrintMargin(false);
$("#submit-execute_query").click(function() { $("#button-execute_query").click(function() {
// Show the spinner. // Show the spinner.
showSpinner(true); showSpinner(true);
// Empty the results container. // Empty the results container.

View File

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

View File

@ -9612,6 +9612,7 @@ function api_set_new_user($id, $thrash2, $other, $thrash3)
$values['section'] = $other['data'][11]; $values['section'] = $other['data'][11];
$values['session_time'] = $other['data'][12]; $values['session_time'] = $other['data'][12];
$values['metaconsole_access_node'] = $other['data'][13]; $values['metaconsole_access_node'] = $other['data'][13];
$values['api_token'] = api_token_generate();
if (empty($password) === true) { if (empty($password) === true) {
returnError('Password cannot be empty.'); returnError('Password cannot be empty.');
@ -9708,6 +9709,8 @@ function api_set_update_user($id, $thrash2, $other, $thrash3)
if (!update_user_password($id, $other['data'][4])) { if (!update_user_password($id, $other['data'][4])) {
returnError('The user could not be updated. Password info incorrect.'); returnError('The user could not be updated. Password info incorrect.');
return; return;
} else {
$values['api_token'] = api_token_generate();
} }
} }

View File

@ -296,22 +296,34 @@ function clippy_context_help($help=null)
$code = str_replace('{clippy}', '#'.$id, $code); $code = str_replace('{clippy}', '#'.$id, $code);
$code = str_replace('{clippy_obj}', 'intro_'.$id, $code); $code = str_replace('{clippy_obj}', 'intro_'.$id, $code);
$return = $code.'<div id="'.$id.'" class="inline"><a onclick="show_'.$id.'();" href="javascript: void(0);" >'.html_print_image( if ($help === 'module_unknow') {
'images/clippy_icon.png', $img = html_print_image(
true 'images/info-warning.svg',
).'</a></div> true,
[
'class' => 'main_menu_icon invert_filter',
'style' => 'margin-left: -25px;',
]
);
} else {
$img = html_print_image(
'images/info-warning.svg',
true,
['class' => 'main_menu_icon invert_filter']
);
}
$return = $code.'<div id="'.$id.'" class="inline"><a onclick="show_'.$id.'();" href="javascript: void(0);" >'.$img.'</a></div>
<script type="text/javascript"> <script type="text/javascript">
function show_'.$id.'() { function show_'.$id.'() {
if (intro_'.$id.'.started()) { confirmDialog({
started = 1; title: "'.__('You have unknown modules in this agent.').'",
} message: "'.('Unknown modules are modules which receive data normally at least in one occassion, but at this time are not receving data. Please check our troubleshoot help page to help you determine why you have unknown modules.').'",
else { strOKButton: "'.__('Close').'",
started = 0; hideCancelButton: true,
} size: 675,
});
if (started == 0)
intro_'.$id.'.start();
} }
$(document).ready(function() { $(document).ready(function() {

View File

@ -2665,7 +2665,7 @@ function events_print_type_img(
$urlImage = ui_get_full_url(false); $urlImage = ui_get_full_url(false);
$icon = ''; $icon = '';
$style = 'invert_filter main_menu_icon'; $style = 'main_menu_icon';
switch ($type) { switch ($type) {
case 'alert_recovered': case 'alert_recovered':
@ -2702,23 +2702,28 @@ function events_print_type_img(
break; break;
case 'system': case 'system':
$style .= ' invert_filter';
$icon = 'images/configuration@svg.svg'; $icon = 'images/configuration@svg.svg';
break; break;
case 'recon_host_detected': case 'recon_host_detected':
$style .= ' invert_filter';
$icon = 'images/recon.png'; $icon = 'images/recon.png';
break; break;
case 'new_agent': case 'new_agent':
$style .= ' invert_filter';
$icon = 'images/agents@svg.svg'; $icon = 'images/agents@svg.svg';
break; break;
case 'configuration_change': case 'configuration_change':
$style .= ' invert_filter';
$icon = 'images/configuration@svg.svg'; $icon = 'images/configuration@svg.svg';
break; break;
case 'unknown': case 'unknown':
default: default:
$style .= ' invert_filter';
$icon = 'images/event.svg'; $icon = 'images/event.svg';
break; break;
} }

View File

@ -601,7 +601,7 @@ function filemanager_file_explorer(
} }
}).show(); }).show();
$("#submit-submit").on("click", copyToClipboard); $("#button-submit").on("click", copyToClipboard);
} }
function copyToClipboard() { function copyToClipboard() {

View File

@ -899,10 +899,15 @@ function html_print_select(
if (is_array($selected) && in_array($value, $selected)) { if (is_array($selected) && in_array($value, $selected)) {
$output .= ' selected="selected"'; $output .= ' selected="selected"';
} else if (is_numeric($value) && is_numeric($selected) } else if (is_numeric($value) && is_numeric($selected)
&& $value == $selected && $value === $selected
) { ) {
// This fixes string ($value) to int ($selected) comparisons // This fixes string ($value) to int ($selected) comparisons
$output .= ' selected="selected"'; $output .= ' selected="selected"';
} else if (is_numeric($value) && is_string($selected)) {
$str_value = strval($value);
if ($str_value === $selected) {
$output .= ' selected="selected"';
}
} else if ($value === $selected) { } else if ($value === $selected) {
// Needs type comparison otherwise if $selected = 0 and $value = "string" this would evaluate to true // Needs type comparison otherwise if $selected = 0 and $value = "string" this would evaluate to true
$output .= ' selected="selected"'; $output .= ' selected="selected"';
@ -4273,22 +4278,22 @@ function html_print_checkbox_extended(
if (is_array($attributes) === true) { if (is_array($attributes) === true) {
$tmpAttributes = []; $tmpAttributes = [];
foreach ($attributes as $key => $value) { foreach ($attributes as $key => $val) {
switch ($key) { switch ($key) {
case 'input_class': case 'input_class':
$inputClass .= ' '.$value; $inputClass .= ' '.$val;
break; break;
case 'label_class': case 'label_class':
$labelClass .= ' '.$value; $labelClass .= ' '.$val;
break; break;
case 'label_style': case 'label_style':
$labelStyle .= 'style="'.$value.'"'; $labelStyle .= 'style="'.$val.'"';
break; break;
default: default:
$tmpAttributes[] = $key.'="'.$value.'"'; $tmpAttributes[] = $key.'="'.$val.'"';
break; break;
} }
} }

View File

@ -2831,7 +2831,7 @@ function modules_get_color_status($status, $force_module=false)
case STATUS_SERVER_DOWN: case STATUS_SERVER_DOWN:
case STATUS_SERVER_DOWN_BALL: case STATUS_SERVER_DOWN_BALL:
return '#444'; return '#B2B2B2';
default: default:
// Ignored. // Ignored.

View File

@ -1122,10 +1122,18 @@ function snmp_browser_print_container(
if ($toggle === false) { if ($toggle === false) {
// This extra div that can be handled by jquery's dialog. // This extra div that can be handled by jquery's dialog.
$output .= '<div id="snmp_browser_container" style="display:none">'; $output .= '<div id="snmp_browser_container" style="'.$display.'">';
$output .= '<div style="text-align: left; width: '.$width.'; height: '.$height.';">'; $output .= '<div style="text-align: left; width: '.$width.'; height: '.$height.';">';
$output .= '<div class="w100p">'; $output .= '<div class="w100p">';
$output .= '<form onsubmit="snmpBrowse(); return false;">'; $output .= '<form onsubmit="snmpBrowse(); return false;">';
$output .= html_print_input_hidden(
'id_agent_module',
0,
true,
false,
false,
'id_agent_module'
);
$output .= html_print_table($table, true); $output .= html_print_table($table, true);
$output .= html_print_div( $output .= html_print_div(
[ [

View File

@ -4610,37 +4610,38 @@ function ui_toggle(
$output .= ' var is_metaconsole = '.(int) is_metaconsole().";\n"; $output .= ' var is_metaconsole = '.(int) is_metaconsole().";\n";
$output .= ' /* <![CDATA[ */'."\n"; $output .= ' /* <![CDATA[ */'."\n";
$output .= " $(document).ready (function () {\n"; $output .= " $(document).ready (function () {\n";
$output .= ' var switch_enable = '.(int) $switch.";\n";
$output .= " $('#checkbox-".$switch_name."').click(function() {\n"; $output .= " $('#checkbox-".$switch_name."').click(function() {\n";
$output .= ' if (is_metaconsole == 0) {'; $output .= ' if (hide_tgl_ctrl_'.$uniqid.") {\n";
$output .= ' if (hide_tgl_ctrl_'.$uniqid.") {\n"; $output .= ' hide_tgl_ctrl_'.$uniqid." = 0;\n";
$output .= ' hide_tgl_ctrl_'.$uniqid." = 0;\n"; $output .= " $('#tgl_div_".$uniqid."').css('height', 'auto');\n";
$output .= " $('#tgl_div_".$uniqid."').css('height', 'auto');\n"; $output .= " $('#tgl_div_".$uniqid."').css('position', 'relative');\n";
$output .= " $('#tgl_div_".$uniqid."').css('position', 'relative');\n";
$output .= " }\n";
$output .= " else {\n";
$output .= ' hide_tgl_ctrl_'.$uniqid." = 1;\n";
$output .= " $('#tgl_div_".$uniqid."').css('height', 0);\n";
$output .= " $('#tgl_div_".$uniqid."').css('position', 'absolute');\n";
$output .= " }\n";
$output .= " }\n";
$output .= " });\n";
$output .= " $('#tgl_ctrl_".$uniqid."').click(function() {\n";
$output .= ' if (hide_tgl_ctrl_'.$uniqid.") {\n";
$output .= ' hide_tgl_ctrl_'.$uniqid." = 0;\n";
$output .= " $('#tgl_div_".$uniqid."').css('height', 'auto');\n";
$output .= " $('#tgl_div_".$uniqid."').css('position', 'relative');\n";
$output .= " $('#image_".$uniqid."').attr('style', 'rotate: ".$rotateA."');\n";
$output .= " $('#checkbox-".$switch_name."').prop('checked', true);\n";
$output .= $class_table;
$output .= " }\n"; $output .= " }\n";
$output .= " else {\n"; $output .= " else {\n";
$output .= ' hide_tgl_ctrl_'.$uniqid." = 1;\n"; $output .= ' hide_tgl_ctrl_'.$uniqid." = 1;\n";
$output .= " $('#tgl_div_".$uniqid."').css('height', 0);\n"; $output .= " $('#tgl_div_".$uniqid."').css('height', 0);\n";
$output .= " $('#tgl_div_".$uniqid."').css('position', 'absolute');\n"; $output .= " $('#tgl_div_".$uniqid."').css('position', 'absolute');\n";
$output .= " $('#image_".$uniqid."').attr('style', 'rotate: ".$rotateB."');\n";
$output .= " $('#checkbox-".$switch_name."').prop('checked', false);\n";
$output .= " }\n"; $output .= " }\n";
$output .= " });\n"; $output .= " });\n";
$output .= ' if (switch_enable === 0) {';
$output .= " $('#tgl_ctrl_".$uniqid."').click(function() {\n";
$output .= ' if (hide_tgl_ctrl_'.$uniqid.") {\n";
$output .= ' hide_tgl_ctrl_'.$uniqid." = 0;\n";
$output .= " $('#tgl_div_".$uniqid."').css('height', 'auto');\n";
$output .= " $('#tgl_div_".$uniqid."').css('position', 'relative');\n";
$output .= " $('#image_".$uniqid."').attr('style', 'rotate: ".$rotateA."');\n";
$output .= " $('#checkbox-".$switch_name."').prop('checked', true);\n";
$output .= $class_table;
$output .= " }\n";
$output .= " else {\n";
$output .= ' hide_tgl_ctrl_'.$uniqid." = 1;\n";
$output .= " $('#tgl_div_".$uniqid."').css('height', 0);\n";
$output .= " $('#tgl_div_".$uniqid."').css('position', 'absolute');\n";
$output .= " $('#image_".$uniqid."').attr('style', 'rotate: ".$rotateB."');\n";
$output .= " $('#checkbox-".$switch_name."').prop('checked', false);\n";
$output .= " }\n";
$output .= " });\n";
$output .= " }\n";
$output .= " });\n"; $output .= " });\n";
$output .= '/* ]]> */'; $output .= '/* ]]> */';
$output .= '</script>'; $output .= '</script>';
@ -7241,10 +7242,8 @@ function ui_query_result_editor($name='default')
] ]
); );
$buttons = html_print_submit_button(__('Execute query'), 'execute_query', false, ['icon' => 'update'], true); html_print_submit_button(__('Execute query'), 'execute_query', false, ['icon' => 'update']);
html_print_action_buttons(
$buttons
);
} }
@ -7970,4 +7969,4 @@ function ui_update_name_fav_element($id_element, $section, $label)
'id_element' => $id_element, 'id_element' => $id_element,
] ]
); );
} }

View File

@ -2846,8 +2846,11 @@ function get_donut_module_data($id_module)
$values_to_return = []; $values_to_return = [];
foreach ($values as $val) { foreach ($values as $val) {
$data = explode(',', $val); if (empty($val) === true) {
continue;
}
$data = explode(',', $val);
if ($data[0] === $val) { if ($data[0] === $val) {
continue; continue;
} }
@ -3173,7 +3176,12 @@ function visual_map_get_image_status_element($layoutData, $status=false)
if ($layoutData['type'] == 5) { if ($layoutData['type'] == 5) {
// ICON ELEMENT. // ICON ELEMENT.
$img .= '.png'; $url = parse_url($layoutData['image']);
if (isset($url['scheme']) === false) {
$img .= '.png';
} else {
$img = $layoutData['image'];
}
} else { } else {
if ($status === false) { if ($status === false) {
$status = visual_map_get_status_element($layoutData); $status = visual_map_get_status_element($layoutData);
@ -3564,12 +3572,13 @@ function visual_map_print_visual_map(
} }
echo '<div id="background_'.$id_layout.'" echo '<div id="background_'.$id_layout.'"
style="margin:0px auto;text-align: style="margin:0px auto;text-align:
z-index: 0; z-index: 0;
position:relative; position:relative;
width:'.$mapWidth.'px; width:'.$mapWidth.'px;
height:'.$mapHeight.'px; height:'.$mapHeight.'px;
background-color:'.$layout['background_color'].';">'; background-color:'.$layout['background_color'].';
z-index:0;">';
if ($layout['background'] != 'None.png') { if ($layout['background'] != 'None.png') {
echo "<img src='".ui_get_full_url($backgroundImage, false, false, false)."' width='100%' height='100%' />"; echo "<img src='".ui_get_full_url($backgroundImage, false, false, false)."' width='100%' height='100%' />";

View File

@ -130,18 +130,16 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
'datos', 'datos',
'box_item', 'box_item',
]; ];
$form_items['border_color_row']['html'] = '<td align="left" valign="top" >'.__('Border color').'</td>'.'<td align="left" >'.html_print_input_text_extended( $form_items['border_color_row']['html'] = '<td align="left" valign="top" >'.__('Border color').'</td>';
$form_items['border_color_row']['html'] .= '<td align="left" >';
$form_items['border_color_row']['html'] .= html_print_input_color(
'border_color', 'border_color',
'#000000', '#000000',
'text-border_color', 'text-border_color',
'', '',
7,
7,
false,
'',
'class="border_color"',
true true
).'</td>'; );
$form_items['border_color_row']['html'] .= '</td>';
$form_items['border_width_row'] = []; $form_items['border_width_row'] = [];
$form_items['border_width_row']['items'] = [ $form_items['border_width_row']['items'] = [
@ -157,18 +155,16 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
'box_item', 'box_item',
'clock', 'clock',
]; ];
$form_items['fill_color_row']['html'] = '<td align="left" valign="top" >'.__('Fill color').'</td>'.'<td align="left" >'.html_print_input_text_extended( $form_items['fill_color_row']['html'] = '<td align="left" valign="top" >'.__('Fill color').'</td>';
$form_items['fill_color_row']['html'] .= '<td align="left" >';
$form_items['fill_color_row']['html'] .= html_print_input_color(
'fill_color', 'fill_color',
'#000000', '#000000',
'text-fill_color', 'text-fill_color',
'', '',
7,
7,
false,
'',
'class="fill_color"',
true true
).'</td>'; );
$form_items['fill_color_row']['html'] .= '</td>';
$form_items['module_graph_size_row'] = []; $form_items['module_graph_size_row'] = [];
$form_items['module_graph_size_row']['items'] = [ $form_items['module_graph_size_row']['items'] = [
@ -375,18 +371,16 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
$form_items['grid_color_row'] = []; $form_items['grid_color_row'] = [];
$form_items['grid_color_row']['items'] = ['bars_graph']; $form_items['grid_color_row']['items'] = ['bars_graph'];
$form_items['grid_color_row']['html'] = '<td align="left" valign="top" >'.__('Grid color').'</td>'.'<td align="left" >'.html_print_input_text_extended( $form_items['grid_color_row']['html'] = '<td align="left" valign="top">'.__('Grid color').'</td>';
$form_items['grid_color_row']['html'] .= '<td align="left" >';
$form_items['grid_color_row']['html'] .= html_print_input_color(
'grid_color', 'grid_color',
'#000000', '#000000',
'text-grid_color', 'text-grid_color',
'', '',
7,
7,
false,
'',
'class="grid_color"',
true true
).'</td>'; );
$form_items['grid_color_row']['html'] .= '</td>';
$form_items['radio_choice_graph'] = []; $form_items['radio_choice_graph'] = [];
$form_items['radio_choice_graph']['items'] = [ $form_items['radio_choice_graph']['items'] = [
@ -500,18 +494,18 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
$form_items['resume_color_row'] = []; $form_items['resume_color_row'] = [];
$form_items['resume_color_row']['items'] = ['donut_graph']; $form_items['resume_color_row']['items'] = ['donut_graph'];
$form_items['resume_color_row']['html'] = '<td align="left" valign="top" >'.__('Resume data color').'</td>'.'<td align="left" >'.html_print_input_text_extended( $form_items['resume_color_row']['html'] = '<td align="left" valign="top" >';
$form_items['resume_color_row']['html'] .= __('Resume data color');
$form_items['resume_color_row']['html'] .= '</td>';
$form_items['resume_color_row']['html'] .= '<td align="left" >';
$form_items['resume_color_row']['html'] .= html_print_input_color(
'resume_color', 'resume_color',
'#000000', '#000000',
'text-resume_color', 'text-resume_color',
'', '',
7,
7,
false,
'',
'class="resume_color"',
true true
).'</td>'; );
$form_items['resume_color_row']['html'] .= '</td>';
$event_times = [ $event_times = [
86400 => __('24h'), 86400 => __('24h'),
@ -637,24 +631,60 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
'background', 'background',
'datos', 'datos',
]; ];
$form_items['background_row_2']['html'] = '<td align="left">'.__('Original Size').'</td> $form_items['background_row_2']['html'] = '<td align="left">'.__('Original Size').'</td>';
<td align="left">'.html_print_button(__('Apply'), 'original_false', false, "setAspectRatioBackground('original')", 'class="sub vs_button_ghost"', true).'</td>'; $form_items['background_row_2']['html'] .= '<td align="left">';
$form_items['background_row_2']['html'] .= html_print_button(
__('Apply'),
'original_false',
false,
'setAspectRatioBackground("original", '.$visualConsole_id.')',
[
'icon' => 'cog',
'mode' => 'mini secondary',
],
true
);
$form_items['background_row_2']['html'] .= '</td>';
$form_items['background_row_3'] = []; $form_items['background_row_3'] = [];
$form_items['background_row_3']['items'] = [ $form_items['background_row_3']['items'] = [
'background', 'background',
'datos', 'datos',
]; ];
$form_items['background_row_3']['html'] = '<td align="left">'.__('Aspect ratio').'</td> $form_items['background_row_3']['html'] = '<td align="left">'.__('Aspect ratio').'</td>';
<td align="left">'.html_print_button(__('Proportional Width'), 'original_false', false, "setAspectRatioBackground('width')", 'class="sub vs_button_ghost"', true).'</td>'; $form_items['background_row_3']['html'] .= '<td align="left">';
$form_items['background_row_3']['html'] .= html_print_button(
__('Proportional Width'),
'original_false',
false,
'setAspectRatioBackground("width", '.$visualConsole_id.')',
[
'icon' => 'cog',
'mode' => 'mini secondary',
],
true
);
$form_items['background_row_3']['html'] .= '</td>';
$form_items['background_row_4'] = []; $form_items['background_row_4'] = [];
$form_items['background_row_4']['items'] = [ $form_items['background_row_4']['items'] = [
'background', 'background',
'datos', 'datos',
]; ];
$form_items['background_row_4']['html'] = '<td align="left"></td> $form_items['background_row_4']['html'] = '<td align="left"></td>';
<td align="left">'.html_print_button(__('Height proportional'), 'original_false', false, "setAspectRatioBackground('height')", 'class="sub vs_button_ghost"', true).'</td>'; $form_items['background_row_4']['html'] .= '<td align="left">';
$form_items['background_row_4']['html'] .= html_print_button(
__('Height proportional'),
'original_false',
false,
'setAspectRatioBackground("height", '.$visualConsole_id.')',
[
'icon' => 'cog',
'mode' => 'mini secondary',
],
true
);
$form_items['background_row_4']['html'] .= '</td>';
$form_items['percentile_bar_row_1'] = []; $form_items['percentile_bar_row_1'] = [];
$form_items['percentile_bar_row_1']['items'] = [ $form_items['percentile_bar_row_1']['items'] = [
@ -665,11 +695,31 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
'bars_graph', 'bars_graph',
'clock', 'clock',
]; ];
$form_items['percentile_bar_row_1']['html'] = '<td align="left">'.__('Widtzzzzh').html_print_input_text('width_percentile', 0, '', 3, 5, true).'</td>'; $form_items['percentile_bar_row_1']['html'] = '<td align="left">'.__('Width').'</td>';
$form_items['percentile_bar_row_1']['html'] .= '<td align="left">';
$form_items['percentile_bar_row_1']['html'] .= html_print_input_text(
'width_percentile',
0,
'',
3,
5,
true
);
$form_items['percentile_bar_row_1']['html'] .= '</td>';
$form_items['height_bars_graph_row'] = []; $form_items['height_bars_graph_row'] = [];
$form_items['height_bars_graph_row']['items'] = ['bars_graph']; $form_items['height_bars_graph_row']['items'] = ['bars_graph'];
$form_items['height_bars_graph_row']['html'] = '<td align="left">'.__('Height').html_print_input_text('bars_graph_height', 0, '', 3, 5, true).'</td>'; $form_items['height_bars_graph_row']['html'] = '<td align="left">'.__('Height').'</td>';
$form_items['height_bars_graph_row']['html'] .= '<td align="left">';
$form_items['height_bars_graph_row']['html'] .= html_print_input_text(
'bars_graph_height',
0,
'',
3,
5,
true
);
$form_items['height_bars_graph_row']['html'] .= '</td>';
$form_items['percentile_bar_row_2'] = []; $form_items['percentile_bar_row_2'] = [];
$form_items['percentile_bar_row_2']['items'] = [ $form_items['percentile_bar_row_2']['items'] = [
@ -735,16 +785,11 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
'datos', 'datos',
]; ];
$form_items['percentile_item_row_5']['html'] = '<td align="left">'.__('Element color').'</td> $form_items['percentile_item_row_5']['html'] = '<td align="left">'.__('Element color').'</td>
<td align="left">'.html_print_input_text_extended( <td align="left">'.html_print_input_color(
'percentile_color', 'percentile_color',
'#ffffff', '#ffffff',
'text-percentile_color', 'text-percentile_color',
'', '',
7,
7,
false,
'',
'class="percentile_color"',
true true
).'</td>'; ).'</td>';
@ -755,16 +800,11 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
'datos', 'datos',
]; ];
$form_items['percentile_item_row_6']['html'] = '<td align="left">'.__('Value color').'</td> $form_items['percentile_item_row_6']['html'] = '<td align="left">'.__('Value color').'</td>
<td align="left">'.html_print_input_text_extended( <td align="left">'.html_print_input_color(
'percentile_label_color', 'percentile_label_color',
'#ffffff', '#ffffff',
'text-percentile_label_color', 'text-percentile_label_color',
'', '',
7,
7,
false,
'',
'class="percentile_label_color"',
true true
).'</td>'; ).'</td>';
@ -815,8 +855,16 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
// End of Color Cloud rows // End of Color Cloud rows
$form_items['show_on_top_row'] = []; $form_items['show_on_top_row'] = [];
$form_items['show_on_top_row']['items'] = ['group_item']; $form_items['show_on_top_row']['items'] = ['group_item'];
$form_items['show_on_top_row']['html'] = '<td align="left" >'.__('Always show on top').'</td> $form_items['show_on_top_row']['html'] = '<td align="left" >';
<td align="left" >'.html_print_checkbox('show_on_top', 1, '', true).ui_print_help_tip(__('It allows the element to be superimposed to the rest of items of the visual console'), true).'</td>'; $form_items['show_on_top_row']['html'] .= __('Always show on top');
$form_items['show_on_top_row']['html'] .= ui_print_help_tip(
__('It allows the element to be superimposed to the rest of items of the visual console'),
true
);
$form_items['show_on_top_row']['html'] .= '</td>';
$form_items['show_on_top_row']['html'] .= '<td align="left" >';
$form_items['show_on_top_row']['html'] .= html_print_checkbox('show_on_top', 1, '', true);
$form_items['show_on_top_row']['html'] .= '</td>';
$show_last_value = [ $show_last_value = [
'0' => __('Hide last value on boolean modules'), '0' => __('Hide last value on boolean modules'),
@ -875,11 +923,11 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
$form_items['button_update_row'] = []; $form_items['button_update_row'] = [];
$form_items['button_update_row']['items'] = ['datos']; $form_items['button_update_row']['items'] = ['datos'];
$form_items['button_update_row']['html'] = '<td align="left" colspan="2" style="text-align: right;">'.html_print_button(__('Cancel'), 'cancel_button', false, 'cancel_button_palette_callback();', 'class="sub cancel"', true).'<span ="margin-right:10px;">&nbsp</span>'.html_print_button(__('Update'), 'update_button', false, 'update_button_palette_callback();', 'class="sub upd"', true).'</td>'; $form_items['button_update_row']['html'] = '<td align="left" colspan="2"><div class="flex flex-end">'.html_print_button(__('Cancel'), 'cancel_button', false, 'cancel_button_palette_callback();', [ 'icon' => 'delete', 'mode' => 'secondary'], true).'<span ="margin-right:10px;">&nbsp</span>'.html_print_button(__('Update'), 'update_button', false, 'update_button_palette_callback();', [ 'icon' => 'upd'], true).'</div></td>';
$form_items['button_create_row'] = []; $form_items['button_create_row'] = [];
$form_items['button_create_row']['items'] = ['datos']; $form_items['button_create_row']['items'] = ['datos'];
$form_items['button_create_row']['html'] = '<td align="left" colspan="2" style="text-align: right;">'.html_print_button(__('Cancel'), 'cancel_button', false, 'cancel_button_palette_callback();', 'class="sub cancel"', true).'<span ="margin-right:10px;">&nbsp</span>'.html_print_button(__('Create'), 'create_button', false, 'create_button_palette_callback();', 'class="sub wand"', true).'</td>'; $form_items['button_create_row']['html'] = '<td align="left" colspan="2" ><div class="flex flex-end">'.html_print_button(__('Cancel'), 'cancel_button', false, 'cancel_button_palette_callback();', [ 'icon' => 'delete', 'mode' => 'secondary'], true).'<span ="margin-right:10px;">&nbsp</span>'.html_print_button(__('Create'), 'create_button', false, 'create_button_palette_callback();', [ 'icon' => 'wand'], true).'</div></td>';
foreach ($form_items as $item => $item_options) { foreach ($form_items as $item => $item_options) {
echo '<tr id="'.$item.'" class="'.implode(' ', (array) $item_options['items']).'">'; echo '<tr id="'.$item.'" class="'.implode(' ', (array) $item_options['items']).'">';
@ -1054,14 +1102,18 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
<?php <?php
$form_items_advance['map_linked_row']['html'] .= ob_get_clean(); $form_items_advance['map_linked_row']['html'] .= ob_get_clean();
} else { } else {
$visual_maps = array_reduce( $visual_maps = [];
$visual_maps, if (empty($visual_maps) === false) {
function ($all, $item) { $visual_maps = array_reduce(
$all[$item['id']] = $item['name']; $visual_maps,
return $all; function ($all, $item) {
}, $all[$item['id']] = $item['name'];
[] return $all;
); },
[]
);
}
$form_items_advance['map_linked_row']['html'] .= html_print_select( $form_items_advance['map_linked_row']['html'] .= html_print_select(
$visual_maps, $visual_maps,
'map_linked', 'map_linked',
@ -1201,7 +1253,15 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
'donut_graph', 'donut_graph',
'color_cloud', 'color_cloud',
]; ];
$form_items_advance['element_group_row']['html'] = '<td align="left">'.__('Restrict access to group').'</td>'.'<td align="left">'.html_print_select_groups( $form_items_advance['element_group_row']['html'] = '<td align="left">';
$form_items_advance['element_group_row']['html'] .= __('Restrict access to group');
$form_items_advance['element_group_row']['html'] .= ui_print_help_tip(
__('If selected, restrict visualization of this item in the visual console to users who have access to selected group. This is also used on calculating child visual consoles.'),
true
);
$form_items_advance['element_group_row']['html'] .= '</td>';
$form_items_advance['element_group_row']['html'] .= '<td align="left">';
$form_items_advance['element_group_row']['html'] .= html_print_select_groups(
$config['id_user'], $config['id_user'],
'VR', 'VR',
true, true,
@ -1211,10 +1271,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
'', '',
'', '',
true true
).ui_print_help_tip( );
__('If selected, restrict visualization of this item in the visual console to users who have access to selected group. This is also used on calculating child visual consoles.'), $form_items_advance['element_group_row']['html'] .= '</td>';
true
).'</td>';
if (!$config['legacy_vc']) { if (!$config['legacy_vc']) {
$intervals = [ $intervals = [
@ -1393,8 +1451,8 @@ function visual_map_editor_print_toolbox()
visual_map_print_button_editor('icon', __('Icon'), 'left', false, 'icon_min', true); visual_map_print_button_editor('icon', __('Icon'), 'left', false, 'icon_min', true);
visual_map_print_button_editor('clock', __('Clock'), 'left', false, 'clock_min', true); visual_map_print_button_editor('clock', __('Clock'), 'left', false, 'clock_min', true);
visual_map_print_button_editor('group_item', __('Group'), 'left', false, 'group_item_min', true); visual_map_print_button_editor('group_item', __('Group'), 'left', false, 'group_item_min', true);
visual_map_print_button_editor('box_item', __('Box'), 'left', false, 'box_item_min', true); visual_map_print_button_editor('box_item', __('Box'), 'left', false, 'box_item', true);
visual_map_print_button_editor('line_item', __('Line'), 'left', false, 'line_item_min', true); visual_map_print_button_editor('line_item', __('Line'), 'left', false, 'line_item', true);
visual_map_print_button_editor('color_cloud', __('Color cloud'), 'left', false, 'color_cloud_min', true); visual_map_print_button_editor('color_cloud', __('Color cloud'), 'left', false, 'color_cloud_min', true);
if (isset($config['legacy_vc']) === false if (isset($config['legacy_vc']) === false
|| (bool) $config['legacy_vc'] === false || (bool) $config['legacy_vc'] === false
@ -1415,9 +1473,9 @@ function visual_map_editor_print_toolbox()
$text_autosave = html_print_input_hidden('auto_save', true, true); $text_autosave = html_print_input_hidden('auto_save', true, true);
visual_map_print_item_toolbox('auto_save', $text_autosave, 'right'); visual_map_print_item_toolbox('auto_save', $text_autosave, 'right');
visual_map_print_button_editor('show_grid', __('Show grid'), 'right', true, 'grid_min', true); visual_map_print_button_editor('show_grid', __('Show grid'), 'right', true, 'show_grid', true);
visual_map_print_button_editor('edit_item', __('Update item'), 'right', true, 'config_min', true); visual_map_print_button_editor('edit_item', __('Update item'), 'right', true, 'edit_item', true);
visual_map_print_button_editor('delete_item', __('Delete item'), 'right', true, 'delete_min', true); visual_map_print_button_editor('delete_item', __('Delete item'), 'right', true, 'delete_item', true);
visual_map_print_button_editor('copy_item', __('Copy item'), 'right', true, 'copy_item', true); visual_map_print_button_editor('copy_item', __('Copy item'), 'right', true, 'copy_item', true);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
@ -1435,12 +1493,12 @@ function visual_map_print_button_editor(
) { ) {
html_print_button( html_print_button(
$label, $label,
'button_toolbox2', $idDiv,
$disabled, $disabled,
"click_button_toolbox('".$idDiv."');", 'click_button_toolbox("'.$idDiv.'");',
[ [
'icon' => $class, 'class' => $class.' float-'.$float,
'mode' => 'onlyIcon', 'mode' => 'onlyIcon',
], ],
false, false,
$imageButton $imageButton

View File

@ -1395,6 +1395,76 @@
duration = +_; duration = +_;
return zoom; return zoom;
}; };
zoom.setTranslate = function(v) {
translate = v;
};
zoom.convertLevelsToScale = function(i) {
min = Math.pow(2, (-360 * i) * .002) * 1;
max = Math.pow(2, (360 * i) * .002) * 1;
return [min, max];
};
zoom.getZoomLevel = function(x, y) {
if (typeof(x) == 'undefined') {
x = 0;
//Get center
}
if (typeof(y) == 'undefined') {
y = 0;
//Get center
}
var zoom_levels = [];
if (!translate0)
translate0 = location([x, y]);
var old_scale = scale;
var old_translate = [translate[0], translate[1]];
var count = 0;
scale = 1;
high_levels = [];
high_levels.push({'scale': scale, 'translate': [translate[0], translate[1]]});
do {
scaleTo(Math.pow(2, 360 * .002) * scale);
translateTo([x, y], translate0);
high_levels.push({'scale': scale, 'translate': [translate[0], translate[1]]});
if (count > 30) {
break;
}
count++;
}
while (scale < scaleExtent[1]);
scale = 1;
count = 0;
do {
scaleTo(Math.pow(2, -360 * .002) * scale);
translateTo([x, y], translate0);
zoom_levels.push({'scale': scale, 'translate': [translate[0], translate[1]]});
if (count > 30) {
break;
}
count++;
}
while (scale > scaleExtent[0]);
zoom_levels.reverse();
high_levels.forEach(function(v, i) {
zoom_levels.push(v);
});
scale = old_scale;
translate = old_translate;
return zoom_levels;
};
zoom.x = function(z) { zoom.x = function(z) {
if (!arguments.length) return x1; if (!arguments.length) return x1;
x1 = z; x1 = z;
@ -9550,4 +9620,4 @@
return request.responseXML; return request.responseXML;
}); });
if (typeof define === "function" && define.amd) this.d3 = d3, define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3; if (typeof define === "function" && define.amd) this.d3 = d3, define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3;
}(); }();

View File

@ -21,7 +21,10 @@ function parse_alert_command(command, classs) {
"[RECOVER]" + $($(".fields")[nfield - 1]).val() "[RECOVER]" + $($(".fields")[nfield - 1]).val()
); );
} }
} else if ($(this).css("-webkit-text-security") == "disc") { } else if (
$(this).css("-webkit-text-security") == "disc" ||
$(this).css("font-family") == "text-security-disc"
) {
var hidden_character = "*"; var hidden_character = "*";
var hidden_string = hidden_character.repeat($(this).val().length); var hidden_string = hidden_character.repeat($(this).val().length);

View File

@ -1001,13 +1001,18 @@ function add_macro_field(macro, row_model_id, type_copy, k) {
$("#" + row_id).show(); $("#" + row_id).show();
} }
function load_plugin_macros_fields(row_model_id) { function load_plugin_macros_fields(row_model_id, moduleId = 0) {
// Get plugin macros when selected and load macros fields // Get plugin macros when selected and load macros fields
var id_plugin = $("#id_plugin").val(); var id_plugin = $("#id_plugin").val();
var params = []; var params = [];
params.push("page=include/ajax/module"); params.push("page=include/ajax/module");
params.push("get_plugin_macros=1");
if (moduleId > 0) {
params.push("get_module_macros=" + moduleId);
} else {
params.push("get_plugin_macros=1");
}
params.push("id_plugin=" + id_plugin); params.push("id_plugin=" + id_plugin);
jQuery.ajax({ jQuery.ajax({

View File

@ -258,7 +258,7 @@ function snmpGet(oid) {
var ajax_url = $("#hidden-ajax_url").val(); var ajax_url = $("#hidden-ajax_url").val();
var server_to_exec = $("#server_to_exec").val(); var server_to_exec = $("#server_to_exec").val();
var target_port = $("#target_port").val(); var target_port = $("#target_port").val();
var print_create_agent_module = $("#print_create_agent_module").val(); var print_create_agent_module = true;
// Check for a custom action // Check for a custom action
var custom_action = $("#hidden-custom_action").val(); var custom_action = $("#hidden-custom_action").val();
@ -533,7 +533,7 @@ function checkSNMPVersion() {
} }
// Show the SNMP browser window // Show the SNMP browser window
function snmpBrowserWindow() { function snmpBrowserWindow(id_agente = 0) {
// Keep elements in the form and the SNMP browser synced // Keep elements in the form and the SNMP browser synced
$("#text-target_ip").val($("#text-ip_target").val()); $("#text-target_ip").val($("#text-ip_target").val());
$("#target_port").val($("#text-tcp_port").val()); $("#target_port").val($("#text-tcp_port").val());
@ -549,6 +549,8 @@ function snmpBrowserWindow() {
$("#password-snmp3_browser_privacy_pass").val( $("#password-snmp3_browser_privacy_pass").val(
$("#password-snmp3_privacy_pass").val() $("#password-snmp3_privacy_pass").val()
); );
// Realation agente module.
$("#id_agent_module").val(id_agente);
checkSNMPVersion(); checkSNMPVersion();

File diff suppressed because it is too large Load Diff

View File

@ -561,7 +561,6 @@ class BasicChart extends Widget
global $config; global $config;
$size = parent::getSize(); $size = parent::getSize();
hd($size, true);
include_once $config['homedir'].'/include/functions_graph.php'; include_once $config['homedir'].'/include/functions_graph.php';
include_once $config['homedir'].'/include/functions_agents.php'; include_once $config['homedir'].'/include/functions_agents.php';
@ -625,16 +624,20 @@ class BasicChart extends Widget
], ],
]; ];
$graph = \grafico_modulo_sparse($params);
$output = '<div class="container-center widget-mrgn-0px">'; $output = '<div class="container-center widget-mrgn-0px">';
$output .= '<div class="basic-chart-title">'; if (str_contains($graph, '<img') === false) {
$output .= '<span style="color:'.$this->values['colorLabel'].'; font-size:'.$this->values['sizeLabel'].'px;">'; $output .= '<div class="basic-chart-title">';
$output .= ((bool) $this->values['showLabel'] === true) ? $title : ''; $output .= '<span style="color:'.$this->values['colorLabel'].'; font-size:'.$this->values['sizeLabel'].'px;">';
$output .= '</span>'; $output .= ((bool) $this->values['showLabel'] === true) ? $title : '';
$output .= '<span style="color:'.$color_status.'; font-size:'.$this->values['sizeValue'].'px;">'; $output .= '</span>';
$output .= ((bool) $this->values['showValue'] === true) ? $value : ''; $output .= '<span style="color:'.$color_status.'; font-size:'.$this->values['sizeValue'].'px;">';
$output .= '</span>'; $output .= ((bool) $this->values['showValue'] === true) ? $value : '';
$output .= '</div>'; $output .= '</span>';
$output .= \grafico_modulo_sparse($params); $output .= '</div>';
}
$output .= $graph;
$output .= '</div>'; $output .= '</div>';
return $output; return $output;
} }

View File

@ -279,13 +279,26 @@ class AgentModuleWidget extends Widget
$return_all_group = true; $return_all_group = true;
} }
$mgroup = '';
if (isset($this->values['mGroup']) === false) {
$sql = sprintf(
'SELECT id_group FROM tdashboard WHERE id = %d',
$this->dashboardId
);
$group_dahsboard = db_get_value_sql($sql);
if ($group_dahsboard > 0) {
$mgroup = $group_dahsboard;
}
}
$inputs[] = [ $inputs[] = [
'class' => 'flex flex-row', 'class' => 'flex flex-row',
'id' => 'select_multiple_modules_filtered', 'id' => 'select_multiple_modules_filtered',
'arguments' => [ 'arguments' => [
'type' => 'select_multiple_modules_filtered', 'type' => 'select_multiple_modules_filtered',
'uniqId' => $this->cellId, 'uniqId' => $this->cellId,
'mGroup' => (isset($this->values['mGroup']) === true) ? $this->values['mGroup'] : '', 'mGroup' => (isset($this->values['mGroup']) === true) ? $this->values['mGroup'] : $mgroup,
'mRecursion' => (isset($this->values['mRecursion']) === true) ? $this->values['mRecursion'] : '', 'mRecursion' => (isset($this->values['mRecursion']) === true) ? $this->values['mRecursion'] : '',
'mModuleGroup' => (isset($this->values['mModuleGroup']) === true) ? $this->values['mModuleGroup'] : '', 'mModuleGroup' => (isset($this->values['mModuleGroup']) === true) ? $this->values['mModuleGroup'] : '',
'mAgents' => (isset($this->values['mAgents']) === true) ? $this->values['mAgents'] : '', 'mAgents' => (isset($this->values['mAgents']) === true) ? $this->values['mAgents'] : '',

View File

@ -540,7 +540,7 @@ class TreeViewWidget extends Widget
$searchAgent = ''; $searchAgent = '';
if (empty($this->values['filterAgent']) === false) { if (empty($this->values['filterAgent']) === false) {
$searchAgent = $this->values['filterAgent']; $searchAgent = io_safe_output($this->values['filterAgent']);
} }
$statusModule = -1; $statusModule = -1;
@ -552,7 +552,7 @@ class TreeViewWidget extends Widget
$searchModule = ''; $searchModule = '';
if (empty($this->values['filterModule']) === false) { if (empty($this->values['filterModule']) === false) {
$searchModule = $this->values['filterModule']; $searchModule = io_safe_output($this->values['filterModule']);
} }
$searchGroup = 0; $searchGroup = 0;

View File

@ -160,9 +160,6 @@ final class DonutGraph extends Item
if (empty($graphData) === true) { if (empty($graphData) === true) {
$data['html'] = graph_nodata_image(['width' => $width, 'height' => $height]); $data['html'] = graph_nodata_image(['width' => $width, 'height' => $height]);
} else { } else {
array_pop($graphData['labels']);
array_pop($graphData['data']);
$options = [ $options = [
'waterMark' => false, 'waterMark' => false,
'legend' => [ 'legend' => [
@ -226,7 +223,7 @@ final class DonutGraph extends Item
'module_input' => true, 'module_input' => true,
'module_name' => 'moduleId', 'module_name' => 'moduleId',
'module_none' => false, 'module_none' => false,
'get_only_string_modules' => false, 'get_only_string_modules' => true,
], ],
]; ];
@ -241,7 +238,7 @@ final class DonutGraph extends Item
'sort' => false, 'sort' => false,
'agent_id' => $values['agentId'], 'agent_id' => $values['agentId'],
'metaconsole_id' => $values['metaconsoleId'], 'metaconsole_id' => $values['metaconsoleId'],
'get_only_string_modules' => false, 'get_only_string_modules' => true,
], ],
]; ];

View File

@ -34,6 +34,25 @@ final class Group extends Item
protected static $indexCacheByUser = true; protected static $indexCacheByUser = true;
/**
* Get the "recursive Group" switch value.
*
* @param array $data Unknown input data structure.
*
* @return mixed If the recursive should be true or not.
*/
private static function getRecursiveGroup(array $data)
{
return static::issetInArray(
$data,
[
'recursiveGroup',
'recursive_group',
]
);
}
/** /**
* Get the "show statistics" switch value. * Get the "show statistics" switch value.
* *
@ -87,6 +106,11 @@ final class Group extends Item
$return['id_group'] = $id_group; $return['id_group'] = $id_group;
} }
$recursive_group = static::getRecursiveGroup($data);
if ($recursive_group !== null) {
$return['recursive_group'] = static::parseBool($recursive_group);
}
$show_statistics = static::getShowStatistics($data); $show_statistics = static::getShowStatistics($data);
if ($show_statistics !== null) { if ($show_statistics !== null) {
$return['show_statistics'] = static::parseBool($show_statistics); $return['show_statistics'] = static::parseBool($show_statistics);
@ -112,6 +136,7 @@ final class Group extends Item
$return['groupId'] = static::extractGroupId($data); $return['groupId'] = static::extractGroupId($data);
$return['imageSrc'] = static::extractImageSrc($data); $return['imageSrc'] = static::extractImageSrc($data);
$return['statusImageSrc'] = static::extractStatusImageSrc($data); $return['statusImageSrc'] = static::extractStatusImageSrc($data);
$return['recursiveGroup'] = static::extractRecursiveGroup($data);
$return['showStatistics'] = static::extractShowStatistics($data); $return['showStatistics'] = static::extractShowStatistics($data);
return $return; return $return;
@ -177,6 +202,21 @@ final class Group extends Item
} }
/**
* Extract the "show statistics" switch value.
*
* @param array $data Unknown input data structure.
*
* @return boolean If the statistics should be shown or not.
*/
private static function extractRecursiveGroup(array $data): bool
{
return static::parseBool(
static::issetInArray($data, ['recursiveGroup', 'recursive_group'])
);
}
/** /**
* Extract the "show statistics" switch value. * Extract the "show statistics" switch value.
* *
@ -227,63 +267,147 @@ final class Group extends Item
} }
$groupId = static::extractGroupId($data); $groupId = static::extractGroupId($data);
$recursiveGroup = static::extractrecursiveGroup($data);
$showStatistics = static::extractShowStatistics($data); $showStatistics = static::extractShowStatistics($data);
if ($showStatistics === true) { if ($showStatistics === true) {
$isMetaconsole = \is_metaconsole(); $isMetaconsole = \is_metaconsole();
if ($recursiveGroup) {
$childers_id = groups_get_children_ids($groupId);
}
// Retrieve the agent stats. // Retrieve the agent stats.
$agentsCritical = \agents_get_agents( if ($recursiveGroup) {
[ $numCritical = 0;
'id_grupo' => $groupId, foreach ($childers_id as $id_group) {
'status' => AGENT_STATUS_CRITICAL, $agentsCritical = \agents_get_agents(
], [
['COUNT(*) AS total'], 'id_grupo' => $id_group,
'AR', 'status' => AGENT_STATUS_CRITICAL,
false, ],
false, ['COUNT(*) AS total'],
true, 'AR',
$isMetaconsole false,
); false,
$numCritical = $agentsCritical[0]['total']; true,
$agentsWarning = \agents_get_agents( $isMetaconsole
[ );
'id_grupo' => $groupId, $numCritical += $agentsCritical[0]['total'];
'status' => AGENT_STATUS_WARNING, }
], } else {
['COUNT(*) AS total'], $agentsCritical = \agents_get_agents(
'AR', [
false, 'id_grupo' => $groupId,
false, 'status' => AGENT_STATUS_CRITICAL,
true, ],
$isMetaconsole ['COUNT(*) AS total'],
); 'AR',
$numWarning = $agentsWarning[0]['total']; false,
$agentsUnknown = \agents_get_agents( false,
[ true,
'id_grupo' => $groupId, $isMetaconsole
'status' => AGENT_STATUS_UNKNOWN, );
], $numCritical = $agentsCritical[0]['total'];
['COUNT(*) AS total'], }
'AR',
false, if ($recursiveGroup) {
false, $numWarning = 0;
true, foreach ($childers_id as $id_group) {
$isMetaconsole $agentsWarning = \agents_get_agents(
); [
$numUnknown = $agentsUnknown[0]['total']; 'id_grupo' => $id_group,
$agentsOk = \agents_get_agents( 'status' => AGENT_STATUS_WARNING,
[ ],
'id_grupo' => $groupId, ['COUNT(*) AS total'],
'status' => AGENT_STATUS_NORMAL, 'AR',
], false,
['COUNT(*) AS total'], false,
'AR', true,
false, $isMetaconsole
false, );
true, $numWarning += $agentsWarning[0]['total'];
$isMetaconsole }
); } else {
$numNormal = $agentsOk[0]['total']; $agentsWarning = \agents_get_agents(
[
'id_grupo' => $groupId,
'status' => AGENT_STATUS_WARNING,
],
['COUNT(*) AS total'],
'AR',
false,
false,
true,
$isMetaconsole
);
$numWarning = $agentsWarning[0]['total'];
}
if ($recursiveGroup) {
$numUnknown = 0;
foreach ($childers_id as $id_group) {
$agentsUnknown = \agents_get_agents(
[
'id_grupo' => $id_group,
'status' => AGENT_STATUS_UNKNOWN,
],
['COUNT(*) AS total'],
'AR',
false,
false,
true,
$isMetaconsole
);
$numUnknown += $agentsUnknown[0]['total'];
}
} else {
$agentsUnknown = \agents_get_agents(
[
'id_grupo' => $groupId,
'status' => AGENT_STATUS_UNKNOWN,
],
['COUNT(*) AS total'],
'AR',
false,
false,
true,
$isMetaconsole
);
$numUnknown = $agentsUnknown[0]['total'];
}
if ($recursiveGroup) {
$numNormal = 0;
foreach ($childers_id as $id_group) {
$agentsOk = \agents_get_agents(
[
'id_grupo' => $id_group,
'status' => AGENT_STATUS_NORMAL,
],
['COUNT(*) AS total'],
'AR',
false,
false,
true,
$isMetaconsole
);
$numNormal += $agentsOk[0]['total'];
}
} else {
$agentsOk = \agents_get_agents(
[
'id_grupo' => $groupId,
'status' => AGENT_STATUS_NORMAL,
],
['COUNT(*) AS total'],
'AR',
false,
false,
true,
$isMetaconsole
);
$numNormal = $agentsOk[0]['total'];
}
$numTotal = ($numCritical + $numWarning + $numUnknown + $numNormal); $numTotal = ($numCritical + $numWarning + $numUnknown + $numNormal);
@ -327,6 +451,11 @@ final class Group extends Item
',', ',',
array_keys(\users_get_groups()) array_keys(\users_get_groups())
); );
if ($recursiveGroup === true) {
$childers_id = groups_get_children_ids($groupId);
$groupFilter .= ','.implode(',', $childers_id);
}
} }
$sql = sprintf( $sql = sprintf(
@ -356,8 +485,25 @@ final class Group extends Item
$status = AGENT_STATUS_NORMAL; $status = AGENT_STATUS_NORMAL;
} }
} else { } else {
// Get the status img src. if ($recursiveGroup === true) {
$status = \groups_get_status($groupId, true); $childers_id = groups_get_children_ids($groupId);
$flag_stop_foreach = false;
foreach ($childers_id as $id_children) {
if ($flag_stop_foreach === true) {
// Stop if some child is not normal.
break;
}
// Get the status img src from all modules childs.
$status = \groups_get_status($id_children, true);
if ($status !== AGENT_STATUS_NORMAL) {
$flag_stop_foreach = true;
}
}
} else {
// Get the status img src.
$status = \groups_get_status($groupId, true);
}
} }
$imagePath = \visual_map_get_image_status_element($data, $status); $imagePath = \visual_map_get_image_status_element($data, $status);
@ -559,6 +705,23 @@ final class Group extends Item
], ],
]; ];
if ((int) $values['type'] === GROUP_ITEM) {
if (isset($values['recursiveGroup']) === false) {
$values['recursiveGroup'] = true;
}
// Recursive group.
$inputs[] = [
'label' => __('Recursive'),
'arguments' => [
'name' => 'recursiveGroup',
'id' => 'recursiveGroup',
'type' => 'switch',
'value' => $values['recursiveGroup'],
],
];
}
// Show statistics. // Show statistics.
$inputs[] = [ $inputs[] = [
'label' => __('Show statistics'), 'label' => __('Show statistics'),

View File

@ -116,7 +116,12 @@ final class Icon extends Item
// Get the img src. // Get the img src.
$imagePath = \visual_map_get_image_status_element($data); $imagePath = \visual_map_get_image_status_element($data);
$data['imageSrc'] = \ui_get_full_url($imagePath, false, false, false); $url = parse_url($imagePath);
if (isset($url['scheme']) === false) {
$data['imageSrc'] = \ui_get_full_url($imagePath, false, false, false);
} else {
$data['imageSrc'] = $imagePath;
}
// If the width or the height are equal to 0 we will extract them // If the width or the height are equal to 0 we will extract them
// from the real image size. // from the real image size.

View File

@ -584,10 +584,12 @@ final class NetworkLink extends Model
$inOctets = sprintf('%0.3f %s', $inOctets, $unitIn); $inOctets = sprintf('%0.3f %s', $inOctets, $unitIn);
$labelStart = $interface_name; $labelStart = $interface_name;
$labelStart .= ' (in): '.$inOctets; $inOctets = explode(' ', $inOctets);
$labelStart .= ' (in): '.format_for_graph($inOctets[0]).' '.$inOctets[1];
$labelStart .= '<br>'.$interface_name; $labelStart .= '<br>'.$interface_name;
$labelStart .= ' (out): '.$outOctets; $outOctets = explode(' ', $outOctets);
$labelStart .= ' (out): '.format_for_graph($outOctets[0]).' '.$outOctets[1];
} }
if (isset($links['start']['id_metaconsole']) === true if (isset($links['start']['id_metaconsole']) === true
@ -665,10 +667,12 @@ final class NetworkLink extends Model
$inOctets = sprintf('%0.3f %s', $inOctets, $unitIn); $inOctets = sprintf('%0.3f %s', $inOctets, $unitIn);
$labelEnd = $interface_name; $labelEnd = $interface_name;
$labelEnd .= ' (in): '.$inOctets; $inOctets = explode(' ', $inOctets);
$labelEnd .= ' (in): '.format_for_graph($inOctets[0]).' '.$inOctets[1];
$labelEnd .= '<br>'.$interface_name; $labelEnd .= '<br>'.$interface_name;
$labelEnd .= ' (out): '.$outOctets; $outOctets = explode(' ', $outOctets);
$labelEnd .= ' (out): '.format_for_graph($outOctets[0]).' '.$outOctets[1];
} }
if (isset($links['end']['id_metaconsole']) === true if (isset($links['end']['id_metaconsole']) === true

View File

@ -379,6 +379,10 @@ class View extends \HTML
case GROUP_ITEM: case GROUP_ITEM:
$data['imageSrc'] = \get_parameter('imageSrc'); $data['imageSrc'] = \get_parameter('imageSrc');
$data['recursiveGroup'] = \get_parameter_switch(
'recursiveGroup',
0
);
$data['showStatistics'] = \get_parameter_switch( $data['showStatistics'] = \get_parameter_switch(
'showStatistics', 'showStatistics',
0 0

View File

@ -88,6 +88,10 @@ table#table_events > tbody > tr > td {
padding: 0px !important; padding: 0px !important;
} }
table#table_events > tbody > tr > td > i {
font-size: 7.5pt;
}
td > input[id^="checkbox-multi"] { td > input[id^="checkbox-multi"] {
margin: 0px !important; margin: 0px !important;
} }

View File

@ -87,6 +87,11 @@
font-weight: 900; font-weight: 900;
} }
@font-face {
font-family: "text-security-disc";
src: url("https://raw.githubusercontent.com/noppa/text-security/master/dist/text-security-disc.woff");
}
/* /*
@font-face { @font-face {
font-family: "lato-italic"; font-family: "lato-italic";
@ -4424,9 +4429,13 @@ span.log_zone_line_error {
border: 1px solid red; border: 1px solid red;
} }
#toolbox > input { /* VISUAL MAP */
border-width: 0px 1px 0px 0px; #toolbox {
border-color: lightgray; padding-top: 10px;
}
#toolbox button {
margin: 0px 10px;
} }
#toolbox > input.service_min { #toolbox > input.service_min {
@ -10443,12 +10452,24 @@ button.submitButton.onlyIcon.delete_item {
-webkit-mask: url(../../images/delete.svg) no-repeat right / contain; -webkit-mask: url(../../images/delete.svg) no-repeat right / contain;
} }
button.buttonButton.onlyIcon.edit_item,
button.submitButton.onlyIcon.edit_item {
mask: url(../../images/edit.svg) no-repeat right / contain;
-webkit-mask: url(../../images/edit.svg) no-repeat right / contain;
}
button.buttonButton.onlyIcon.copy_item, button.buttonButton.onlyIcon.copy_item,
button.submitButton.onlyIcon.copy_item { button.submitButton.onlyIcon.copy_item {
mask: url(../../images/copy.svg) no-repeat right / contain; mask: url(../../images/copy.svg) no-repeat right / contain;
-webkit-mask: url(../../images/copy.svg) no-repeat right / contain; -webkit-mask: url(../../images/copy.svg) no-repeat right / contain;
} }
button.buttonButton.onlyIcon.show_grid,
button.submitButton.onlyIcon.show_grid {
mask: url(../../images/WMI@svg.svg) no-repeat right / contain;
-webkit-mask: url(../../images/WMI@svg.svg) no-repeat right / contain;
}
button.buttonButton.link-create-item, button.buttonButton.link-create-item,
button.submitButton.link-create-item { button.submitButton.link-create-item {
border-radius: 0; border-radius: 0;

View File

@ -736,7 +736,7 @@ div#main_pure {
div#main, div#main,
div#container, div#container,
body.pure { body.pure {
background-color: #111; background-color: #111 !important;
} }
form ul.form_flex { form ul.form_flex {

View File

@ -99,15 +99,6 @@ div#vc-controls img.vc-qr {
flex: inherit; flex: inherit;
} }
input.vs_button_ghost {
background-color: transparent;
border: 1px solid #82b92e;
color: #82b92e;
text-align: center;
padding: 4px 12px;
font-weight: bold;
}
#toolbox #auto_save { #toolbox #auto_save {
padding-top: 5px; padding-top: 5px;
} }

View File

@ -797,6 +797,7 @@ if (isset($config['id_user']) === false) {
$pass2 = get_parameter_post('pass2'); $pass2 = get_parameter_post('pass2');
$id_user = get_parameter_post('id_user'); $id_user = get_parameter_post('id_user');
$db_reset_pass_entry = false;
if (empty($reset_hash) === false) { if (empty($reset_hash) === false) {
$hash_data = explode(':::', $reset_hash); $hash_data = explode(':::', $reset_hash);
$id_user = $hash_data[0]; $id_user = $hash_data[0];
@ -1361,7 +1362,7 @@ if ($searchPage) {
$_GET['sec2'] = 'operation/agentes/group_view'; $_GET['sec2'] = 'operation/agentes/group_view';
break; break;
case 'Alert detail': case 'Alert details':
$_GET['sec'] = 'view'; $_GET['sec'] = 'view';
$_GET['sec2'] = 'operation/agentes/alerts_status'; $_GET['sec2'] = 'operation/agentes/alerts_status';
break; break;
@ -1388,7 +1389,7 @@ if ($searchPage) {
case 'Visual console': case 'Visual console':
$id_visualc = db_get_value('id', 'tlayout', 'name', $home_url); $id_visualc = db_get_value('id', 'tlayout', 'name', $home_url);
if (($home_url == '') || ($id_visualc == false)) { if (($home_url == '') || ($id_visualc == false)) {
$str = 'sec=network&sec2=operation/visual_console/index&refr=60'; $str = 'sec=godmode/reporting/map_builder&sec2=godmode/reporting/map_builder';
} else { } else {
$str = 'sec=network&sec2=operation/visual_console/render_view&id='.$id_visualc; $str = 'sec=network&sec2=operation/visual_console/render_view&id='.$id_visualc;
} }

View File

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

View File

@ -278,7 +278,7 @@ $fields[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$fields[AGENT_STATUS_NOT_INIT] = __('Not init'); $fields[AGENT_STATUS_NOT_INIT] = __('Not init');
$searchForm = ''; $searchForm = '';
$searchForm .= '<form method="post" action="?sec=view&sec2=operation/agentes/estado_agente&group_id='.$group_id.'">'; $searchForm .= '<form method="post" action="?sec=view&sec2=operation/agentes/estado_agente">';
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';

View File

@ -187,16 +187,13 @@ html_print_div(
'class' => 'agent_details_line', 'class' => 'agent_details_line',
'content' => ui_toggle( 'content' => ui_toggle(
$html_toggle, $html_toggle,
__('List of modules').' '.$help_not_init.ui_print_help_tip( '<span class="subsection_header_title">'.__('List of modules').' '.$help_not_init.reporting_tiny_stats(
__('To see the list of modules paginated, enable this option in the Styles Configuration.'),
true
).reporting_tiny_stats(
$agent, $agent,
true, true,
'modules', 'modules',
':', ':',
true, true,
), ).'</span>',
'status_monitor_agent', 'status_monitor_agent',
false, false,
false, false,
@ -549,7 +546,8 @@ function print_form_filter_monitors(
$table->size[0] = '25%'; $table->size[0] = '25%';
$table->size[1] = '25%'; $table->size[1] = '25%';
$table->size[2] = '25%'; $table->size[2] = '25%';
$table->size[3] = '25%'; $table->size[3] = '15%';
$table->size[4] = '10%';
// Captions. // Captions.
$table->data[0][0] = html_print_label_input_block( $table->data[0][0] = html_print_label_input_block(
html_print_input_hidden('filter_monitors', 1, true).html_print_input_hidden( html_print_input_hidden('filter_monitors', 1, true).html_print_input_hidden(
@ -618,11 +616,7 @@ function print_form_filter_monitors(
) )
); );
$form_text = html_print_table($table, true); $table->data[0][4] = html_print_button(
$filtersButtons = [];
$filtersButtons[] = html_print_button(
__('Filter'), __('Filter'),
'filter', 'filter',
false, false,
@ -633,9 +627,7 @@ function print_form_filter_monitors(
'style' => 'margin-left: 15px', 'style' => 'margin-left: 15px',
], ],
true true
); ).html_print_button(
$filtersButtons[] = html_print_button(
__('Reset'), __('Reset'),
'filter', 'filter',
false, false,
@ -646,6 +638,9 @@ function print_form_filter_monitors(
], ],
true true
); );
$table->cellstyle[0][4] = 'width:20%;display: flex;flex-direction: row-reverse;justify-content: flex-end;height: 60px;align-items: flex-end;width:10%;';
$form_text = html_print_table($table, true);
// TODO. Unused code. // TODO. Unused code.
if ($status_filter_monitor === -1 && empty($status_text_monitor) === true && $status_module_group === -1) { if ($status_filter_monitor === -1 && empty($status_text_monitor) === true && $status_module_group === -1) {
@ -655,10 +650,4 @@ function print_form_filter_monitors(
} }
echo $form_text; echo $form_text;
html_print_div(
[
'class' => 'action-buttons-right-forced',
'content' => implode('', $filtersButtons),
]
);
} }

View File

@ -229,6 +229,9 @@ if (empty($result_groups) === false) {
echo '<table class="info_table mrgn_top_10px" border="0" width="100%">'; echo '<table class="info_table mrgn_top_10px" border="0" width="100%">';
echo '<thead>'; echo '<thead>';
echo '<tr>';
echo '<th colspan=14>'.__('Total items').': '.$count.'</th>';
echo '</tr>';
echo '<tr>'; echo '<tr>';
echo '<th colspan=2 ></th>'; echo '<th colspan=2 ></th>';
echo '<th colspan=6>'.__('Agents').'</th>'; echo '<th colspan=6>'.__('Agents').'</th>';
@ -238,13 +241,13 @@ if (empty($result_groups) === false) {
echo '<tr>'; echo '<tr>';
echo "<th class='w26px'>".__('Force').'</th>'; echo "<th class='w26px'>".__('Force').'</th>';
echo "<th width='30%' class='mw60px' style='text-align: justify'>".__('Group').'/'.__('Tags').'</th>'; echo "<th width='30%' class='mw60px' style='text-align: justify'>".__('Group').'/'.__('Tags').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Total').'</th>'; echo "<th class='center'>".__('Total').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Unknown').'</th>'; echo "<th width='10%' class='mw60px center'>".__('Unknown').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Not init').'</th>'; echo "<th width='10%' class='mw60px center'>".__('Not init').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Normal').'</th>'; echo "<th width='10%' class='mw60px center'>".__('Normal').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Warning').'</th>'; echo "<th width='10%' class='mw60px center'>".__('Warning').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Critical').'</th>'; echo "<th width='10%' class='mw60px center'>".__('Critical').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Unknown').'</th>'; echo "<th class='center'>".__('Unknown').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Not init').'</th>'; echo "<th width='10%' class='mw60px center'>".__('Not init').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Normal').'</th>'; echo "<th width='10%' class='mw60px center'>".__('Normal').'</th>';
echo "<th width='10%' class='mw60px center'>".__('Warning').'</th>'; echo "<th width='10%' class='mw60px center'>".__('Warning').'</th>';

View File

@ -1100,16 +1100,29 @@ $load_filter_id = (int) get_parameter('filter_id', 0);
$fav_menu = []; $fav_menu = [];
if ($load_filter_id === 0) { if ($load_filter_id === 0) {
// Load user filter. // Load user filter.
$loaded_filter = db_get_row_sql( if (is_metaconsole() === true) {
sprintf( $loaded_filter = db_get_row_sql(
'SELECT f.id_filter, f.id_name sprintf(
FROM tevent_filter f 'SELECT f.id_filter, f.id_name
INNER JOIN tusuario u FROM tevent_filter f
ON u.default_event_filter=f.id_filter INNER JOIN tusuario u
WHERE u.id_user = "%s" ', ON u.metaconsole_default_event_filter=f.id_filter
$config['id_user'] WHERE u.id_user = "%s" ',
) $config['id_user']
); )
);
} else {
$loaded_filter = db_get_row_sql(
sprintf(
'SELECT f.id_filter, f.id_name
FROM tevent_filter f
INNER JOIN tusuario u
ON u.default_event_filter=f.id_filter
WHERE u.id_user = "%s" ',
$config['id_user']
)
);
}
} else { } else {
// Load filter selected by user. // Load filter selected by user.
$loaded_filter['id_filter'] = $load_filter_id; $loaded_filter['id_filter'] = $load_filter_id;

View File

@ -342,7 +342,7 @@ $details_box .= '
<div class="integriaims_details_titles">'.__('Type').'</div>'; <div class="integriaims_details_titles">'.__('Type').'</div>';
$details_box .= ' $details_box .= '
<div>'.html_print_image('images/heart.png', true, ['class' => 'invert_filter']).'</div> <div>'.html_print_image('images/heart.png', true, ['class' => 'invert_filter']).'</div>
<div>'.html_print_image('images/builder.png', true, ['class' => 'invert_filter']).'</div> <div>'.html_print_image('images/builder@svg.svg', true, ['class' => 'invert_filter']).'</div>
<div>'.html_print_image('images/user_green.png', true, ['class' => 'invert_filter']).'</div> <div>'.html_print_image('images/user_green.png', true, ['class' => 'invert_filter']).'</div>
<div>'.ui_print_integria_incident_priority($priority, $priority_text).'</div> <div>'.ui_print_integria_incident_priority($priority, $priority_text).'</div>
<div>'.html_print_image('images/incidents.png', true, ['class' => 'invert_filter']).'</div>'; <div>'.html_print_image('images/incidents.png', true, ['class' => 'invert_filter']).'</div>';

View File

@ -637,7 +637,7 @@ $menu_operation['workspace']['id'] = 'oper-users';
// ANY user can view him/herself ! // ANY user can view him/herself !
// Users. // Users.
$query_paramameters_user = '&edit_user=1&pure=0&id_user='.$config['id_user']; $query_paramameters_user = '&edit_user=1&pure=0';
$sub = []; $sub = [];
$sub['godmode/users/configure_user'.$query_paramameters_user]['text'] = __('Edit my user'); $sub['godmode/users/configure_user'.$query_paramameters_user]['text'] = __('Edit my user');

View File

@ -85,7 +85,7 @@ if (is_ajax() === true) {
// Read filter configuration. // Read filter configuration.
$filter_id = (int) get_parameter('filter_id', 0); $filter_id = (int) get_parameter('filter_id', 0);
$filter['id_name'] = get_parameter('name', ''); $filter['id_name'] = get_parameter('new_filter_name', '');
$filter['id_group'] = (int) get_parameter('assign_group', 0); $filter['id_group'] = (int) get_parameter('assign_group', 0);
$filter['aggregate'] = get_parameter('aggregate', ''); $filter['aggregate'] = get_parameter('aggregate', '');
$filter['ip_dst'] = get_parameter('ip_dst', ''); $filter['ip_dst'] = get_parameter('ip_dst', '');
@ -162,6 +162,10 @@ if ($save != '' && check_acl($config['id_user'], 0, 'AW')) {
// Save filter args. // Save filter args.
$filter['filter_args'] = netflow_get_filter_arguments($filter, true); $filter['filter_args'] = netflow_get_filter_arguments($filter, true);
if ($filter['id_name'] === '') {
$filter['id_name'] = 'Netflow_Filter_'.time();
}
$filter_id = db_process_sql_insert('tnetflow_filter', $filter); $filter_id = db_process_sql_insert('tnetflow_filter', $filter);
if ($filter_id === false) { if ($filter_id === false) {
$filter_id = 0; $filter_id = 0;
@ -380,6 +384,9 @@ $advanced_toggle .= '<td colspan="2">'.html_print_checkbox_switch(
'displayMonitoringFilter()', 'displayMonitoringFilter()',
).'</td>'; ).'</td>';
$advanced_toggle .= '<td><b>'.__('New filter name').'</b></td>';
$advanced_toggle .= '<td>'.html_print_input_text('new_filter_name', '', false, 40, 80, true).'</td>';
$advanced_toggle .= '<tr id="netlofw_monitoring_filters">'; $advanced_toggle .= '<tr id="netlofw_monitoring_filters">';
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Netflow monitoring interval').ui_print_help_tip(__('Netflow monitoring interval in secs.'), true).'</td>'; $advanced_toggle .= "<td style='font-weight:bold;'>".__('Netflow monitoring interval').ui_print_help_tip(__('Netflow monitoring interval in secs.'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_number( $advanced_toggle .= '<td colspan="2">'.html_print_input_number(

View File

@ -198,7 +198,7 @@ if ($view_graph) {
'graph_editor' => [ 'graph_editor' => [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&edit_graph=1&id='.$id_graph.'">'.html_print_image( 'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&edit_graph=1&id='.$id_graph.'">'.html_print_image(
'images/builder.png', 'images/builder@svg.svg',
true, true,
[ [
'title' => __('Graph editor'), 'title' => __('Graph editor'),

View File

@ -93,7 +93,9 @@ ui_print_standard_header(
); );
// SNMP tree container. // SNMP tree container.
snmp_browser_print_container(false, '100%', '60%', '', true, true); if (!isset($_GET['tab'])) {
snmp_browser_print_container(false, '100%', '60%', '', true, true);
}
// Div for modal. // Div for modal.
echo '<div id="modal" style="display:none"></div>'; echo '<div id="modal" style="display:none"></div>';
@ -607,87 +609,142 @@ function show_add_module() {
var id_agent = 0; var id_agent = 0;
var id_module = 0; var id_module = 0;
var id_agent_module = $("#id_agent_module").val();
if (id_agent_module) {
// Get SNMP target.
confirmDialog({
title: '<?php echo __('Are you sure?'); ?>',
message: '<?php echo __('Are you sure you want add module?'); ?> ',
ok: '<?php echo __('OK'); ?>',
cancel: '<?php echo __('Cancel'); ?>',
onAccept: function() {
// Get SNMP target.
var snmp_target = {
target_ip : $('#text-target_ip').val(),
community : $('#text-community').val(),
snmp_version : $('#snmp_browser_version').val(),
snmp3_auth_user : $('#text-snmp3_browser_auth_user').val(),
snmp3_security_level : $('#snmp3_browser_security_level').val(),
snmp3_auth_method : $('#snmp3_browser_auth_method').val(),
snmp3_auth_pass : $('#password-snmp3_browser_auth_pass').val(),
snmp3_privacy_method : $('#snmp3_browser_privacy_method').val(),
snmp3_privacy_pass : $('#password-snmp3_browser_privacy_pass').val(),
tcp_port : $('#target_port').val(),
};
// Append values to form.
var input = "";
$.each( snmp_target, function( key, val ) {
input = $("<input>")
.attr("type", "hidden")
.attr("name", key).val(val);
$("#snmp_create_module").append(input);
});
//Submit form to agent module url.
$("#snmp_create_module").attr(
"action",
"index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente="
+id_agent_module+
"&tab=module&edit_module=1"
);
$('#snmp_create_module').submit();
$("#dialog_create_module").dialog({
resizable: true,
draggable: true,
modal: true,
width: '300',
height:'auto',
overlay: {
opacity: 0.5,
background: "black"
},
buttons:
[
{
class: "ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-cancel",
text: '<?php echo __('Cancel'); ?>',
click: function() {
$(this).dialog("close");
}
}, },
onDeny: function () {
{ $("#dialog_create_module").dialog("close");
class: "ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next", return false;
text: '<?php echo __('Create module'); ?>',
click: function(e) {
confirmDialog({
title: '<?php echo __('Are you sure?'); ?>',
message: '<?php echo __('Are you sure you want add module?'); ?> ',
ok: '<?php echo __('OK'); ?>',
cancel: '<?php echo __('Cancel'); ?>',
onAccept: function() {
// Get id agent and add it to form.
id_agent = $('#hidden-id_agent').val();
// Get SNMP target.
var snmp_target = {
target_ip : $('#text-target_ip').val(),
community : $('#text-community').val(),
snmp_version : $('#snmp_browser_version').val(),
snmp3_auth_user : $('#text-snmp3_browser_auth_user').val(),
snmp3_security_level : $('#snmp3_browser_security_level').val(),
snmp3_auth_method : $('#snmp3_browser_auth_method').val(),
snmp3_auth_pass : $('#password-snmp3_browser_auth_pass').val(),
snmp3_privacy_method : $('#snmp3_browser_privacy_method').val(),
snmp3_privacy_pass : $('#password-snmp3_browser_privacy_pass').val(),
tcp_port : $('#target_port').val(),
};
// Append values to form.
var input = "";
$.each( snmp_target, function( key, val ) {
input = $("<input>")
.attr("type", "hidden")
.attr("name", key).val(val);
$("#snmp_create_module").append(input);
});
//Submit form to agent module url.
$("#snmp_create_module").attr(
"action",
"index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente="
+id_agent+
"&tab=module&edit_module=1"
);
$('#snmp_create_module').submit();
},
onDeny: function () {
$("#dialog_create_module").dialog("close");
return false;
}
});
}
} }
], });
});
} else {
$("#dialog_create_module").dialog({
resizable: true,
draggable: true,
modal: true,
width: '300',
height:'auto',
overlay: {
opacity: 0.5,
background: "black"
},
buttons:
[
{
class: "ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-cancel",
text: '<?php echo __('Cancel'); ?>',
click: function() {
$(this).dialog("close");
}
},
{
class: "ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: '<?php echo __('Create module'); ?>',
click: function(e) {
confirmDialog({
title: '<?php echo __('Are you sure?'); ?>',
message: '<?php echo __('Are you sure you want add module?'); ?> ',
ok: '<?php echo __('OK'); ?>',
cancel: '<?php echo __('Cancel'); ?>',
onAccept: function() {
// Get id agent and add it to form.
id_agent = $('#hidden-id_agent').val();
// Get SNMP target.
var snmp_target = {
target_ip : $('#text-target_ip').val(),
community : $('#text-community').val(),
snmp_version : $('#snmp_browser_version').val(),
snmp3_auth_user : $('#text-snmp3_browser_auth_user').val(),
snmp3_security_level : $('#snmp3_browser_security_level').val(),
snmp3_auth_method : $('#snmp3_browser_auth_method').val(),
snmp3_auth_pass : $('#password-snmp3_browser_auth_pass').val(),
snmp3_privacy_method : $('#snmp3_browser_privacy_method').val(),
snmp3_privacy_pass : $('#password-snmp3_browser_privacy_pass').val(),
tcp_port : $('#target_port').val(),
};
// Append values to form.
var input = "";
$.each( snmp_target, function( key, val ) {
input = $("<input>")
.attr("type", "hidden")
.attr("name", key).val(val);
$("#snmp_create_module").append(input);
});
//Submit form to agent module url.
$("#snmp_create_module").attr(
"action",
"index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente="
+id_agent+
"&tab=module&edit_module=1"
);
$('#snmp_create_module').submit();
},
onDeny: function () {
$("#dialog_create_module").dialog("close");
return false;
}
});
}
}
],
});
}
} }
</script> </script>

View File

@ -475,7 +475,12 @@ $skin = '';
'Dashboard' => __('Dashboard'), 'Dashboard' => __('Dashboard'),
]; ];
$home_screen .= html_print_select($values, 'section', io_safe_output($user_info['section']), 'show_data_section();', '', -1, true, false, false).'</div>'; if (is_metaconsole() === true) {
$home_screen .= html_print_select($values, 'metaconsole_section', io_safe_output($user_info['section']), 'show_data_section();', '', -1, true, false, false).'</div>';
} else {
$home_screen .= html_print_select($values, 'section', io_safe_output($user_info['section']), 'show_data_section();', '', -1, true, false, false).'</div>';
}
$dashboards = Manager::getDashboards( $dashboards = Manager::getDashboards(
-1, -1,
@ -558,6 +563,10 @@ $skin = '';
$double_authentication .= '</div>'; $double_authentication .= '</div>';
} }
if (is_metaconsole() === true && empty($user_info['metaconsole_default_event_filter']) !== true) {
$user_info['default_event_filter'] = $user_info['metaconsole_default_event_filter'];
}
if ((bool) check_acl($config['id_user'], 0, 'ER') === true) { if ((bool) check_acl($config['id_user'], 0, 'ER') === true) {
$event_filter = '<div class="label_select"><p class="edit_user_labels">'.__('Event filter').'</p>'; $event_filter = '<div class="label_select"><p class="edit_user_labels">'.__('Event filter').'</p>';
$user_groups = implode(',', array_keys((users_get_groups($config['id_user'], 'AR', true)))); $user_groups = implode(',', array_keys((users_get_groups($config['id_user'], 'AR', true))));

View File

@ -173,7 +173,7 @@ if ($vconsole_write || $vconsole_manage) {
] ]
).'</a>'; ).'</a>';
$options['editor']['text'] = '<a href="'.$url_base.$action.'&tab=editor&id_visual_console='.$id_layout.'">'.html_print_image( $options['editor']['text'] = '<a href="'.$url_base.$action.'&tab=editor&id_visual_console='.$id_layout.'">'.html_print_image(
'images/builder.png', 'images/builder@svg.svg',
true, true,
[ [
'title' => __('Builder'), 'title' => __('Builder'),
@ -192,30 +192,41 @@ $options['view']['text'] = '<a href="index.php?sec=network&sec2=operation/visual
).'</a>'; ).'</a>';
$options['view']['active'] = true; $options['view']['active'] = true;
if (!is_metaconsole()) { if (!$config['pure']) {
if (!$config['pure']) { $options['pure']['text'] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$id_layout.'&refr='.$refr.'&pure=1">'.html_print_image(
$options['pure']['text'] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$id_layout.'&refr='.$refr.'&pure=1">'.html_print_image( 'images/full_screen.png',
'images/full_screen.png', true,
true, [
[ 'title' => __('Full screen mode'),
'title' => __('Full screen mode'), 'class' => 'invert_filter',
'class' => 'invert_filter', ]
] ).'</a>';
).'</a>';
ui_print_page_header(
$layout_name,
'images/visual_console.png',
false,
'visual_console_view',
false,
$options
);
}
// Set the hidden value for the javascript ui_print_standard_header(
$layout_name,
'images/visual_console.png',
false,
'visual_console_view',
false,
$options,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('Visual console'),
],
]
);
}
if (!is_metaconsole()) {
// Set the hidden value for the javascript.
html_print_input_hidden('metaconsole', 0); html_print_input_hidden('metaconsole', 0);
} else { } else {
// Set the hidden value for the javascript // Set the hidden value for the javascript.
html_print_input_hidden('metaconsole', 1); html_print_input_hidden('metaconsole', 1);
} }

View File

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

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.771 %define version 7.0NG.771
%define release 230517 %define release 230524
%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

View File

@ -1297,6 +1297,8 @@ CREATE TABLE IF NOT EXISTS `tusuario` (
`shortcut_data` TEXT, `shortcut_data` TEXT,
`section` TEXT, `section` TEXT,
`data_section` TEXT, `data_section` TEXT,
`metaconsole_section` VARCHAR(255) NOT NULL DEFAULT 'Default',
`metaconsole_data_section` VARCHAR(255) NOT NULL DEFAULT '',
`force_change_pass` TINYINT UNSIGNED NOT NULL DEFAULT 0, `force_change_pass` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`last_pass_change` DATETIME, `last_pass_change` DATETIME,
`last_failed_login` DATETIME, `last_failed_login` DATETIME,
@ -1311,6 +1313,7 @@ CREATE TABLE IF NOT EXISTS `tusuario` (
`id_filter` INT UNSIGNED NULL DEFAULT NULL, `id_filter` INT UNSIGNED NULL DEFAULT NULL,
`session_time` INT signed NOT NULL DEFAULT 0, `session_time` INT signed NOT NULL DEFAULT 0,
`default_event_filter` INT UNSIGNED NOT NULL DEFAULT 0, `default_event_filter` INT UNSIGNED NOT NULL DEFAULT 0,
`metaconsole_default_event_filter` INT UNSIGNED NOT NULL DEFAULT 0,
`show_tips_startup` TINYINT UNSIGNED NOT NULL DEFAULT 1, `show_tips_startup` TINYINT UNSIGNED NOT NULL DEFAULT 1,
`autorefresh_white_list` TEXT , `autorefresh_white_list` TEXT ,
`time_autorefresh` INT UNSIGNED NOT NULL DEFAULT 30, `time_autorefresh` INT UNSIGNED NOT NULL DEFAULT 30,
@ -1727,6 +1730,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_data` (
`label_position` VARCHAR(50) NOT NULL DEFAULT 'down', `label_position` VARCHAR(50) NOT NULL DEFAULT 'down',
`border_color` VARCHAR(200) DEFAULT '', `border_color` VARCHAR(200) DEFAULT '',
`fill_color` VARCHAR(200) DEFAULT '', `fill_color` VARCHAR(200) DEFAULT '',
`recursive_group` TINYINT NOT NULL DEFAULT 0,
`show_statistics` TINYINT NOT NULL DEFAULT 0, `show_statistics` TINYINT NOT NULL DEFAULT 0,
`linked_layout_node_id` INT NOT NULL DEFAULT 0, `linked_layout_node_id` INT NOT NULL DEFAULT 0,
`linked_layout_status_type` ENUM ('default', 'weight', 'service') DEFAULT 'default', `linked_layout_status_type` ENUM ('default', 'weight', 'service') DEFAULT 'default',

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.771-230517 Version: 7.0NG.771-230524
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -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.771"; my $pandora_version = "7.0NG.771";
my $pandora_build = "230517"; my $pandora_build = "230524";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

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