Merge remote-tracking branch 'origin/develop' into ent-10551-Al-crear-actualizar-CV-con-espacios-se-meten-entities-en-el-nombre

This commit is contained in:
alejandro.campos@artica.es 2023-03-09 08:49:27 +01:00
commit 15afa2d976
100 changed files with 3759 additions and 2378 deletions

View File

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

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.769-230307" pandora_version="7.0NG.769-230309"
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.769'; use constant AGENT_VERSION => '7.0NG.769';
use constant AGENT_BUILD => '230307'; use constant AGENT_BUILD => '230309';
# 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.769 %define version 7.0NG.769
%define release 230307 %define release 230309
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.769 %define version 7.0NG.769
%define release 230307 %define release 230309
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.769" PI_VERSION="7.0NG.769"
PI_BUILD="230307" PI_BUILD="230309"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{230307} {230309}
ViewReadme ViewReadme
{Yes} {Yes}

View File

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

View File

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

View File

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

View File

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

View File

@ -377,17 +377,17 @@ function mainAgentsModules()
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp; $fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'&show_type='.$show_type.' offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'&show_type='.$show_type.'
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>'; &full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/fullscreen@svg.svg', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
} else if ($full_modules_selected[0] && $full_agents_id[0]) { } else if ($full_modules_selected[0] && $full_agents_id[0]) {
$full_modules = urlencode(implode(';', $full_modules_selected)); $full_modules = urlencode(implode(';', $full_modules_selected));
$full_agents = urlencode(implode(';', $full_agents_id)); $full_agents = urlencode(implode(';', $full_agents_id));
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp; $fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'&show_type='.$show_type.' offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'&show_type='.$show_type.'
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>'; &full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/fullscreen@svg.svg', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
} else { } else {
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp; $fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&show_type='.$show_type.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>'; offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&show_type='.$show_type.'">'.html_print_image('images/fullscreen@svg.svg', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
} }
} }
@ -597,11 +597,11 @@ function mainAgentsModules()
echo '<li class="nomn">'; echo '<li class="nomn">';
echo '<a target="_top" href="'.$url.'">'; echo '<a target="_top" href="'.$url.'">';
echo html_print_image( echo html_print_image(
'images/normal_screen.png', 'images/exit_fullscreen@svg.svg',
true, true,
[ [
'title' => __('Back to normal mode'), 'title' => __('Back to normal mode'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
); );
echo '</a>'; echo '</a>';

View File

@ -1,16 +1,33 @@
<?php <?php
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Users
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com // Begin.
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
function users_extension_main() function users_extension_main()
{ {
users_extension_main_god(false); users_extension_main_god(false);
@ -34,7 +51,24 @@ function users_extension_main_god($god=true)
} }
// Header. // Header.
ui_print_page_header(__('Users connected'), $image, false, '', $god); ui_print_standard_header(
__('List of users connected'),
$image,
false,
'',
$god,
[],
[
[
'link' => '',
'label' => __('Workspace'),
],
[
'link' => '',
'label' => __('Users connected'),
],
]
);
$check_profile = db_get_row('tusuario_perfil', 'id_usuario', $config['id_user'], 'id_up'); $check_profile = db_get_row('tusuario_perfil', 'id_usuario', $config['id_user'], 'id_up');
if ($check_profile === false && !users_is_admin()) { if ($check_profile === false && !users_is_admin()) {

View File

@ -471,10 +471,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
</div> <!-- Closes #table_header_inner --> </div> <!-- Closes #table_header_inner -->
</div> <!-- Closes #table_header --> </div> <!-- Closes #table_header -->
<!-- Notifications content wrapper-->
<div id='notification-content' class='invisible'/></div>
<!-- Old style div wrapper --> <!-- Old style div wrapper -->
<div id="alert_messages" class="invisible"></div> <div id="alert_messages" class="invisible"></div>

View File

@ -34,7 +34,6 @@ $url = sprintf(
$url_id_agente $url_id_agente
); );
enterprise_include('godmode/agentes/module_manager.php');
$isFunctionPolicies = enterprise_include_once('include/functions_policies.php'); $isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_modules.php';
require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_agents.php';
@ -51,196 +50,10 @@ if (isset($policy_page) === false) {
$checked = (bool) get_parameter('checked'); $checked = (bool) get_parameter('checked');
$sec2 = (string) get_parameter('sec2'); $sec2 = (string) get_parameter('sec2');
// Table for filter bar.
$filterTable = new stdClass();
$filterTable->class = 'fixed_filter_bar';
$filterTable->data = [];
$filterTable->cellstyle[0][0] = 'width:0';
$filterTable->data[0][0] = __('Search');
$filterTable->data[1][0] .= html_print_input_text(
'search_string',
$search_string,
'',
30,
255,
true,
false,
false,
'',
''
);
$filterTable->data[0][0] .= html_print_input_hidden('search', 1, true);
if ((bool) $policy_page === false) {
$filterTable->data[0][1] = __('Show in hierachy mode');
$filterTable->data[1][1] = html_print_checkbox_switch(
'status_hierachy_mode',
'',
((string) $checked === 'true'),
true,
false,
'onChange=change_mod_filter();'
);
}
$filterTable->data[1][2] = html_print_submit_button(
__('Filter'),
'filter',
false,
[
'icon' => 'search',
'class' => 'float-right',
'mode' => 'secondary mini',
],
true
);
// Print filter table.
echo '<form id="create_module_type" method="post" action="'.$url.'">';
html_print_table($filterTable);
echo '</form>';
// Check if there is at least one server of each type available to assign that
// kind of modules. If not, do not show server type in combo.
$network_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = '.SERVER_TYPE_NETWORK
);
// POSTGRESQL AND ORACLE COMPATIBLE.
$wmi_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = '.SERVER_TYPE_WMI
);
// POSTGRESQL AND ORACLE COMPATIBLE.
$plugin_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = '.SERVER_TYPE_PLUGIN
);
// POSTGRESQL AND ORACLE COMPATIBLE.
$prediction_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = '.SERVER_TYPE_PREDICTION
);
// POSTGRESQL AND ORACLE COMPATIBLE.
$web_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = '.SERVER_TYPE_WEB
);
// POSTGRESQL AND ORACLE COMPATIBLE.
// Development mode to use all servers.
if ($develop_bypass || is_metaconsole()) {
$network_available = 1;
$wmi_available = 1;
$plugin_available = 1;
// FIXME when prediction predictions server modules can be configured.
// on metaconsole.
$prediction_available = (is_metaconsole() === true) ? 0 : 1;
}
$modules = [];
$modules['dataserver'] = __('Create a new data server module');
if ($network_available) {
$modules['networkserver'] = __('Create a new network server module');
}
if ($plugin_available) {
$modules['pluginserver'] = __('Create a new plugin server module');
}
if ($wmi_available) {
$modules['wmiserver'] = __('Create a new WMI server module');
}
if ($prediction_available) {
$modules['predictionserver'] = __('Create a new prediction server module');
}
if (is_metaconsole() === true || $web_available >= '1') {
$modules['webserver'] = __('Create a new web Server module');
}
if (enterprise_installed() === true) {
set_enterprise_module_types($modules);
}
if (strstr($sec2, 'enterprise/godmode/policies/policies') !== false) {
// It is unset because the policies haven't a table tmodule_synth and the
// some part of code to apply this kind of modules in policy agents.
// But in the future maybe will be good to make this feature, but remember
// the modules to show in syntetic module policy form must be the policy
// modules from the same policy.
unset($modules['predictionserver']);
if (enterprise_installed() === true) {
unset($modules['webux']);
}
}
if (($policy_page === true) || (isset($agent) === true)) {
if ($policy_page === true) {
$show_creation = is_management_allowed();
} else {
if (isset($all_groups) === false) {
$all_groups = agents_get_all_groups_agent(
$agent['id_agente'],
$agent['id_grupo']
);
}
$show_creation = check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true;
}
} else {
$show_creation = false;
}
if ($show_creation === true) {
// Create module/type combo.
$tableCreateModule = new stdClass();
$tableCreateModule->id = 'create';
$tableCreateModule->class = 'create_module_dialog';
$tableCreateModule->width = '100%';
$tableCreateModule->data = [];
$tableCreateModule->style = [];
$tableCreateModule->data['caption_type'] = html_print_input_hidden('edit_module', 1);
$tableCreateModule->data['caption_type'] .= __('Type');
$tableCreateModule->data['type'] = html_print_select(
$modules,
'moduletype',
'',
'',
'',
'',
true,
false,
false,
'',
false,
'width:380px;'
);
// Link for get more modules.
if ((bool) $config['disable_help'] === false) {
$tableCreateModule->data['get_more_modules'] = html_print_anchor(
[
'href' => 'https://pandorafms.com/Library/Library/',
'target' => '_blank',
'class' => 'color-black-grey',
'content' => __('Get more modules on Monitoring Library'),
],
true
);
}
}
if (isset($id_agente) === false) { if (isset($id_agente) === false) {
return; return;
} }
$module_action = (string) get_parameter('module_action'); $module_action = (string) get_parameter('module_action');
if ($module_action === 'delete') { if ($module_action === 'delete') {
@ -1256,35 +1069,6 @@ if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === tr
[ 'type' => 'data_table' ] [ 'type' => 'data_table' ]
); );
echo '</form>'; echo '</form>';
$modalCreateModule = '<form name="create_module_form" method="post">';
$modalCreateModule .= html_print_table($tableCreateModule, true);
$modalCreateModule .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Create'),
'create_module',
false,
[
'icon' => 'next',
'mode' => 'mini secondary',
],
true
),
],
true
);
$modalCreateModule .= '</form>';
html_print_div(
[
'id' => 'modal',
'style' => 'display: none',
'content' => $modalCreateModule,
]
);
} }
?> ?>

View File

@ -802,7 +802,7 @@ if ($id_agent_module) {
__('Delete'), __('Delete'),
'deleteModule', 'deleteModule',
false, false,
'window.location.assign(\'index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$id_agent_module.')', 'window.location.assign("index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$id_agent_module.'")',
[ [
'icon' => 'delete', 'icon' => 'delete',
'mode' => 'secondary', 'mode' => 'secondary',

View File

@ -325,7 +325,7 @@ if ($edit === false) {
$table_simple->data['module_n_type'][1] = '<span class="result_info_text">'.modules_get_moduletype_description($id_module_type).' ('.$type_names_hash[$id_module_type].')</span>'; $table_simple->data['module_n_type'][1] = '<span class="result_info_text">'.modules_get_moduletype_description($id_module_type).' ('.$type_names_hash[$id_module_type].')</span>';
} else { } else {
$idModuleType = (isset($id_module_type) === true) ? $idModuleType : ''; $idModuleType = (isset($id_module_type) === true) ? $id_module_type : '';
// Removed web analysis and log4x from select. // Removed web analysis and log4x from select.
$tipe_not_in = '24, 25'; $tipe_not_in = '24, 25';
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
@ -444,7 +444,7 @@ $tableBasicThresholds->data = [];
$tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width pdd_t_10px'; $tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width pdd_t_10px';
$tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width'; $tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').'&nbsp;'; $tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').'&nbsp;';
if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === false)) { if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) {
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>'; $tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text( $tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'min_warning', 'min_warning',
@ -482,7 +482,7 @@ if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeM
); );
} }
if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === true)) { if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) {
$basicThresholdsIntervalWarning = []; $basicThresholdsIntervalWarning = [];
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>'; $basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch( $basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
@ -531,7 +531,7 @@ $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div(
$tableBasicThresholds->rowclass['caption_critical_threshold'] = 'field_half_width pdd_t_10px'; $tableBasicThresholds->rowclass['caption_critical_threshold'] = 'field_half_width pdd_t_10px';
$tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width'; $tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').'&nbsp;'; $tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').'&nbsp;';
if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === false)) { if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) {
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>'; $tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text( $tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'min_critical', 'min_critical',
@ -569,7 +569,7 @@ if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeM
); );
} }
if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === true)) { if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) {
$basicThresholdsIntervalCritical = []; $basicThresholdsIntervalCritical = [];
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>'; $basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch( $basicThresholdsIntervalCritical[] = html_print_checkbox_switch(

View File

@ -128,6 +128,7 @@ if ($page === 'enterprise/godmode/policies/policy_modules') {
// In ICMP modules, port is not configurable. // In ICMP modules, port is not configurable.
if ($id_module_type !== 6 && $id_module_type !== 7) { if ($id_module_type !== 6 && $id_module_type !== 7) {
$tcp_port = (empty($tcp_port) === false) ? $tcp_port : get_parameter('tcp_port');
$data[1] = html_print_input_text( $data[1] = html_print_input_text(
'tcp_port', 'tcp_port',
$tcp_port, $tcp_port,
@ -524,7 +525,7 @@ $data[0] .= html_print_button(
__('Manage credentials'), __('Manage credentials'),
'manage_credentials_button', 'manage_credentials_button',
false, false,
'window.location.assign(\'index.php?sec=gmodules&sec2=godmode/groups/group_list&tab=credbox\')', 'window.location.assign("index.php?sec=gmodules&sec2=godmode/groups/group_list&tab=credbox")',
[ 'mode' => 'link' ], [ 'mode' => 'link' ],
true true
); );

View File

@ -15,7 +15,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -29,8 +29,6 @@
global $config; global $config;
check_login(); check_login();
$agent_d = check_acl($config['id_user'], 0, 'AD'); $agent_d = check_acl($config['id_user'], 0, 'AD');
@ -54,23 +52,33 @@ require_once $config['homedir'].'/include/functions_cron.php';
// Buttons. // Buttons.
$buttons = [ $buttons = [
'text' => "<a href='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'>".html_print_image( 'text' => "<a href='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'>".html_print_image(
'images/list.png', 'images/logs@svg.svg',
true, true,
[ [
'title' => __('List'), 'title' => __('List'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
// Header. // Header.
ui_print_page_header( ui_print_standard_header(
__('Scheduled Downtime'), __('Scheduled Downtime'),
'images/gm_monitoring.png', 'images/gm_monitoring.png',
false, false,
'', '',
true, true,
$buttons $buttons,
[
[
'link' => '',
'label' => __('Tools'),
],
[
'link' => '',
'label' => __('Scheduled Downtime'),
],
]
); );
// Recursion group filter. // Recursion group filter.
@ -813,227 +821,7 @@ if (users_can_manage_group_all('AW') === true || $disabled) {
$return_all_group = true; $return_all_group = true;
} }
$table = new StdClass();
$table->class = 'databox filters';
$table->width = '100%';
$table->data = [];
$table->data[0][0] = __('Name');
$table->data[0][1] = html_print_input_text(
'name',
$name,
'',
25,
40,
true,
$disabled_in_execution
);
$table->data[1][0] = __('Group');
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
false,
$access,
$return_all_group,
'id_group',
$id_group,
'',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
).'</div>';
$table->data[2][0] = __('Description');
$table->data[2][1] = html_print_textarea(
'description',
3,
35,
$description,
'',
true
);
$table->data[3][0] = __('Type').ui_print_help_tip(
__('Quiet: Modules will not generate events or fire alerts.').'<br>'.__('Disable Agents: Disables the selected agents.').'<br>'.__('Disable Alerts: Disable alerts for the selected agents.'),
true
);
$table->data[3][1] = html_print_select(
[
'quiet' => __('Quiet'),
'disable_agents' => __('Disabled Agents'),
'disable_agent_modules' => __('Disable Modules'),
'disable_agents_alerts' => __('Disabled only Alerts'),
],
'type_downtime',
$type_downtime,
'change_type_downtime()',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
);
$table->data[4][0] = __('Execution');
$table->data[4][1] = html_print_select(
[
'once' => __('Once'),
'periodically' => __('Periodically'),
'cron' => __('Cron from/to'),
],
'type_execution',
$type_execution,
'change_type_execution();',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
);
$days = array_combine(range(1, 31), range(1, 31)); $days = array_combine(range(1, 31), range(1, 31));
$table->data[5][0] = __('Configure the time').'&nbsp;';
;
$table->data[5][1] = "
<div id='once_time' style='display: none;'>
<table>
<tr>
<td>".__('From:').'</td>
<td>'.html_print_input_text('once_date_from', $once_date_from, '', 10, 10, true, $disabled_in_execution).html_print_input_text('once_time_from', $once_time_from, '', 9, 9, true, $disabled_in_execution).'</td>
</tr>
<tr>
<td>'.__('To:').'</td>
<td>'.html_print_input_text('once_date_to', $once_date_to, '', 10, 10, true).html_print_input_text('once_time_to', $once_time_to, '', 9, 9, true)."</td>
</tr>
</table>
</div>
<div id='periodically_time' style='display: none;'>
<table>
<tr><td>".ui_get_using_system_timezone_warning().'</td></tr>
<tr>
<td>'.__('Type Periodicity:').'&nbsp;'.html_print_select(
[
'weekly' => __('Weekly'),
'monthly' => __('Monthly'),
],
'type_periodicity',
$type_periodicity,
'change_type_periodicity();',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
)."</td>
</tr>
<tr>
<td colspan='2'>
<table id='weekly_item' style='display: none;'>
<tr>
<td>".__('Mon').html_print_checkbox('monday', 1, $monday, true, $disabled_in_execution).'</td>
<td>'.__('Tue').html_print_checkbox('tuesday', 1, $tuesday, true, $disabled_in_execution).'</td>
<td>'.__('Wed').html_print_checkbox('wednesday', 1, $wednesday, true, $disabled_in_execution).'</td>
<td>'.__('Thu').html_print_checkbox('thursday', 1, $thursday, true, $disabled_in_execution).'</td>
<td>'.__('Fri').html_print_checkbox('friday', 1, $friday, true, $disabled_in_execution).'</td>
<td>'.__('Sat').html_print_checkbox('saturday', 1, $saturday, true, $disabled_in_execution).'</td>
<td>'.__('Sun').html_print_checkbox('sunday', 1, $sunday, true, $disabled_in_execution)."</td>
</tr>
</table>
<table id='monthly_item' style='display: none;'>
<tr>
<td>".__('From day:').'</td>
<td>'.html_print_select(
$days,
'periodically_day_from',
$periodically_day_from,
'',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
).'</td>
<td>'.__('To day:').'</td>
<td>'.html_print_select(
$days,
'periodically_day_to',
$periodically_day_to,
'',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
).'</td>
<td>'.ui_print_help_tip(__('The end day must be higher than the start day'), true).'</td>
</tr>
</table>
<table>
<tr>
<td>'.__('From hour:').'</td>
<td>'.html_print_input_text(
'periodically_time_from',
$periodically_time_from,
'',
7,
7,
true,
$disabled_in_execution
).ui_print_help_tip(
__('The end time must be higher than the start time'),
true
).'</td>
<td>'.__('To hour:').'</td>
<td>'.html_print_input_text(
'periodically_time_to',
$periodically_time_to,
'',
7,
7,
true,
$disabled_in_execution
).ui_print_help_tip(
__('The end time must be higher than the start time'),
true
).'</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="cron_time" style="display: none;">
<table class="w100p">
<tr>
<td>'.__('Cron from:').'</td>
<td>'.html_print_extended_select_for_cron($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, false, false, true, 'from').'</td>
</tr>
<tr>
<td>'.__('Cron to:').'</td>
<td>'.html_print_extended_select_for_cron($hour_to, $minute_to, $mday_to, $month_to, $wday_to, true, false, true, true, 'to').'</td>
</tr>
</table>
</div>';
if ($id_downtime > 0) {
echo "<form method=post action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
} else {
echo '<form method="POST" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor">';
}
// Editor form.
html_print_table($table);
echo "<td valign=top style='width:300px;padding-left:20px;'>";
$filter_group = (int) get_parameter('filter_group', 0); $filter_group = (int) get_parameter('filter_group', 0);
@ -1074,105 +862,467 @@ if (empty($agents) || $disabled_in_execution) {
$disabled_add_button = true; $disabled_add_button = true;
} }
// Show available agents to include into downtime
$table = new StdClass(); $table = new StdClass();
$table->class = 'databox filters'; $table->class = 'databox filter-table-adv';
$table->id = 'principal_table_scheduled';
$table->width = '100%'; $table->width = '100%';
$table->size = [];
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = []; $table->data = [];
$table->size[0] = '25%'; $table->data['first_title'][] = html_print_div(
$table->data[0][0] = __('Group filter');
$table->data[0][1] = html_print_select_groups(
false,
$access,
$return_all_group,
'filter_group',
$filter_group,
'',
'',
'',
true,
false,
true,
'',
false,
'min-width:180px;margin-right:15px;'
);
$table->data[0][2] = __('Recursion').'&nbsp&nbsp'.html_print_checkbox('recursion', 1, $recursion, true, false, '');
$table->data[1][0] = __('Available agents');
$table->data[1][1] = html_print_select($agents, 'id_agents[]', -1, '', _('Any'), -2, true, true, true, '', false, 'min-width: 250px;width: 70%;');
$table->rowid[2] = 'available_modules_selection_mode';
$table->data[2][1] = html_print_select(
[ [
'common' => __('Show common modules'), 'class' => 'section_table_title',
'all' => __('Show all modules'), 'content' => __('Editor'),
], ],
'modules_selection_mode', true
'common', );
false, $table->data[0][] = html_print_label_input_block(
'', __('Name'),
'', html_print_input_text(
true, 'name',
false, $name,
true, '',
'', 25,
false, 40,
'min-width:180px;' true,
$disabled_in_execution
)
); );
$table->data[0][] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
$access,
$return_all_group,
'id_group',
$id_group,
'',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
)
);
$table->rowid[3] = 'available_modules'; $table->data[1][] = html_print_label_input_block(
$table->data[3][0] = __('Available modules:').ui_print_help_tip( __('Description'),
__('Only for type Quiet for downtimes.'), html_print_textarea(
'description',
3,
35,
$description,
'',
true
)
);
$table->data[1][] = html_print_label_input_block(
__('Type'),
html_print_select(
[
'quiet' => __('Quiet'),
'disable_agents' => __('Disabled Agents'),
'disable_agent_modules' => __('Disable Modules'),
'disable_agents_alerts' => __('Disabled only Alerts'),
],
'type_downtime',
$type_downtime,
'change_type_downtime()',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
).ui_print_input_placeholder(
__('Quiet: Modules will not generate events or fire alerts.').'<br>'.__('Disable Agents: Disables the selected agents.').'<br>'.__('Disable Alerts: Disable alerts for the selected agents.'),
true
)
);
$table->data[2][] = html_print_label_input_block(
__('Execution'),
html_print_select(
[
'once' => __('Once'),
'periodically' => __('Periodically'),
'cron' => __('Cron from/to'),
],
'type_execution',
$type_execution,
'change_type_execution();',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
)
);
$timeInputs = [];
$timeInputs[] = html_print_div(
[
'id' => 'once_time',
'style' => 'display: none',
'content' => html_print_div(
[
'class' => '',
'content' => html_print_input_text(
'once_date_from',
$once_date_from,
'',
10,
10,
true,
$disabled_in_execution
).html_print_input_text(
'once_time_from',
$once_time_from,
'',
9,
9,
true,
$disabled_in_execution
).'<span class="margin-lr-10 result_info_text">'.__(
'To'
).'</span>'.html_print_input_text(
'once_date_to',
$once_date_to,
'',
10,
10,
true
).html_print_input_text(
'once_time_to',
$once_time_to,
'',
9,
9,
true
),
],
true
),
],
true true
); );
$table->data[3][1] = html_print_select( $timeInputs[] = html_print_div(
[], [
'module[]', 'id' => 'periodically_time',
'', 'style' => 'display: none',
'', 'content' => html_print_div(
'', [
0, 'class' => 'filter-table-adv-manual w50p',
true, 'content' => html_print_label_input_block(
true, __('Type Periodicity'),
true, html_print_select(
'', [
false, 'weekly' => __('Weekly'),
'min-width: 250px;width: 70%;' 'monthly' => __('Monthly'),
],
'type_periodicity',
$type_periodicity,
'change_type_periodicity();',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
)
),
],
true
).html_print_div(
[
'id' => 'weekly_item',
'class' => '',
'content' => '<ul class="flex-row-center mrgn_top_15px mrgn_btn_15px">
<li class="flex">'.__('Mon').html_print_checkbox('monday', 1, $monday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
<li class="flex">'.__('Tue').html_print_checkbox('tuesday', 1, $tuesday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
<li class="flex">'.__('Wed').html_print_checkbox('wednesday', 1, $wednesday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
<li class="flex">'.__('Thu').html_print_checkbox('thursday', 1, $thursday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
<li class="flex">'.__('Fri').html_print_checkbox('friday', 1, $friday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
<li class="flex">'.__('Sat').html_print_checkbox('saturday', 1, $saturday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
<li class="flex">'.__('Sun').html_print_checkbox('sunday', 1, $sunday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
</ul>',
],
true
).html_print_div(
[
'id' => 'monthly_item',
'style' => 'margin-top: 12px;',
'class' => 'filter-table-adv-manual flex-row-start w50p',
'content' => html_print_label_input_block(
__('From day'),
html_print_select(
$days,
'periodically_day_from',
$periodically_day_from,
'',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
),
[ 'div_style' => 'flex: 50; margin-right: 5px;' ]
).html_print_label_input_block(
__('To day'),
html_print_select(
$days,
'periodically_day_to',
$periodically_day_to,
'',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
).ui_print_input_placeholder(
__('The end day must be higher than the start day'),
true
),
[ 'div_style' => 'flex: 50; margin-left: 5px;' ]
),
],
true
).html_print_div(
[
'class' => 'filter-table-adv-manual flex-row-start w50p',
'content' => html_print_label_input_block(
__('From hour'),
html_print_input_text(
'periodically_time_from',
$periodically_time_from,
'',
7,
7,
true,
$disabled_in_execution
).ui_print_input_placeholder(
__('The start time must be lower than the end time'),
true
),
[ 'div_style' => 'flex: 50; margin-right: 5px;' ]
).html_print_label_input_block(
__('To hour'),
html_print_input_text(
'periodically_time_to',
$periodically_time_to,
'',
7,
7,
true,
$disabled_in_execution
).ui_print_input_placeholder(
__('The end time must be higher than the start time'),
true
),
[ 'div_style' => 'flex: 50; margin-left: 5px;' ]
),
],
true
).ui_get_using_system_timezone_warning(),
],
true
);
$timeInputs[] = html_print_div(
[
'id' => 'cron_time',
'style' => 'display: none',
'content' => html_print_label_input_block(
__('Cron from'),
html_print_extended_select_for_cron($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, false, false, true, 'from')
).html_print_label_input_block(
__('Cron to'),
html_print_extended_select_for_cron($hour_to, $minute_to, $mday_to, $month_to, $wday_to, true, false, true, true, 'to')
),
],
true
);
$table->colspan[3][0] = 2;
$table->data[3][0] = html_print_label_input_block(
__('Configure the time'),
implode('', $timeInputs)
);
$table->data[4][] = html_print_div(
[
'class' => 'section_table_title',
'content' => __('Filtering'),
],
true
);
$table->data[5][] = html_print_label_input_block(
__('Group filter'),
html_print_select_groups(
false,
$access,
$return_all_group,
'filter_group',
$filter_group,
'',
'',
'',
true,
false,
true,
'',
false,
'min-width:180px;margin-right:15px;'
)
);
$table->data[5][] = html_print_label_input_block(
__('Recursion'),
html_print_checkbox_switch(
'recursion',
1,
$recursion,
true,
false,
''
)
);
$table->colspan[6][0] = 2;
$availableModules = html_print_label_input_block(
__('Available agents'),
html_print_select(
$agents,
'id_agents[]',
-1,
'',
__('Any'),
-2,
true,
true,
true,
'',
false,
'min-width: 250px;width: 70%;'
),
[
'div_class' => 'flex-column',
'div_style' => 'flex: 33',
]
);
$availableModules .= html_print_label_input_block(
__('Selection mode'),
html_print_select(
[
'common' => __('Show common modules'),
'all' => __('Show all modules'),
],
'modules_selection_mode',
'common',
false,
'',
'',
true,
false,
true,
'',
false,
'min-width:180px;'
),
[
'div_class' => 'available_modules_selection_mode flex-column',
'div_style' => 'flex: 33',
]
);
$availableModules .= html_print_label_input_block(
__('Available modules'),
html_print_select(
[],
'module[]',
'',
'',
'',
0,
true,
true,
true,
'',
false,
'min-width: 250px;width: 70%;'
).ui_print_input_placeholder(
__('Only for type Quiet for downtimes.'),
true
),
[
'div_class' => 'available_modules flex-column',
'div_style' => 'flex: 33',
]
);
$table->data[6][0] = html_print_div(
[
'style' => 'flex-direction: row;align-items: flex-start;',
'content' => $availableModules,
],
true
); );
// Print agent table. // Print agent table.
if ($id_downtime > 0) {
echo "<form method=post action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
} else {
echo '<form method="POST" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor">';
}
html_print_table($table); html_print_table($table);
echo '<br /><br /><br />'; $buttons = '';
html_print_input_hidden('id_agent', $id_agent); html_print_input_hidden('id_agent', $id_agent);
echo '<div class="action-buttons w100p" >';
if ($id_downtime > 0) { if ($id_downtime > 0) {
html_print_input_hidden('update_downtime', 1); html_print_input_hidden('update_downtime', 1);
html_print_input_hidden('id_downtime', $id_downtime); html_print_input_hidden('id_downtime', $id_downtime);
html_print_submit_button( $buttons .= html_print_submit_button(
__('Update'), __('Update'),
'updbutton', 'updbutton',
false, false,
'class="sub upd"' ['icon' => 'update'],
true
); );
} else { } else {
html_print_input_hidden('create_downtime', 1); html_print_input_hidden('create_downtime', 1);
html_print_submit_button( $buttons .= html_print_submit_button(
__('Add'), __('Add'),
'crtbutton', 'crtbutton',
false, false,
'class="sub wand"' ['icon' => 'wand'],
true
); );
} }
echo '</div>'; html_print_action_buttons(
$buttons
);
html_print_input_hidden('all_common_modules', ''); html_print_input_hidden('all_common_modules', '');
echo '</form>'; echo '</form>';
@ -1208,11 +1358,17 @@ if (empty($downtimes_agents)) {
$table->head[2] = __('OS'); $table->head[2] = __('OS');
$table->head[3] = __('Last contact'); $table->head[3] = __('Last contact');
$table->head['count_modules'] = __('Modules'); $table->head['count_modules'] = __('Modules');
$table->align = [];
$table->align[0] = 'center';
$table->align[1] = 'center';
$table->align[2] = 'center';
$table->align[3] = 'center';
$table->align[4] = 'center';
if (!$running) { if (!$running) {
$table->head[5] = __('Actions'); $table->head[5] = __('Actions');
$table->align[5] = 'center'; $table->align[5] = 'right';
$table->size[5] = '5%'; $table->size[5] = '10%';
} }
foreach ($downtimes_agents as $downtime_agent) { foreach ($downtimes_agents as $downtime_agent) {
@ -1232,7 +1388,13 @@ if (empty($downtimes_agents)) {
WHERE id_grupo = '.$downtime_agent['id_grupo'] WHERE id_grupo = '.$downtime_agent['id_grupo']
); );
$data[2] = ui_print_os_icon($downtime_agent['id_os'], true, true); $data[2] = html_print_div(
[
'class' => 'main_menu_icon invert_filter',
'content' => ui_print_os_icon($downtime_agent['id_os'], false, true),
],
true
);
$data[3] = $downtime_agent['ultimo_contacto']; $data[3] = $downtime_agent['ultimo_contacto'];
@ -1251,10 +1413,10 @@ if (empty($downtimes_agents)) {
if (!$running) { if (!$running) {
$data[5] = ''; $data[5] = '';
if ($type_downtime !== 'disable_agents') { if ($type_downtime !== 'disable_agents') {
$data[5] = '<a href="javascript:show_editor_module('.$downtime_agent['id_agente'].');">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter']).'</a>'; $data[5] = '<a href="javascript:show_editor_module('.$downtime_agent['id_agente'].');">'.html_print_image('images/edit.svg', true, ['alt' => __('Edit'), 'class' => 'main_menu_icon invert_filter']).'</a>';
} }
$data[5] .= '<a href="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor&id_agent='.$downtime_agent['id_agente'].'&delete_downtime_agent=1&id_downtime_agent='.$downtime_agent['id'].'&id_downtime='.$id_downtime.'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter']).'</a>'; $data[5] .= '<a href="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor&id_agent='.$downtime_agent['id_agente'].'&delete_downtime_agent=1&id_downtime_agent='.$downtime_agent['id'].'&id_downtime='.$id_downtime.'">'.html_print_image('images/delete.svg', true, ['alt' => __('Delete'), 'class' => 'main_menu_icon invert_filter']).'</a>';
} }
$table->data['agent_'.$downtime_agent['id_agente']] = $data; $table->data['agent_'.$downtime_agent['id_agente']] = $data;
@ -1263,17 +1425,7 @@ if (empty($downtimes_agents)) {
html_print_table($table); html_print_table($table);
} }
$table = new stdClass(); ui_print_spinner('Loading');
$table->id = 'loading';
$table->width = '100%';
$table->colspan['loading'][0] = '6';
$table->style[0] = 'text-align: center;';
$table->data = [];
$table->data['loading'] = [];
$table->data['loading'][0] = html_print_image('images/spinner.gif', true);
echo "<div class='invisible'>";
html_print_table($table);
echo '</div>';
$table = new stdClass(); $table = new stdClass();
$table->id = 'editor'; $table->id = 'editor';
@ -1577,13 +1729,13 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
switch ($("#type_downtime").val()) { switch ($("#type_downtime").val()) {
case 'disable_agents_alerts': case 'disable_agents_alerts':
case 'disable_agents': case 'disable_agents':
$("#available_modules").hide(); $(".available_modules").hide();
$("#available_modules_selection_mode").hide(); $(".available_modules_selection_mode").hide();
break; break;
case 'quiet': case 'quiet':
case 'disable_agent_modules': case 'disable_agent_modules':
$("#available_modules_selection_mode").show(); $(".available_modules_selection_mode").show();
$("#available_modules").show(); $(".available_modules").show();
break; break;
} }
} }

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -89,7 +89,7 @@ if (is_ajax() === true) {
[ [
'id' => 'agent_modules_affected_planned_downtime', 'id' => 'agent_modules_affected_planned_downtime',
'class' => 'info_table', 'class' => 'info_table',
'style' => 'width: 100%', 'style' => 'width: 99%',
'columns' => $columns, 'columns' => $columns,
'column_names' => $column_names, 'column_names' => $column_names,
'ajax_url' => 'godmode/agentes/planned_downtime.list', 'ajax_url' => 'godmode/agentes/planned_downtime.list',
@ -103,6 +103,7 @@ if (is_ajax() === true) {
], ],
'search_button_class' => 'sub filter float-right', 'search_button_class' => 'sub filter float-right',
'form' => [ 'form' => [
'class' => 'filter-table-adv',
'inputs' => [ 'inputs' => [
[ [
'label' => __('Agents'), 'label' => __('Agents'),
@ -207,13 +208,23 @@ if ($migrate_malformed === true) {
} }
// Header. // Header.
ui_print_page_header( ui_print_standard_header(
__('Scheduled Downtime'), __('Scheduled Downtime'),
'images/gm_monitoring.png', 'images/gm_monitoring.png',
false, false,
'', '',
true, true,
'' [],
[
[
'link' => '',
'label' => __('Tools'),
],
[
'link' => '',
'label' => __('Scheduled Downtime'),
],
],
); );
$id_downtime = (int) get_parameter('id_downtime', 0); $id_downtime = (int) get_parameter('id_downtime', 0);
@ -308,34 +319,8 @@ $filter_params['module_name'] = $module_name;
$filter_params_str = http_build_query($filter_params); $filter_params_str = http_build_query($filter_params);
// Table filter. // From/To inputs.
$table_form = new StdClass(); $date_inputs = html_print_input_text(
$table_form->class = 'databox filters';
$table_form->width = '100%';
$table_form->rowstyle = [];
$table_form->cellstyle[0] = ['width: 100px;'];
$table_form->cellstyle[1] = ['width: 100px;'];
$table_form->cellstyle[1][2] = 'display: flex; align-items: center;';
$table_form->cellstyle[2] = ['width: 100px;'];
$table_form->cellstyle[3] = ['text-align: right;'];
$table_form->colspan[3][0] = 3;
$table_form->data = [];
$row = [];
// Search text.
$row[] = __('Search');
$row[] = html_print_input_text(
'search_text',
$search_text,
'',
50,
250,
true
);
// Dates.
$date_inputs = __('From').'&nbsp;'.html_print_input_text(
'date_from', 'date_from',
$date_from, $date_from,
'', '',
@ -343,8 +328,8 @@ $date_inputs = __('From').'&nbsp;'.html_print_input_text(
10, 10,
true true
); );
$date_inputs .= '&nbsp;&nbsp;'; $date_inputs .= '&nbsp;'.__('To').'&nbsp;';
$date_inputs .= __('To').'&nbsp;'.html_print_input_text( $date_inputs .= html_print_input_text(
'date_to', 'date_to',
$date_to, $date_to,
'', '',
@ -352,11 +337,6 @@ $date_inputs .= __('To').'&nbsp;'.html_print_input_text(
10, 10,
true true
); );
$row[] = $date_inputs;
$table_form->data[] = $row;
$row = [];
// Execution type. // Execution type.
$execution_type_fields = [ $execution_type_fields = [
@ -364,29 +344,6 @@ $execution_type_fields = [
'periodically' => __('Periodically'), 'periodically' => __('Periodically'),
'cron' => __('Cron'), 'cron' => __('Cron'),
]; ];
$row[] = __('Execution type');
$row[] = html_print_select(
$execution_type_fields,
'execution_type',
$execution_type,
'',
__('Any'),
'',
true,
false,
false
);
// Show past downtimes.
$row[] = __('Show past downtimes').'&nbsp;&nbsp;&nbsp;&nbsp;'.html_print_switch(
[
'name' => 'archived',
'value' => $show_archived,
]
);
$table_form->data[] = $row;
$row = [];
// Agent. // Agent.
$params = []; $params = [];
@ -397,36 +354,89 @@ $params['return'] = true;
$params['print_hidden_input_idagent'] = true; $params['print_hidden_input_idagent'] = true;
$params['hidden_input_idagent_name'] = 'agent_id'; $params['hidden_input_idagent_name'] = 'agent_id';
$params['hidden_input_idagent_value'] = $agent_id; $params['hidden_input_idagent_value'] = $agent_id;
$row[] = __('Agent');
$row[] = ui_print_agent_autocomplete_input($params);
// Module. // Table filter.
$row[] = __('Module').'&nbsp;'.html_print_autocomplete_modules( $table_form = new stdClass();
'module_name', $table_form->class = 'filter-table-adv';
$module_name, $table_form->id = 'filter_scheduled_downtime';
false, $table_form->width = '100%';
true, $table_form->rowstyle = [];
'', $table_form->cellstyle[0] = ['width: 100px;'];
[], $table_form->cellstyle[1] = ['width: 100px;'];
true $table_form->cellstyle[1][2] = 'display: flex; align-items: center;';
); $table_form->cellstyle[2] = ['width: 100px;'];
$table_form->cellstyle[3] = ['text-align: right;'];
$table_form->data[] = $row; $table_form->data = [];
// Search text.
$row = []; $table_form->data[0][] = html_print_label_input_block(
$row[] = html_print_submit_button(
__('Search'), __('Search'),
'search', html_print_input_text(
false, 'search_text',
[ $search_text,
'icon' => 'search', '',
'mode' => 'mini', 50,
], 250,
true true
)
);
// From / To.
$table_form->data[0][] = html_print_label_input_block(
__('Between dates'),
html_print_div(
[
'class' => 'flex-content-left',
'content' => $date_inputs,
],
true
)
);
// Show past downtimes.
$table_form->data[0][] = html_print_label_input_block(
__('Show past downtimes'),
html_print_switch(
[
'name' => 'archived',
'value' => $show_archived,
]
)
);
// Execution type.
$table_form->data[1][] = html_print_label_input_block(
__('Execution type'),
html_print_select(
$execution_type_fields,
'execution_type',
$execution_type,
'',
__('Any'),
'',
true,
false,
false
)
);
$table_form->data[1][] = html_print_label_input_block(
__('Agent'),
ui_print_agent_autocomplete_input($params)
);
$table_form->data[1][] = html_print_label_input_block(
__('Module'),
html_print_autocomplete_modules(
'module_name',
$module_name,
false,
true,
'',
[],
true,
0,
30,
true
)
); );
$table_form->data[] = $row;
// End of table filter. // End of table filter.
// Useful to know if the user has done a form filtering. // Useful to know if the user has done a form filtering.
$filter_performed = false; $filter_performed = false;
@ -629,41 +639,86 @@ if ($downtimes === false && $filter_performed === false) {
// No downtimes cause the user performed a search. // No downtimes cause the user performed a search.
// Filter form. // Filter form.
echo '<form method="post" action="'.$url_list.'">'; echo '<form method="post" action="'.$url_list.'">';
html_print_table($table_form); $outputTable = html_print_table($table_form, true);
$outputTable .= html_print_div(
[
'class' => 'action-buttons-right-forced',
'content' => html_print_submit_button(
__('Filter'),
'search',
false,
[
'icon' => 'search',
'mode' => 'mini',
],
true
),
],
true
);
ui_toggle(
$outputTable,
'<span class="subsection_header_title">'.__('Filters').'</span>',
__('Filters'),
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
echo '</form>'; echo '</form>';
// Info message. // Info message.
echo '<div class="nf">'.__('No scheduled downtime').'</div>'; ui_print_info_message(__('No scheduled downtime'));
// Create button. // Create button.
if ($write_permisson === true) { if ($write_permisson === true) {
echo '<form method="post" class="display_in" action="'.$url_editor.'">'; echo '<form method="post" class="display_in" action="'.$url_editor.'">';
html_print_div( html_print_action_buttons(
[ html_print_submit_button(
'class' => 'action-buttons', __('Create'),
'content' => html_print_submit_button( 'create',
__('Create'), false,
'create', ['icon' => 'next'],
false, true
['icon' => 'next'], )
true
),
]
); );
echo '</form>'; echo '</form>';
} }
} else { } else {
// Has downtimes. // Has downtimes.
echo '<form method="post" action="'.$url_list.'">'; echo '<form method="post" action="'.$url_list.'">';
html_print_table($table_form); $outputTable = html_print_table($table_form, true);
$outputTable .= html_print_div(
[
'class' => 'action-buttons-right-forced',
'content' => html_print_submit_button(
__('Search'),
'search',
false,
[
'icon' => 'search',
'mode' => 'mini',
],
true
),
],
true
);
ui_toggle(
$outputTable,
'<span class="subsection_header_title">'.__('Filters').'</span>',
__('Filters'),
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
echo '</form>'; echo '</form>';
ui_pagination(
$downtimes_number,
$url_list.'&'.$filter_params_str,
$offset
);
// User groups with AR, AD or AW permission. // User groups with AR, AD or AW permission.
$groupsAD = users_get_groups($config['id_user'], $access); $groupsAD = users_get_groups($config['id_user'], $access);
$groupsAD = array_keys($groupsAD); $groupsAD = array_keys($groupsAD);
@ -762,17 +817,17 @@ if ($downtimes === false && $filter_performed === false) {
$settings = [ $settings = [
'url' => ui_get_full_url('ajax.php', false, false, false), 'url' => ui_get_full_url('ajax.php', false, false, false),
'loadingText' => __('Loading, this operation might take several minutes...'), 'loadingText' => __('Loading, this operation might take several minutes...'),
'title' => __('Agents / Modules affected'), 'title' => __('Elements affected'),
'id' => $downtime['id'], 'id' => $downtime['id'],
]; ];
$data['agents_modules'] = '<a href="#" onclick=\'dialogAgentModulesAffected('.json_encode($settings).')\'>'; $data['agents_modules'] = '<a href="#" onclick=\'dialogAgentModulesAffected('.json_encode($settings).')\'>';
$data['agents_modules'] .= html_print_image( $data['agents_modules'] .= html_print_image(
'images/search_big.png', 'images/details.svg',
true, true,
[ [
'title' => __('Agents and modules affected'), 'title' => __('Agents and modules affected'),
'style' => 'width:22px; height: 22px;', 'class' => 'main_menu_icon invert_filter',
] ]
); );
$data['agents_modules'] .= '</a>'; $data['agents_modules'] .= '</a>';
@ -789,15 +844,21 @@ if ($downtimes === false && $filter_performed === false) {
$url_list_params = $url_list.'&stop_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str; $url_list_params = $url_list.'&stop_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str;
$data['stop'] = '<a href="'.$url_list_params.'">'; $data['stop'] = '<a href="'.$url_list_params.'">';
$data['stop'] .= html_print_image( $data['stop'] .= html_print_image(
'images/cancel.png', 'images/fail@svg.svg',
true, true,
['title' => __('Stop downtime')] [
'title' => __('Stop downtime'),
'class' => 'main_menu_icon invert_filter',
]
); );
} else { } else {
$data['stop'] = html_print_image( $data['stop'] = html_print_image(
'images/cancel.png', 'images/fail@svg.svg',
true, true,
['title' => __('Stop downtime')] [
'title' => __('Stop downtime'),
'class' => 'main_menu_icon invert_filter',
]
); );
} }
} else { } else {
@ -812,11 +873,11 @@ if ($downtimes === false && $filter_performed === false) {
// Copy. // Copy.
$data['copy'] = '<a href="'.$url_editor.'&downtime_copy=1&id_downtime='.$downtime['id'].'">'; $data['copy'] = '<a href="'.$url_editor.'&downtime_copy=1&id_downtime='.$downtime['id'].'">';
$data['copy'] .= html_print_image( $data['copy'] .= html_print_image(
'images/copy.png', 'images/copy.svg',
true, true,
[ [
'title' => __('Copy'), 'title' => __('Copy'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
); );
$data['copy'] .= '</a>'; $data['copy'] .= '</a>';
@ -824,11 +885,11 @@ if ($downtimes === false && $filter_performed === false) {
// Edit. // Edit.
$data['edit'] = '<a href="'.$url_editor.'&edit_downtime=1&id_downtime='.$downtime['id'].'">'; $data['edit'] = '<a href="'.$url_editor.'&edit_downtime=1&id_downtime='.$downtime['id'].'">';
$data['edit'] .= html_print_image( $data['edit'] .= html_print_image(
'images/config.png', 'images/configuration@svg.svg',
true, true,
[ [
'title' => __('Update'), 'title' => __('Update'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
); );
$data['edit'] .= '</a>'; $data['edit'] .= '</a>';
@ -837,11 +898,11 @@ if ($downtimes === false && $filter_performed === false) {
$url_delete = $url_list.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str; $url_delete = $url_list.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str;
$data['delete'] = '<a id="delete_downtime" href="'.$url_delete.'">'; $data['delete'] = '<a id="delete_downtime" href="'.$url_delete.'">';
$data['delete'] .= html_print_image( $data['delete'] .= html_print_image(
'images/cross.png', 'images/delete.svg',
true, true,
[ [
'title' => __('Delete'), 'title' => __('Delete'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
); );
$data['delete'] .= '</a>'; $data['delete'] .= '</a>';
@ -858,22 +919,22 @@ if ($downtimes === false && $filter_performed === false) {
// Copy. // Copy.
$data['copy'] = '<a href="'.$url_editor.'&downtime_copy=1&id_downtime='.$downtime['id'].'">'; $data['copy'] = '<a href="'.$url_editor.'&downtime_copy=1&id_downtime='.$downtime['id'].'">';
$data['copy'] .= html_print_image( $data['copy'] .= html_print_image(
'images/copy.png', 'images/copy.svg',
true, true,
[ [
'title' => __('Copy'), 'title' => __('Copy'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
); );
$data['copy'] .= '</a>'; $data['copy'] .= '</a>';
// Edit. // Edit.
$data['edit'] = '<a href="'.$url_editor.'&edit_downtime=1&id_downtime='.$downtime['id'].'">'; $data['edit'] = '<a href="'.$url_editor.'&edit_downtime=1&id_downtime='.$downtime['id'].'">';
$data['edit'] .= html_print_image( $data['edit'] .= html_print_image(
'images/config.png', 'images/configuration@svg.svg',
true, true,
[ [
'title' => __('Update'), 'title' => __('Update'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
); );
$data['edit'] .= '</a>'; $data['edit'] .= '</a>';
@ -910,44 +971,47 @@ if ($downtimes === false && $filter_performed === false) {
} }
html_print_table($table); html_print_table($table);
ui_pagination( $tablePagination = ui_pagination(
$downtimes_number, $downtimes_number,
$url_list.'&'.$filter_params_str, $url_list.'&'.$filter_params_str,
$offset, $offset,
0, 0,
false,
'offset',
true, true,
'pagination-bottom' 'offset',
false
); );
echo '<div class="action-buttons" style="width: '.$table->width.'">'; $actionsButtons = '';
// CSV export button.
echo '<div class="display_in">';
html_print_button(
__('Export to CSV'),
'csv_export',
false,
'blockResubmit($(this)); location.href=\'godmode/agentes/planned_downtime.export_csv.php?'.$filter_params_str.'\'',
'class="sub next"'
);
echo '</div>';
// Create button. // Create button.
if ($write_permisson === true) { if ($write_permisson === true) {
echo '&nbsp;'; $actionsButtons .= '<form method="post" action="'.$url_editor.'" class="display_in" >';
echo '<form method="post" action="'.$url_editor.'" class="display_in" >'; $actionsButtons .= html_print_submit_button(
html_print_submit_button(
__('Create'), __('Create'),
'create', 'create',
false, false,
'class="sub next"' ['icon' => 'next'],
true
); );
echo '</form>'; $actionsButtons .= '</form>';
} }
echo '</div>'; // CSV export button.
$actionsButtons .= html_print_button(
__('Export to CSV'),
'csv_export',
false,
'blockResubmit($(this)); location.href="godmode/agentes/planned_downtime.export_csv.php?'.$filter_params_str.'"',
[
'icon' => 'load',
'mode' => 'secondary',
],
true
);
html_print_action_buttons(
$actionsButtons,
[ 'right_content' => $tablePagination ]
);
} }
ui_require_jquery_file( ui_require_jquery_file(

View File

@ -171,10 +171,10 @@ if (is_ajax()) {
$ffield = $editor_type_chkbx; $ffield = $editor_type_chkbx;
$ffield .= html_print_textarea( $ffield .= html_print_textarea(
'field'.$i.'_value', 'field'.$i.'_value',
1, 5,
1, 1,
'', '',
'class="fields"', 'class="fields w100p"',
true, true,
'', '',
$is_management_allowed $is_management_allowed
@ -208,7 +208,7 @@ if (is_ajax()) {
$rfield = $editor_type_chkbx; $rfield = $editor_type_chkbx;
$rfield .= html_print_textarea( $rfield .= html_print_textarea(
'field'.$i.'_recovery_value', 'field'.$i.'_recovery_value',
1, 5,
1, 1,
'', '',
'class="fields_recovery"', 'class="fields_recovery"',
@ -307,7 +307,8 @@ if (is_ajax()) {
false, false,
false, false,
'fields', 'fields',
$is_management_allowed $is_management_allowed,
'width: 100%;'
); );
$rfield .= html_print_select( $rfield .= html_print_select(
@ -321,7 +322,8 @@ if (is_ajax()) {
false, false,
false, false,
'fields', 'fields',
$is_management_allowed $is_management_allowed,
'width: 100%;'
); );
$ffield .= html_print_input_text('field'.$i.'_value[]', '', '', 10, 10, true, false, false, '', 'datepicker'); $ffield .= html_print_input_text('field'.$i.'_value[]', '', '', 10, 10, true, false, false, '', 'datepicker');
@ -329,7 +331,7 @@ if (is_ajax()) {
$ffield .= html_print_textarea( $ffield .= html_print_textarea(
'field'.$i.'_value[]', 'field'.$i.'_value[]',
1, 5,
1, 1,
'', '',
'style="min-height:40px; '.$style.'" class="fields"', 'style="min-height:40px; '.$style.'" class="fields"',
@ -341,7 +343,7 @@ if (is_ajax()) {
$rfield .= html_print_textarea( $rfield .= html_print_textarea(
'field'.$i.'_recovery_value[]', 'field'.$i.'_recovery_value[]',
1, 5,
1, 1,
'', '',
'style="min-height:40px; '.$style.'" class="fields_recovery', 'style="min-height:40px; '.$style.'" class="fields_recovery',
@ -484,20 +486,20 @@ if (is_ajax()) {
} else { } else {
$ffield = html_print_textarea( $ffield = html_print_textarea(
'field'.$i.'_value', 'field'.$i.'_value',
1, 5,
1, 1,
$fv[0], $fv[0],
'style="'.$style.'" class="fields min-height-40px"', 'style="'.$style.'" class="fields min-height-40px w100p"',
true, true,
'', '',
$is_management_allowed $is_management_allowed
); );
$rfield = html_print_textarea( $rfield = html_print_textarea(
'field'.$i.'_recovery_value', 'field'.$i.'_recovery_value',
1, 5,
1, 1,
$fv[0], $fv[0],
'style="'.$style.'" class="fields_recovery min-height-40px', 'style="'.$style.'" class="fields_recovery min-height-40px w100p',
true, true,
'', '',
$is_management_allowed $is_management_allowed
@ -507,20 +509,20 @@ if (is_ajax()) {
} else { } else {
$ffield = html_print_textarea( $ffield = html_print_textarea(
'field'.$i.'_value', 'field'.$i.'_value',
1, 5,
1, 1,
'', '',
'style="'.$style.'" class="fields min-height-40px"', 'style="'.$style.'" class="fields min-height-40px w100p"',
true, true,
'', '',
$is_management_allowed $is_management_allowed
); );
$rfield = html_print_textarea( $rfield = html_print_textarea(
'field'.$i.'_recovery_value', 'field'.$i.'_recovery_value',
1, 5,
1, 1,
'', '',
'style="'.$style.'" class="fields_recovery min-height-40px"', 'style="'.$style.'" class="fields_recovery min-height-40px w100p"',
true, true,
'', '',
$is_management_allowed $is_management_allowed
@ -533,7 +535,7 @@ if (is_ajax()) {
$fields_rows[$i] = ''; $fields_rows[$i] = '';
} else { } else {
$fields_rows[$i] = '<tr id="table_macros-field'.$i.'" class="datos">'; $fields_rows[$i] = '<tr id="table_macros-field'.$i.'" class="datos">';
$fields_rows[$i] .= '<td class="datos bolder w20p">'.$fdesc.'</td>'; $fields_rows[$i] .= '<td class="datos bolder w20p" style="font-size: 13px;">'.$fdesc.'</td>';
$fields_rows[$i] .= '<td class="datos">'.$ffield.'</td>'; $fields_rows[$i] .= '<td class="datos">'.$ffield.'</td>';
if ($get_recovery_fields) { if ($get_recovery_fields) {
$fields_rows[$i] .= '<td class="datos recovery_col">'.$rfield.'</td>'; $fields_rows[$i] .= '<td class="datos recovery_col">'.$rfield.'</td>';
@ -575,12 +577,19 @@ if ($update_command) {
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
alerts_meta_print_header(); alerts_meta_print_header();
} else { } else {
ui_print_page_header( ui_print_standard_header(
__('Alerts').' &raquo; '.__('Alert commands'), __('Alerts'),
'images/gm_alerts.png', 'images/gm_alerts.png',
false, false,
'', '',
true true,
[],
[
[
'link' => '',
'label' => __('Alert commands'),
],
]
); );
} }
@ -811,10 +820,9 @@ foreach ($commands as $command) {
array_push($table->data, $data); array_push($table->data, $data);
} }
ui_pagination($total_commands, $url);
if (isset($data) === true && count($table->data) > 0) { if (isset($data) === true && count($table->data) > 0) {
html_print_table($table); html_print_table($table);
ui_pagination($total_commands, $url, 0, 0, false, 'offset', true, 'pagination-bottom'); $pagination = ui_pagination($total_commands, $url, 0, 0, true, 'offset', false, '');
} else { } else {
ui_print_info_message( ui_print_info_message(
[ [
@ -826,12 +834,17 @@ if (isset($data) === true && count($table->data) > 0) {
// Commands can only be created by the super administrator. // Commands can only be created by the super administrator.
if (users_is_admin() === true) { if (users_is_admin() === true) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">'; echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); $buttonSubmit = html_print_submit_button(
__('Create'),
'create',
false,
['icon' => 'wand'],
true
);
html_print_input_hidden('create_alert', 1); html_print_input_hidden('create_alert', 1);
html_print_action_buttons($buttonSubmit, ['right_content' => $pagination]);
echo '</form>'; echo '</form>';
echo '</div>';
} }
?> ?>

View File

@ -68,12 +68,19 @@ if ($al_action !== false) {
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
alerts_meta_print_header(); alerts_meta_print_header();
} else { } else {
ui_print_page_header( ui_print_standard_header(
__('Alerts').' &raquo; '.__('Configure alert action'), __('Alerts'),
'images/gm_alerts.png', 'images/gm_alerts.png',
false, false,
'alert_config', '',
true true,
[],
[
[
'link' => '',
'label' => __('Configure alert action'),
],
]
); );
} }
} else { } else {
@ -81,12 +88,19 @@ if ($al_action !== false) {
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
alerts_meta_print_header(); alerts_meta_print_header();
} else { } else {
ui_print_page_header( ui_print_standard_header(
__('Alerts').' &raquo; '.__('Configure alert action'), __('Alerts'),
'images/gm_alerts.png', 'images/gm_alerts.png',
false, false,
'alert_config', '',
true true,
[],
[
[
'link' => '',
'label' => __('Configure alert action'),
],
]
); );
} }
@ -290,73 +304,99 @@ $table->data[1][1] = html_print_label_input_block(
) )
); );
$table->data[2][0] = html_print_label_input_block( $table_macros = new stdClass();
$table_macros->id = 'table_macros';
$table_macros->width = '100%';
$table_macros->class = 'databox filters filter-table-adv';
$table_macros->style = [];
$table_macros->size = [];
$table_macros->size[0] = '20%';
$table_macros->size[1] = '40%';
$table_macros->size[2] = '40%';
$table_macros->data = [];
$table_macros->data[0][0] = '';
$table_macros->data[0][1] = html_print_label_input_block(
__('Triggering'),
''
);
$table_macros->data[0][2] = html_print_label_input_block(
__('Recovery'), __('Recovery'),
'' ''
); );
$table->data[2][1] = html_print_label_input_block( $table_macros->data[1][0] = html_print_label_input_block(
__('Recovery'), __('Command preview'),
'' ''
); );
$table->data[5][0] = __('Command preview'); $table_macros->data[1][1] = html_print_label_input_block(
$table->data[5][1] = html_print_textarea(
'command_preview',
5,
30,
'', '',
'disabled="disabled"', html_print_textarea(
true 'command_preview',
5,
30,
'',
'disabled="disabled"',
true
)
); );
$table->data[5][2] = html_print_textarea(
'command_recovery_preview', $table_macros->data[1][2] = html_print_label_input_block(
5,
30,
'', '',
'disabled="disabled"', html_print_textarea(
true 'command_recovery_preview',
5,
30,
'',
'disabled="disabled"',
true
)
); );
// Selector will work only with Integria activated. // Selector will work only with Integria activated.
$integriaIdName = 'integria_wu'; $integriaIdName = 'integria_wu';
$table->data[$integriaIdName][0] = __('Create workunit on recovery').ui_print_help_tip( $table_macros->colspan[$integriaIdName][0] = 3;
__('If closed status is set on recovery, a workunit will be added to the ticket in Integria IMS rather that closing the ticket.'), $table_macros->data[$integriaIdName][0] = html_print_label_input_block(
true __('Create workunit on recovery').ui_print_help_tip(
); __('If closed status is set on recovery, a workunit will be added to the ticket in Integria IMS rather that closing the ticket.'),
$table->data[$integriaIdName][1] = html_print_checkbox_switch_extended( true
'create_wu_integria', ),
1, html_print_checkbox_switch_extended(
$create_wu_integria, 'create_wu_integria',
false, 1,
'', $create_wu_integria,
$disabled_attr, false,
true '',
$disabled_attr,
true
)
); );
for ($i = 1; $i <= $config['max_macro_fields']; $i++) { for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$table->data['field'.$i][0] = html_print_image( $table_macros->data['field'.$i][0] = html_print_image(
'images/spinner.gif', 'images/spinner.gif',
true true
); );
$table->data['field'.$i][1] = html_print_image( $table_macros->data['field'.$i][1] = html_print_image(
'images/spinner.gif', 'images/spinner.gif',
true true
); );
$table->data['field'.$i][2] = html_print_image( $table_macros->data['field'.$i][2] = html_print_image(
'images/spinner.gif', 'images/spinner.gif',
true true
); );
// Store the value in a hidden to keep it on first execution // Store the value in a hidden to keep it on first execution
$table->data['field'.$i][1] .= html_print_input_hidden( $table_macros->data['field'.$i][1] .= html_print_input_hidden(
'field'.$i.'_value', 'field'.$i.'_value',
(!empty($action['field'.$i]) || $action['field'.$i] == 0) ? $action['field'.$i] : '', (!empty($action['field'.$i]) || $action['field'.$i] == 0) ? $action['field'.$i] : '',
true, true,
'', '',
$disabled_attr $disabled_attr
); );
$table->data['field'.$i][2] .= html_print_input_hidden( $table_macros->data['field'.$i][2] .= html_print_input_hidden(
'field'.$i.'_recovery_value', 'field'.$i.'_recovery_value',
(!empty($action['field'.$i.'_recovery']) || $action['field'.$i] == 0) ? $action['field'.$i.'_recovery'] : '', (!empty($action['field'.$i.'_recovery']) || $action['field'.$i] == 0) ? $action['field'.$i.'_recovery'] : '',
true, true,
@ -369,10 +409,12 @@ $offset = (int) get_parameter('offset', 0);
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&pure='.$pure.'&offset='.$offset.'" class="max_floating_element_size">'; echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&pure='.$pure.'&offset='.$offset.'" class="max_floating_element_size">';
$table_html = html_print_table($table, true); $table_html = html_print_table($table, true);
$table_html_macros = html_print_table($table_macros, true);
$backButton = ''; $backButton = '';
$submitButton = ''; $submitButton = '';
echo $table_html; echo $table_html;
echo $table_html_macros;
if ($is_management_allowed === true) { if ($is_management_allowed === true) {
if ($id) { if ($id) {
html_print_input_hidden('id', $id); html_print_input_hidden('id', $id);

View File

@ -54,12 +54,19 @@ $alert = [];
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
alerts_meta_print_header(); alerts_meta_print_header();
} else { } else {
ui_print_page_header( ui_print_standard_header(
__('Alerts').' &raquo; '.__('Configure alert command'), __('Alerts'),
'images/gm_alerts.png', 'images/gm_alerts.png',
false, false,
'', '',
true true,
[],
[
[
'link' => '',
'label' => __('Configure alert command'),
],
]
); );
} }
@ -199,112 +206,23 @@ if ($is_management_allowed === false) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters filter-table-adv';
if (is_metaconsole() === true) {
$table->head[0] = ($id) ? __('Update Command') : __('Create Command');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
}
$table->style = []; $table->style = [];
if (is_metaconsole() === false) {
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
$table->style[4] = 'font-weight: bold';
}
$table->size = []; $table->size = [];
$table->size[0] = '20%'; $table->size[0] = '45%';
$table->size[1] = '45%';
$table->size[2] = '10%';
$table->data = []; $table->data = [];
$table->colspan['name'][1] = 3; $table->data[0][0] = html_print_label_input_block(
$table->data['name'][0] = __('Name'); __('Name'),
$table->data['name'][2] = html_print_input_text( html_print_input_text(
'name', 'name',
$name, $name,
'',
35,
255,
true,
false,
false,
'',
'',
'',
'',
false,
'',
'',
'',
!$is_management_allowed
);
$table->colspan['command'][1] = 3;
$table->data['command'][0] = __('Command');
$table->data['command'][1] = html_print_textarea(
'command',
8,
30,
$command,
'',
true,
'',
!$is_management_allowed
);
$return_all_group = false;
if (users_can_manage_group_all('LM') === true) {
$return_all_group = true;
}
$table->colspan['group'][1] = 3;
$table->data['group'][0] = __('Group');
$table->data['group'][1] = '<div class="w250px inline">'.html_print_select_groups(
false,
'LM',
$return_all_group,
'id_group',
$id_group,
false,
'',
0,
true,
false,
true,
'',
!$is_management_allowed
).'</div>';
$table->colspan['description'][1] = 3;
$table->data['description'][0] = __('Description');
$table->data['description'][1] = html_print_textarea(
'description',
10,
30,
$description,
'',
true,
'',
!$is_management_allowed
);
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$table->data['field'.$i][0] = sprintf(__('Field %s description'), $i);
if (empty($fields_descriptions) === false) {
$field_description = $fields_descriptions[($i - 1)];
} else {
$field_description = '';
}
$table->data['field'.$i][1] = html_print_input_text(
'field'.$i.'_description',
$field_description,
'', '',
30, 35,
255, 255,
true, true,
false, false,
@ -318,12 +236,91 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
'', '',
'', '',
!$is_management_allowed !$is_management_allowed
); )
);
$table->data['field'.$i][2] = sprintf(__('Field %s values'), $i); if (users_can_manage_group_all('LM') === true) {
$table->data['field'.$i][2] .= ui_print_help_tip( $return_all_group = true;
__('value1,tag1;value2,tag2;value3,tag3'), }
true
$table->data[0][1] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'LM',
$return_all_group,
'id_group',
$id_group,
false,
'',
0,
true,
false,
true,
'',
!$is_management_allowed
)
);
$table->data[1][0] = html_print_label_input_block(
__('Command'),
html_print_textarea(
'command',
8,
30,
$command,
'',
true,
'',
!$is_management_allowed
)
);
$return_all_group = false;
$table->data[1][1] = html_print_label_input_block(
__('Description'),
html_print_textarea(
'description',
8,
30,
$description,
'',
true,
'',
!$is_management_allowed
)
);
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
if (empty($fields_descriptions) === false) {
$field_description = $fields_descriptions[($i - 1)];
} else {
$field_description = '';
}
$table->data['field'.$i][0] = html_print_label_input_block(
sprintf(__('Field %s description'), $i),
html_print_input_text(
'field'.$i.'_description',
$field_description,
'',
30,
255,
true,
false,
false,
'',
'',
'',
'',
false,
'',
'',
'',
!$is_management_allowed
)
); );
if (empty($fields_values) === false) { if (empty($fields_values) === false) {
@ -338,54 +335,72 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$selected = false; $selected = false;
} }
$table->data['field'.$i][3] = html_print_input_text( $table->data['field'.$i][1] = html_print_label_input_block(
'field'.$i.'_values', sprintf(__('Field %s values'), $i).ui_print_help_tip(
$field_values, __('value1,tag1;value2,tag2;value3,tag3'),
'', true
55, ),
1000, html_print_input_text(
true, 'field'.$i.'_values',
false, $field_values,
false, '',
'', 55,
'field_value', 1000,
'', true,
'', false,
false, false,
'', '',
'', 'field_value',
'', '',
!$is_management_allowed '',
false,
'',
'',
'',
!$is_management_allowed
)
); );
$table->data['field'.$i][4] = __('Hide'); $table->data['field'.$i][2] = html_print_label_input_block(
__('Hide'),
$table->data['field'.$i][5] = html_print_checkbox_extended( html_print_checkbox_extended(
'field'.$i.'_hide', 'field'.$i.'_hide',
1, 1,
$selected, $selected,
!$is_management_allowed, !$is_management_allowed,
'cursor: \'pointer\'', 'cursor: \'pointer\'',
'class="hide_inputs"', 'class="hide_inputs"',
true true
)
); );
} }
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_commands&pure='.$pure.'">'; echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_commands&pure='.$pure.'" class="max_floating_element_size">';
html_print_table($table); html_print_table($table);
if ($is_management_allowed === true) { if ($is_management_allowed === true) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ($id) { if ($id) {
html_print_input_hidden('id', $id); html_print_input_hidden('id', $id);
html_print_input_hidden('update_command', 1); html_print_input_hidden('update_command', 1);
html_print_submit_button(__('Update'), 'create', false, 'class="sub upd"'); $buttonSubmit = html_print_submit_button(
__('Update'),
'create',
false,
['icon' => 'wand'],
true
);
} else { } else {
html_print_input_hidden('create_command', 1); html_print_input_hidden('create_command', 1);
html_print_submit_button(__('Create'), 'create', false, 'class="sub wand"'); $buttonSubmit = html_print_submit_button(
__('Create'),
'create',
false,
['icon' => 'wand'],
true
);
} }
echo '</div>'; html_print_action_buttons($buttonSubmit);
} }
echo '</form>'; echo '</form>';

View File

@ -738,14 +738,7 @@ if ($tab == 'tree') {
* Group tree view. * Group tree view.
*/ */
echo html_print_image( ui_print_spinner(__('Loading'));
'images/spinner.gif',
true,
[
'class' => 'loading_tree',
'style' => 'display: none;',
]
);
echo "<div id='tree-controller-recipient'></div>"; echo "<div id='tree-controller-recipient'></div>";
} else { } else {
/* /*
@ -1042,7 +1035,7 @@ $tab = 'group_edition';
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0) if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
treeController.recipient.empty(); treeController.recipient.empty();
$(".loading_tree").show(); showSpinner();
var parameters = {}; var parameters = {};
parameters['page'] = "include/ajax/tree.ajax"; parameters['page'] = "include/ajax/tree.ajax";
@ -1066,7 +1059,7 @@ $tab = 'group_edition';
data: parameters, data: parameters,
success: function(data) { success: function(data) {
if (data.success) { if (data.success) {
$(".loading_tree").hide(); hideSpinner();
treeController.init({ treeController.init({
recipient: $("div#tree-controller-recipient"), recipient: $("div#tree-controller-recipient"),

View File

@ -332,14 +332,16 @@ if ($result === false) {
if ($management_allowed === true) { if ($management_allowed === true) {
// Update module. // Update module.
$data[4] = '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules_form&id_module_inventory='.$row['id_module_inventory'].'">'; $data[4] = '<div class="table_action_buttons">';
$data[4] .= html_print_image('images/config.png', true, ['border' => '0', 'title' => __('Update'), 'class' => 'invert_filter']).'</b></a>'; $data[4] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules_form&id_module_inventory='.$row['id_module_inventory'].'">';
$data[4] .= html_print_image('images/edit.svg', true, ['border' => '0', 'title' => __('Update'), 'class' => 'main_menu_icon invert_filter']).'</b></a>';
// Delete module. // Delete module.
$data[4] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules&delete_inventory_module='.$row['id_module_inventory'].'" onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'; $data[4] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules&delete_inventory_module='.$row['id_module_inventory'].'" onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">';
$data[4] .= html_print_image('images/cross.png', true, ['border' => '0', 'title' => __('Delete'), 'class' => 'invert_filter']); $data[4] .= html_print_image('images/delete.svg', true, ['border' => '0', 'title' => __('Delete'), 'class' => 'main_menu_icon invert_filter']);
$data[4] .= '</b></a>&nbsp;&nbsp;'; $data[4] .= '</b></a>&nbsp;&nbsp;';
$data[4] .= html_print_checkbox_extended('delete_multiple[]', $row['id_module_inventory'], false, false, '', 'class="check_delete"', true); $data[4] .= html_print_checkbox_extended('delete_multiple[]', $row['id_module_inventory'], false, false, '', 'class="check_delete"', true);
$data[4] .= '</div>';
} }
array_push($table->data, $data); array_push($table->data, $data);
@ -349,22 +351,50 @@ if ($result === false) {
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table($table); html_print_table($table);
echo '</form>'; echo '</form>';
$tablePagination = ui_pagination($total_modules, 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules', $offset, 0, true, 'offset', false);
$actionButtons = []; echo '<form id="form_create" method="post" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules_form">';
echo html_print_input_hidden('create_module_inventory', 1);
echo '<form>';
$tablePagination = ui_pagination(
$total_modules,
'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules',
$offset,
0,
true,
'offset',
false
);
$actionButtons = '';
if ($management_allowed === true) { if ($management_allowed === true) {
$actionButtons[] = html_print_submit_button(__('Delete'), 'delete_btn', false, ['icon' => 'delete', 'mode' => 'secondary', 'form' => 'form_delete'], true); $actionButtons .= html_print_submit_button(
$actionButtons[] = html_print_submit_button(__('Create'), 'crt', false, ['icon' => 'wand', 'form' => 'form_create'], true); __('Create'),
'crt',
false,
[
'icon' => 'wand',
'form' => 'form_create',
],
true
);
$actionButtons[] = '<form id="form_create" method="post" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules_form">'; $actionButtons .= html_print_submit_button(
$actionButtons[] = html_print_input_hidden('create_module_inventory', 1, true); __('Delete'),
$actionButtons[] = '<form>'; 'delete_btn',
false,
[
'icon' => 'delete',
'mode' => 'secondary',
'form' => 'form_delete',
],
true
);
} }
html_print_action_buttons( html_print_action_buttons(
implode('', $actionButtons), $actionButtons,
[ [
'type' => 'form_action', 'type' => 'form_action',
'right_content' => $tablePagination, 'right_content' => $tablePagination,

View File

@ -26,22 +26,32 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'],
// Header // Header
if (defined('METACONSOLE')) { if (is_metaconsole() === true) {
$sec = 'advanced'; $sec = 'advanced';
enterprise_include_once('meta/include/functions_components_meta.php'); enterprise_include_once('meta/include/functions_components_meta.php');
components_meta_print_header(); components_meta_print_header();
} else { } else {
$sec = 'gmodules'; $sec = 'gmodules';
ui_print_page_header( ui_print_standard_header(
__('Module management').' » '.__('Inventory modules'), __('Module management'),
'images/op_inventory.png', 'images/op_inventory.png',
false, false,
'', '',
true true,
[],
[
[
'link' => '',
'label' => __('Configuration'),
],
[
'link' => '',
'label' => __('Inventory modules'),
],
]
); );
} }
// Header
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'; $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
if ($is_windows) { if ($is_windows) {
ui_print_error_message(__('Not supported in Windows systems')); ui_print_error_message(__('Not supported in Windows systems'));
@ -95,82 +105,166 @@ if ($id_os == null) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filter-table-adv';
$table->style = []; $table->style = [];
$table->style[0] = 'font-weight: bold'; $table->style[0] = 'width: 50%';
$table->style[1] = 'width: 50%';
$table->data = []; $table->data = [];
$table->data[0][0] = '<strong>'.__('Name').'</strong>';
$table->data[0][1] = html_print_input_text('name', $name, '', 45, 100, true, $disabled); $table->data[0][] = html_print_label_input_block(
$table->data[1][0] = '<strong>'.__('Description').'</strong>'; __('Name'),
$table->data[1][1] = html_print_input_text('description', $description, '', 60, 500, true); html_print_input_text(
$table->data[2][0] = '<strong>'.__('OS').'</strong>'; 'name',
$table->data[2][1] = html_print_select_from_sql( $name,
'SELECT id_os, name FROM tconfig_os ORDER BY name', '',
'id_os', 45,
$id_os, 100,
'', true,
'', $disabled
'', )
$return = true
); );
$table->data[3][0] = '<strong>'.__('Interpreter').'</strong>'; $table->data[0][] = html_print_label_input_block(
$table->data[3][1] = html_print_input_text('interpreter', $interpreter, '', 25, 100, true); __('Description'),
$table->data[3][1] .= ui_print_help_tip(__('Left blank for the LOCAL inventory modules'), true); html_print_input_text(
'description',
$description,
'',
60,
500,
true
)
);
$table->data['block_mode'][0] = '<strong>'.__('Block Mode').'</strong>'; $table->data[1][] = html_print_label_input_block(
$table->data['block_mode'][1] = html_print_checkbox('block_mode', 1, $block_mode, true); __('OS'),
html_print_select_from_sql(
'SELECT id_os, name FROM tconfig_os ORDER BY name',
'id_os',
$id_os,
'',
'',
'',
$return = true
)
);
$table->data[4][0] = '<strong>'.__('Format').'</strong>'; $table->data[1][] = html_print_label_input_block(
$table->data[4][0] .= ui_print_help_tip(__('separate fields with ').SEPARATOR_COLUMN, true); __('Interpreter'),
$table->data[4][1] = html_print_input_text('format', $data_format, '', 50, 100, true); html_print_input_text(
'interpreter',
$interpreter,
'',
25,
100,
true
).ui_print_input_placeholder(
__('Left blank for the LOCAL inventory modules'),
true
)
);
$table->data[5][0] = '<strong>'.__('Script mode').'</strong>'; $table->data[2][] = html_print_label_input_block(
$table->data[5][0] .= ui_print_help_tip(__(''), true); __('Format'),
$table->data[5][1] = __('Use script'); html_print_input_text(
$table->data[5][1] .= html_print_radio_button( 'format',
'script_mode', $data_format,
1, '',
'', 50,
$script_mode, 100,
true true
).'&nbsp;&nbsp;'; ).ui_print_input_placeholder(
$table->data[5][1] .= '&nbsp&nbsp&nbsp&nbsp'.__('Use inline code'); __('separate fields with ').SEPARATOR_COLUMN,
$table->data[5][1] .= html_print_radio_button( true
'script_mode', )
2, );
'',
$script_mode,
true
).'&nbsp;&nbsp;';
$table->data[6][0] = '<strong>'.__('Script path').'</strong>'; $table->data[2][] = html_print_label_input_block(
$table->data[6][1] = html_print_input_text('script_path', $script_path, '', 50, 1000, true); __('Block Mode'),
html_print_checkbox_switch(
'block_mode',
1,
$block_mode,
true
)
);
$table->data[7][0] = '<strong>'.__('Code').'</strong>'; $radioButtons = [];
$table->data[7][0] .= ui_print_help_tip(__("Here is placed the script for the REMOTE inventory modules Local inventory modules don't use this field").SEPARATOR_COLUMN, true); $radioButtons[] = html_print_radio_button('script_mode', 1, __('Script mode'), $script_mode, true);
$radioButtons[] = html_print_radio_button('script_mode', 2, __('Use inline code'), $script_mode, true);
$table->data[7][1] = html_print_textarea('code', 25, 80, base64_decode($code), '', true); $table->data[3][] = html_print_label_input_block(
__('Script mode'),
html_print_div(
[
'class' => 'switch_radio_button',
'content' => implode('', $radioButtons),
],
true
)
);
echo '<form name="inventorymodule" id="inventorymodule_form" method="post" $table->colspan[4][0] = 2;
$table->data[4][0] = html_print_label_input_block(
__('Script path'),
html_print_input_text(
'script_path',
$script_path,
'',
50,
1000,
true
),
['div_class' => 'script_path_inventory_modules']
);
$table->data[4][0] .= html_print_label_input_block(
__('Code'),
html_print_textarea(
'code',
25,
80,
base64_decode($code),
'',
true
).ui_print_input_placeholder(
__("Here is placed the script for the REMOTE inventory modules Local inventory modules don't use this field").SEPARATOR_COLUMN,
true
),
['div_class' => 'code_inventory_modules']
);
echo '<form name="inventorymodule" id="inventorymodule_form" class="max_floating_element_size" method="post"
action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules">'; action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules">';
html_print_table($table); html_print_table($table);
if ($id_module_inventory) { if ($id_module_inventory) {
html_print_input_hidden('update_module_inventory', 1); html_print_input_hidden('update_module_inventory', 1);
html_print_input_hidden('id_module_inventory', $id_module_inventory); html_print_input_hidden('id_module_inventory', $id_module_inventory);
$buttonCaption = __('Update');
$buttonIcon = 'update';
} else { } else {
html_print_input_hidden('create_module_inventory', 1); html_print_input_hidden('create_module_inventory', 1);
$buttonCaption = __('Create');
$buttonIcon = 'wand';
} }
echo '<div class="action-buttons" style="width: '.$table->width.'">'; $actionButtons = '';
if ($id_module_inventory) { $actionButtons = html_print_submit_button(
html_print_submit_button(__('Update'), 'submit', false, 'class="sub next"'); $buttonCaption,
} else { 'submit',
html_print_submit_button(__('Create'), 'submit', false, 'class="sub upd"'); false,
} ['icon' => $buttonIcon],
true
);
$actionButtons .= html_print_go_back_button(
'index.php?sec=gmodules&sec2=godmode/modules/manage_inventory_modules',
['button_class' => ''],
true
);
echo '</div>'; html_print_action_buttons($actionButtons);
echo '</form>'; echo '</form>';
?> ?>
@ -180,21 +274,21 @@ echo '</form>';
var mode = <?php echo $script_mode; ?>; var mode = <?php echo $script_mode; ?>;
if (mode == 1) { if (mode == 1) {
$('#table1-6').show(); $('.script_path_inventory_modules').show();
$('#table1-7').hide(); $('.code_inventory_modules').hide();
} else { } else {
$('#table1-7').show(); $('.code_inventory_modules').show();
$('#table1-6').hide(); $('.script_path_inventory_modules').hide();
} }
$('input[type=radio][name=script_mode]').change(function() { $('input[type=radio][name=script_mode]').change(function() {
if (this.value == 1) { if (this.value == 1) {
$('#table1-6').show(); $('.script_path_inventory_modules').show();
$('#table1-7').hide(); $('.code_inventory_modules').hide();
} }
else if (this.value == 2) { else if (this.value == 2) {
$('#table1-7').show(); $('.code_inventory_modules').show();
$('#table1-6').hide(); $('.script_path_inventory_modules').hide();
} }
}); });
}); });

View File

@ -615,18 +615,6 @@ $url = ui_get_url_refresh(
true, true,
false false
); );
$name_url = 'index.php?sec=templates&sec2=godmode/modules/manage_network_components';
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->style = [];
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
$table->data = [];
$table->data[0][0] = __('Group');
$component_groups = network_components_get_groups(); $component_groups = network_components_get_groups();
@ -656,54 +644,81 @@ foreach ($component_groups as $component_group_key => $component_group_val) {
} }
} }
$table->data[0][1] = html_print_select( $name_url = 'index.php?sec=templates&sec2=godmode/modules/manage_network_components';
$component_groups, $table = new stdClass();
'search_id_group', $table->width = '100%';
$search_id_group, $table->class = 'filter-table-adv';
$table->style = [];
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
$table->data = [];
$table->data[0][] = html_print_label_input_block(
__('Group'),
html_print_select(
$component_groups,
'search_id_group',
$search_id_group,
'',
__('All'),
0,
true,
false,
false,
'',
false,
'width: 100%'
)
);
$table->data[0][] = html_print_label_input_block(
__('Free Search'),
html_print_input_text(
'search_string',
$search_string,
'',
25,
255,
true
).ui_print_input_placeholder(
__('Search by name, description, tcp send or tcp rcv, list matches.'),
true
)
);
$toggleFilters = '<form class="filters_form" method="POST" action="'.$url.'">';
$toggleFilters .= html_print_table($table, true);
$toggleFilters .= html_print_div(
[
'class' => 'action-buttons-right-forced',
'content' => html_print_submit_button(
__('Filter'),
'search',
false,
[
'icon' => 'search',
'mode' => 'mini',
],
true
),
],
true
);
$toggleFilters .= '</form>';
ui_toggle(
$toggleFilters,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'', '',
__('All'),
0,
true, true,
false, false,
false
);
$table->data[0][2] = __('Free Search').ui_print_help_tip(
__('Search by name, description, tcp send or tcp rcv, list matches.'),
true
);
$table->data[0][3] = html_print_input_text(
'search_string',
$search_string,
'', '',
25, 'white-box-content',
255, 'box-flat white_table_graph fixed_filter_bar'
true
); );
if (is_metaconsole() === true) {
$table->data[0][4] = '<div>';
} else {
$table->data[0][4] = '<div class="action-buttons">';
}
$table->data[0][4] .= html_print_submit_button(
__('Search'),
'search',
false,
'class="sub search"',
true
);
$table->data[0][4] .= '</div>';
if (is_metaconsole() === true) {
$filter = '<form class="filters_form" method="post" action="'.$url.'">';
$filter .= html_print_table($table, true);
$filter .= '</form>';
ui_toggle($filter, __('Show Options'));
} else {
echo '<form method="post" action="'.$url.'">';
html_print_table($table);
echo '</form>';
}
$filter = []; $filter = [];
if ($search_id_group) { if ($search_id_group) {
@ -721,7 +736,6 @@ $total_components = network_components_get_network_components(
); );
$total_components = $total_components[0]['total']; $total_components = $total_components[0]['total'];
$offset_delete = ($offset >= ($total_components - 1)) ? ($offset - $config['block_size']) : $offset; $offset_delete = ($offset >= ($total_components - 1)) ? ($offset - $config['block_size']) : $offset;
ui_pagination($total_components, $name_url);
$filter['offset'] = (int) get_parameter('offset'); $filter['offset'] = (int) get_parameter('offset');
$filter['limit'] = (int) $config['block_size']; $filter['limit'] = (int) $config['block_size'];
$components = network_components_get_network_components( $components = network_components_get_network_components(
@ -935,30 +949,20 @@ html_print_action_buttons(
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$( document ).ready(function() { $( document ).ready(function() {
$('[id^=checkbox-delete_multiple]').change(function(){ $('[id^=checkbox-delete_multiple]').click(function(){
if($(this).parent().parent().hasClass('checkselected')){ if($(this).prop("checked") === false ){
$(this).parent().parent().removeClass('checkselected'); $(this).prop("checked", false);
} } else {
else{ $(this).prop("checked", true);
$(this).parent().parent().addClass('checkselected');
} }
}); });
$('[id^=checkbox-all_delete]').change(function(){ $('#checkbox-all_delete').click(function(){
if ($("#checkbox-all_delete").prop("checked")) { if ($("#checkbox-all_delete").prop("checked") === true) {
$('[id^=checkbox-delete_multiple]') $("[id^=checkbox-delete_multiple]").prop("checked", true);
.parent()
.parent()
.addClass('checkselected');
$(".check_delete")
.prop("checked", true);
} }
else{ else{
$('[id^=checkbox-delete_multiple]') $("[id^=checkbox-delete_multiple]").prop("checked", false);
.parent()
.parent()
.removeClass('checkselected');
$(".check_delete").prop("checked", false);
} }
}); });
}); });

View File

@ -366,43 +366,43 @@ if (is_metaconsole() === true) {
html_print_table($table); html_print_table($table);
html_print_input_hidden('id_component_type', $id_component_type); $buttons = html_print_input_hidden('id_component_type', $id_component_type);
if ($id) { if ($id) {
html_print_input_hidden('update_component', 1); $buttons .= html_print_input_hidden('update_component', 1, true);
html_print_input_hidden('id', $id); $buttons .= html_print_input_hidden('id', $id, true);
$buttonCaption = __('Update'); $buttonCaption = __('Update');
$buttonIcon = 'update'; $buttonIcon = 'update';
$buttonName = 'upd'; $buttonName = 'upd';
html_print_submit_button(__('Update'), 'upd', false, 'class="sub upd"');
} else { } else {
html_print_input_hidden('create_component', 1); $buttons .= html_print_input_hidden('create_component', 1, true);
html_print_input_hidden('create_network_from_module', 0); $buttons .= html_print_input_hidden('create_network_from_module', 0, true);
$buttonCaption = __('Create'); $buttonCaption = __('Create');
$buttonIcon = 'wand'; $buttonIcon = 'wand';
$buttonName = 'crt'; $buttonName = 'crt';
} }
html_print_div( $buttons .= html_print_submit_button(
$buttonCaption,
$buttonName,
false,
['icon' => $buttonIcon],
true
);
$buttons .= html_print_button(
__('Go back'),
'go_back',
false,
'',
[ [
'class' => 'action-buttons', 'icon' => 'back',
'content' => html_print_button( 'mode' => 'secondary',
__('Go back'), ],
'go_back', true
false, );
'',
[ html_print_action_buttons(
'icon' => 'back', $buttons
'mode' => 'secondary',
],
true
).html_print_submit_button(
$buttonCaption,
$buttonName,
false,
['icon' => $buttonIcon],
true
),
]
); );
echo '</form>'; echo '</form>';

View File

@ -496,7 +496,7 @@ if ($edit_container) {
$single_table .= "<td id='row_type_graphs' width='30%'>"; $single_table .= "<td id='row_type_graphs' width='30%'>";
$single_table .= html_print_label_input_block( $single_table .= html_print_label_input_block(
__('Type of graph'), __('Type of graph'),
html_print_select($type_graphs, 'simple_type_graph', '', '', '', 0, true) html_print_select($type_graphs, 'simple_type_graph2', '', '', '', 0, true, false, true, '', false, 'width:100%')
); );
$single_table .= '</td>'; $single_table .= '</td>';
@ -543,21 +543,22 @@ if ($edit_container) {
$table->width = '100%'; $table->width = '100%';
$table->cellspacing = 4; $table->cellspacing = 4;
$table->cellpadding = 4; $table->cellpadding = 4;
$table->class = 'dat'; $table->class = 'filter-table-adv';
$table->styleTable = 'font-weight: bold;'; $table->styleTable = 'font-weight: bold;';
$table->style[0] = 'width: 13%'; $table->style[0] = 'width: 13%';
$table->data = []; $table->data = [];
$table->size[0] = '30%';
$table->size[1] = '30%';
$table->size[2] = '30%';
$data = []; $table->data[0][0] = html_print_label_input_block(
$data[0] = __('Time lapse'); __('Time lapse').ui_print_help_tip(
$data[0] .= ui_print_help_tip(__('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '), true); __('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '),
$data[1] = html_print_extended_select_for_time('period_custom', $period, '', '', '0', 10, true, false, true, '', false, $periods); true
$table->data[] = $data; ),
$table->rowclass[] = ''; html_print_extended_select_for_time('period_custom', $period, '', '', '0', 10, true, 'width:100%', true, '', false, $periods)
);
$data = [];
$data[0] = __('Custom graph');
$list_custom_graphs = custom_graphs_get_user($config['id_user'], false, true, 'RR'); $list_custom_graphs = custom_graphs_get_user($config['id_user'], false, true, 'RR');
@ -566,29 +567,45 @@ if ($edit_container) {
$graphs[$custom_graph['id_graph']] = $custom_graph['name']; $graphs[$custom_graph['id_graph']] = $custom_graph['name'];
} }
$data[1] = html_print_select($graphs, 'id_custom_graph', $idCustomGraph, '', __('None'), 0, true); $table->data[0][1] = html_print_label_input_block(
$table->data[] = $data; __('Custom graph'),
$table->rowclass[] = ''; html_print_select($graphs, 'id_custom_graph', $idCustomGraph, '', __('None'), 0, true, '', true, '', false, 'width:100%')
);
$data = []; $table->data[0][2] = html_print_label_input_block(
$data[0] = __('Show full scale graph (TIP)').ui_print_help_tip('This option may cause performance issues', true); __('Show full scale graph (TIP)').ui_print_help_tip('This option may cause performance issues', true),
$data[1] = html_print_checkbox('fullscale_2', 1, false, true); html_print_checkbox('fullscale_2', 1, false, true)
$table->data[] = $data; );
$table->rowclass[] = '';
$data = []; $data_toggle = html_print_table($table, true);
$data[0] = ''; $data_toggle .= html_print_div(
$data[1] = "<input style='float:right;' type=submit name='add_custom' class='sub add' value='".__('Add item')."'>"; [
$table->data[] = $data; 'class' => 'action-buttons-right-forced mrgn_right_10px',
$table->rowclass[] = ''; 'content' => html_print_submit_button(
__('Add item'),
'add_custom',
false,
[
'mode' => 'mini',
'icon' => 'next',
],
true
),
],
true
);
echo "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>"; ui_toggle(
echo '<tr>'; $data_toggle,
echo '<td>'; '<span class="subsection_header_title">'.__('Custom graph').'</span>',
echo ui_toggle(html_print_table($table, true), 'Custom graph', '', '', true); 'container',
echo '</td>'; '',
echo '</tr>'; true,
echo '</table>'; false,
'',
'white-box-content',
'box-flat white_table_graph'
);
unset($table); unset($table);
@ -597,93 +614,113 @@ if ($edit_container) {
$table->width = '100%'; $table->width = '100%';
$table->cellspacing = 4; $table->cellspacing = 4;
$table->cellpadding = 4; $table->cellpadding = 4;
$table->class = 'dat'; $table->class = 'filter-table-adv';
$table->styleTable = 'font-weight: bold;'; $table->styleTable = 'font-weight: bold;';
$table->style[0] = 'width: 13%';
$table->data = []; $table->data = [];
$table->size[0] = '30%';
$table->size[1] = '30%';
$table->size[2] = '30%';
$data = [];
$data[0] = __('Time lapse');
$data[0] .= ui_print_help_tip(__('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '), true);
$data[1] = html_print_extended_select_for_time('period_dynamic', $period, '', '', '0', 10, true, false, true, '', false, $periods);
$table->data[] = $data;
$table->rowclass[] = '';
$data = []; $table->data[0][0] = html_print_label_input_block(
$data[0] = __('Group'); __('Time lapse').ui_print_help_tip(
$data[1] = '<div class="w250px">'.html_print_select_groups($config['id_user'], 'RW', $return_all_groups, 'container_id_group', $id_group, '', '', '', true).'</div>'; __('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '),
$table->data[] = $data; true
$table->rowclass[] = ''; ),
html_print_extended_select_for_time('period_custom', $period, '', '', '0', 10, true, 'width:100%', true, '', false, $periods)
);
$data = []; $table->data[0][1] = html_print_label_input_block(
$data[0] = __('Module group'); __('Group'),
$data[1] = html_print_select_from_sql( html_print_select_groups($config['id_user'], 'RW', $return_all_groups, 'container_id_group', $id_group, '', '', '', true)
'SELECT * FROM tmodule_group ORDER BY name', );
'combo_modulegroup',
$modulegroup, $table->data[0][2] = html_print_label_input_block(
'', __('Module group'),
__('All'), html_print_select_from_sql(
false, 'SELECT * FROM tmodule_group ORDER BY name',
'combo_modulegroup',
$modulegroup,
'',
__('All'),
false,
true,
false,
true,
false,
'width:100%'
)
);
$table->data[1][0] = html_print_label_input_block(
__('Agent'),
html_print_input_text('text_agent', $textAgent, '', 30, 100, true)
);
$table->data[1][1] = html_print_label_input_block(
__('Module'),
html_print_input_text('text_agent_module', $textModule, '', 30, 100, true)
);
$select_tags = tags_search_tag(false, false, true);
$table->data[1][2] = html_print_label_input_block(
__('Tag'),
html_print_select(
$select_tags,
'tag',
$tag,
'',
__('Any'),
0,
true,
false,
false,
'',
false,
'width:100%'
)
);
$table->data[2][0] = html_print_label_input_block(
__('Type of graph'),
html_print_select($type_graphs, 'simple_type_graph2', '', '', '', 0, true, false, true, '', false, 'width:100%')
);
$table->data[2][1] = html_print_label_input_block(
__('Show full scale graph (TIP)').ui_print_help_tip('This option may cause performance issues', true),
html_print_checkbox('fullscale_3', 1, false, true)
);
$data_toggle = html_print_table($table, true);
$data_toggle .= html_print_div(
[
'class' => 'action-buttons-right-forced mrgn_right_10px',
'content' => html_print_submit_button(
__('Add item'),
'add_dynamic',
false,
[
'mode' => 'mini',
'icon' => 'next',
],
true
),
],
true true
); );
$table->data[] = $data;
$table->rowclass[] = '';
$data = []; ui_toggle(
$data[0] = __('Agent'); $data_toggle,
$data[1] = html_print_input_text('text_agent', $textAgent, '', 30, 100, true); '<span class="subsection_header_title">'.__('Dynamic rules for simple module graph').'</span>',
$table->data[] = $data; 'container',
$table->rowclass[] = '';
$data = [];
$data[0] = __('Module');
$data[1] = html_print_input_text('text_agent_module', $textModule, '', 30, 100, true);
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$data[0] = __('Tag');
$select_tags = tags_search_tag(false, false, true);
$data[1] = html_print_select(
$select_tags,
'tag',
$tag,
'', '',
__('Any'),
0,
true, true,
false, false,
false '',
'white-box-content',
'box-flat white_table_graph'
); );
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$data[0] = __('Type of graph');
$data[1] = html_print_select($type_graphs, 'simple_type_graph2', '', '', '', 0, true);
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$data[0] = __('Show full scale graph (TIP)').ui_print_help_tip('This option may cause performance issues', true);
$data[1] = html_print_checkbox('fullscale_3', 1, false, true);
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$data[0] = '';
$data[1] = "<input style='float:right;' type=submit name='add_dynamic' class='sub add' value='".__('Add item')."'>";
$table->data[] = $data;
$table->rowclass[] = '';
echo "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>";
echo '<tr>';
echo '<td>';
echo ui_toggle(html_print_table($table, true), 'Dynamic rules for simple module graph', '', '', true);
echo '</td>';
echo '</tr>';
echo '</table>';
if ((bool) $id_container !== false) { if ((bool) $id_container !== false) {
$total_item = db_get_all_rows_sql('SELECT count(*) FROM tcontainer_item WHERE id_container = '.$id_container); $total_item = db_get_all_rows_sql('SELECT count(*) FROM tcontainer_item WHERE id_container = '.$id_container);
@ -696,7 +733,7 @@ if ($edit_container) {
ui_pagination($total_item[0]['count(*)'], false, $offset, 10); ui_pagination($total_item[0]['count(*)'], false, $offset, 10);
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->id = 'item_table'; $table->id = 'item_table';
$table->align = []; $table->align = [];
$table->head = []; $table->head = [];
@ -710,7 +747,7 @@ if ($edit_container) {
$table->head[7] = __('Delete'); $table->head[7] = __('Delete');
$table->data = []; $table->data = [];
$i = 0;
foreach ($result_item as $item) { foreach ($result_item as $item) {
$data = []; $data = [];
@ -759,6 +796,8 @@ if ($edit_container) {
break; break;
} }
$table->cellclass[$i][7] = 'table_action_buttons';
$i++;
$data[7] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&delete_item=1&id_item='.$item['id_ci'].'&id='.$id_container.'" onClick="if (!confirm(\''.__('Are you sure?').'\')) $data[7] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&delete_item=1&id_item='.$item['id_ci'].'&id='.$id_container.'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
return false;">'.html_print_image('images/delete.svg', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>'; return false;">'.html_print_image('images/delete.svg', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
@ -801,7 +840,7 @@ echo html_print_input_hidden('id_agent', 0);
} }
}); });
$("input[name=add_custom]").click (function () { $("#button-add_custom").click (function () {
var id_custom = $("#id_custom_graph").val(); var id_custom = $("#id_custom_graph").val();
var fullscale = $("#checkbox-fullscale_2").prop("checked"); var fullscale = $("#checkbox-fullscale_2").prop("checked");
if (id_custom !== '0'){ if (id_custom !== '0'){
@ -824,7 +863,7 @@ echo html_print_input_hidden('id_agent', 0);
} }
}); });
$("input[name=add_dynamic]").click (function () { $("#button-add_dynamic").click (function () {
var agent_alias = $("#text-text_agent").val(); var agent_alias = $("#text-text_agent").val();
var module_name = $("#text-text_agent_module").val(); var module_name = $("#text-text_agent_module").val();
var time_lapse = $("#hidden-period_dynamic").attr('value'); var time_lapse = $("#hidden-period_dynamic").attr('value');

View File

@ -129,11 +129,22 @@ $container = folder_get_folders();
$tree = folder_get_folders_tree_recursive($container); $tree = folder_get_folders_tree_recursive($container);
echo folder_togge_tree_folders($tree); echo folder_togge_tree_folders($tree);
if ($report_r && $report_w) { if ($report_r && $report_w) {
echo "<div class='right'>"; $ActionButtons[] = '<form method="post" class="right" action="index.php?sec=reporting&sec2=godmode/reporting/create_container">';
echo '<form method="post" class="right" action="index.php?sec=reporting&sec2=godmode/reporting/create_container">'; $ActionButtons[] = '<div class="action-buttons">';
html_print_submit_button(__('Create container'), 'create', false, 'class="sub next mrgn_right_5px mrgn_top_15px"'); $ActionButtons[] = html_print_submit_button(
echo '</form>'; __('Create container'),
echo '</div>'; 'create',
false,
[
'class' => 'sub ok submitButton',
'icon' => 'next',
],
true
);
$ActionButtons[] = '</div>';
$ActionButtons[] = '</form>';
html_print_action_buttons(implode('', $ActionButtons), ['type' => 'form_action']);
} }
?> ?>

View File

@ -2229,7 +2229,7 @@ $class = 'databox filters';
<tr id="row_custom_graph" class="datos"> <tr id="row_custom_graph" class="datos">
<td class="bolder"><?php echo __('Custom graph'); ?></td> <td class="bolder"><?php echo __('Custom graph'); ?></td>
<td > <td class="toolbox-buttons">
<?php <?php
if ($meta) { if ($meta) {
$graphs = []; $graphs = [];
@ -2303,21 +2303,38 @@ $class = 'databox filters';
} }
} }
echo '&nbsp;'; if (!empty($style_button_create_custom_graph)) {
$style_create = [
'mode' => 'link',
'style' => 'display:none',
];
} else {
$style_create = [ 'mode' => 'link' ];
}
if (!empty($style_button_edit_custom_graph)) {
$style_edit = [
'mode' => 'link',
'style' => 'display:none',
];
} else {
$style_edit = [ 'mode' => 'link' ];
}
html_print_button( html_print_button(
__('Create'), __('Create'),
'create_graph', 'create_graph',
false, false,
'create_custom_graph();', 'create_custom_graph()',
'class="sub add" '.$style_button_create_custom_graph $style_create
); );
html_print_button( html_print_button(
__('Edit'), __('Edit'),
'edit_graph', 'edit_graph',
false, false,
'edit_custom_graph();', 'edit_custom_graph()',
'class="sub config" '.$style_button_edit_custom_graph $style_edit
); );
?> ?>
</td> </td>

View File

@ -509,11 +509,11 @@ switch ($action) {
'list_reports' => [ 'list_reports' => [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'">'.html_print_image( 'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'">'.html_print_image(
'images/report_list.png', 'images/logs@svg.svg',
true, true,
[ [
'title' => __('Reports list'), 'title' => __('Reports list'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
], ],

View File

@ -632,7 +632,7 @@ if (empty($create) === false || empty($view) === false) {
$delete_macro_style = 'display:none;'; $delete_macro_style = 'display:none;';
} }
$datam[2] = '<div id="delete_macro_button" style="'.$delete_macro_style.'">'.'<a href="javascript:;">'.'<span class="bolder">'.__('Delete macro').'</span>'.'&nbsp;'.html_print_image('images/delete.png', true, ['class' => 'invert_filter']).'</a>'.'</div>'; $datam[2] = '<div id="delete_macro_button" style="'.$delete_macro_style.'">'.'<a href="javascript:;">'.'<span class="bolder">'.__('Delete macro').'</span>'.'&nbsp;'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>'.'</div>';
$table->colspan['plugin_action'][0] = 2; $table->colspan['plugin_action'][0] = 2;
$table->colspan['plugin_action'][2] = 2; $table->colspan['plugin_action'][2] = 2;
@ -665,8 +665,10 @@ if (empty($create) === false || empty($view) === false) {
echo '<tr><td align="right">'; echo '<tr><td align="right">';
if ($create != '') { $buttons = '';
$button = html_print_submit_button(
if (empty($create) === false) {
$buttons .= html_print_submit_button(
__('Create'), __('Create'),
'crtbutton', 'crtbutton',
false, false,
@ -674,7 +676,7 @@ if (empty($create) === false || empty($view) === false) {
true true
); );
} else { } else {
$button = html_print_submit_button( $buttons .= html_print_submit_button(
__('Update'), __('Update'),
'uptbutton', 'uptbutton',
false, false,
@ -683,8 +685,14 @@ if (empty($create) === false || empty($view) === false) {
); );
} }
$buttons .= html_print_go_back_button(
'index.php?sec=gservers&sec2=godmode/servers/plugin',
['button_class' => ''],
true
);
html_print_action_buttons( html_print_action_buttons(
$button $buttons
); );
echo '</form></table>'; echo '</form></table>';

View File

@ -25,7 +25,20 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user
} }
// Header // Header
ui_print_page_header(__('Link management'), 'images/extensions.png', false, '', true, ''); ui_print_standard_header(
__('Admin tools'),
'images/extensions.png',
false,
'',
true,
[],
[
[
'link' => '',
'label' => __('Link management'),
],
]
);
if (isset($_POST['create'])) { if (isset($_POST['create'])) {
@ -98,7 +111,7 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
$link = ''; $link = '';
} }
echo '<table class="databox filters" cellpadding="4" cellspacing="4" width="100%">'; echo '<table class="databox filters filter-table-adv max_floating_element_size" cellpadding="4" cellspacing="4" width="100%">';
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/links">'; echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/links">';
if ($creation_mode == 1) { if ($creation_mode == 1) {
echo "<input type='hidden' name='create' value='1'>"; echo "<input type='hidden' name='create' value='1'>";
@ -112,17 +125,42 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
} }
echo "'>"; echo "'>";
echo '<tr> echo '<tr>';
<td class="datos">'.__('Link name').'</td> echo '<td class="w50p">';
<td class="datos"><input type="text" class="text_input" name="name" size="50" value="'.$nombre.'"></td>'; echo html_print_label_input_block(
echo '</tr><tr> __('Link name'),
<td class="datos2">'.__('Link').'</td> html_print_input_text(
<td class="datos2"> 'name',
<input type="text" class="text_input" name="link" size="50" value="'.$link.'"></td>'; $nombre,
echo '</tr>'; '',
50,
255,
true,
false,
true,
'',
'text_input'
)
);
echo '</td>';
echo '<td class="w50p">';
echo html_print_label_input_block(
__('Link'),
html_print_input_text(
'link',
$link,
'',
50,
255,
true,
false,
true,
'',
'text_input'
)
);
echo '</td></tr>';
echo '</table>'; echo '</table>';
echo "<table width='100%'>";
echo "<tr><td align='right'>";
if (isset($_GET['form_add']) === true) { if (isset($_GET['form_add']) === true) {
$actionForPerform = __('Create'); $actionForPerform = __('Create');
$iconForPerform = 'wand'; $iconForPerform = 'wand';
@ -131,16 +169,14 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
$iconForPerform = 'update'; $iconForPerform = 'update';
} }
html_print_div( html_print_action_buttons(
[ html_print_submit_button(
'class' => 'action-buttons', $actionForPerform,
'content' => html_print_submit_button( 'crtbutton',
$actionForPerform, false,
'crtbutton', [ 'icon' => $iconForPerform ],
false, true
[ 'icon' => $iconForPerform ] )
),
],
); );
echo '</form></td></tr></table>'; echo '</form></td></tr></table>';
@ -185,16 +221,14 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
echo "<tr><td align='right'>"; echo "<tr><td align='right'>";
echo "<form method='post' action='index.php?sec=gsetup&sec2=godmode/setup/links&form_add=1'>"; echo "<form method='post' action='index.php?sec=gsetup&sec2=godmode/setup/links&form_add=1'>";
html_print_div( html_print_action_buttons(
[ html_print_submit_button(
'class' => 'action-buttons', __('Add'),
'content' => html_print_submit_button( 'form_add',
__('Add'), false,
'form_add', [ 'icon' => 'wand' ],
false, true
[ 'icon' => 'wand' ] )
),
],
); );
echo '</form></table>'; echo '</form></table>';

File diff suppressed because it is too large Load Diff

View File

@ -135,18 +135,15 @@ if ($load_filter_modal) {
$table->width = '100%'; $table->width = '100%';
$table->cellspacing = 4; $table->cellspacing = 4;
$table->cellpadding = 4; $table->cellpadding = 4;
$table->class = 'databox'; $table->class = 'databox no_border';
if (is_metaconsole()) { if (is_metaconsole()) {
$table->cellspacing = 0; $table->cellspacing = 0;
$table->cellpadding = 0; $table->cellpadding = 0;
$table->class = 'databox filters'; $table->class = 'databox filters no_border';
} }
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;'; $table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
$filter_id_width = '200px'; $filter_id_width = 'w100p';
if (is_metaconsole()) {
$filter_id_width = '150px';
}
$data = []; $data = [];
$table->rowid[3] = 'update_filter_row1'; $table->rowid[3] = 'update_filter_row1';
@ -165,11 +162,17 @@ if ($load_filter_modal) {
false, false,
'margin-left:5px; width:'.$filter_id_width.';' 'margin-left:5px; width:'.$filter_id_width.';'
); );
$table->rowclass[] = 'display-grid';
$data[1] = html_print_submit_button( $data[1] = html_print_submit_button(
__('Load filter'), __('Load filter'),
'load_filter', 'load_filter',
false, false,
'class="sub upd" onclick="load_filter_values()"', [
'class' => 'mini w25p',
'style' => 'margin-left: 73%',
'onclick' => 'load_filter_values();',
],
true true
); );
$data[1] .= html_print_input_hidden('load_filter', 1, true); $data[1] .= html_print_input_hidden('load_filter', 1, true);
@ -186,7 +189,7 @@ function show_filter() {
draggable: true, draggable: true,
modal: false, modal: false,
closeOnEscape: true, closeOnEscape: true,
width: 450 width: 500
}); });
} }
@ -238,7 +241,7 @@ $(document).ready (function() {
if ($save_filter_modal) { if ($save_filter_modal) {
echo '<div id="save-filter-select" style="width:350px;">'; echo '<div id="save-filter-select" style="width:600px;">';
if (check_acl($config['id_user'], 0, 'EW') === 1 || check_acl($config['id_user'], 0, 'EM') === 1) { if (check_acl($config['id_user'], 0, 'EW') === 1 || check_acl($config['id_user'], 0, 'EM') === 1) {
echo '<div id="info_box"></div>'; echo '<div id="info_box"></div>';
@ -247,9 +250,9 @@ if ($save_filter_modal) {
$table->width = '100%'; $table->width = '100%';
$table->cellspacing = 4; $table->cellspacing = 4;
$table->cellpadding = 4; $table->cellpadding = 4;
$table->class = 'databox'; $table->class = 'databox no_border';
if (is_metaconsole()) { if (is_metaconsole()) {
$table->class = 'databox filters'; $table->class = 'databox filters no_border';
$table->cellspacing = 0; $table->cellspacing = 0;
$table->cellpadding = 0; $table->cellpadding = 0;
} }
@ -289,7 +292,11 @@ if ($save_filter_modal) {
__('Save filter'), __('Save filter'),
'save_filter', 'save_filter',
false, false,
'class="sub wand" onclick="save_new_filter();"', [
'class' => 'mini w25p',
'style' => 'margin-left: 56%',
'onclick' => 'save_new_filter();',
],
true true
); );
@ -317,11 +324,16 @@ if ($save_filter_modal) {
0, 0,
true true
); );
$table->rowclass[] = 'display-grid';
$data[1] = html_print_submit_button( $data[1] = html_print_submit_button(
__('Update filter'), __('Update filter'),
'update_filter', 'update_filter',
false, false,
'class="sub upd" onclick="save_update_filter();"', [
'class' => 'mini w25p',
'style' => 'margin-left: 56%',
'onclick' => 'save_update_filter();',
],
true true
); );
@ -359,7 +371,8 @@ function show_save_filter() {
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: false, modal: false,
closeOnEscape: true closeOnEscape: true,
width: 380
}); });
} }

View File

@ -1283,7 +1283,7 @@ if (check_login()) {
$linkCaption, $linkCaption,
'additional_action_for_'.$idAgenteModulo, 'additional_action_for_'.$idAgenteModulo,
false, false,
'window.location.assign(\'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;id_agente_modulo='.$module['id_agente_modulo'].'&amp;refr=60'.$addedLinkParams.'\')', 'window.location.assign("index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;id_agente_modulo='.$module['id_agente_modulo'].'&amp;refr=60'.$addedLinkParams.'")',
[ [
'mode' => 'link', 'mode' => 'link',
'style' => 'justify-content: flex-end;', 'style' => 'justify-content: flex-end;',
@ -1300,7 +1300,7 @@ if (check_login()) {
__('Edit'), __('Edit'),
'edit_module_'.$idAgenteModulo, 'edit_module_'.$idAgenteModulo,
false, false,
'window.location.assign(\'index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$id_agente.'&amp;tab=module&amp;id_agent_module='.$module['id_agente_modulo'].'&amp;edit_module='.$module['id_modulo'].'\')', 'window.location.assign("index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$id_agente.'&amp;tab=module&amp;id_agent_module='.$module['id_agente_modulo'].'&amp;edit_module='.$module['id_modulo'].'")',
[ [
'mode' => 'link', 'mode' => 'link',
'style' => 'justify-content: flex-end;', 'style' => 'justify-content: flex-end;',

View File

@ -437,7 +437,7 @@ class AuditLog extends HTML
$('#audit_logs').css('width','95% !important'); $('#audit_logs').css('width','95% !important');
}); });
$('#save-filter').click(function() { $('#button-save-filter').click(function() {
if ($('#save-filter-select').length) { if ($('#save-filter-select').length) {
$('#save-filter-select').dialog({ $('#save-filter-select').dialog({
width: "20%", width: "20%",
@ -495,7 +495,7 @@ class AuditLog extends HTML
}); });
/* Filter management */ /* Filter management */
$('#load-filter').click(function (){ $('#button-load-filter').click(function (){
if($('#load-filter-select').length) { if($('#load-filter-select').length) {
$('#load-filter-select').dialog({width: "20%", $('#load-filter-select').dialog({width: "20%",
maxWidth: "25%", maxWidth: "25%",

View File

@ -1040,7 +1040,7 @@ class CalendarManager
'id' => 'templates_alerts_special_days', 'id' => 'templates_alerts_special_days',
'return' => true, 'return' => true,
'class' => 'info_table', 'class' => 'info_table',
'style' => 'width: 100%', 'style' => 'width: 99%',
'columns' => $columns, 'columns' => $columns,
'column_names' => $column_names, 'column_names' => $column_names,
'ajax_url' => 'godmode/alerts/alert_special_days', 'ajax_url' => 'godmode/alerts/alert_special_days',
@ -1075,7 +1075,9 @@ class CalendarManager
'name' => 'name', 'name' => 'name',
], ],
], ],
'class' => 'no_border',
], ],
'filter_main_class' => 'box-flat white_table_graph',
] ]
); );
} catch (Exception $e) { } catch (Exception $e) {

View File

@ -103,42 +103,16 @@ class CredentialStore extends Wizard
*/ */
private function ajaxMsg($type, $msg, $delete=false) private function ajaxMsg($type, $msg, $delete=false)
{ {
$msg_err = 'Failed while saving: %s'; if ($type === 'error') {
$msg_ok = 'Successfully saved into keystore '; $msg_title = ($delete === true) ? 'Failed while removing' : 'Failed while saving';
if ($delete) {
$msg_err = 'Failed while removing: %s';
$msg_ok = 'Successfully deleted ';
}
if ($type == 'error') {
echo json_encode(
[
$type => ui_print_error_message(
__(
$msg_err,
$msg
),
'',
true
),
]
);
} else { } else {
echo json_encode( $msg_title = ($delete === true) ? 'Successfully deleted' : 'Successfully saved into keystore';
[
$type => ui_print_success_message(
__(
$msg_ok,
$msg
),
'',
true
),
]
);
} }
echo json_encode(
[ $type => __($msg_title).':<br>'.$msg ]
);
exit; exit;
} }

View File

@ -155,13 +155,19 @@ class Diagnostics extends Wizard
]; ];
// Header. // Header.
ui_print_page_header( ui_print_standard_header(
__('%s Diagnostic tool', $this->product_name), __('Admin tools'),
'images/gm_massive_operations.png', 'images/gm_massive_operations.png',
false, false,
'', '',
true, true,
$header_buttons $header_buttons,
[
[
'link' => '',
'label' => __('%s Diagnostic tool', $this->product_name),
],
]
); );
// Print all Methods Diagnostic Info. // Print all Methods Diagnostic Info.
@ -1569,7 +1575,7 @@ class Diagnostics extends Wizard
[ [
'id' => $tableId, 'id' => $tableId,
'class' => 'info_table caption_table', 'class' => 'info_table caption_table',
'style' => 'width: 100%', 'style' => 'width: 99%',
'columns' => $columns, 'columns' => $columns,
'column_names' => $columnNames, 'column_names' => $columnNames,
'ajax_data' => [ 'ajax_data' => [

View File

@ -544,7 +544,7 @@ class HTML
'container_class' => $input['toggle_container_class'], 'container_class' => $input['toggle_container_class'],
'img_a' => $input['toggle_img_a'], 'img_a' => $input['toggle_img_a'],
'img_b' => $input['toggle_img_b'], 'img_b' => $input['toggle_img_b'],
'clean' => (isset($input['toggle_clean']) ? $input['toggle_clean'] : true), 'clean' => (isset($input['toggle_clean']) ? $input['toggle_clean'] : false),
] ]
); );
} else { } else {

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -264,27 +264,11 @@ class ModuleTemplates extends HTML
*/ */
private function ajaxMsg($type, $msg) private function ajaxMsg($type, $msg)
{ {
if ($type == 'error') { echo json_encode(
echo json_encode( [
[ $type => __($msg),
$type => ui_print_error_message( ]
__($msg), );
'',
true
),
]
);
} else {
echo json_encode(
[
$type => ui_print_success_message(
__($msg),
'',
true
),
]
);
}
exit; exit;
} }
@ -708,7 +692,7 @@ class ModuleTemplates extends HTML
'action' => $this->baseUrl, 'action' => $this->baseUrl,
'id' => 'add_module_form', 'id' => 'add_module_form',
'method' => 'POST', 'method' => 'POST',
'class' => 'modal', 'class' => 'modal filter-list-adv',
'extra' => '', 'extra' => '',
]; ];
@ -846,10 +830,10 @@ class ModuleTemplates extends HTML
false false
); );
// Create the table with Module Block list. // Create the table with Module Block list.
$table = new StdClasS(); $table = new stdClass();
$table->class = 'databox data '; $table->class = 'databox data ';
$table->width = '75%'; $table->width = '75%';
$table->styleTable = 'margin: 2em auto 0;border: 1px solid #ddd;'; $table->styleTable = 'border: 1px solid #ddd;';
$table->rowid = []; $table->rowid = [];
$table->data = []; $table->data = [];
@ -893,7 +877,7 @@ class ModuleTemplates extends HTML
); );
$data[3] .= html_print_input_image( $data[3] .= html_print_input_image(
'export_profile', 'export_profile',
'images/csv.png', 'images/file-csv.svg',
$row['id_np'], $row['id_np'],
'', '',
true, true,
@ -914,7 +898,7 @@ class ModuleTemplates extends HTML
$data[3] .= '</a>'; $data[3] .= '</a>';
$data[3] .= '<a href="'.$this->baseUrl.'&action=export&id_np='.$row['id_np'].'" onclick="blockResubmit($(this))">'; $data[3] .= '<a href="'.$this->baseUrl.'&action=export&id_np='.$row['id_np'].'" onclick="blockResubmit($(this))">';
$data[3] .= html_print_image( $data[3] .= html_print_image(
'images/csv.png', 'images/file-csv.svg',
true, true,
[ [
'title' => __('Export to CSV'), 'title' => __('Export to CSV'),
@ -1165,7 +1149,7 @@ class ModuleTemplates extends HTML
$blockComponentList = chop($blockComponentList, ','); $blockComponentList = chop($blockComponentList, ',');
// Title of Block. // Title of Block.
$blockTitle = '<div class="pdd_t_8px">'; $blockTitle = '<div class="subsection_header_title">';
$blockTitle .= $blockTable['name']; $blockTitle .= $blockTable['name'];
$blockTitle .= '<div class="white_table_header_checkbox">'; $blockTitle .= '<div class="white_table_header_checkbox">';
$blockTitle .= html_print_input_image( $blockTitle .= html_print_input_image(
@ -1186,7 +1170,7 @@ class ModuleTemplates extends HTML
$table = new StdClasS(); $table = new StdClasS();
$table->class = 'databox data border_bt'; $table->class = 'databox data border_bt';
$table->width = '75%'; $table->width = '75%';
$table->styleTable = 'margin: 2em auto 0;border: 1px solid #ddd;'; $table->styleTable = 'margin: 0; border: 1px solid #ddd;';
$table->rowid = []; $table->rowid = [];
$table->data = []; $table->data = [];
@ -1220,7 +1204,7 @@ class ModuleTemplates extends HTML
switch ($module['id_format']) { switch ($module['id_format']) {
case MODULE_NETWORK: case MODULE_NETWORK:
$formatInfo = html_print_image( $formatInfo = html_print_image(
'images/network.png', 'images/network-server@os.svg',
true, true,
[ [
'title' => __('Network module'), 'title' => __('Network module'),
@ -1231,7 +1215,7 @@ class ModuleTemplates extends HTML
case MODULE_WMI: case MODULE_WMI:
$formatInfo = html_print_image( $formatInfo = html_print_image(
'images/wmi.png', 'images/WMI@svg.svg',
true, true,
[ [
'title' => __('WMI module'), 'title' => __('WMI module'),
@ -1242,7 +1226,7 @@ class ModuleTemplates extends HTML
case MODULE_PLUGIN: case MODULE_PLUGIN:
$formatInfo = html_print_image( $formatInfo = html_print_image(
'images/plugin.png', 'images/plugins@svg.svg',
true, true,
[ [
'title' => __('Plug-in module'), 'title' => __('Plug-in module'),

View File

@ -3601,7 +3601,7 @@ class NetworkMap
url_background_grid: url_background_grid, url_background_grid: url_background_grid,
refresh_time: '.$this->mapOptions['refresh_time'].', refresh_time: '.$this->mapOptions['refresh_time'].',
font_size: '.$this->mapOptions['font_size'].', font_size: '.$this->mapOptions['font_size'].',
method: '.$this->map['generation_method'].', method: '.($this->map['generation_method'] ?? 3).',
base_url_homedir: "'.ui_get_full_url(false).'" base_url_homedir: "'.ui_get_full_url(false).'"
}); });
init_drag_and_drop(); init_drag_and_drop();

View File

@ -959,41 +959,28 @@ class SatelliteAgent extends HTML
*/ */
private function ajaxMsg($type, $msg, $delete=false, $disable=false) private function ajaxMsg($type, $msg, $delete=false, $disable=false)
{ {
$msg_err = 'Failed while saving: %s'; if ($type === 'error') {
$msg_ok = 'Successfully saved agent '; if ($delete === true) {
$msg_title = 'Failed while removing';
if ($delete === true) { } else if ($disable === true) {
$msg_err = 'Failed while removing: %s'; $msg_title = 'Failed while disabling';
$msg_ok = 'Successfully deleted '; } else {
} $msg_title = 'Failed while saving';
}
if ($disable === true) {
$msg_err = 'Failed while disabling: %s';
$msg_ok = 'Successfully disabled';
}
if ($type == 'error') {
echo json_encode(
[
$type => ui_print_error_message(
__($msg),
'',
true
),
]
);
} else { } else {
echo json_encode( if ($delete === true) {
[ $msg_title = 'Successfully deleted';
$type => ui_print_success_message( } else if ($disable === true) {
__($msg), $msg_title = 'Successfully disabled';
'', } else {
true $msg_title = 'Successfully saved agent';
), }
]
);
} }
echo json_encode(
[ $type => __($msg_title).':<br>'.$msg ]
);
exit; exit;
} }

View File

@ -475,27 +475,11 @@ class SatelliteCollection extends HTML
*/ */
private function ajaxMsg(string $type, string $msg) private function ajaxMsg(string $type, string $msg)
{ {
if ($type === 'error') { echo json_encode(
echo json_encode( [
[ $type => __($msg),
$type => ui_print_error_message( ]
__($msg), );
'',
true
),
]
);
} else {
echo json_encode(
[
$type => ui_print_success_message(
__($msg),
'',
true
),
]
);
}
exit; exit;
} }

View File

@ -183,29 +183,29 @@ class SnmpConsole extends HTML
if (!isset($config['pure']) || $config['pure'] === false) { if (!isset($config['pure']) || $config['pure'] === false) {
$statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure='.$config['pure'].'">'.html_print_image( $statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure='.$config['pure'].'">'.html_print_image(
'images/op_reporting.png', 'images/logs@svg.svg',
true, true,
[ [
'title' => __('Statistics'), 'title' => __('Statistics'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
$list['text'] = '<a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&pure=0">'.html_print_image( $list['text'] = '<a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&pure=0">'.html_print_image(
'images/op_snmp.png', 'images/SNMP-network-numeric-data@svg.svg',
true, true,
[ [
'title' => __('List'), 'title' => __('List'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
$list['active'] = true; $list['active'] = true;
$screen['text'] = '<a href="#" onClick="javascript:fullscreen(1)">'.html_print_image( $screen['text'] = '<a href="#" onClick="javascript:fullscreen(1)">'.html_print_image(
'images/full_screen.png', 'images/fullscreen@svg.svg',
true, true,
[ [
'title' => __('List'), 'title' => __('View in full screen'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
@ -242,11 +242,11 @@ class SnmpConsole extends HTML
echo '<a href="#" onClick="javascript:fullscreen(0)">'; echo '<a href="#" onClick="javascript:fullscreen(0)">';
echo html_print_image( echo html_print_image(
'images/normal_screen.png', 'images/exit_fullscreen@svg.svg',
true, true,
[ [
'title' => __('Exit fullscreen'), 'title' => __('Exit fullscreen'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
); );
echo '</a>'; echo '</a>';
@ -844,7 +844,7 @@ class SnmpConsole extends HTML
$tmp->snmp_agent .= '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&new_agent=1&direccion='.$tmp->source.'" title="'.__('Create agent').'">'.$tmp->source.'</a>'; $tmp->snmp_agent .= '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&new_agent=1&direccion='.$tmp->source.'" title="'.__('Create agent').'">'.$tmp->source.'</a>';
} else { } else {
$tmp->snmp_agent .= '<div class="'.$severity_class.' snmp-div"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'" title="'.__('View agent details').'">'; $tmp->snmp_agent .= '<div class="'.$severity_class.' snmp-div"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'" title="'.__('View agent details').'">';
$tmp->snmp_agent .= '<strong>'.$agent['alias'].ui_print_help_tip($tmp->source, true, 'images/tip.png'); $tmp->snmp_agent .= '<strong>'.$agent['alias'].ui_print_help_tip($tmp->source, true);
'</strong></a></div>'; '</strong></a></div>';
} }

View File

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

View File

@ -316,13 +316,13 @@ function ui_toggle_container($code, $name, $title='', $hidden_default=true, $ret
$data[0] = '<a href="javascript:" id="tgl_ctrl_'.$uniqid.'">'.html_print_image($original, true, ['title' => $title, 'id' => 'image_'.$uniqid, 'class' => 'invert_filter']).'&nbsp;&nbsp;<b>'.$name.'</b></a>'; $data[0] = '<a href="javascript:" id="tgl_ctrl_'.$uniqid.'">'.html_print_image($original, true, ['title' => $title, 'id' => 'image_'.$uniqid, 'class' => 'invert_filter']).'&nbsp;&nbsp;<b>'.$name.'</b></a>';
$data[1] = ui_print_group_icon($group, true); $data[1] = ui_print_group_icon($group, true);
if ($report_r && $report_w) { if ($report_r && $report_w) {
$data[2] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&id='.$id_container.'">'.html_print_image('images/config.png', true, ['class' => 'invert_filter']).'</a>'; $data[2] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&id='.$id_container.'">'.html_print_image('images/edit.svg', true, ['class' => 'invert_filter main_menu_icon']).'</a>';
} }
if ($report_r && $report_w && $report_m) { if ($report_r && $report_w && $report_m) {
if ($id_container !== '1') { if ($id_container !== '1') {
$data[2] .= '&nbsp;&nbsp;&nbsp;&nbsp'.'<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container&delete_container=1&id='.$id_container.'" onClick="if (!confirm(\''.__('Are you sure?').'\')) $data[2] .= '&nbsp;&nbsp;&nbsp;&nbsp'.'<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container&delete_container=1&id='.$id_container.'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'class' => 'invert_filter']).'</a>'; return false;">'.html_print_image('images/delete.svg', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
} }
} }

View File

@ -744,8 +744,7 @@ function filemanager_file_explorer(
// Actions buttons // Actions buttons
// Delete button. // Delete button.
$data[4] = ''; $data[4] = '<div class="table_action_buttons flex">';
$data[4] .= '<span style="display: flex">';
$typefile = array_pop(explode('.', $fileinfo['name'])); $typefile = array_pop(explode('.', $fileinfo['name']));
if (is_writable($fileinfo['realpath']) === true if (is_writable($fileinfo['realpath']) === true
&& (is_dir($fileinfo['realpath']) === false || count(scandir($fileinfo['realpath'])) < 3) && (is_dir($fileinfo['realpath']) === false || count(scandir($fileinfo['realpath'])) < 3)
@ -774,7 +773,7 @@ function filemanager_file_explorer(
&& ($typefile !== 'iso') && ($typefile !== 'docx') && ($typefile !== 'doc') && ($fileinfo['mime'] != MIME_DIR) && ($typefile !== 'iso') && ($typefile !== 'docx') && ($typefile !== 'doc') && ($fileinfo['mime'] != MIME_DIR)
) { ) {
$hash = md5($fileinfo['realpath'].$config['server_unique_identifier']); $hash = md5($fileinfo['realpath'].$config['server_unique_identifier']);
$data[4] .= "<a style='vertical-align: top;' href='$url&edit_file=1&hash=".$hash.'&location_file='.$fileinfo['realpath']."' style='float: left;'>".html_print_image('images/edit.png', true, ['style' => 'margin-top: 2px;', 'title' => __('Edit file'), 'class' => 'invert_filter']).'</a>'; $data[4] .= "<a style='vertical-align: top;' href='$url&edit_file=1&hash=".$hash.'&location_file='.$fileinfo['realpath']."' style='float: left;'>".html_print_image('images/edit.svg', true, ['style' => 'margin-top: 2px;', 'title' => __('Edit file'), 'class' => 'main_menu_icon invert_filter']).'</a>';
} }
} }
} }
@ -794,7 +793,7 @@ function filemanager_file_explorer(
$data[4] .= '<a href="javascript: show_modal_real_path(`'.$fileinfo['realpath'].'`);">'.html_print_image('images/enable.svg', true, ['style' => 'margin-top: 2px;', 'title' => __('Real path'), 'class' => 'invert_filter main_menu_icon']).'</a>'; $data[4] .= '<a href="javascript: show_modal_real_path(`'.$fileinfo['realpath'].'`);">'.html_print_image('images/enable.svg', true, ['style' => 'margin-top: 2px;', 'title' => __('Real path'), 'class' => 'invert_filter main_menu_icon']).'</a>';
} }
$data[4] .= '</span>'; $data[4] .= '</div>';
array_push($table->data, $data); array_push($table->data, $data);
} }
@ -983,7 +982,7 @@ function filemanager_file_explorer(
<div id='real_path'></div>"; <div id='real_path'></div>";
if (isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'on' || $_SERVER['SERVER_NAME'] == 'localhost' || $_SERVER['SERVER_NAME'] == '127.0.0.1') { if (isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'on' || $_SERVER['SERVER_NAME'] == 'localhost' || $_SERVER['SERVER_NAME'] == '127.0.0.1') {
$modal_real_path .= "<div style='float:right;margin: 5em 0 0 auto';>".html_print_submit_button(__('Copy'), 'submit', false, 'class="sub next"', true).'</div>'; $modal_real_path .= "<div style='float:right;margin: 5em 0 0 auto';>".html_print_submit_button(__('Copy'), 'submit', false, ['icon' => 'wand', 'mode' => 'mini'], true).'</div>';
} }
html_print_div( html_print_div(
@ -997,7 +996,7 @@ function filemanager_file_explorer(
echo '</div>'; echo '</div>';
} else { } else {
echo "<div style='text-align: right; width: ".$table->width."; color:#AC4444; margin-bottom:10px;'>"; echo "<div style='text-align: right; width: ".$table->width."; color:#AC4444; margin-bottom:10px;'>";
echo "<image class='invert_filter' src='images/info.png' />".__('The directory is read-only'); echo "<image class='main_menu_icon invert_filter' src='images/info@svg.svg' />".__('The directory is read-only');
echo '</div>'; echo '</div>';
} }
} }

View File

@ -1361,29 +1361,27 @@ function html_print_select_multiple_filtered(
$output .= '<div class="arrows-container flex-column">'; $output .= '<div class="arrows-container flex-column">';
$output .= html_print_input( $output .= html_print_image(
'images/plus.svg',
true,
[ [
'type' => 'image', 'id' => 'right_autorefreshlist',
'src' => 'images/darrowright.png', 'style' => 'width: 24px; margin: 10px 10px 0;',
'return' => true, 'alt' => __('Push selected pages into autorefresh list'),
'options' => [ 'title' => __('Push selected pages into autorefresh list'),
'title' => $texts['title-add'], 'onclick' => $add,
'onclick' => $add,
'class' => 'invert_filter',
],
] ]
); );
$output .= html_print_input( $output .= html_print_image(
'images/minus.svg',
true,
[ [
'type' => 'image', 'id' => 'left_autorefreshlist',
'src' => 'images/darrowleft.png', 'style' => 'width: 24px; margin: 10px 10px 0;',
'return' => true, 'alt' => __('Pop selected pages out of autorefresh list'),
'options' => [ 'title' => __('Pop selected pages out of autorefresh list'),
'title' => $texts['title-del'], 'onclick' => $del,
'onclick' => $del,
'class' => 'invert_filter',
],
] ]
); );
@ -2332,84 +2330,114 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*',
$adv_mode_name = '_'.$adv_mode_name; $adv_mode_name = '_'.$adv_mode_name;
} }
$table->data[0][0] = html_print_extended_select_for_downtime_cron( $table->data[1][0] = html_print_div(
'cron_hour'.$adv_mode_name, [
$hours, 'class' => '',
$hour, 'content' => html_print_extended_select_for_downtime_cron(
'', 'cron_hour'.$adv_mode_name,
__('Any'), $hours,
'*', $hour,
false, '',
true, __('Any'),
false, '*',
false, false,
false, true,
0, false,
'Valid values: [0-23], [0-23]-[0-23], *, or step value (example: */3, 10/5)' false,
false,
0,
'Valid values: [0-23], [0-23]-[0-23], *, or step value (example: */3, 10/5)'
),
],
true
); );
$table->data[1][1] = html_print_extended_select_for_downtime_cron( $table->data[1][1] = html_print_div(
'cron_minute'.$adv_mode_name, [
$minutes, 'class' => '',
$minute, 'content' => html_print_extended_select_for_downtime_cron(
'', 'cron_minute'.$adv_mode_name,
__('Any'), $minutes,
'*', $minute,
false, '',
true, __('Any'),
false, '*',
false, false,
false, true,
0, false,
'Valid values: [0-59], [0-59]-[0-59], *, or step value (example: */5, 10/1)' false,
false,
0,
'Valid values: [0-59], [0-59]-[0-59], *, or step value (example: */5, 10/1)'
),
],
true
); );
$table->data[1][2] = html_print_extended_select_for_downtime_cron( $table->data[1][2] = html_print_div(
'cron_mday'.$adv_mode_name, [
$mdays, 'class' => '',
$mday, 'content' => html_print_extended_select_for_downtime_cron(
'', 'cron_mday'.$adv_mode_name,
__('Any'), $mdays,
'*', $mday,
false, '',
true, __('Any'),
false, '*',
false, false,
false, true,
0, false,
'Valid values: [1-31], [1-31]-[1-31], *, or step value (example: */5, 7/2)' false,
false,
0,
'Valid values: [1-31], [1-31]-[1-31], *, or step value (example: */5, 7/2)'
),
],
true
); );
$table->data[1][3] = html_print_extended_select_for_downtime_cron( $table->data[1][3] = html_print_div(
'cron_month'.$adv_mode_name, [
$months, 'class' => '',
$month, 'content' => html_print_extended_select_for_downtime_cron(
'', 'cron_month'.$adv_mode_name,
__('Any'), $months,
'*', $month,
false, '',
true, __('Any'),
false, '*',
false, false,
false, true,
0, false,
'Valid values: [1-12], [1-12]-[1-12], *, or step value (example: */3, 9/1)' false,
false,
0,
'Valid values: [1-12], [1-12]-[1-12], *, or step value (example: */3, 9/1)'
),
],
true
); );
$table->data[1][4] = html_print_extended_select_for_downtime_cron( $table->data[1][4] = html_print_div(
'cron_wday'.$adv_mode_name, [
$wdays, 'class' => '',
$wday, 'content' => html_print_extended_select_for_downtime_cron(
'', 'cron_wday'.$adv_mode_name,
__('Any'), $wdays,
'*', $wday,
false, '',
true, __('Any'),
false, '*',
false, false,
false, true,
0, false,
'Valid values: [0-6], [0-6]-[0-6], *, or step value (example: */2, 3/1)' false,
false,
0,
'Valid values: [0-6], [0-6]-[0-6], *, or step value (example: */2, 3/1)'
),
],
true
); );
} }
@ -3449,7 +3477,7 @@ function html_print_action_buttons(mixed $content, array $parameters=[], bool $r
'id' => ($parameters['id'] ?? 'principal_action_buttons'), 'id' => ($parameters['id'] ?? 'principal_action_buttons'),
'class' => 'action-buttons '.$typeClass.' '.($parameters['class'] ?? ''), 'class' => 'action-buttons '.$typeClass.' '.($parameters['class'] ?? ''),
'content' => $content, 'content' => $content,
'style' => 'z-index: 1', 'style' => 'z-index: 6',
], ],
$return $return
); );
@ -4188,7 +4216,7 @@ function html_print_switch_radio_button(array $switches, array $attributes=[], b
* @param string $checked Set the button to be marked (optional, unmarked by default). * @param string $checked Set the button to be marked (optional, unmarked by default).
* @param boolean $disabled Disable the button (optional, button enabled by default). * @param boolean $disabled Disable the button (optional, button enabled by default).
* @param string $script Script to execute when onClick event is triggered (optional). * @param string $script Script to execute when onClick event is triggered (optional).
* @param string $attributes Optional HTML attributes. It's a free string which will be inserted into the HTML tag, use it carefully (optional). * @param mixed $attributes Optional HTML attributes. It's a free string which will be inserted into the HTML tag, use it carefully (optional).
* @param boolean $return Whether to return an output string or echo now (optional, echo by default). * @param boolean $return Whether to return an output string or echo now (optional, echo by default).
* @param string $id Custom id. * @param string $id Custom id.
* @param string $customAttributes Custom Attribute for customized checkbox. * @param string $customAttributes Custom Attribute for customized checkbox.
@ -4219,6 +4247,7 @@ function html_print_checkbox_extended(
$inputClass = 'custom_checkbox_input'; $inputClass = 'custom_checkbox_input';
$labelClass = 'custom_checkbox'; $labelClass = 'custom_checkbox';
$labelStyle = ' ';
if (is_array($attributes) === true) { if (is_array($attributes) === true) {
$tmpAttributes = []; $tmpAttributes = [];
@ -4232,6 +4261,10 @@ function html_print_checkbox_extended(
$labelClass .= ' '.$value; $labelClass .= ' '.$value;
break; break;
case 'label_style':
$labelStyle .= 'style="'.$value.'"';
break;
default: default:
$tmpAttributes[] = $key.'="'.$value.'"'; $tmpAttributes[] = $key.'="'.$value.'"';
break; break;
@ -4243,7 +4276,7 @@ function html_print_checkbox_extended(
$id_aux = preg_replace('/[^a-z0-9\:\;\-\_]/i', '', $name.($idcounter[$name] ? $idcounter[$name] : '')); $id_aux = preg_replace('/[^a-z0-9\:\;\-\_]/i', '', $name.($idcounter[$name] ? $idcounter[$name] : ''));
$output = '<label class="'.$labelClass.'">'; $output = '<label class="'.$labelClass.'"'.$labelStyle.'>';
$output .= '<input class="'.$inputClass.'" name="'.$name.'" type="checkbox" value="'.$value.'" '.($checked ? 'checked="checked"' : ''); $output .= '<input class="'.$inputClass.'" name="'.$name.'" type="checkbox" value="'.$value.'" '.($checked ? 'checked="checked"' : '');
$output .= (empty($id) === true) ? ' id="checkbox-'.$id_aux.'"' : ' id="'.$id.'"'; $output .= (empty($id) === true) ? ' id="checkbox-'.$id_aux.'"' : ' id="'.$id.'"';
$output .= (empty($script) === false) ? ' onclick="'.$script.'"' : ''; $output .= (empty($script) === false) ? ' onclick="'.$script.'"' : '';
@ -4905,7 +4938,8 @@ function html_print_autocomplete_modules(
$filter=[], $filter=[],
$return=false, $return=false,
$id_agent_module=0, $id_agent_module=0,
$size='30' $size='30',
$underInputTip=false
) { ) {
global $config; global $config;
@ -4962,7 +4996,11 @@ function html_print_autocomplete_modules(
html_print_input_hidden($name.'_hidden', $id_agent_module); html_print_input_hidden($name.'_hidden', $id_agent_module);
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
ui_print_help_tip(__('Type at least two characters to search the module.'), false); if ($underInputTip === true) {
ui_print_input_placeholder(__('Type at least two characters to search the module.'), false);
} else {
ui_print_help_tip(__('Type at least two characters to search the module.'), false);
}
} }
$javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false); $javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false);
@ -6626,34 +6664,32 @@ function html_print_extended_select_for_downtime_cron(
$disabled, $disabled,
'font-size: xx-small;'.$select_style 'font-size: xx-small;'.$select_style
); );
echo ' <a href="javascript:">'.html_print_image( echo ' <a style="margin: 7px" href="javascript:">'.html_print_image(
'images/edit.svg', 'images/edit.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler main_menu_icon invert_filter', 'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('Custom'), 'alt' => __('Custom'),
'title' => __('Custom'), 'title' => __('Custom'),
'style' => 'width: 18px;', // 'style' => 'margin: 7px;',
] ]
).'</a>'; ).'</a>';
echo '</div>'; echo '</div>';
$help_tooltip = ($text_help !== '') ? ui_print_help_tip(__($text_help), true) : '';
echo '<div id="'.$uniq_name.'_manual" class="w100p inline_line">'; echo '<div id="'.$uniq_name.'_manual" class="w100p inline_line">';
html_print_input_text($uniq_name.'_text', $selected, '', 20); html_print_input_text($uniq_name.'_text', $selected, '', 20, 20, false, false, false, '', 'w100p');
html_print_input_hidden($name, $selected, false, $uniq_name); html_print_input_hidden($name, $selected, false, $uniq_name);
echo ' <a href="javascript:">'.$help_tooltip.'&nbsp'.html_print_image( echo ' <a href="javascript:">'.html_print_image(
'images/logs@svg.svg', 'images/logs@svg.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler main_menu_icon invert_filter', 'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('List'), 'alt' => __('List'),
'title' => __('List'), 'title' => __('List'),
'style' => 'width: 18px;', 'style' => 'margin: 7px;',
] ]
).'</a>'; ).'</a>';
echo ($text_help !== '') ? ui_print_help_tip(__($text_help), true, '', false, 'margin: 13px 0 0 5px;') : '';
echo '</div>'; echo '</div>';
$select_init_func = (is_numeric($selected) === true || $selected === '*') ? 'post_process_select_init' : 'post_process_select_init_inv'; $select_init_func = (is_numeric($selected) === true || $selected === '*') ? 'post_process_select_init' : 'post_process_select_init_inv';

View File

@ -612,8 +612,8 @@ function snmp_browser_print_oid(
$table->head[1] = __('OID Information'); $table->head[1] = __('OID Information');
$output .= html_print_table($table, true); $output .= html_print_table($table, true);
$url = 'index.php?'.'sec=gmodules&'.'sec2=godmode/modules/manage_network_components'; $url = 'index.php?sec=gmodules&sec2=godmode/modules/manage_network_components';
$output .= '<form id="snmp_create_module" class="center mrgn_10px" target="_blank" method="post" action="'.$url.'">'; $output .= '<form id="snmp_create_module" class="center mrgn_10px flex" target="_blank" method="post" action="'.$url.'">';
$output .= html_print_input_hidden('create_network_from_snmp_browser', 1, true); $output .= html_print_input_hidden('create_network_from_snmp_browser', 1, true);
$output .= html_print_input_hidden('id_component_type', 2, true); $output .= html_print_input_hidden('id_component_type', 2, true);
$output .= html_print_input_hidden('type', 17, true); $output .= html_print_input_hidden('type', 17, true);
@ -638,19 +638,21 @@ function snmp_browser_print_oid(
__('Create network component'), __('Create network component'),
'create_network_component', 'create_network_component',
false, false,
'class="sub add float-left mrgn_right_20px"', 'class="buttonButton mrgn_right_20px"',
true true
); );
// Hidden by default. if (isset($_POST['print_create_agent_module'])) {
$output .= html_print_button( // Hidden by default.
__('Create agent module'), $output .= html_print_button(
'create_module_agent_single', __('Create agent module'),
false, 'create_module_agent_single',
'show_add_module()', false,
'class="sub add invisible"', 'show_add_module()',
true 'class="sub add invisible"',
); true
);
}
// Select agent modal. // Select agent modal.
$output .= snmp_browser_print_create_modules(true); $output .= snmp_browser_print_create_modules(true);
@ -685,7 +687,8 @@ function snmp_browser_print_container(
$width='100%', $width='100%',
$height='60%', $height='60%',
$display='', $display='',
$show_massive_buttons=false $show_massive_buttons=false,
$toggle=false
) { ) {
global $config; global $config;
@ -948,8 +951,22 @@ function snmp_browser_print_container(
); );
$table->data[2] .= '</div>'; $table->data[2] .= '</div>';
if ($toggle == true) {
$print_create_agent_module = 1;
} else {
$print_create_agent_module = 0;
}
$searchForm = '<form onsubmit="snmpBrowse(); return false;">'; $searchForm = '<form onsubmit="snmpBrowse(); return false;">';
$searchForm .= html_print_table($table, true); $searchForm .= html_print_table($table, true);
$searchForm .= html_print_input_hidden(
'print_create_agent_module',
$print_create_agent_module,
true,
false,
false,
'print_create_agent_module'
);
$searchForm .= html_print_div( $searchForm .= html_print_div(
[ [
'class' => 'action-buttons', 'class' => 'action-buttons',
@ -969,17 +986,19 @@ function snmp_browser_print_container(
$searchForm .= '</form>'; $searchForm .= '</form>';
ui_toggle( if ($toggle == true) {
$searchForm, ui_toggle(
'<span class="subsection_header_title">'.__('Filters').'</span>', $searchForm,
'filter_form', '<span class="subsection_header_title">'.__('Filters').'</span>',
'', 'filter_form',
false, '',
false, false,
'', false,
'white-box-content', '',
'box-flat white_table_graph fixed_filter_bar' 'white-box-content',
); 'box-flat white_table_graph fixed_filter_bar'
);
}
// Search tools. // Search tools.
$table2 = new stdClass(); $table2 = new stdClass();
@ -1101,6 +1120,62 @@ function snmp_browser_print_container(
); );
$output .= '</div>'; $output .= '</div>';
if ($toggle === false) {
// This extra div that can be handled by jquery's dialog.
$output .= '<div id="snmp_browser_container" style="display:none">';
$output .= '<div style="text-align: left; width: '.$width.'; height: '.$height.';">';
$output .= '<div class="w100p">';
$output .= '<form onsubmit="snmpBrowse(); return false;">';
$output .= html_print_table($table, true);
$output .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Execute'),
'srcbutton',
false,
[
'mode' => 'mini',
'icon' => 'cog',
],
true
),
],
true
);
$output .= '</form></div>';
if (isset($snmp_version) === false) {
$snmp_version = null;
}
if ($snmp_version == 3) {
$output .= '<div id="snmp3_browser_options">';
} else {
$output .= '<div id="snmp3_browser_options" style="display: none;">';
}
$output .= ui_toggle(
html_print_table($table3, true),
__('SNMP v3 options'),
'',
'',
true,
true
);
$output .= '</div>';
$output .= '<div class="search_options">';
$output .= ui_toggle(
html_print_table($table2, true),
__('Search options'),
'',
'',
true,
true
);
$output .= '</div>';
}
// SNMP tree container. // SNMP tree container.
$output .= '<div class="snmp_tree_container" id="snmp_tree_container" style="display:none">'; $output .= '<div class="snmp_tree_container" id="snmp_tree_container" style="display:none">';
$output .= html_print_input_hidden('search_count', 0, true); $output .= html_print_input_hidden('search_count', 0, true);

View File

@ -467,7 +467,7 @@ function treeview_printAlertsTable($id_module, $server_data=[], $no_head=false)
__('Go to alerts edition'), __('Go to alerts edition'),
'upd_button', 'upd_button',
false, false,
'window.location.assign(\''.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&search=1&module_name='.$module_name.'&id_agente='.$agent_id.$url_hash.'\')', 'window.location.assign("'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&search=1&module_name='.$module_name.'&id_agente='.$agent_id.$url_hash.'")',
['icon' => 'alert'], ['icon' => 'alert'],
true true
), ),
@ -588,7 +588,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$hashdata = md5($hashdata); $hashdata = md5($hashdata);
if ((bool) $grants_on_node === true && (bool) $user_access_node !== false) { if ((bool) $grants_on_node === true && (bool) $user_access_node !== false) {
$urlAgent = 'sendHash(\''.$server_data['server_url'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'\')'; $urlAgent = $server_data['server_url'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'];
} else { } else {
$urlAgent = ''; $urlAgent = '';
} }

View File

@ -908,11 +908,11 @@ function ui_print_type_agent_icon(
if ((int) $id_os === SATELLITE_OS_ID) { if ((int) $id_os === SATELLITE_OS_ID) {
// Satellite. // Satellite.
$options['title'] = __('Satellite'); $options['title'] = __('Satellite');
$output = html_print_image('images/satellite@svg.svg', true, ['class' => 'main_menu_icon invert_filter'], false, false, false, true); $output = html_print_image('images/satellite@os.svg', true, ['class' => 'main_menu_icon invert_filter'], false, false, false, true);
} else if ($remote_contact === $contact && $remote === 0 && empty($version) === true) { } else if ($remote_contact === $contact && $remote === 0 && empty($version) === true) {
// Network. // Network.
$options['title'] = __('Network'); $options['title'] = __('Network');
$output = html_print_image('images/network-server@svg.svg', true, ['class' => 'main_menu_icon invert_filter'], false, false, false, true); $output = html_print_image('images/network-server@os.svg', true, ['class' => 'main_menu_icon invert_filter'], false, false, false, true);
} else { } else {
// Software. // Software.
$options['title'] = __('Software'); $options['title'] = __('Software');
@ -1214,7 +1214,7 @@ function ui_format_alert_row(
$forceTitle, $forceTitle,
'force_execution_'.$alert['id'], 'force_execution_'.$alert['id'],
false, false,
'window.location.assign(\''.$url.'&amp;id_alert='.$alert['id'].'&amp;refr=60'.$additionUrl.'\');', 'window.location.assign("'.$url.'&amp;id_alert='.$alert['id'].'&amp;refr=60'.$additionUrl.'");',
[ 'mode' => 'link' ], [ 'mode' => 'link' ],
true true
); );
@ -1500,6 +1500,7 @@ function ui_print_alert_template_example($id_alert_template, $return=false, $pri
* @param string $image Image path. * @param string $image Image path.
* @param boolean $is_relative Route is relative or not. * @param boolean $is_relative Route is relative or not.
* @param string $id Target id. * @param string $id Target id.
* @param string $isHeader If true, the view is header.
* *
* @return string The help tip * @return string The help tip
*/ */
@ -1509,10 +1510,17 @@ function ui_print_help_icon(
$home_url='', $home_url='',
$image='images/info@svg.svg', $image='images/info@svg.svg',
$is_relative=false, $is_relative=false,
$id='' $id='',
$isHeader=false
) { ) {
global $config; global $config;
if (empty($image) === true) {
$image = 'images/info@svg.svg';
}
$iconClass = ($isHeader === true) ? 'header_help_icon' : 'main_menu_icon';
// Do not display the help icon if help is disabled. // Do not display the help icon if help is disabled.
if ((bool) $config['disable_help'] === true) { if ((bool) $config['disable_help'] === true) {
return ''; return '';
@ -1537,7 +1545,7 @@ function ui_print_help_icon(
$image, $image,
true, true,
[ [
'class' => 'img_help main_menu_icon', 'class' => 'img_help '.$iconClass,
'title' => __('Help'), 'title' => __('Help'),
'onclick' => "open_help ('".ui_get_full_url($help_handler)."')", 'onclick' => "open_help ('".ui_get_full_url($help_handler)."')",
'id' => $id, 'id' => $id,
@ -2440,35 +2448,35 @@ function ui_print_session_action_icon($action, $return=false)
global $config; global $config;
$key_icon = [ $key_icon = [
'acl' => 'images/delete.png', 'acl' => 'images/delete.svg',
'agent' => 'images/agent.png', 'agent' => 'images/agents@svg.svg',
'module' => 'images/module.png', 'module' => 'images/modules@svg.svg',
'alert' => 'images/bell.png', 'alert' => 'images/alerts.svg',
'incident' => 'images/default_list.png', 'incident' => 'images/logs@svg.svg',
'logon' => 'images/house.png', 'logon' => 'images/house@svg.svg',
'logoff' => 'images/house.png', 'logoff' => 'images/house@svg.svg',
'massive' => 'images/config.png', 'massive' => 'images/configuration@svg.svg',
'hack' => 'images/application_edit.png', 'hack' => 'images/custom-input@svg.svg',
'event' => 'images/lightning_go.png', 'event' => 'images/event.svg',
'policy' => 'images/policies_mc.png', 'policy' => 'images/policy@svg.svg',
'report' => 'images/reporting.png', 'report' => 'images/agent-fields.svg',
'file collection' => 'images/collection_col.png', 'file collection' => 'images/file-collection@svg.svg',
'user' => 'images/user_green.png', 'user' => 'images/user.svg',
'password' => 'images/lock.png', 'password' => 'images/password.svg',
'session' => 'images/heart_col.png', 'session' => 'images/star@svg.svg',
'snmp' => 'images/snmp.png', 'snmp' => 'images/SNMP-network-numeric-data@svg.svg',
'command' => 'images/bell.png', 'command' => 'images/external-tools@svg.svg',
'category' => 'images/category_col.png', 'category' => 'images/tag@svg.svg',
'dashboard' => 'images/dashboard_col.png', 'dashboard' => 'images/workstation@groups.svg',
'api' => 'images/eye.png', 'api' => 'images/enable.svg',
'db' => 'images/database.png', 'db' => 'images/data-server@svg.svg',
'setup' => 'images/cog.png', 'setup' => 'images/configuration@svg.svg',
]; ];
$output = ''; $output = '';
foreach ($key_icon as $key => $icon) { foreach ($key_icon as $key => $icon) {
if (stristr($action, $key) !== false) { if (stristr($action, $key) !== false) {
$output = html_print_image($icon, true, ['title' => $action, 'class' => 'invert_filter'], false, false, false, true).' '; $output = html_print_image($icon, true, ['title' => $action, 'class' => 'main_menu_icon invert_filter'], false, false, false, true).' ';
break; break;
} }
} }
@ -2500,6 +2508,10 @@ function ui_print_help_tip(
$style='', $style='',
$blink=false $blink=false
) { ) {
if (empty($img) === true) {
$img = 'images/info@svg.svg';
}
$output = '<a href="javascript:" class="tip" style="'.$style.'" >'; $output = '<a href="javascript:" class="tip" style="'.$style.'" >';
$output .= html_print_image( $output .= html_print_image(
$img, $img,
@ -4507,8 +4519,8 @@ function ui_print_toggle($data)
(isset($data['toggle_class']) === true) ? $data['toggle_class'] : '', (isset($data['toggle_class']) === true) ? $data['toggle_class'] : '',
(isset($data['container_class']) === true) ? $data['container_class'] : 'white-box-content', (isset($data['container_class']) === true) ? $data['container_class'] : 'white-box-content',
(isset($data['main_class']) === true) ? $data['main_class'] : 'box-flat white_table_graph', (isset($data['main_class']) === true) ? $data['main_class'] : 'box-flat white_table_graph',
(isset($data['img_a']) === true) ? $data['img_a'] : 'images/arrow_down_green.png', (isset($data['img_a']) === true) ? $data['img_a'] : 'images/arrow@svg.svg',
(isset($data['img_b']) === true) ? $data['img_b'] : 'images/arrow_right_green.png', (isset($data['img_b']) === true) ? $data['img_b'] : 'images/arrow@svg.svg',
(isset($data['clean']) === true) ? $data['clean'] : false, (isset($data['clean']) === true) ? $data['clean'] : false,
(isset($data['reverseImg']) === true) ? $data['reverseImg'] : false, (isset($data['reverseImg']) === true) ? $data['reverseImg'] : false,
(isset($data['switch']) === true) ? $data['switch'] : false, (isset($data['switch']) === true) ? $data['switch'] : false,
@ -5057,7 +5069,7 @@ function ui_print_page_header(
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
if ($help != '') { if ($help != '') {
$buffer .= "<div class='head_help head_tip'>".ui_print_help_icon($help, true, '', 'images/help_g.png').'</div>'; $buffer .= "<div class='head_help head_tip'>".ui_print_help_icon($help, true, '', '', false, '', true).'</div>';
} }
} }
@ -7158,7 +7170,7 @@ function ui_print_servertype_icon(int $id)
case MODULE_NETWORK: case MODULE_NETWORK:
$title = __('Network server'); $title = __('Network server');
$image = 'images/network-server@svg.svg'; $image = 'images/network-server@os.svg';
break; break;
case MODULE_PLUGIN: case MODULE_PLUGIN:

View File

@ -855,7 +855,7 @@ function flot_slicesbar_graph(
$full_legend_date = false; $full_legend_date = false;
} }
if (!$date_to) { if (!$date_to || $date_to === '1') {
$date_to = get_system_time(); $date_to = get_system_time();
} }

View File

@ -2400,3 +2400,10 @@ function topFunction() {
500 500
); );
} }
function menuActionButtonResizing() {
$(".action_buttons_right_content").attr(
"style",
"left: " + $("#menu_full").width() + "px;"
);
}

View File

@ -257,6 +257,8 @@ function snmpGet(oid) {
var snmp3_privacy_pass = $("#password-snmp3_browser_privacy_pass").val(); var snmp3_privacy_pass = $("#password-snmp3_browser_privacy_pass").val();
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 print_create_agent_module = $("#print_create_agent_module").val();
// Check for a custom action // Check for a custom action
var custom_action = $("#hidden-custom_action").val(); var custom_action = $("#hidden-custom_action").val();
@ -280,6 +282,8 @@ function snmpGet(oid) {
params["action"] = "snmpget"; params["action"] = "snmpget";
params["custom_action"] = custom_action; params["custom_action"] = custom_action;
params["page"] = "include/ajax/snmp_browser.ajax"; params["page"] = "include/ajax/snmp_browser.ajax";
params["target_port"] = target_port;
params["print_create_agent_module"] = print_create_agent_module;
// SNMP get! // SNMP get!
jQuery.ajax({ jQuery.ajax({
@ -560,7 +564,7 @@ function snmpBrowserWindow() {
background: "black" background: "black"
}, },
width: 1000, width: 1000,
height: 500 height: 800
}); });
} }

View File

@ -354,3 +354,35 @@ div#rules.show {
.note-special-day div a.tip > img { .note-special-day div a.tip > img {
margin: 0px; margin: 0px;
} }
form#icalendar-special-days.calendar-upload-form {
border: 0px;
padding: 0px;
}
form#icalendar-special-days.calendar-upload-form > ul {
align-items: flex-start !important;
}
form#icalendar-special-days.calendar-upload-form > ul > li > label {
font-size: 13px;
line-height: 16px;
margin-bottom: 10px;
}
.special-days-thead > thead > tr > th:not(.header) {
border: 1px solid #e2e2e2;
}
.special-days-thead > thead > tr > th.header {
border: 0px;
border-bottom: 1px solid #878787;
}
.special-days-thead > thead > tr > th.c0 {
border-left: 1px solid #e2e2e2;
}
.special-days-thead > thead > tr > th.c6 {
border-right: 1px solid #e2e2e2;
}

View File

@ -8,8 +8,8 @@
text-align: center; text-align: center;
font-size: 1.5em; font-size: 1.5em;
font-weight: bolder; font-weight: bolder;
color: #fff; color: #000;
background: #282828; background: var(--secondary-color);
padding: 8px; padding: 8px;
} }

View File

@ -6,7 +6,7 @@
/* Calendar background */ /* Calendar background */
table.scw { table.scw {
background-color: #82b92e; background-color: var(--secondary-color);
border: 0 !important; border: 0 !important;
border-radius: 4px; border-radius: 4px;
} }
@ -65,3 +65,19 @@ td.scwFoot {
color: #3c3c3c !important; color: #3c3c3c !important;
border: 0 !important; border: 0 !important;
} }
.scwHead input {
line-height: 6px;
padding-left: 5px;
background-color: #000;
color: #cccccc;
}
.scwHead input:hover {
background-color: #cccccc;
color: #000;
}
table.scw {
border: 2px solid #c0ccdc;
}

View File

@ -598,7 +598,7 @@ ul li {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-evenly; justify-content: space-evenly;
min-height: 53px; min-height: 50px;
} }
.tabs_li { .tabs_li {
@ -637,7 +637,7 @@ ul li {
} }
.tabs_collapsed { .tabs_collapsed {
height: 53px; height: 50px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;

View File

@ -489,14 +489,6 @@ li > .select2-selection {
padding: 0px !important; padding: 0px !important;
} }
.box-flat {
margin: 20px;
}
.mrgn_20px {
margin: 20px !important;
}
.omnishell_results_wrapper { .omnishell_results_wrapper {
max-width: 100% !important; max-width: 100% !important;
} }
@ -547,10 +539,6 @@ ul.datatable_filter > li > div.action-buttons > button {
height: auto !important; height: auto !important;
} }
.action_buttons_right_content {
padding-left: 20px;
}
#image-1, #image-1,
#image-2 { #image-2 {
padding-left: 0px !important; padding-left: 0px !important;
@ -560,10 +548,6 @@ ul.datatable_filter > li > div.action-buttons > button {
margin-bottom: 10px !important; margin-bottom: 10px !important;
} }
.dataTables_length {
margin-bottom: 50px !important;
}
.item_status_tree_view { .item_status_tree_view {
position: initial; position: initial;
} }

View File

@ -297,6 +297,7 @@ td input[type="checkbox"] {
padding: 10px; padding: 10px;
margin-top: 2px; margin-top: 2px;
display: table-cell; display: table-cell;
height: 15px;
} }
input[type="image"] { input[type="image"] {
@ -675,6 +676,14 @@ select:-internal-list-box {
width: 40%; width: 40%;
} }
.w45p {
width: 45%;
}
.w48p {
width: 48%;
}
.w47p { .w47p {
width: 47%; width: 47%;
} }
@ -711,6 +720,10 @@ select:-internal-list-box {
width: 80%; width: 80%;
} }
.w88p {
width: 88%;
}
.w90p { .w90p {
width: 90%; width: 90%;
} }
@ -2097,6 +2110,10 @@ table.rounded_cells td {
z-index: 5; z-index: 5;
} }
#principal_action_buttons {
z-index: 6;
}
.action-buttons > button { .action-buttons > button {
margin-left: 16px; margin-left: 16px;
} }
@ -2406,7 +2423,7 @@ ol.steps li.visited span {
} }
ol.steps li.current { ol.steps li.current {
border-left: 5px solid #778866; border-left: 5px solid var(--primary-color);
margin-left: 0; margin-left: 0;
font-weight: bold; font-weight: bold;
background-color: #e9f3d2; background-color: #e9f3d2;
@ -2778,7 +2795,7 @@ td.cellBig {
} }
.info_box_container:not(.info_box_information) { .info_box_container:not(.info_box_information) {
z-index: 2; z-index: 6;
} }
.info_box_container.info_box_information { .info_box_container.info_box_information {
@ -4800,7 +4817,7 @@ div#dialog_messages table th:last-child {
z-index: 900000; z-index: 900000;
position: absolute; position: absolute;
width: 550px; width: 550px;
margin-top: -5px; margin-top: 55px;
border-radius: 5px; border-radius: 5px;
} }
@ -5807,10 +5824,10 @@ div.label_select_child_left > span {
overflow: hidden; overflow: hidden;
} }
.switch_radio_button label { div.switch_radio_button label {
background-color: #fff; background-color: #fff;
color: rgba(0, 0, 0, 0.6); color: rgba(0, 0, 0, 0.6);
line-height: 9pt; line-height: 6px !important;
text-align: center; text-align: center;
padding: 14px 10px; padding: 14px 10px;
margin-right: -1px; margin-right: -1px;
@ -5818,14 +5835,14 @@ div.label_select_child_left > span {
transition: all 0.1s ease-in-out; transition: all 0.1s ease-in-out;
} }
.switch_radio_button label:first { div.switch_radio_button label:first-of-type {
border-top-left-radius: 4px; border-top-left-radius: 4px !important;
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px !important;
} }
.switch_radio_button label:last-child { div.switch_radio_button label:last-of-type {
border-top-right-radius: 4px; border-top-right-radius: 4px !important;
border-bottom-right-radius: 4px; border-bottom-right-radius: 4px !important;
margin-right: 0px; margin-right: 0px;
} }
@ -7519,6 +7536,9 @@ div.graph div.legend table {
.pdd_t_0px { .pdd_t_0px {
padding-top: 0px; padding-top: 0px;
} }
.pdd_t_0px_important {
padding-top: 0px !important;
}
.pdd_t_3px { .pdd_t_3px {
padding-top: 3px; padding-top: 3px;
@ -7877,6 +7897,10 @@ div.graph div.legend table {
height: 10px; height: 10px;
} }
.height_15px {
height: 15px;
}
.height_20px { .height_20px {
height: 20px; height: 20px;
} }
@ -11010,14 +11034,14 @@ pre.external_tools_output {
.tag-editor .tag-editor-tag { .tag-editor .tag-editor-tag {
padding: 5px !important; padding: 5px !important;
color: #fff !important; color: #fff !important;
background: #82b92e !important; background: var(--primary-color) !important;
border-radius: 0 2px 2px 0 !important; border-radius: 0 2px 2px 0 !important;
} }
.tag-editor .tag-editor-delete { .tag-editor .tag-editor-delete {
padding: 5px !important; padding: 5px !important;
line-height: 16px !important; line-height: 16px !important;
background: #82b92e !important; background: var(--primary-color) !important;
border-radius: 2px 0 0 2px !important; border-radius: 2px 0 0 2px !important;
} }
@ -11191,6 +11215,10 @@ table.table_modal_alternate
height: 20px; height: 20px;
} }
.header_help_icon {
width: 16px;
height: 16px;
}
.main_menu_icon.arrow_up { .main_menu_icon.arrow_up {
transform: rotate(90deg); transform: rotate(90deg);
} }
@ -11505,6 +11533,15 @@ div[role="dialog"] {
/* font-weight: bold; */ /* font-weight: bold; */
} }
.font-title-font {
font-size: 13px;
line-height: 16px;
color: #161628;
text-align: left;
margin-bottom: 10px;
font-weight: bold;
}
.preimage_container span { .preimage_container span {
font-size: 11pt; font-size: 11pt;
line-height: 28px; line-height: 28px;
@ -11540,3 +11577,30 @@ table.alert-template-fields > tbody > tr > td > div > textarea {
table.alert-template-fields > tbody > tr > td[id^="template-label_fields"] { table.alert-template-fields > tbody > tr > td[id^="template-label_fields"] {
text-align: center; text-align: center;
} }
ul.tag-editor {
list-style-type: none;
padding: 0.5em !important;
margin: 0;
overflow: hidden;
border: 2px solid #c0ccdc;
border-radius: 6px;
cursor: text;
font: normal 14px sans-serif;
color: #333333;
background: #f6f7fb;
line-height: 20px;
}
.max-width-100p {
max-width: 100%;
}
/* Datatables overrides */
.ui-dialog .ui-dialog-titlebar-close {
right: 1em !important;
}
.ui-dialog .ui-dialog-titlebar {
display: block !important;
}

View File

@ -67,11 +67,22 @@ table.agent_info_table tr {
color: #fff !important; color: #fff !important;
} }
div#head, div#head {
#menu_tabs {
border-bottom: 1px solid #1a1a1a; border-bottom: 1px solid #1a1a1a;
} }
.menu_full_classic #menu_tabs {
height: 49px;
border-bottom: 1px solid #82b92e;
padding-bottom: 2px;
}
.menu_full_collapsed #menu_tabs {
height: 49px;
border-bottom: 1px solid #82b92e;
padding-bottom: 1px;
}
#menu_full { #menu_full {
border-right: 1px solid #111; border-right: 1px solid #111;
} }
@ -248,13 +259,10 @@ ol.steps li a {
/* Tabs icons change color */ /* Tabs icons change color */
/* menu.css */ /* menu.css */
.operation { .operation,
background-color: #252525;
}
.godmode, .godmode,
#menu_full { #menu_full {
background-color: #1a1a1a; background-color: #222;
} }
.button_collapse { .button_collapse {
@ -264,11 +272,72 @@ ol.steps li a {
.operation .selected, .operation .selected,
.godmode .selected, .godmode .selected,
.menu_icon:hover { .menu_icon:hover {
background-color: #080808; background-color: #191919;
}
.submenu_text,
.span_has_menu_text,
.title_menu_classic span {
font-size: 14px;
font-weight: normal;
letter-spacing: -0.3px;
height: 18px;
color: #fff;
}
.head_tab_selected span {
color: #fff;
}
.tabs_selected {
background-color: #1d7874;
}
.operation .menu_icon ul.submenu > li,
.godmode .menu_icon ul.submenu > li {
background-color: #222;
padding-left: 24px !important;
}
.submenu_not_selected:hover {
background-color: #171717 !important;
color: #fff !important;
}
.submenu_selected {
margin-bottom: 0px;
background-color: #171717 !important;
}
.submenu_selected_no_submenu {
background-color: #111 !important;
color: #ffffff !important;
} }
.sub_subMenu { .sub_subMenu {
background-color: #343434; font-weight: normal;
background-color: #171717;
padding-left: 1.5em;
color: #fff !important;
}
.sub_subMenu.selected {
font-weight: 600;
background-color: #111 !important;
}
.sub_subMenu:hover {
background-color: #141414;
}
.sub_subMenu.selected a {
color: #fff !important;
}
.span_has_menu_text {
font-weight: normal;
font-size: 9.4pt;
color: #fff;
} }
/* footer */ /* footer */

View File

@ -235,7 +235,8 @@
.table_action_buttons > a, .table_action_buttons > a,
.table_action_buttons > img, .table_action_buttons > img,
.table_action_buttons > button { .table_action_buttons > button,
.table_action_buttons > form {
visibility: hidden; visibility: hidden;
} }
.info_table > tbody > tr:hover { .info_table > tbody > tr:hover {
@ -246,7 +247,8 @@
.info_table > tbody > tr:hover .table_action_buttons > a, .info_table > tbody > tr:hover .table_action_buttons > a,
.info_table > tbody > tr:hover .table_action_buttons > img, .info_table > tbody > tr:hover .table_action_buttons > img,
.info_table > tbody > tr:hover .table_action_buttons > button { .info_table > tbody > tr:hover .table_action_buttons > button,
.info_table > tbody > tr:hover .table_action_buttons > form {
visibility: visible; visibility: visible;
} }
@ -528,6 +530,7 @@ table.filter-table-adv td {
vertical-align: top; vertical-align: top;
} }
div.filter-table-adv-manual > div,
table.filter-table-adv td > div { table.filter-table-adv td > div {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -535,6 +538,7 @@ table.filter-table-adv td > div {
align-items: normal; align-items: normal;
} }
div.filter-table-adv-manual > div label,
table.filter-table-adv td > div label { table.filter-table-adv td > div label {
color: #161628; color: #161628;
font-size: 13px; font-size: 13px;
@ -646,10 +650,6 @@ td#save_filter_form-1-0 > b {
line-height: 16px; line-height: 16px;
} }
tr#save_filter_row1 {
display: flex !important;
}
td#save_filter_form-0-0, td#save_filter_form-0-0,
td#save_filter_form-0-1, td#save_filter_form-0-1,
td#save_filter_form-1-0 > input#text-id_name, td#save_filter_form-1-0 > input#text-id_name,

View File

@ -46,7 +46,6 @@ ul.wizard li > label:not(.p-switch):first-of-type {
} }
ul.wizard li > textarea { ul.wizard li > textarea {
width: 600px;
height: 15em; height: 15em;
display: inline-block; display: inline-block;
} }
@ -130,6 +129,12 @@ ul.wizard li > textarea {
background: #e63c52; background: #e63c52;
} }
.wizard .tag-editor li,
.wizard .tag-editor li:focus,
.wizard .tag-editor li:hover {
border: 0;
padding: 0;
}
.wizard .time_selection_container { .wizard .time_selection_container {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
@ -200,6 +205,7 @@ li#textarea-create-site > textarea {
width: 100%; width: 100%;
} }
form.alert-correlation > ul.wizard > li > label,
form#create_site > ul.wizard > li > label { form#create_site > ul.wizard > li > label {
font-size: 13px; font-size: 13px;
line-height: 16px; line-height: 16px;
@ -210,3 +216,27 @@ form#create_site > ul.wizard > li > label {
select[multiple] { select[multiple] {
min-height: 20em; min-height: 20em;
} }
form.alert-correlation > div > ul,
form.alert-correlation > ul {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
form.alert-correlation > div > ul > li.flex-flex-end {
display: flex;
align-items: flex-end;
}
form.alert-correlation > div > ul > li.flex-flex-end > input {
width: 150px !important;
}
form.alert-correlation > div > ul > li.flex-flex-end > label {
width: 50px !important;
}
form.alert-correlation > div > ul > li.display-grid > textarea {
width: 100% !important;
}

View File

@ -1169,6 +1169,10 @@ if ($config['pure'] == 0) {
$menuTypeClass = ($menuCollapsed === true) ? 'collapsed' : 'classic'; $menuTypeClass = ($menuCollapsed === true) ? 'collapsed' : 'classic';
// Container. // Container.
echo '<div id="container">'; echo '<div id="container">';
// Notifications content wrapper
echo '<div id="notification-content" class="invisible"/></div>';
// Header. // Header.
echo '<div id="head">'; echo '<div id="head">';
include 'general/header.php'; include 'general/header.php';
@ -1524,17 +1528,6 @@ require 'include/php_to_js_values.php';
} }
} }
//$('.button_collapse').on('click', menuActionButtonResizing());
// Cursor change for show a spinner. Experimental.
/*
$('.buttonButton').not('.dialog_opener').on('click', function(){
$('*').css('cursor', 'wait');
});
$('.submitButton').not('.dialog_opener').on('click', function(){
$('*').css('cursor', 'wait');
});
*/
// When the user scrolls down 400px from the top of the document, show the // When the user scrolls down 400px from the top of the document, show the
// button. // button.
window.onscroll = function() { window.onscroll = function() {
@ -1545,10 +1538,6 @@ require 'include/php_to_js_values.php';
scrollFunction() scrollFunction()
}; };
function menuActionButtonResizing() {
$('.action_buttons_right_content').attr('style', 'left: '+($('#menu_full').width())+'px;');
}
function first_time_identification() { function first_time_identification() {
jQuery.post("ajax.php", { jQuery.post("ajax.php", {
"page": "general/register", "page": "general/register",

View File

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

View File

@ -1141,7 +1141,7 @@ foreach ($agents as $agent) {
$data[0] .= ui_print_help_tip( $data[0] .= ui_print_help_tip(
__('Agent in scheduled downtime'), __('Agent in scheduled downtime'),
true, true,
'images/minireloj-16.png' 'images/clock.svg'
); );
$data[0] .= '</em>'; $data[0] .= '</em>';
} }
@ -1254,12 +1254,12 @@ foreach ($agents as $agent) {
$fb64 = base64_encode(json_encode($agent_event_filter)); $fb64 = base64_encode(json_encode($agent_event_filter));
$data[11] = '<a href="index.php?sec=eventos&sec2=operation/events/events&fb64='.$fb64.'">'.html_print_image( $data[11] = '<a href="index.php?sec=eventos&sec2=operation/events/events&fb64='.$fb64.'">'.html_print_image(
'images/lightning.png', 'images/event.svg',
true, true,
[ [
'align' => 'middle', 'align' => 'middle',
'title' => __('Agent events'), 'title' => __('Agent events'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';

View File

@ -401,7 +401,7 @@ $buttonsRefreshAgent = html_print_button(
__('Refresh data'), __('Refresh data'),
'refresh_data', 'refresh_data',
false, false,
'window.location.assign(\'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;refr=60\')', 'window.location.assign("index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;refr=60")',
[ 'mode' => 'link' ], [ 'mode' => 'link' ],
true true
); );
@ -411,7 +411,7 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true) {
__('Force checks'), __('Force checks'),
'force_checks', 'force_checks',
false, false,
'window.location.assign(\'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;flag_agent=1&amp;id_agente='.$id_agente.'\')', 'window.location.assign("index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;flag_agent=1&amp;id_agente='.$id_agente.'")',
[ 'mode' => 'link' ], [ 'mode' => 'link' ],
true true
); );

View File

@ -1,10 +1,10 @@
<?php <?php
/** /**
* Export Data view * Export data.
* *
* @category Community * @category Tools
* @package Pandora FMS * @package Pandora FMS
* @subpackage Tools * @subpackage Operation
* @version 1.0.0 * @version 1.0.0
* @license See below * @license See below
* *
@ -14,9 +14,15 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2007-2022 Artica Soluciones Tecnologicas, http://www.artica.es * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* This code is NOT free software. This code is NOT licenced under GPL2 licence * Please see http://pandorafms.org for full contribution list
* You cannnot redistribute it without written permission of copyright holder. * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================ * ============================================================================
*/ */
@ -38,9 +44,25 @@ if (!check_acl($config['id_user'], 0, 'RR')) {
ui_require_javascript_file('calendar'); ui_require_javascript_file('calendar');
// Header. // Header.
ui_print_page_header(__('Export data'), 'images/server_export_mc.png'); ui_print_standard_header(
__('Export data'),
'images/server_export_mc.png',
false,
'',
false,
[],
[
[
'link' => '',
'label' => __('Tools'),
],
[
'link' => '',
'label' => __('Export data'),
],
]
);
$group = get_parameter_post('group', 0); $group = get_parameter_post('group', 0);
$agentName = get_parameter_post('agent', 0); $agentName = get_parameter_post('agent', 0);
@ -220,48 +242,10 @@ if (!empty($export_btn) && !empty($module)) {
} }
if (empty($export_btn) || $show_form) { if (empty($export_btn) || $show_form) {
echo '<form method="post" action="index.php?sec=reporting&amp;sec2=operation/agentes/exportdata" name="export_form" id="export_form">';
$table = new stdClass();
$table->width = '100%';
$table->border = 0;
$table->cellspacing = 3;
$table->cellpadding = 5;
$table->class = 'databox filters';
$table->style[0] = 'vertical-align: top;';
$table->data = [];
// Group selector
$table->data[0][0] = '<b>'.__('Group').'</b>';
$groups = users_get_groups($config['id_user'], 'RR', users_can_manage_group_all()); $groups = users_get_groups($config['id_user'], 'RR', users_can_manage_group_all());
$table->data[0][1] = '<div class="w250px">'.html_print_select_groups(
$config['id_user'],
'RR',
true,
'group',
$group,
'',
'',
0,
true,
false,
true,
'',
false
).'</div>';
// Agent selector.
$table->data[1][0] = '<b>'.__('Source agent').'</b>';
$filter = []; $filter = [];
if ($group > 0) { $filter['id_grupo'] = ($group > 0) ? (array) $group : array_keys($groups);
$filter['id_grupo'] = (array) $group;
} else {
$filter['id_grupo'] = array_keys($groups);
}
$agents = []; $agents = [];
$rows = agents_get_agents($filter, false, 'RR'); $rows = agents_get_agents($filter, false, 'RR');
@ -286,11 +270,6 @@ if (empty($export_btn) || $show_form) {
$params['add_none_module'] = false; $params['add_none_module'] = false;
$params['size'] = 38; $params['size'] = 38;
$params['selectbox_id'] = 'module_arr'; $params['selectbox_id'] = 'module_arr';
$table->data[1][1] = ui_print_agent_autocomplete_input($params);
// Module selector.
$table->data[2][0] = '<b>'.__('Modules').'</b>';
$table->data[2][0] .= ui_print_help_tip(__('No modules of type string. You can not calculate their average'), true);
if ($agent > 0) { if ($agent > 0) {
$modules = agents_get_modules($agent); $modules = agents_get_modules($agent);
@ -325,91 +304,170 @@ if (empty($export_btn) || $show_form) {
$disabled_export_button = true; $disabled_export_button = true;
} }
$table->data[2][1] = html_print_select($modules, 'module_arr[]', array_keys($modules), '', '', 0, true, true, true, 'w250px', false);
// Start date selector.
$table->data[3][0] = '<b>'.__('Begin date').'</b>';
$table->data[3][1] = html_print_input_text(
'start_date',
date('Y-m-d', (get_system_time() - SECONDS_1DAY)),
false,
13,
10,
true
);
$table->data[3][1] .= html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'onclick' => "scwShow(scwID('text-start_date'),this);",
'class' => 'invert_filter',
]
);
$table->data[3][1] .= html_print_input_text(
'start_time',
date('H:i:s', (get_system_time() - SECONDS_1DAY)),
false,
10,
9,
true
);
// End date selector.
$table->data[4][0] = '<b>'.__('End date').'</b>';
$table->data[4][1] = html_print_input_text(
'end_date',
date('Y-m-d', get_system_time()),
false,
13,
10,
true
);
$table->data[4][1] .= html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'onclick' => "scwShow(scwID('text-end_date'),this);",
'class' => 'invert_filter',
]
);
$table->data[4][1] .= html_print_input_text(
'end_time',
date('H:i:s', get_system_time()),
false,
10,
9,
true
);
// Export type.
$table->data[5][0] = '<b>'.__('Export type').'</b>';
$export_types = []; $export_types = [];
$export_types['data'] = __('Data table'); $export_types['data'] = __('Data table');
$export_types['csv'] = __('CSV'); $export_types['csv'] = __('CSV');
$export_types['excel'] = __('MS Excel'); $export_types['excel'] = __('MS Excel');
$export_types['avg'] = __('Average per hour/day'); $export_types['avg'] = __('Average per hour/day');
$table->data[5][1] = html_print_select($export_types, 'export_type', $export_type, '', '', 0, true, false, true, 'w250px', false);
echo '<form method="post" action="index.php?sec=reporting&amp;sec2=operation/agentes/exportdata" name="export_form" id="export_form">';
$table = new stdClass();
$table->width = '100%';
$table->border = 0;
$table->cellspacing = 3;
$table->cellpadding = 5;
$table->class = 'databox filter-table-adv';
$table->style[0] = 'vertical-align: top;';
$table->data = [];
// Group selector.
$table->data[0][] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
$config['id_user'],
'RR',
true,
'group',
$group,
'',
'',
0,
true,
false,
true,
'',
false
)
);
// Agent selector.
$table->data[0][] = html_print_label_input_block(
__('Source agent'),
ui_print_agent_autocomplete_input($params)
);
// Module selector.
$table->data[1][] = html_print_label_input_block(
__('Modules'),
html_print_select(
$modules,
'module_arr[]',
array_keys($modules),
'',
'',
0,
true,
true,
true,
'w100p',
false
).ui_print_input_placeholder(
__('No modules of type string. You can not calculate their average'),
true
)
);
// Export type.
$table->data[1][] = html_print_label_input_block(
__('Export type'),
html_print_select(
$export_types,
'export_type',
$export_type,
'',
'',
0,
true,
false,
true,
'w100p',
false
)
);
// Start date selector.
$table->data[2][] = html_print_label_input_block(
__('Begin date'),
html_print_div(
[
'class' => 'flex-content',
'content' => html_print_input_text(
'start_date',
date('Y-m-d', (get_system_time() - SECONDS_1DAY)),
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'onclick' => "scwShow(scwID('text-start_date'),this);",
'class' => 'main_menu_icon invert_filter',
]
).html_print_input_text(
'start_time',
date('H:i:s', (get_system_time() - SECONDS_1DAY)),
false,
10,
9,
true
),
],
true
)
);
// End date selector.
$table->data[2][] = html_print_label_input_block(
__('End date'),
html_print_div(
[
'class' => 'flex-content',
'content' => html_print_input_text(
'end_date',
date('Y-m-d', get_system_time()),
false,
13,
10,
true
).html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'onclick' => "scwShow(scwID('text-end_date'),this);",
'class' => 'main_menu_icon invert_filter',
]
).html_print_input_text(
'end_time',
date('H:i:s', get_system_time()),
false,
10,
9,
true
),
],
true
),
);
html_print_table($table); html_print_table($table);
// Submit button. // Submit button.
html_print_div( html_print_action_buttons(
[ html_print_button(
'class' => 'action-buttons', __('Export'),
'content' => html_print_button( 'export_btn',
__('Export'), false,
'export_btn', 'change_action()',
false, ['icon' => 'wand'],
'change_action()', true
['icon' => 'wand'], )
true
),
]
); );
echo '</form>'; echo '</form>';

View File

@ -289,12 +289,12 @@ if (empty($result_groups) === false) {
echo "<td class='group_view_data center vertical_middle'>"; echo "<td class='group_view_data center vertical_middle'>";
if (!isset($data['_is_tag_']) && check_acl($config['id_user'], $data['_id_'], 'AW')) { if (!isset($data['_is_tag_']) && check_acl($config['id_user'], $data['_id_'], 'AW')) {
echo '<a href="index.php?sec=estado&sec2=operation/agentes/group_view&update_netgroup='.$data['_id_'].'">'.html_print_image( echo '<a href="index.php?sec=estado&sec2=operation/agentes/group_view&update_netgroup='.$data['_id_'].'">'.html_print_image(
'images/target.png', 'images/change-active.svg',
true, true,
[ [
'border' => '0', 'border' => '0',
'title' => __('Force'), 'title' => __('Force'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
} }

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -64,11 +64,11 @@ if ($group_sent === true) {
$is_ajax = is_ajax(); $is_ajax = is_ajax();
if ($is_ajax === false && $pure === false) { if ($is_ajax === false && $pure === false) {
$viewtab['config'] = '<a id="config" href="">'.html_print_image( $viewtab['config'] = '<a id="config" href="">'.html_print_image(
'images/setup.png', 'images/configuration@svg.svg',
true, true,
[ [
'title' => __('Config'), 'title' => __('Config'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
@ -81,11 +81,11 @@ if ($is_ajax === false && $pure === false) {
); );
$viewtab['full_screen'] = '<a id="full_screen" href="'.$url.'">'.html_print_image( $viewtab['full_screen'] = '<a id="full_screen" href="'.$url.'">'.html_print_image(
'images/full_screen.png', 'images/fullscreen@svg.svg',
true, true,
[ [
'title' => __('Full screen'), 'title' => __('Full screen'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
@ -208,11 +208,11 @@ if ($is_ajax === false && $pure === true) {
echo '<a href="'.$urlNoFull.'">'; echo '<a href="'.$urlNoFull.'">';
echo html_print_image( echo html_print_image(
'images/normal_screen.png', 'images/exit_fullscreen@svg.svg',
true, true,
[ [
'title' => __('Back to normal mode'), 'title' => __('Back to normal mode'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
); );
echo '</a>'; echo '</a>';

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -52,7 +52,7 @@ $buttons['message_list'] = [
true, true,
[ [
'title' => __('Received messages'), 'title' => __('Received messages'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -64,7 +64,7 @@ $buttons['sent_messages'] = [
true, true,
[ [
'title' => __('Sent messages'), 'title' => __('Sent messages'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -76,7 +76,7 @@ $buttons['create_message'] = [
true, true,
[ [
'title' => __('Create message'), 'title' => __('Create message'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -218,11 +218,8 @@ if ($read_message) {
true true
); );
html_print_div( html_print_action_buttons(
[ $outputButtons
'class' => 'action-buttons',
'content' => $outputButtons,
],
); );
return; return;
@ -264,18 +261,6 @@ if ($send_mes === true) {
// User info. // User info.
$own_info = get_user_info($config['id_user']); $own_info = get_user_info($config['id_user']);
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->data = [];
$table->data[0][0] = __('Sender');
$table->data[0][1] = (empty($own_info['fullname']) === false) ? $own_info['fullname'] : $config['id_user'];
$table->data[1][0] = __('Destination');
$is_admin = (bool) db_get_value( $is_admin = (bool) db_get_value(
'is_admin', 'is_admin',
'tusuario', 'tusuario',
@ -305,15 +290,29 @@ foreach ($users_full as $user_id => $user_info) {
$users[$user_info['id_user']] = (empty($user_info['fullname']) === true) ? $user_info['id_user'] : $user_info['fullname']; $users[$user_info['id_user']] = (empty($user_info['fullname']) === true) ? $user_info['id_user'] : $user_info['fullname'];
} }
$table = new stdClass();
$table->id = 'send_message_table';
$table->width = '100%';
$table->class = 'databox max_floating_element_size filter-table-adv';
$table->style = [];
$table->style[0] = 'width: 30%';
$table->style[1] = 'width: 70%';
$table->data = [];
$table->data[0][] = html_print_label_input_block(
__('Sender'),
'<span class="result_info_text">'.((empty($own_info['fullname']) === false) ? $own_info['fullname'] : $config['id_user']).'</span>'
);
// Check if the user to reply is in the list, if not add reply user. // Check if the user to reply is in the list, if not add reply user.
if ($reply === true) { if ($reply === true) {
$table->data[1][1] = (array_key_exists($dst_user, $users) === true) ? $users[$dst_user] : $dst_user; $destinationInputs = (array_key_exists($dst_user, $users) === true) ? $users[$dst_user] : $dst_user;
$table->data[1][1] .= html_print_input_hidden( $destinationInputs .= html_print_input_hidden(
'dst_user', 'dst_user',
$dst_user, $dst_user,
true true
); );
$table->data[1][1] .= html_print_input_hidden( $destinationInputs .= html_print_input_hidden(
'replied', 'replied',
'1', '1',
true true
@ -324,21 +323,27 @@ if ($reply === true) {
$groups = users_get_groups($config['id_user'], 'AR'); $groups = users_get_groups($config['id_user'], 'AR');
// Get a list of all groups. // Get a list of all groups.
$table->data[1][1] = html_print_select( $destinationInputs = html_print_div(
$users,
'dst_user',
$dst_user,
'changeStatusOtherSelect(\'dst_user\', \'dst_group\')',
__('Select user'),
false,
true,
false,
''
);
$table->data[1][1] .= '&nbsp;&nbsp;'.__('OR').'&nbsp;&nbsp;';
$table->data[1][1] .= html_print_div(
[ [
'class' => 'w250px inline', 'class' => 'select_users mrgn_right_5px',
'content' => html_print_select(
$users,
'dst_user',
$dst_user,
'changeStatusOtherSelect(\'dst_user\', \'dst_group\')',
__('Select user'),
false,
true,
false,
''
),
],
true
);
$destinationInputs .= __('OR');
$destinationInputs .= html_print_div(
[
'class' => 'mrgn_lft_5px',
'content' => html_print_select_groups( 'content' => html_print_select_groups(
$config['id_user'], $config['id_user'],
'AR', 'AR',
@ -355,24 +360,41 @@ if ($reply === true) {
); );
} }
$table->data[2][0] = __('Subject'); $table->data[0][] = html_print_label_input_block(
$table->data[2][1] = html_print_input_text( __('Destination'),
'subject', html_print_div(
$subject, [
'', 'class' => 'flex-content-left',
50, 'content' => $destinationInputs,
70, ],
true true
)
); );
$table->data[3][0] = __('Message'); $table->colspan[1][] = 2;
$table->data[3][1] = html_print_textarea( $table->data[1][] = html_print_label_input_block(
'message', __('Subject'),
15, html_print_input_text(
255, 'subject',
$message, $subject,
'', '',
true 50,
70,
true
)
);
$table->colspan[2][] = 2;
$table->data[2][] = html_print_label_input_block(
__('Message'),
html_print_textarea(
'message',
15,
50,
$message,
'',
true
)
); );
$jsOutput = ''; $jsOutput = '';
@ -396,17 +418,14 @@ echo '<form method="post" action="index.php?sec=message_list&amp;sec2=operation/
// Print the main table. // Print the main table.
html_print_table($table); html_print_table($table);
// Print the action buttons section. // Print the action buttons section.
html_print_div( html_print_action_buttons(
[ html_print_submit_button(
'class' => 'action-buttons', __('Send message'),
'content' => html_print_submit_button( 'send_mes',
__('Send message'), false,
'send_mes', [ 'icon' => 'wand' ],
false, true
[ 'icon' => 'wand' ], )
true
),
]
); );
echo '</form>'; echo '</form>';

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -206,26 +206,37 @@ if (empty($messages) === true) {
$data[0] = ''; $data[0] = '';
if ($message['read'] == 1) { if ($message['read'] == 1) {
if ($show_sent === true) { if ($show_sent === true) {
$data[0] .= '<a href="index.php?sec=message_list&amp;sec2=operation/messages/message_edit&read_message=1&amp;show_sent=1&amp;id_message='.$message_id.'">'; $pathRead = 'index.php?sec=message_list&amp;sec2=operation/messages/message_edit&read_message=1&amp;show_sent=1&amp;id_message='.$message_id;
$data[0] .= html_print_image('images/email_inbox.png', true, ['border' => 0, 'title' => __('Click to read'), 'class' => 'invert_filter']); $titleRead = __('Click to read');
$data[0] .= '</a>';
} else { } else {
$data[0] .= '<a href="index.php?sec=message_list&amp;sec2=operation/messages/message_list&amp;mark_unread=1&amp;id_message='.$message_id.'">'; $pathRead = 'index.php?sec=message_list&amp;sec2=operation/messages/message_list&amp;mark_unread=1&amp;id_message='.$message_id;
$data[0] .= html_print_image('images/email_inbox.png', true, ['border' => 0, 'title' => __('Mark as unread'), 'class' => 'invert_filter']); $titleRead = __('Mark as unread');
$data[0] .= '</a>';
} }
} else { } else {
if ($show_sent === true) { if ($show_sent === true) {
$data[0] .= '<a href="index.php?sec=message_list&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;show_sent=1&amp;id_message='.$message_id.'">'; $pathRead = 'index.php?sec=message_list&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;show_sent=1&amp;id_message='.$message_id;
$data[0] .= html_print_image('images/email_inbox.png', true, ['border' => 0, 'title' => __('Message unread - click to read'), 'class' => 'invert_filter']); $titleRead = __('Message unread - click to read');
$data[0] .= '</a>';
} else { } else {
$data[0] .= '<a href="index.php?sec=message_list&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;id_message='.$message_id.'">'; $pathRead = 'index.php?sec=message_list&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;id_message='.$message_id;
$data[0] .= html_print_image('images/email_inbox.png', true, ['border' => 0, 'title' => __('Message unread - click to read'), 'class' => 'invert_filter']); $titleRead = __('Message unread - click to read');
$data[0] .= '</a>';
} }
} }
$data[0] = html_print_anchor(
[
'href' => $pathRead,
'content' => html_print_image(
'images/email_inbox.png',
true,
[
'title' => $titleRead,
'class' => 'main_menu_icon invert_filter',
],
),
],
true
);
if ($show_sent === true) { if ($show_sent === true) {
$dest_user = get_user_fullname($message['dest']); $dest_user = get_user_fullname($message['dest']);
if (!$dest_user) { if (!$dest_user) {
@ -243,18 +254,24 @@ if (empty($messages) === true) {
} }
if ($show_sent === true) { if ($show_sent === true) {
$data[2] = '<a href="index.php?sec=message_list&amp;sec2=operation/messages/message_edit&amp;read_message=1&show_sent=1&amp;id_message='.$message_id.'">'; $pathSubject = 'index.php?sec=message_list&amp;sec2=operation/messages/message_edit&amp;read_message=1&show_sent=1&amp;id_message='.$message_id;
} else { } else {
$data[2] = '<a href="index.php?sec=message_list&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;id_message='.$message_id.'">'; $pathSubject = 'index.php?sec=message_list&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;id_message='.$message_id;
} }
if ($message['subject'] == '') { $contentSubject = (empty($message['subject']) === true) ? __('No Subject') : $message['subject'];
$data[2] .= __('No Subject');
} else { if ((int) $message['read'] !== 1) {
$data[2] .= $message['subject']; $contentSubject = '<strong>'.$contentSubject.'</strong>';
} }
$data[2] .= '</a>'; $data[2] .= html_print_anchor(
[
'href' => $pathSubject,
'content' => $contentSubject,
],
true
);
$data[3] = ui_print_timestamp( $data[3] = ui_print_timestamp(
$message['timestamp'], $message['timestamp'],
@ -264,13 +281,27 @@ if (empty($messages) === true) {
$table->cellclass[][4] = 'table_action_buttons'; $table->cellclass[][4] = 'table_action_buttons';
if ($show_sent === true) { if ($show_sent === true) {
$data[4] = '<a href="index.php?sec=message_list&amp;sec2=operation/messages/message_list&show_sent=1&delete_message=1&id='.$message_id.'" $pathDelete = 'index.php?sec=message_list&amp;sec2=operation/messages/message_list&show_sent=1&delete_message=1&id='.$message_id;
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>';
} else { } else {
$data[4] = '<a href="index.php?sec=message_list&amp;sec2=operation/messages/message_list&delete_message=1&id='.$message_id.'" $pathDelete = 'index.php?sec=message_list&amp;sec2=operation/messages/message_list&delete_message=1&id='.$message_id;
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>';
} }
$data[4] = html_print_anchor(
[
'href' => $pathDelete,
'content' => html_print_image(
'images/delete.svg',
true,
[
'title' => __('Delete'),
'class' => 'main_menu_icon invert_filter',
]
),
'onClick' => 'javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;',
],
true
);
array_push($table->data, $data); array_push($table->data, $data);
} }
} }
@ -312,11 +343,8 @@ if (empty($messages) === false) {
echo '<form id="create_message_form" method="post" class="float-right" action="index.php?sec=message_list&sec2=operation/messages/message_edit"></form>'; echo '<form id="create_message_form" method="post" class="float-right" action="index.php?sec=message_list&sec2=operation/messages/message_edit"></form>';
html_print_div( html_print_action_buttons(
[ $outputButton
'class' => 'action-buttons',
'content' => $outputButton,
]
); );
?> ?>

View File

@ -226,77 +226,52 @@ ui_print_standard_header(
// ------------------- END HEADER --------------------------------------- // ------------------- END HEADER ---------------------------------------
// ------------------------ INIT FORM ----------------------------------- // ------------------------ INIT FORM -----------------------------------
$table = new stdClass(); $table2 = new stdClass();
$table->id = 'controls_table'; $table2->id = 'controls_table';
$table->width = '100%'; $table2->size[2] = '50%';
$table->class = 'filter-table-adv'; $table2->size[3] = '50%';
$table2->style[0] = 'text-align:center';
$table2->style[1] = 'text-align:center';
$table2->styleTable = 'border:none';
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
$table->width = '100%'; $table2->width = '100%';
$table->class = 'databox filters'; $table2->class = 'databox filters';
$table->head[0] = __('View Report'); $table2->head[0] = __('View Report');
$table->head_colspan[0] = 5; $table2->head_colspan[0] = 5;
$table->headstyle[0] = 'text-align: center'; $table2->headstyle[0] = 'text-align: center';
} }
$table->style = [];
$table->style[0] = 'vertical-align: middle';
$table->rowspan[0][0] = 2;
// Set initial conditions for these controls, later will be modified by javascript // Set initial conditions for these controls, later will be modified by javascript
if (!$enable_init_date) { if (!$enable_init_date) {
$table->style[1] = 'display: none';
$table->style[2] = 'display: flex;align-items: baseline;';
$display_to = 'none'; $display_to = 'none';
$display_item = ''; $display_item = '';
} else { } else {
$table->style[1] = 'display: "block"';
$table->style[2] = 'display: flex;align-items: baseline;';
$display_to = ''; $display_to = '';
$display_item = 'none'; $display_item = 'none';
} }
$table->size = [];
$table->colspan[0][1] = 2;
$table->data = [];
$table->data[0][0] = html_print_image(
'images/reporting32.png',
true,
[
'width' => '32',
'height' => '32',
]
);
if (reporting_get_description($id_report)) {
$table->data[0][1] = '<div class="float-left">'.reporting_get_description($id_report).'</div>';
} else {
$table->data[0][1] = '<div class="float-left">'.reporting_get_name($id_report).'</div>';
}
$table->data[0][1] .= '<div class="float-right">'.__('Set initial date').html_print_checkbox('enable_init_date', 1, $enable_init_date, true).'</br>';
$html_menu_export = enterprise_hook('reporting_print_button_export'); $html_menu_export = enterprise_hook('reporting_print_button_export');
if ($html_menu_export === ENTERPRISE_NOT_HOOK) { if ($html_menu_export === ENTERPRISE_NOT_HOOK) {
$html_menu_export = ''; $html_menu_export = '';
} }
$table->data[0][1] .= '</div>'; $table2->data[0][2] = '<div><span class="font-title-font">'.__('Set initial date').'</span><br>'.html_print_checkbox_switch('enable_init_date', 1, $enable_init_date, true).'</div><br>';
$table->data[0][1] .= $html_menu_export; $table2->data[0][2] .= '<div style="display:'.$display_to.'" id="string_from"><div><span class="font-title-font">'.__('From').':</span></div>';
$table2->data[0][2] .= html_print_input_text('date_init', $date_init, '', 12, 10, true).' ';
$table2->data[0][2] .= html_print_input_text('time_init', $time_init, '', 10, 7, true).' ';
$table2->data[0][2] .= '</div><div style="display:'.$display_item.'" id="string_items"><span class="font-title-font">'.__('Items period before').':</span></div>';
$table2->data[0][2] .= '<div style="display:'.$display_to.'" id="string_to"><span class="font-title-font">'.__('to').':</span></div>';
$table2->data[0][2] .= html_print_input_text('date', $date, '', 12, 10, true).' ';
$table2->data[0][2] .= html_print_input_text('time', $time, '', 10, 7, true).' ';
$table2->data[0][3] = $html_menu_export;
$table->data[1][1] = '<div>'.__('From').': </div>';
$table->data[1][1] .= html_print_input_text('date_init', $date_init, '', 12, 10, true).' ';
$table->data[1][1] .= html_print_input_text('time_init', $time_init, '', 10, 7, true).' ';
$table->data[1][2] = '<div style="display:'.$display_item.'" id="string_items">'.__('Items period before').':</div>';
$table->data[1][2] .= '<div style="display:'.$display_to.'" id="string_to">'.__('to').':</div>';
$table->data[1][2] .= html_print_input_text('date', $date, '', 12, 10, true).' ';
$table->data[1][2] .= html_print_input_text('time', $time, '', 10, 7, true).' ';
$searchForm = '<form method="post" action="'.$url.'&pure='.$config['pure'].'" class="mrgn_right_0px">'; $searchForm = '<form method="post" action="'.$url.'&pure='.$config['pure'].'" class="mrgn_right_0px">';
$searchForm .= html_print_table($table, true); $searchForm .= html_print_table($table2, true);
$searchForm .= html_print_input_hidden('id_report', $id_report, true); $searchForm .= html_print_input_hidden('id_report', $id_report, true);
$Actionbuttons .= html_print_submit_button( $Actionbuttons .= html_print_submit_button(
@ -354,10 +329,6 @@ for ($i = 0; $i < count($report['contents']); $i++) {
reporting_html_print_report($report, false, $config['custom_report_info']); reporting_html_print_report($report, false, $config['custom_report_info']);
// ----------------------------------------------------------------------
// The rowspan of the first row is only 2 in controls table. Why is used the same code here and in the items??
$table->rowspan[0][0] = 1;
echo '<div id="loading" class="center">'; echo '<div id="loading" class="center">';
echo html_print_image('images/wait.gif', true, ['border' => '0']); echo html_print_image('images/wait.gif', true, ['border' => '0']);
echo '<strong>'.__('Loading').'...</strong>'; echo '<strong>'.__('Loading').'...</strong>';
@ -396,7 +367,6 @@ $(document).ready (function () {
changeYear: true, changeYear: true,
showAnim: "slideDown"}); showAnim: "slideDown"});
$('[id^=text-time_init]').timepicker({ $('[id^=text-time_init]').timepicker({
showSecond: true, showSecond: true,
timeFormat: '<?php echo TIME_FORMAT_JS; ?>', timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
@ -414,22 +384,16 @@ $(document).ready (function () {
changeYear: true, changeYear: true,
showAnim: "slideDown"}); showAnim: "slideDown"});
$("*", "#controls_table-0").css("display", ""); //Re-show the first row of form.
/* Show/hide begin date reports controls */ /* Show/hide begin date reports controls */
$("#checkbox-enable_init_date").click(function() { $("#checkbox-enable_init_date").click(function() {
flag = $("#checkbox-enable_init_date").is(':checked'); flag = $("#checkbox-enable_init_date").is(':checked');
if (flag == true) { if (flag == true) {
$("#controls_table-1-1").css("display", "");
$("#controls_table-1-2").css("display", "");
$("#string_to").show(); $("#string_to").show();
$('#string_from').show();
$("#string_items").hide(); $("#string_items").hide();
} } else {
else {
$("#controls_table-1-1").css("display", "none");
$("#controls_table-1-2").css("display", "");
$("#string_to").hide(); $("#string_to").hide();
$('#string_from').hide();
$("#string_items").show(); $("#string_items").show();
} }
}); });

View File

@ -50,11 +50,11 @@ if ($config['pure']) {
// Windowed. // Windowed.
$link['text'] = '<a target="_top" href="'.$url.'&pure=0&refr=30">'; $link['text'] = '<a target="_top" href="'.$url.'&pure=0&refr=30">';
$link['text'] .= html_print_image( $link['text'] .= html_print_image(
'images/normal_screen.png', 'images/exit_fullscreen@svg.svg',
true, true,
[ [
'title' => __('Normal screen'), 'title' => __('Normal screen'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
); );
$link['text'] .= '</a>'; $link['text'] .= '</a>';
@ -62,11 +62,11 @@ if ($config['pure']) {
// Fullscreen. // Fullscreen.
$link['text'] = '<a target="_top" href="'.$url.'&pure=1&refr=0">'; $link['text'] = '<a target="_top" href="'.$url.'&pure=1&refr=0">';
$link['text'] .= html_print_image( $link['text'] .= html_print_image(
'images/full_screen.png', 'images/fullscreen@svg.svg',
true, true,
[ [
'title' => __('Full screen'), 'title' => __('Full screen'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
); );
$link['text'] .= '</a>'; $link['text'] .= '</a>';
@ -93,7 +93,7 @@ ui_print_standard_header(
); );
// SNMP tree container. // SNMP tree container.
snmp_browser_print_container(false, '100%', '60%', '', true); 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>';
@ -655,7 +655,7 @@ function show_add_module() {
snmp3_auth_pass : $('#password-snmp3_browser_auth_pass').val(), snmp3_auth_pass : $('#password-snmp3_browser_auth_pass').val(),
snmp3_privacy_method : $('#snmp3_browser_privacy_method').val(), snmp3_privacy_method : $('#snmp3_browser_privacy_method').val(),
snmp3_privacy_pass : $('#password-snmp3_browser_privacy_pass').val(), snmp3_privacy_pass : $('#password-snmp3_browser_privacy_pass').val(),
tcp_port : $('#target_port').val(),
}; };
// Append values to form. // Append values to form.

View File

@ -39,20 +39,20 @@ $refr = (int) get_parameter('refr', 0);
$fullscreen = []; $fullscreen = [];
if ($config['pure']) { if ($config['pure']) {
$fullscreen['text'] = '<a target="_top" href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure=0&refr='.$refr.'">'.html_print_image( $fullscreen['text'] = '<a target="_top" href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure=0&refr='.$refr.'">'.html_print_image(
'images/normal_screen.png', 'images/exit_fullscreen@svg.svg',
true, true,
[ [
'title' => __('Normal screen'), 'title' => __('Normal screen'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
} else { } else {
$fullscreen['text'] = '<a target="_top" href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure=1&refr='.$refr.'">'.html_print_image( $fullscreen['text'] = '<a target="_top" href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure=1&refr='.$refr.'">'.html_print_image(
'images/full_screen.png', 'images/fullscreen@svg.svg',
true, true,
[ [
'title' => __('Full screen'), 'title' => __('Full screen'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
} }
@ -60,11 +60,11 @@ if ($config['pure']) {
// List // List
$list = []; $list = [];
$list['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_view&pure='.$config['pure'].'&refresh='.$refr.'">'.html_print_image( $list['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_view&pure='.$config['pure'].'&refresh='.$refr.'">'.html_print_image(
'images/op_snmp.png', 'images/SNMP-network-numeric-data@svg.svg',
true, true,
[ [
'title' => __('List'), 'title' => __('List'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
@ -72,11 +72,11 @@ $list['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_v
$statistics = []; $statistics = [];
$statistics['active'] = true; $statistics['active'] = true;
$statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure='.$config['pure'].'&refr='.$refr.'">'.html_print_image( $statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure='.$config['pure'].'&refr='.$refr.'">'.html_print_image(
'images/op_reporting.png', 'images/logs@svg.svg',
true, true,
[ [
'title' => __('Statistics'), 'title' => __('Statistics'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License

View File

@ -27,11 +27,7 @@
*/ */
// Begin. // Begin.
if (is_metaconsole() === true) { ui_require_css_file('tree');
ui_require_css_file('tree_meta');
} else {
ui_require_css_file('tree');
}
ui_require_css_file('fixed-bottom-box'); ui_require_css_file('fixed-bottom-box');
@ -168,10 +164,6 @@ switch ($tab) {
break; break;
} }
if (is_metaconsole() === true) {
$tabs = [];
}
if (!$strict_acl) { if (!$strict_acl) {
$header_title = $header_title.' &raquo; '.$header_sub_title; $header_title = $header_title.' &raquo; '.$header_sub_title;
} }
@ -373,11 +365,7 @@ html_print_input_hidden('tag-id', $tag_id);
ui_include_time_picker(); ui_include_time_picker();
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/'); ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
if (is_metaconsole() === true) { ui_require_javascript_file('TreeController', 'include/javascript/tree/');
ui_require_javascript_file('TreeControllerMeta', 'include/javascript/tree/');
} else {
ui_require_javascript_file('TreeController', 'include/javascript/tree/');
}
ui_print_spinner(__('Loading')); ui_print_spinner(__('Loading'));
@ -388,10 +376,6 @@ html_print_div(
] ]
); );
if (is_metaconsole() === true) {
echo '</div>';
}
$infoHeadTitle = 'Sombra oscura'; $infoHeadTitle = 'Sombra oscura';
?> ?>
@ -505,7 +489,7 @@ $infoHeadTitle = 'Sombra oscura';
emptyMessage: "<?php echo __('No data found'); ?>", emptyMessage: "<?php echo __('No data found'); ?>",
foundMessage: foundMessage, foundMessage: foundMessage,
tree: data.tree, tree: data.tree,
baseURL: "<?php echo ui_get_full_url(false, false, false, is_metaconsole()); ?>", baseURL: "<?php echo ui_get_full_url(false, false, false, false); ?>",
ajaxURL: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>", ajaxURL: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
filter: parameters['filter'], filter: parameters['filter'],
counterTitles: { counterTitles: {

View File

@ -77,28 +77,28 @@ if (is_metaconsole()) {
user_meta_print_header(); user_meta_print_header();
$urls['main'] = 'index.php?sec=advanced&amp;sec2=advanced/users_setup&amp;tab=user_edit'; $urls['main'] = 'index.php?sec=advanced&amp;sec2=advanced/users_setup&amp;tab=user_edit';
} else { } else {
$urls['main'] = 'index.php?sec=workspace&amp;sec2=operation/users/user_edit'; $urls['main'] = 'index.php?sec=gusuarios&sec2=godmode/users/user_list';
$urls['notifications'] = 'index.php?sec=workspace&amp;sec2=operation/users/user_edit_notifications'; $urls['notifications'] = 'index.php?sec=workspace&amp;sec2=operation/users/user_edit_notifications';
$buttons = [ $buttons = [
'main' => [ 'main' => [
'active' => $_GET['sec2'] === 'operation/users/user_edit', 'active' => $_GET['sec2'] === 'godmode/users/user_list&tab=user&pure=0',
'text' => "<a href='{$urls['main']}'>".html_print_image( 'text' => "<a href='{$urls['main']}'>".html_print_image(
'images/user.png', 'images/user.svg',
true, true,
[ [
'title' => __('User management'), 'title' => __('User management'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
], ],
'notifications' => [ 'notifications' => [
'active' => $_GET['sec2'] === 'operation/users/user_edit_notifications', 'active' => $_GET['sec2'] === 'operation/users/user_edit_notifications',
'text' => "<a href='{$urls['notifications']}'>".html_print_image( 'text' => "<a href='{$urls['notifications']}'>".html_print_image(
'images/alerts_template.png', 'images/alert@svg.svg',
true, true,
[ [
'title' => __('User notifications'), 'title' => __('User notifications'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
], ],

View File

@ -15,7 +15,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -58,7 +58,7 @@ if (get_parameter('change_label', 0)) {
} }
echo '<div id="user-notifications-wrapper" class="white_box table_div table_three_columns"> echo '<div id="user-notifications-wrapper" class="white_box table_div table_three_columns padding-2">
<div class="table_thead"> <div class="table_thead">
<div class="table_th"></div> <div class="table_th"></div>
<div class="table_th">'.__('Enable').'</div> <div class="table_th">'.__('Enable').'</div>
@ -91,8 +91,9 @@ foreach ($sources as $source) {
} }
if ((bool) $disabled_flag === true) { if ((bool) $disabled_flag === true) {
$s = __('Controls have been disabled by the system administrator'); ui_print_warning_message(
echo '<span class="bolder color_ff0">'.$s.'</span>'; __('Controls have been disabled by the system administrator')
);
} }
echo '</div>'; echo '</div>';

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.769 %define version 7.0NG.769
%define release 230307 %define release 230309
# 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.769 %define version 7.0NG.769
%define release 230307 %define release 230309
# 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.769 %define version 7.0NG.769
%define release 230307 %define release 230309
%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

@ -4206,3 +4206,17 @@ CREATE TABLE `tevent_sound` (
`sound` TEXT NULL, `sound` TEXT NULL,
`active` TINYINT NOT NULL DEFAULT '1', `active` TINYINT NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `tsesion_filter`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tsesion_filter` (
`id_filter` INT NOT NULL AUTO_INCREMENT,
`id_name` TEXT NULL,
`text` TEXT NULL,
`period` TEXT NULL,
`ip` TEXT NULL,
`type` TEXT NULL,
`user` TEXT NULL,
PRIMARY KEY (`id_filter`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -34,19 +34,19 @@ if (\is_metaconsole() === true) {
\alerts_meta_print_header($tabs); \alerts_meta_print_header($tabs);
} else { } else {
// Header. // Header.
\ui_print_page_header( \ui_print_standard_header(
// Title. __('Alerts'),
__('Calendars Edit'),
// Icon.
'images/gm_alerts.png', 'images/gm_alerts.png',
// Return.
false, false,
// Help.
'alert_special_days', 'alert_special_days',
// Godmode.
true, true,
// Options. $tabs,
$tabs [
[
'link' => '',
'label' => __('Calendars Edit'),
],
]
); );
} }
@ -114,19 +114,24 @@ $inputs[] = [
'rows' => 50, 'rows' => 50,
'columns' => 30, 'columns' => 30,
], ],
'class' => 'w100p',
]; ];
$button_create = '';
if ($is_management_allowed === true) { if ($is_management_allowed === true) {
// Submit. // Submit.
$inputs[] = [ html_print_action_buttons(
'arguments' => [ html_print_submit_button(
'name' => 'button', (($create === true) ? __('Create') : __('Update')),
'label' => (($create === true) ? __('Create') : __('Update')), 'button',
'type' => 'submit', false,
'attributes' => 'class="sub next"', [
], 'icon' => 'wand',
]; 'form' => 'create_specia_days',
],
true
)
);
} }
// Print form. // Print form.
@ -135,6 +140,8 @@ HTML::printForm(
'form' => [ 'form' => [
'action' => $url.'&op=edit&action=save&id='.$calendar->id(), 'action' => $url.'&op=edit&action=save&id='.$calendar->id(),
'method' => 'POST', 'method' => 'POST',
'id' => 'create_specia_days',
'class' => 'aaaa',
], ],
'inputs' => $inputs, 'inputs' => $inputs,
], ],

View File

@ -101,7 +101,7 @@ try {
[ [
'id' => $tableId, 'id' => $tableId,
'class' => 'info_table', 'class' => 'info_table',
'style' => 'width: 100%', 'style' => 'width: 99%',
'columns' => $columns, 'columns' => $columns,
'column_names' => $column_names, 'column_names' => $column_names,
'ajax_url' => $ajax_url, 'ajax_url' => $ajax_url,
@ -117,12 +117,14 @@ try {
[ [
'label' => __('Free search'), 'label' => __('Free search'),
'type' => 'text', 'type' => 'text',
'class' => 'mw250px', 'class' => 'w25p',
'id' => 'free_search', 'id' => 'free_search',
'name' => 'free_search', 'name' => 'free_search',
], ],
], ],
], ],
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
'dom_elements' => 'lftpB',
] ]
); );
} catch (Exception $e) { } catch (Exception $e) {
@ -130,7 +132,7 @@ try {
} }
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) { if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
HTML::printForm( $form_create = HTML::printForm(
[ [
'form' => [ 'form' => [
'action' => $url.'&op=edit', 'action' => $url.'&op=edit',
@ -142,10 +144,12 @@ if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
'name' => 'button', 'name' => 'button',
'label' => __('Create'), 'label' => __('Create'),
'type' => 'submit', 'type' => 'submit',
'attributes' => 'class="sub next"', 'attributes' => ['icon' => 'wand'],
], ],
], ],
], ],
] ],
true
); );
html_print_action_buttons($form_create);
} }

View File

@ -35,19 +35,19 @@ if (\is_metaconsole() === true) {
\alerts_meta_print_header($tabs); \alerts_meta_print_header($tabs);
} else { } else {
// Header. // Header.
\ui_print_page_header( ui_print_standard_header(
// Title. __('Alerts'),
__('Special days'),
// Icon.
'images/gm_alerts.png', 'images/gm_alerts.png',
// Return.
false, false,
// Help.
'alert_special_days', 'alert_special_days',
// Godmode.
true, true,
// Options. $tabs,
$tabs [
[
'link' => '',
'label' => __('Special days'),
],
]
); );
} }
@ -85,6 +85,7 @@ $inputs[] = [
'rows' => 10, 'rows' => 10,
'options' => ['required' => 1], 'options' => ['required' => 1],
], ],
'class' => 'flex flex_column',
]; ];
$days = []; $days = [];
@ -104,6 +105,7 @@ $inputs[] = [
'type' => 'select', 'type' => 'select',
'fields' => $days, 'fields' => $days,
], ],
'class' => 'mrgn_right_20px',
]; ];
// Group. // Group.
@ -114,6 +116,7 @@ $inputs[] = [
'returnAllGroup' => true, 'returnAllGroup' => true,
'name' => 'id_group', 'name' => 'id_group',
], ],
'class' => 'mrgn_right_20px',
]; ];
// Group. // Group.
@ -128,6 +131,7 @@ $inputs[] = [
'id' => 'overwrite', 'id' => 'overwrite',
'disabled_hidden' => true, 'disabled_hidden' => true,
], ],
'class' => 'flex flex_column',
]; ];
// Submit. // Submit.
@ -136,23 +140,39 @@ $inputs[] = [
'name' => 'button', 'name' => 'button',
'label' => __('Upload'), 'label' => __('Upload'),
'type' => 'submit', 'type' => 'submit',
'attributes' => 'class="sub next"', 'attributes' => [
'icon' => 'wand',
'class' => 'mini',
],
], ],
]; ];
if ($is_management_allowed === true) { if ($is_management_allowed === true) {
// Print form. // Print form.
HTML::printForm( $form_upload = HTML::printForm(
[ [
'form' => [ 'form' => [
'action' => $url.'&op=upload_ical&id='.$id_calendar, 'action' => $url.'&op=upload_ical&id='.$id_calendar,
'method' => 'POST', 'method' => 'POST',
'id' => 'icalendar-special-days', 'id' => 'icalendar-special-days',
'enctype' => 'multipart/form-data', 'enctype' => 'multipart/form-data',
'class' => 'calendar-upload-form',
], ],
'inputs' => $inputs, 'inputs' => $inputs,
], ],
false true
);
ui_toggle(
$form_upload,
'<span class="subsection_header_title">'.__('Upload').'</span>',
__('Upload'),
'upload',
true,
false,
'',
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph fixed_filter_bar '
); );
} }
@ -216,7 +236,7 @@ for ($month = 1; $month <= 12; $month++) {
$cal_table = new stdClass(); $cal_table = new stdClass();
$cal_table->width = '100%'; $cal_table->width = '100%';
$cal_table->class = 'databox data'; $cal_table->class = 'databox data special-days-thead';
$cal_table->data = []; $cal_table->data = [];
$cal_table->head = []; $cal_table->head = [];
@ -238,7 +258,7 @@ for ($month = 1; $month <= 12; $month++) {
$cal_table->size[6] = '14%'; $cal_table->size[6] = '14%';
$cal_table->align = []; $cal_table->align = [];
$cal_table->border = '1'; $cal_table->border = '1';
$cal_table->titlestyle = 'text-align:center; font-weight: bold;'; $cal_table->titlestyle = 'text-align:center;';
switch ($display_month) { switch ($display_month) {
case 1: case 1:
$cal_table->title = __('January'); $cal_table->title = __('January');
@ -467,7 +487,7 @@ for ($month = 1; $month <= 12; $month++) {
} }
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) { if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
HTML::printForm( $form_create = HTML::printForm(
[ [
'form' => [ 'form' => [
'action' => $url.'&op=edit', 'action' => $url.'&op=edit',
@ -479,12 +499,14 @@ if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
'name' => 'button', 'name' => 'button',
'label' => __('Create'), 'label' => __('Create'),
'type' => 'submit', 'type' => 'submit',
'attributes' => 'class="sub next"', 'attributes' => ['icon' => 'wand'],
], ],
], ],
], ],
] ],
true
); );
html_print_action_buttons($form_create);
} }
echo '<div id="modal-alert-templates" class="invisible"></div>'; echo '<div id="modal-alert-templates" class="invisible"></div>';

View File

@ -156,14 +156,18 @@ $inputs[] = [
if ($is_management_allowed === true) { if ($is_management_allowed === true) {
// Submit. // Submit.
$inputs[] = [ html_print_action_buttons(
'arguments' => [ html_print_submit_button(
'name' => 'button', (($create === true) ? __('Create') : __('Update')),
'label' => (($create === true) ? __('Create') : __('Update')), 'button',
'type' => 'submit', false,
'attributes' => 'class="sub next"', [
], 'icon' => 'wand',
]; 'form' => 'form-special-days',
],
true
)
);
} }
// Print form. // Print form.

View File

@ -48,6 +48,7 @@ $inputs = [
'class' => 'search_input', 'class' => 'search_input',
'autofocus' => true, 'autofocus' => true,
], ],
'class' => 'pdd_t_0px_important',
], ],
]; ];
@ -58,9 +59,8 @@ HTML::printForm(
] ]
); );
ui_pagination($total, '#', $offset, 9);
$output = '<div class="container-list-widgets" >'; $output = '<div class="container-list-widgets mrgn_top_50px">';
foreach ($widgets as $widget) { foreach ($widgets as $widget) {
$urlWidgets = $config['homedir']; $urlWidgets = $config['homedir'];
@ -97,3 +97,5 @@ foreach ($widgets as $widget) {
$output .= '</div>'; $output .= '</div>';
echo $output; echo $output;
ui_pagination($total, '#', $offset, 9, false, 'offset', false, 'center mrgn_top_10px');

View File

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

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.769-230307" pandora_version="7.0NG.769-230309"
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.769"; my $pandora_version = "7.0NG.769";
my $pandora_build = "230307"; my $pandora_build = "230309";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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