Merge branch 'ent-9662-Restyling-fuentes-colores-botones' of brutus.artica.es:artica/pandorafms into ent-9662-Restyling-fuentes-colores-botones

This commit is contained in:
Pablo Aragon 2023-03-02 17:10:01 +01:00
commit 816f0f4770
77 changed files with 1880 additions and 814 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.769-230301 Version: 7.0NG.769-230302
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-230301" pandora_version="7.0NG.769-230302"
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 => '230301'; use constant AGENT_BUILD => '230302';
# 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 230301 %define release 230302
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 230301 %define release 230302
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="230301" PI_BUILD="230302"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{230301} {230302}
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 230301") #define PANDORA_VERSION ("7.0NG.769 Build 230302")
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 230301))" VALUE "ProductVersion", "(7.0NG.769(Build 230302))"
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-230301 Version: 7.0NG.769-230302
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-230301" pandora_version="7.0NG.769-230302"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -76,10 +76,6 @@ function dbmgr_extension_main()
global $config; global $config;
if (is_metaconsole() === true) {
open_meta_frame();
}
if (!is_user_admin($config['id_user'])) { if (!is_user_admin($config['id_user'])) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
@ -92,7 +88,21 @@ function dbmgr_extension_main()
$sql = (string) get_parameter('sql'); $sql = (string) get_parameter('sql');
$node_id = (int) get_parameter('node_id', -1); $node_id = (int) get_parameter('node_id', -1);
ui_print_page_header(__('Database interface'), 'images/gm_db.png', false, false, true); // Header.
ui_print_standard_header(
__('Database interface'),
'images/gm_db.png',
false,
'',
true,
[],
[
[
'link' => '',
'label' => __('Extensions'),
],
]
);
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
$img = '../../images/warning_modern.png'; $img = '../../images/warning_modern.png';
@ -285,10 +295,6 @@ function dbmgr_extension_main()
html_print_table($table); html_print_table($table);
echo '</div>'; echo '</div>';
if (is_metaconsole()) {
close_meta_frame();
}
} }

View File

@ -15,9 +15,6 @@ global $config;
check_login(); check_login();
ui_require_css_file('first_task'); ui_require_css_file('first_task');
?> ?>
<?php
ui_print_info_message(['no_close' => true, 'message' => __('There are no custom graphs defined yet.') ]);
?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
@ -36,7 +33,17 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no custom
?> ?>
</p> </p>
<form action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder" method="post"> <form action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Custom Graph'); ?>" /> <?php
html_print_action_buttons(
html_print_submit_button(
__('Create Custom Graph'),
'button_task',
false,
['icon' => 'wand'],
true
)
);
?>
</form> </form>
</div> </div>
</div> </div>

View File

@ -36,10 +36,6 @@ enterprise_include_once('meta/include/functions_alerts_meta.php');
check_login(); check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'LM')) { if (! check_acl($config['id_user'], 0, 'LM')) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
@ -473,5 +469,3 @@ if (is_management_allowed() === true) {
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';
} }
enterprise_hook('close_meta_frame');

View File

@ -566,8 +566,6 @@ tyle='display:none;'>";
echo '</div>'; echo '</div>';
} }
enterprise_hook('open_meta_frame');
if ($update_command) { if ($update_command) {
include_once 'configure_alert_command.php'; include_once 'configure_alert_command.php';
return; return;
@ -836,8 +834,6 @@ if (users_is_admin() === true) {
echo '</div>'; echo '</div>';
} }
enterprise_hook('close_meta_frame');
?> ?>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -21,8 +21,6 @@ enterprise_include_once('meta/include/functions_alerts_meta.php');
check_login(); check_login();
enterprise_hook('open_meta_frame');
if (is_ajax()) { if (is_ajax()) {
$get_template_tooltip = (bool) get_parameter('get_template_tooltip'); $get_template_tooltip = (bool) get_parameter('get_template_tooltip');
@ -124,7 +122,7 @@ $sec = (is_metaconsole() === true) ? 'advanced' : 'galertas';
// case delete_templete action is performed. // case delete_templete action is performed.
if (!$delete_template) { if (!$delete_template) {
// Header. // Header.
if (defined('METACONSOLE')) { if (is_metaconsole() === true) {
alerts_meta_print_header(); alerts_meta_print_header();
} else { } else {
ui_print_page_header( ui_print_page_header(
@ -485,5 +483,3 @@ if (is_management_allowed() === true) {
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';
} }
enterprise_hook('close_meta_frame');

View File

@ -48,8 +48,6 @@ if (is_ajax()) {
} }
} }
enterprise_hook('open_meta_frame');
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
$sec = 'advanced'; $sec = 'advanced';
} else { } else {
@ -412,8 +410,6 @@ if ($is_management_allowed === true) {
echo '</form>'; echo '</form>';
enterprise_hook('close_meta_frame');
ui_require_javascript_file('pandora_alerts'); ui_require_javascript_file('pandora_alerts');
ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/'); ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
?> ?>

View File

@ -36,8 +36,6 @@ enterprise_include_once('meta/include/functions_alerts_meta.php');
check_login(); check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'PM')) { if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
@ -392,7 +390,6 @@ if ($is_management_allowed === true) {
echo '</form>'; echo '</form>';
enterprise_hook('close_meta_frame');
?> ?>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -32,8 +32,6 @@ global $config;
// Check login and ACLs. // Check login and ACLs.
check_login(); check_login();
enterprise_hook('open_meta_frame');
if (!check_acl($config['id_user'], 0, 'PM') && !is_user_admin($config['id_user'])) { if (!check_acl($config['id_user'], 0, 'PM') && !is_user_admin($config['id_user'])) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
@ -70,30 +68,24 @@ $buttons = [
$buttons[$tab]['active'] = true; $buttons[$tab]['active'] = true;
// Header. ui_print_standard_header(
if (is_metaconsole() === true) { __('Categories configuration'),
ui_meta_print_header(__('Categories configuration'), __('List'), $buttons); 'images/gm_modules.png',
} else { false,
ui_print_standard_header( '',
__('Categories configuration'), true,
'images/gm_modules.png', $buttons,
false, [
'',
true,
$buttons,
[ [
[ 'link' => '',
'link' => '', 'label' => __('Resources'),
'label' => __('Resources'), ],
], [
[ 'link' => '',
'link' => '', 'label' => __('Module categories'),
'label' => __('Module categories'), ],
], ]
] );
);
}
$is_management_allowed = true; $is_management_allowed = true;
if (is_management_allowed() === false) { if (is_management_allowed() === false) {
@ -277,6 +269,4 @@ if ($is_management_allowed === true) {
); );
echo '</form>'; echo '</form>';
enterprise_hook('close_meta_frame');
} }

View File

@ -274,8 +274,6 @@ if (is_ajax() === true) {
return; return;
} }
enterprise_hook('open_meta_frame');
$tab = (string) get_parameter('tab', 'groups'); $tab = (string) get_parameter('tab', 'groups');
if ($tab !== 'credbox' if ($tab !== 'credbox'
@ -990,7 +988,6 @@ if ($is_management_allowed === true
ui_require_javascript_file('TreeController', 'include/javascript/tree/'); ui_require_javascript_file('TreeController', 'include/javascript/tree/');
enterprise_hook('close_meta_frame');
$tab = 'group_edition'; $tab = 'group_edition';
?> ?>

View File

@ -33,7 +33,6 @@ $management_allowed = is_management_allowed();
if (is_metaconsole() === true) { 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');
enterprise_hook('open_meta_frame');
components_meta_print_header(); components_meta_print_header();
if ($management_allowed === false) { if ($management_allowed === false) {
@ -375,7 +374,6 @@ if ($result === false) {
} }
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
enterprise_hook('close_meta_frame');
echo '<div id="deploy_messages" class="invisible">'; echo '<div id="deploy_messages" class="invisible">';
echo '<span>'.__( echo '<span>'.__(
'The configurations of inventory modules from the nodes have been unified. 'The configurations of inventory modules from the nodes have been unified.

View File

@ -31,8 +31,6 @@ global $config;
check_login(); check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) { if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
@ -380,8 +378,6 @@ html_print_action_buttons(
['type' => 'form_action'] ['type' => 'form_action']
); );
enterprise_hook('close_meta_frame');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$( document ).ready(function() { $( document ).ready(function() {

View File

@ -30,8 +30,6 @@ global $config;
check_login(); check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) { if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
@ -934,8 +932,6 @@ html_print_action_buttons(
] ]
); );
enterprise_hook('close_meta_frame');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$( document ).ready(function() { $( document ).ready(function() {

View File

@ -115,20 +115,18 @@ if ($edit_graph === true) {
// ----------------------- // -----------------------
$url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1'; $url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1';
if ($edit_graph === true) { if ($edit_graph === true) {
$output = "<form method='post' action='".$url.'&update_graph=1&id='.$id_graph."'>"; $output = "<form method='post' class='max_floating_element_size' action='".$url.'&update_graph=1&id='.$id_graph."'>";
} else { } else {
$output = "<form method='post' action='".$url."&add_graph=1'>"; $output = "<form method='post' class='max_floating_element_size' action='".$url."&add_graph=1'>";
} }
$output .= "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>"; $output .= "<table width='100%' cellpadding=4 cellspacing=4 class='filter-table-adv databox'>";
$output .= '<tr>'; $output .= '<tbody width="100%">';
$output .= "<td class='datos'><b>".__('Name').'</b></td>'; $output .= '<tr class="datos2">';
$output .= "<td class='datos'><input type='text' name='name' size='25' "; $graphInTgraph['name'] = (isset($graphInTgraph['name']) === true) ? $graphInTgraph['name'] : '';
if ($edit_graph === true) { $output .= '<td width="50%">';
$output .= "value='".$graphInTgraph['name']."' "; $output .= html_print_label_input_block(__('Name'), html_print_input_text('name', $graphInTgraph['name'], '', '', 255, true), ['style' => 'width:50%']);
} $output .= '</td>';
$output .= '>';
$own_info = get_user_info($config['id_user']); $own_info = get_user_info($config['id_user']);
@ -140,9 +138,9 @@ if (users_can_manage_group_all('RW') === false
$return_all_group = false; $return_all_group = false;
} }
$output .= '<td><b>'.__('Group').'</b></td><td>'; $output .= '<td width="50%">';
if (check_acl($config['id_user'], 0, 'RW')) { if (check_acl($config['id_user'], 0, 'RW')) {
$output .= html_print_input( $inputGroup = html_print_input(
[ [
'type' => 'select_groups', 'type' => 'select_groups',
'id_user' => $config['id_user'], 'id_user' => $config['id_user'],
@ -158,7 +156,7 @@ if (check_acl($config['id_user'], 0, 'RW')) {
] ]
); );
} else if (check_acl($config['id_user'], 0, 'RM')) { } else if (check_acl($config['id_user'], 0, 'RM')) {
$output .= html_print_input( $inputGroup = html_print_input(
[ [
'type' => 'select_groups', 'type' => 'select_groups',
'id_user' => $config['id_user'], 'id_user' => $config['id_user'],
@ -175,38 +173,34 @@ if (check_acl($config['id_user'], 0, 'RW')) {
); );
} }
$output .= html_print_label_input_block(__('Group'), $inputGroup);
$output .= '</td></tr>'; $output .= '</td></tr>';
$output .= '<tr>'; $output .= '<tr class="datos2">';
$output .= "<td class='datos2'><b>".__('Description').'</b></td>'; $output .= '<td width="100%" colspan="2">';
$output .= "<td class='datos2' colspan=3><textarea name='description' class='height_45px' cols=55 rows=2>"; $graphInTgraph['description'] = (isset($graphInTgraph['description']) === true) ? $graphInTgraph['description'] : '';
if ($edit_graph === true) { $output .= html_print_label_input_block(
$output .= $graphInTgraph['description']; __('Description'),
} html_print_textarea('description', 10, 5, $graphInTgraph['description'], '', true)
$output .= '</textarea>';
$output .= '</td></tr>';
if ($stacked == CUSTOM_GRAPH_GAUGE) {
$hidden = ' class="invisible" ';
} else {
$hidden = '';
}
$output .= '<tr>';
$output .= "<td class='datos'>";
$output .= '<b>'.__('Period').'</b></td>';
$output .= "<td class='datos'>";
$output .= html_print_extended_select_for_time(
'period',
$period,
'',
'',
'0',
10,
true
); );
$output .= "</td><td class='datos2'>"; $output .= '</td>';
$output .= '<b>'.__('Type of graph').'</b></td>'; $output .= '</tr><tr class="datos2">';
$output .= "<td class='datos2'> <div class='left inline'>"; $output .= "<td class='datos' width='50%''>";
$output .= html_print_label_input_block(
__('Period'),
html_print_extended_select_for_time(
'period',
$period,
'',
'',
'0',
false,
true,
false,
false,
'w100p'
)
);
$output .= "</td><td class='datos2' width='50%'>";
require_once $config['homedir'].'/include/functions_graph.php'; require_once $config['homedir'].'/include/functions_graph.php';
@ -221,90 +215,116 @@ $stackeds = [
CUSTOM_GRAPH_VBARS => __('Vertical bars'), CUSTOM_GRAPH_VBARS => __('Vertical bars'),
CUSTOM_GRAPH_PIE => __('Pie'), CUSTOM_GRAPH_PIE => __('Pie'),
]; ];
$output .= html_print_select($stackeds, 'stacked', $stacked, '', '', 0, true); $output .= html_print_label_input_block(
__('Type of graph'),
$output .= '</div></td></tr>'; html_print_select(
$stackeds,
$output .= '<tr>'; 'stacked',
$output .= "<td class='datos2 thresholdDiv'><b>"; $stacked,
$output .= __('Equalize maximum thresholds'); '',
$output .= '</b></td>'; '',
$output .= "<td class='datos2 thresholdDiv'>"; 0,
$output .= html_print_checkbox( true
'threshold', )
CUSTOM_GRAPH_BULLET_CHART_THRESHOLD,
$check,
true,
false,
'',
false
); );
$output .= '</td></tr>'; $output .= '</td></tr>';
$output .= "<tr><td class='datos2 sparse_graph '><b>"; $output .= '<tr class="datos2">';
$output .= __('Percentil'); $output .= "<td class='datos2 thresholdDiv' width='50%'>";
$output .= '</b></td>'; $output .= html_print_label_input_block(
$output .= "<td class='datos2 sparse_graph'>"; __('Equalize maximum thresholds'),
$output .= html_print_checkbox( html_print_checkbox(
'percentil', 'threshold',
1, CUSTOM_GRAPH_BULLET_CHART_THRESHOLD,
$percentil, $check,
true true,
false,
'',
false
)
);
$output .= '</td>';
$output .= '<td class="datos2 sparse_graph" width="50%">';
$output .= html_print_label_input_block(
__('Percentil'),
html_print_checkbox(
'percentil',
1,
$percentil,
true
)
); );
$output .= '</td>'; $output .= '</td>';
$output .= '</tr>'; $output .= '</tr>';
$output .= "<tr><td class='datos2 sparse_graph'><b>"; $output .= '<tr class="datos2"><td class="datos2 sparse_graph" width="50%">';
$output .= __('Add summatory series'); $output .= html_print_label_input_block(
$output .= '</b></td>'; __('Add summatory series'),
$output .= "<td class='datos2 sparse_graph'>"; html_print_checkbox(
$output .= html_print_checkbox( 'summatory_series',
'summatory_series', 1,
1, $summatory_series,
$summatory_series, true
true )
); );
$output .= "</td><td class='datos2 sparse_graph'><b>"; $output .= "</td><td class='datos2 sparse_graph' width='50%'>";
$output .= __('Add average series'); $output .= html_print_label_input_block(
$output .= '</b></td>'; __('Add average series'),
$output .= "<td class='datos2 sparse_graph'>"; html_print_checkbox(
$output .= html_print_checkbox( 'average_series',
'average_series', 1,
1, $average_series,
$average_series, true
true )
); );
$output .= '</td></tr>'; $output .= '</td></tr>';
$output .= "<tr><td class='datos2 sparse_graph'><b>"; $output .= '<tr class="datos2"><td class="datos2 sparse_graph" width="50%">';
$output .= __('Modules and series'); $output .= html_print_label_input_block(
$output .= '</b></td>'; __('Modules and series'),
$output .= "<td class='datos2 sparse_graph'>"; html_print_checkbox('modules_series', 1, $modules_series, true)
$output .= html_print_checkbox('modules_series', 1, $modules_series, true); );
$output .= '</td>'; $output .= '</td>';
$output .= "<td class='datos2 sparse_graph'><b>"; $output .= "<td class='datos2 sparse_graph' width='50%'>";
$output .= __('Show full scale graph (TIP)'); $output .= html_print_label_input_block(
$output .= '</td>'; __('Show full scale graph (TIP)'),
$output .= "<td class='datos2 sparse_graph'>"; html_print_checkbox('fullscale', 1, $fullscale, true)
$output .= html_print_checkbox('fullscale', 1, $fullscale, true); );
$output .= '</td>'; $output .= '</td>';
$output .= '</tr>'; $output .= '</tr>';
$output .= '</tbody>';
$output .= '</table>'; $output .= '</table>';
$labelButton = ($edit_graph === true) ? __('Update') : __('Create');
$ActionButtons[] = html_print_submit_button(
$labelButton,
'store',
false,
[
'class' => 'sub ok submitButton',
'icon' => 'next',
],
true
);
$ActionButtons[] = html_print_button(
__('Go back'),
'back',
false,
"window.location.href = 'index.php?sec=reporting&sec2=godmode/reporting/graphs'",
[
'class' => 'sub ok submitButton',
'icon' => 'back',
'mode' => 'secondary',
],
true
);
$output .= html_print_div( $output .= html_print_div(
[ [
'class' => 'action-buttons', 'class' => 'action-buttons',
'content' => html_print_submit_button( 'content' => html_print_action_buttons(implode('', $ActionButtons), ['type' => 'form_action'], true),
($edit_graph === true) ? __('Update') : __('Create'),
'store',
false,
[ 'icon' => 'next' ],
true
).html_print_go_back_button(
'index.php?sec=reporting&sec2=godmode/reporting/graphs',
[],
true
),
], ],
true true
); );

View File

@ -222,217 +222,309 @@ $graphs = custom_graphs_get_user($config['id_user'], false, true, $access);
$offset = (int) get_parameter('offset'); $offset = (int) get_parameter('offset');
$table_aux = new stdClass(); $table_aux = new stdClass();
$table_aux->width = '100%'; $table_aux->width = '100%';
$table_aux->class = 'databox filters'; if (is_metaconsole() === true) {
$table_aux->cellpadding = 0; $table_aux->class = 'databox filters';
$table_aux->cellspacing = 0; $table_aux->cellpadding = 0;
$table_aux->cellspacing = 0;
$table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, '', false, false, 'id_grupo', $strict_user).'<br>';
$table_aux->data[0][2] = '<b>'.__('Free text for search: ').ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
).'</b>';
$table_aux->data[0][3] = html_print_input_text('search', $search, '', 30, '', true);
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true);
$filter = "<form class ='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure'
method='post'>";
$filter .= html_print_table($table_aux, true);
$filter .= '</form>';
ui_toggle($filter, __('Show Option'));
} else {
$table_aux->class = 'filter-table-adv';
$table_aux->size[0] = '50%';
$table_aux->colspan[0][0] = 4; $table_aux->data[0][0] = html_print_label_input_block(
$table_aux->data[0][0] = '<b>'.__('Group').'</b>'; __('Group'),
html_print_select_groups(
false,
$access,
true,
'id_group',
$id_group,
'',
'',
'',
true,
false,
true,
'',
false,
'',
false,
false,
'id_grupo',
$strict_user
)
);
$table_aux->data[0][1] = html_print_label_input_block(
__('Free text for search: ').ui_print_help_tip(__('Search by report name or description, list matches.'), true),
html_print_input_text('search', $search, '', 30, '', true)
);
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, '', false, false, 'id_grupo', $strict_user).'<br>'; $searchForm .= '<form action="index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group='.$id_group.'&pure='.$pure.'"method="post">';
$searchForm .= html_print_table($table_aux, true);
$table_aux->data[0][2] = '<b>'.__('Free text for search: ').ui_print_help_tip( $searchForm .= html_print_div(
__('Search by report name or description, list matches.'), [
true 'class' => 'action-buttons',
).'</b>'; 'content' => html_print_submit_button(
$table_aux->data[0][3] = html_print_input_text('search', $search, '', 30, '', true); __('Filter'),
'search_submit',
false,
[
'mode' => 'mini',
'icon' => 'search',
],
true
),
],
true
);
$searchForm .= '</form>';
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true); ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
}
if (is_metaconsole()) { // Show only selected groups.
$filter = "<form class ='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure' if ($id_group > 0) {
method='post'>"; $group = ["$id_group" => $id_group];
$filter .= html_print_table($table_aux, true); } else {
$filter .= '</form>'; $group = false;
ui_toggle($filter, __('Show Option')); }
} else {
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure' $own_info = get_user_info($config['id_user']);
method='post'>"; if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'RM')) {
html_print_table($table_aux); $return_all_group = true;
} else {
$return_all_group = false;
}
if ($search != '') {
$filter = [
'name' => $search_name,
'order' => 'name',
];
} else {
$filter = ['order' => 'name'];
}
// Fix : group filter was not working
// Show only selected groups.
if ($id_group > 0) {
$group = ["$id_group" => $id_group];
$filter['id_group'] = $id_group;
} else {
$group = false;
}
// Filter normal and metaconsole reports.
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
$filter['metaconsole'] = 1;
} else {
$filter['metaconsole'] = 0;
}
if ($id_group != null || $search != null) {
$graphs = custom_graphs_search($id_group, $search);
}
if (!empty($graphs)) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->align = [];
$table->head = [];
$table->head[0] = __('Graph name');
$table->head[1] = __('Description');
$table->head[2] = __('Number of Graphs');
$table->head[3] = __('Group');
$table->size[0] = '30%';
$table->size[2] = '200px';
$table->size[3] = '200px';
$table->align[2] = 'left';
$table->align[3] = 'left';
$op_column = false;
if ($report_w || $report_m) {
$op_column = true;
$table->align[4] = 'left';
$table->head[4] = __('Op.');
$table->size[4] = '90px';
}
if ($report_w || $report_m) {
$table->align[5] = 'left';
$table->head[5] = html_print_checkbox('all_delete', 0, false, true, false);
$table->size[5] = '20px';
}
$table->data = [];
$result_graphs = array_slice($graphs, $offset, $config['block_size']);
foreach ($result_graphs as $graph) {
$data = [];
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text(
$graph['name'],
70
).'</a>';
$data[1] = ui_print_truncate_text($graph['description'], 70);
$data[2] = $graph['graphs_count'];
$data[3] = ui_print_group_icon($graph['id_group'], true);
$data[4] = '';
$table->cellclass[][4] = 'table_action_buttons';
if (($report_w || $report_m)) {
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image(
'images/edit.svg',
true,
['class' => 'invert_filter main_menu_icon']
).'</a>';
}
$data[5] = '';
if (check_acl_restricted_all($config['id_user'], $graph['id_group'], 'RM')) {
$data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" 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>';
$data[5] .= html_print_checkbox_extended(
'delete_multiple[]',
$graph['id_graph'],
false,
false,
'',
[
'class' => 'check_delete mrgn_lft_2px check_delete',
'form' => 'form_delete',
'data-value' => $graph['id_graph'],
],
true
);
}
array_push($table->data, $data);
}
if (is_metaconsole() === true) {
if (!empty($result_graphs)) {
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
html_print_input_hidden('multiple_delete', 1);
html_print_table($table);
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
echo "<div class='right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</form>'; echo '</form>';
} }
// Show only selected groups.
if ($id_group > 0) { echo "<div class='right'>";
$group = ["$id_group" => $id_group]; if ($report_w || $report_m) {
} else { echo '<form method="post" class="right" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
$group = false; html_print_submit_button(__('Create graph'), 'create', false, 'class="sub next mrgn_right_5px"');
echo '</form>';
}
} else {
if ($report_w || $report_m) {
$ActionButtons[] = '<form method="post" class="right mrgn_lft_10px" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
$ActionButtons[] = html_print_submit_button(
__('Create graph'),
'create',
false,
[
'class' => 'sub ok',
'icon' => 'next',
],
true
);
$ActionButtons[] = '</form>';
} }
$own_info = get_user_info($config['id_user']); if (!empty($result_graphs)) {
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'RM')) { $ActionButtons[] = "<form method='post' id='form_delete' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
$return_all_group = true; $ActionButtons[] = html_print_input_hidden('multiple_delete', 1, true);
} else { $ActionButtons[] = html_print_submit_button(
$return_all_group = false; __('Delete'),
'delete_btn',
false,
[
'class' => 'secondary',
'icon' => 'delete',
],
true
);
$ActionButtons[] = '</form>';
} }
if ($search != '') { // FALTA METER EL PRINT TABLE.
$filter = [ html_print_table($table);
'name' => $search_name, html_print_action_buttons(
'order' => 'name', implode('', $ActionButtons),
]; ['type' => 'form_action']
} else { );
$filter = ['order' => 'name']; }
}
// Fix : group filter was not working echo '</div>';
// Show only selected groups.
if ($id_group > 0) {
$group = ["$id_group" => $id_group];
$filter['id_group'] = $id_group;
} else {
$group = false;
}
// Filter normal and metaconsole reports. echo '</div>';
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) { } else {
$filter['metaconsole'] = 1; include_once $config['homedir'].'/general/first_task/custom_graphs.php';
} else { }
$filter['metaconsole'] = 0;
}
if ($id_group != null || $search != null) { ?>
$graphs = custom_graphs_search($id_group, $search);
}
ui_pagination(count($graphs));
if (!empty($graphs)) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->align = [];
$table->head = [];
$table->head[0] = __('Graph name');
$table->head[1] = __('Description');
$table->head[2] = __('Number of Graphs');
$table->head[3] = __('Group');
$table->size[0] = '30%';
$table->size[2] = '200px';
$table->size[3] = '200px';
$table->align[2] = 'left';
$table->align[3] = 'left';
$op_column = false;
if ($report_w || $report_m) {
$op_column = true;
$table->align[4] = 'left';
$table->head[4] = __('Op.');
$table->size[4] = '90px';
}
if ($report_w || $report_m) {
$table->align[5] = 'left';
$table->head[5] = html_print_checkbox('all_delete', 0, false, true, false);
$table->size[5] = '20px';
}
$table->data = [];
$result_graphs = array_slice($graphs, $offset, $config['block_size']);
foreach ($result_graphs as $graph) {
$data = [];
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text(
$graph['name'],
70
).'</a>';
$data[1] = ui_print_truncate_text($graph['description'], 70);
$data[2] = $graph['graphs_count'];
$data[3] = ui_print_group_icon($graph['id_group'], true);
$data[4] = '';
$table->cellclass[][4] = 'table_action_buttons';
if (($report_w || $report_m)) {
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image(
'images/config.png',
true,
['class' => 'invert_filter']
).'</a>';
}
$data[5] = '';
if (check_acl_restricted_all($config['id_user'], $graph['id_group'], 'RM')) {
$data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
return false;">'.html_print_image(
'images/cross.png',
true,
[
'alt' => __('Delete'),
'title' => __('Delete'),
'class' => 'invert_filter',
]
).'</a>';
$data[5] .= html_print_checkbox_extended(
'delete_multiple[]',
$graph['id_graph'],
false,
false,
'',
'class="check_delete mrgn_lft_2px"',
true
);
}
array_push($table->data, $data);
}
if (!empty($result_graphs)) {
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
html_print_input_hidden('multiple_delete', 1);
html_print_table($table);
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
echo "<div class='right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</form>';
}
echo "<div class='right'>";
if ($report_w || $report_m) {
echo '<form method="post" class="right" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
html_print_submit_button(__('Create graph'), 'create', false, 'class="sub next mrgn_right_5px"');
echo '</form>';
}
echo '</div>';
echo '</div>';
} else {
include_once $config['homedir'].'/general/first_task/custom_graphs.php';
}
?>
<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]').parent().parent().addClass('checkselected'); $("[id^=checkbox-delete_multiple]").prop("checked", true);
$(".check_delete").prop("checked", true);
} }
else{ else{
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected'); $("[id^=checkbox-delete_multiple]").prop("checked", false);
$(".check_delete").prop("checked", false);
} }
}); });

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas * Copyright (c) 2007-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
@ -62,18 +62,18 @@ if ($is_metaconsole === false) {
$pure = (int) get_parameter('pure', 0); $pure = (int) get_parameter('pure', 0);
$hack_metaconsole = ''; $hack_metaconsole = '';
if (defined('METACONSOLE')) { if (is_metaconsole() === true) {
$hack_metaconsole = '../../'; $hack_metaconsole = '../../';
} }
$buttons['visual_console'] = [ $buttons['visual_console'] = [
'active' => true, 'active' => true,
'text' => '<a href="'.$url_visual_console.'">'.html_print_image( 'text' => '<a href="'.$url_visual_console.'">'.html_print_image(
'images/visual_console.png', 'images/logs@svg.svg',
true, true,
[ [
'title' => __('Visual Console List'), 'title' => __('Visual Console List'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -81,11 +81,11 @@ $buttons['visual_console'] = [
$buttons['visual_console_favorite'] = [ $buttons['visual_console_favorite'] = [
'active' => false, 'active' => false,
'text' => '<a href="'.$url_visual_console_favorite.'">'.html_print_image( 'text' => '<a href="'.$url_visual_console_favorite.'">'.html_print_image(
'images/list.png', 'images/star@svg.svg',
true, true,
[ [
'title' => __('Visual Favourite Console'), 'title' => __('Visual Favourite Console'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -94,11 +94,11 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
$buttons['visual_console_template'] = [ $buttons['visual_console_template'] = [
'active' => false, 'active' => false,
'text' => '<a href="'.$url_visual_console_template.'">'.html_print_image( 'text' => '<a href="'.$url_visual_console_template.'">'.html_print_image(
'images/templates.png', 'images/groups@svg.svg',
true, true,
[ [
'title' => __('Visual Console Template'), 'title' => __('Visual Console Template'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -106,11 +106,11 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
$buttons['visual_console_template_wizard'] = [ $buttons['visual_console_template_wizard'] = [
'active' => false, 'active' => false,
'text' => '<a href="'.$url_visual_console_template_wizard.'">'.html_print_image( 'text' => '<a href="'.$url_visual_console_template_wizard.'">'.html_print_image(
'images/wand.png', 'images/wizard@svg.svg',
true, true,
[ [
'title' => __('Visual Console Template Wizard'), 'title' => __('Visual Console Template Wizard'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -328,24 +328,6 @@ if ($ag_group > 0) {
} }
} }
echo "<table class='databox filters bolder mrgn_btn_10px' width='100%'>
<tr>";
if (is_metaconsole() === false) {
echo "<form method='post'
action='index.php?sec=network&amp;sec2=godmode/reporting/map_builder'>";
} else {
echo "<form method='post'
action='index.php?sec=screen&sec2=screens/screens&action=visualmap'>";
}
echo "<td class='w33p'>";
echo __('Search').'&nbsp;';
html_print_input_text('search', $search, '', 50);
echo '</td>';
echo "<td class='w25p'>";
echo __('Group').'&nbsp;';
$own_info = get_user_info($config['id_user']); $own_info = get_user_info($config['id_user']);
if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'VR')) { if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'VR')) {
$return_all_group = false; $return_all_group = false;
@ -353,26 +335,69 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'VR')) {
$return_all_group = true; $return_all_group = true;
} }
echo '<div class="w250px inline">'; $filterTable = new stdClass();
html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false); $filterTable->id = 'map_buider_filter';
echo '</div>'; $filterTable->class = 'filter-table-adv';
echo "<td class='w25p'>"; $filterTable->width = '100%';
echo __('Group Recursion').'&nbsp;'; $filterTable->size = [];
html_print_checkbox('recursion', 1, $recursion, false, false, 'this.form.submit()'); $filterTable->size[0] = '33%';
$filterTable->size[1] = '33%';
echo "</td><td class='w22p'>"; $filterTable->data = [];
html_print_submit_button(
$filterTable->data[0][] = html_print_label_input_block(
__('Search'), __('Search'),
'search_visual_console', html_print_input_text('search', $search, '', 50, 255, true)
false, );
[
'icon' => 'search', $filterTable->data[0][] = html_print_label_input_block(
'mode' => 'secondary mini', __('Group'),
] html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, 'this.form.submit();', '', 0, true, false, true, '', false)
);
$filterTable->data[0][] = html_print_label_input_block(
__('Group Recursion'),
html_print_checkbox_switch('recursion', 1, $recursion, true, false, 'this.form.submit()')
);
if (is_metaconsole() === false) {
$actionUrl = 'index.php?sec=network&amp;sec2=godmode/reporting/map_builder';
} else {
$actionUrl = 'index.php?sec=screen&sec2=screens/screens&action=visualmap';
}
$searchForm = [];
$searchForm[] = '<form method="POST" action="'.$actionUrl.'">';
$searchForm[] = html_print_table($filterTable, true);
$searchForm[] = html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'search_visual_console',
false,
[
'icon' => 'search',
'mode' => 'mini',
],
true
),
],
true
);
$searchForm[] = '</form>';
ui_toggle(
implode('', $searchForm),
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
); );
echo '</form>';
echo '</td>';
echo '</tr></table>';
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
@ -471,7 +496,6 @@ if (!$maps && is_metaconsole() === false) {
); );
} }
} else { } else {
ui_pagination($total_maps, $url, $offset, $pagination);
foreach ($maps as $map) { foreach ($maps as $map) {
// ACL for the visual console permission. // ACL for the visual console permission.
$vconsole_write = false; $vconsole_write = false;
@ -505,25 +529,25 @@ if (!$maps && is_metaconsole() === false) {
4 => 'table_action_buttons', 4 => 'table_action_buttons',
]; ];
$data[3] = '<a class="copy_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image( $data[3] = '<a class="copy_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image(
'images/copy.png', 'images/copy.svg',
true, true,
['class' => 'invert_filter'] ['class' => 'main_menu_icon invert_filter']
).'</a>'; ).'</a>';
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image( $data[4] = '<a class="delete_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
'images/cross.png', 'images/delete.svg',
true, true,
['class' => 'invert_filter'] ['class' => 'main_menu_icon invert_filter']
).'</a>'; ).'</a>';
} else { } else {
$data[3] = '<a class="copy_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image( $data[3] = '<a class="copy_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image(
'images/copy.png', 'images/copy.svg',
true, true,
['class' => 'invert_filter'] ['class' => 'main_menu_icon invert_filter']
).'</a>'; ).'</a>';
$data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&amp;delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image( $data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&amp;delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
'images/cross.png', 'images/delete.svg',
true, true,
['class' => 'invert_filter'] ['class' => 'main_menu_icon invert_filter']
).'</a>'; ).'</a>';
} }
} else { } else {
@ -535,42 +559,31 @@ if (!$maps && is_metaconsole() === false) {
} }
html_print_table($table); html_print_table($table);
ui_pagination($total_maps, $url, $offset, $pagination, false, 'offset', true, 'pagination-bottom'); $tablePagination = ui_pagination($total_maps, $url, $offset, $pagination, true, 'offset', false);
}
if ($maps) {
if (is_metaconsole() === false) {
echo '<div class="action-buttons w100p right_align">';
} else {
echo '<div class="w100p right right_align mrgn_btn_20px">';
}
} }
if ($maps || is_metaconsole() === true) { if ($maps || is_metaconsole() === true) {
if ($vconsoles_write || $vconsoles_manage) { if ($vconsoles_write || $vconsoles_manage) {
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
echo '<form action="index.php?sec=network&amp;sec2=godmode/reporting/visual_console_builder" method="post">'; $actionUrl = 'index.php?sec=network&amp;sec2=godmode/reporting/visual_console_builder';
} else { } else {
echo '<form action="index.php?sec=screen&sec2=screens/screens&action=visualmap&action2=new&operation=new_visualmap&tab=data&pure='.$pure.'" method="post">'; $actionUrl = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&action2=new&operation=new_visualmap&tab=data&pure='.$pure;
} }
echo '<form action="'.$actionUrl.'" method="post">';
html_print_input_hidden('edit_layout', 1); html_print_input_hidden('edit_layout', 1);
html_print_div( html_print_action_buttons(
[ html_print_submit_button(
'class' => 'action-buttons', __('Create'),
'content' => html_print_submit_button( '',
__('Create'), false,
'', [ 'icon' => 'next'],
false, true
[ 'icon' => 'next'], ),
true [ 'right_content' => $tablePagination ]
),
]
); );
echo '</form>'; echo '</form>';
} }
echo '</div>';
} }

View File

@ -281,7 +281,7 @@ switch ($action) {
$server_name = $item['server_name']; $server_name = $item['server_name'];
// Metaconsole db connection. // Metaconsole db connection.
if ($meta && empty($server_name) === false) { if ($meta && empty($server_name) === false && $server_name !== 'all') {
$connection = metaconsole_get_connection($server_name); $connection = metaconsole_get_connection($server_name);
$server_id = $connection['id']; $server_id = $connection['id'];
if (metaconsole_load_external_db($connection) != NOERR) { if (metaconsole_load_external_db($connection) != NOERR) {
@ -1233,6 +1233,29 @@ $class = 'databox filters';
} }
?> ?>
<?php
$servers_all_opt = array_merge(['all' => 'All nodes'], $servers);
if ($meta) {
?>
<tr id="row_servers_all_opt" class="datos">
<td class="bolder"><?php echo __('Server'); ?></td>
<td >
<?php
html_print_select(
$servers_all_opt,
'combo_server',
$server_name,
'',
$nothing,
$nothing_value
);
?>
</td>
</tr>
<?php
}
?>
<?php <?php
if ($meta) { if ($meta) {
?> ?>
@ -6338,6 +6361,7 @@ function chooseType() {
$("#row_alert_templates").hide(); $("#row_alert_templates").hide();
$("#row_alert_actions").hide(); $("#row_alert_actions").hide();
$("#row_servers").hide(); $("#row_servers").hide();
$("#row_servers_all_opt").hide();
$("#row_multiple_servers").hide(); $("#row_multiple_servers").hide();
$("#row_sort").hide(); $("#row_sort").hide();
$("#row_date").hide(); $("#row_date").hide();
@ -6652,7 +6676,7 @@ function chooseType() {
$("#row_header").show(); $("#row_header").show();
$("#row_custom").show(); $("#row_custom").show();
$("#row_custom_example").show(); $("#row_custom_example").show();
$("#row_servers").show(); $("#row_servers_all_opt").show();
$("#row_historical_db_check").show(); $("#row_historical_db_check").show();
break; break;

View File

@ -821,7 +821,7 @@ switch ($action) {
[ [
'class' => 'action-buttons', 'class' => 'action-buttons',
'content' => html_print_submit_button( 'content' => html_print_submit_button(
__('Search'), __('Filter'),
'search_submit', 'search_submit',
false, false,
[ [

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

View File

@ -82,7 +82,7 @@ require_once $config['homedir'].'/include/functions_agents.php';
$table = new stdClass(); $table = new stdClass();
$table->id = 'wizard_table'; $table->id = 'wizard_table';
$table->head = []; $table->head = [];
if (!is_metaconsole()) { if (is_metaconsole() === false) {
$metaconsole_hack = ''; $metaconsole_hack = '';
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2007-2022 Artica Soluciones Tecnologicas * Copyright (c) 2007-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
@ -33,15 +33,14 @@ require_once $config['homedir'].'/include/functions_visual_map.php';
// Breadcrumb. // Breadcrumb.
require_once $config['homedir'].'/include/class/HTML.class.php'; require_once $config['homedir'].'/include/class/HTML.class.php';
ui_require_css_file('discovery'); ui_require_css_file('discovery');
// ACL for the general permission // ACL for the general permission.
$vconsoles_read = check_acl($config['id_user'], 0, 'VR'); $vconsoles_read = (bool) check_acl($config['id_user'], 0, 'VR');
$vconsoles_write = check_acl($config['id_user'], 0, 'VW'); $vconsoles_write = (bool) check_acl($config['id_user'], 0, 'VW');
$vconsoles_manage = check_acl($config['id_user'], 0, 'VM'); $vconsoles_manage = (bool) check_acl($config['id_user'], 0, 'VM');
$is_enterprise = enterprise_include_once('include/functions_policies.php'); $is_enterprise = enterprise_include_once('include/functions_policies.php');
$is_metaconsole = is_metaconsole();
if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { if ($vconsoles_read === false && $vconsoles_write === false && $vconsoles_manage === false) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
'Trying to access map builder' 'Trying to access map builder'
@ -50,8 +49,7 @@ if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) {
exit; exit;
} }
if (is_metaconsole() === false) {
if ($is_metaconsole === false) {
$url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder'; $url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder';
$url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite'; $url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite';
$url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template'; $url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template';
@ -63,14 +61,16 @@ if ($is_metaconsole === false) {
$url_visual_console_template_wizard = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_wizard'; $url_visual_console_template_wizard = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_wizard';
} }
$buttons = [];
$buttons['visual_console'] = [ $buttons['visual_console'] = [
'active' => false, 'active' => false,
'text' => '<a href="'.$url_visual_console.'">'.html_print_image( 'text' => '<a href="'.$url_visual_console.'">'.html_print_image(
'images/visual_console.png', 'images/logs@svg.svg',
true, true,
[ [
'title' => __('Visual Console List'), 'title' => __('Visual Console List'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -78,11 +78,11 @@ $buttons['visual_console'] = [
$buttons['visual_console_favorite'] = [ $buttons['visual_console_favorite'] = [
'active' => true, 'active' => true,
'text' => '<a href="'.$url_visual_console_favorite.'">'.html_print_image( 'text' => '<a href="'.$url_visual_console_favorite.'">'.html_print_image(
'images/list.png', 'images/star@svg.svg',
true, true,
[ [
'title' => __('Visual Favourite Console'), 'title' => __('Visual Favourite Console'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -91,11 +91,11 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
$buttons['visual_console_template'] = [ $buttons['visual_console_template'] = [
'active' => false, 'active' => false,
'text' => '<a href="'.$url_visual_console_template.'">'.html_print_image( 'text' => '<a href="'.$url_visual_console_template.'">'.html_print_image(
'images/templates.png', 'images/groups@svg.svg',
true, true,
[ [
'title' => __('Visual Console Template'), 'title' => __('Visual Console Template'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -103,11 +103,11 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
$buttons['visual_console_template_wizard'] = [ $buttons['visual_console_template_wizard'] = [
'active' => false, 'active' => false,
'text' => '<a href="'.$url_visual_console_template_wizard.'">'.html_print_image( 'text' => '<a href="'.$url_visual_console_template_wizard.'">'.html_print_image(
'images/wand.png', 'images/wizard@svg.svg',
true, true,
[ [
'title' => __('Visual Console Template Wizard'), 'title' => __('Visual Console Template Wizard'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -136,115 +136,132 @@ $search = (string) get_parameter('search', '');
$ag_group = (int) get_parameter('ag_group', 0); $ag_group = (int) get_parameter('ag_group', 0);
$recursion = (int) get_parameter('recursion', 0); $recursion = (int) get_parameter('recursion', 0);
$returnAllGroups = 0;
if (is_metaconsole() === false) { $filters = [];
echo "<form method='post' if (empty($search) === false) {
action='index.php?sec=network&amp;sec2=godmode/reporting/visual_console_favorite'>"; $filters['name'] = io_safe_input($search);
} else {
echo "<form method='post'
action='index.php?sec=screen&sec2=screens/screens&action=visualmap_favorite'>";
} }
echo "<ul class='form_flex'><li class='first_elements'>"; if ($ag_group > 0) {
echo '<ul><li>'; $ag_groups = [];
echo __('Search').'&nbsp;'; $ag_groups = (array) $ag_group;
html_print_input_text('search', $search, '', 50); if ($recursion) {
echo '</li><li>'; $ag_groups = groups_get_children_ids($ag_group, true);
echo __('Group').'&nbsp;'; }
$own_info = get_user_info($config['id_user']); } else if ($own_info['is_admin']) {
$returnAllGroups = 1;
}
if ($ag_group) {
$filters['group'] = array_flip($ag_groups);
}
$own_info = get_user_info($config['id_user']);
if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) { if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) {
$return_all_group = false; $return_all_group = false;
} else { } else {
$return_all_group = true; $return_all_group = true;
} }
html_print_select_groups( $filterTable = new stdClass();
false, $filterTable->id = 'visual_console_favorite_filter';
'AR', $filterTable->class = 'filter-table-adv';
$return_all_group, $filterTable->width = '100%';
'ag_group', $filterTable->size = [];
$ag_group, $filterTable->size[0] = '33%';
'', $filterTable->size[1] = '33%';
'',
0, $filterTable->data = [];
false,
false, $filterTable->data[0][] = html_print_label_input_block(
true, __('Search'),
'', html_print_input_text('search', $search, '', 50, 255, true)
false );
);
echo "</li></ul></li><li class='second_elements'><ul><li>"; $filterTable->data[0][] = html_print_label_input_block(
echo __('Group Recursion'); __('Group'),
html_print_checkbox('recursion', 1, $recursion, false, false, ''); html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, '', '', 0, true, false, true, '', false)
echo '</li><li>'; );
html_print_submit_button(
__('Search'), $filterTable->data[0][] = html_print_label_input_block(
__('Group Recursion'),
html_print_checkbox_switch('recursion', 1, $recursion, true, false, '')
);
if (is_metaconsole() === false) {
$actionUrl = 'index.php?sec=network&amp;sec2=godmode/reporting/visual_console_favorite';
} else {
$actionUrl = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_favorite';
}
// exit;
$searchForm = '<form method="POST" action="'.$actionUrl.'">';
$searchForm .= html_print_table($filterTable, true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'search_visual_console', 'search_visual_console',
false, false,
[ [
'icon' => 'search', 'icon' => 'search',
'mode' => 'secondary mini', 'mode' => 'mini',
] ],
);
echo '</li></ul></li></ul>';
echo '</form>';
$returnAllGroups = 0;
$filters = [];
if (!empty($search)) {
$filters['name'] = io_safe_input($search);
}
if ($ag_group > 0) {
$ag_groups = [];
$ag_groups = (array) $ag_group;
if ($recursion) {
$ag_groups = groups_get_children_ids($ag_group, true);
}
} else if ($own_info['is_admin']) {
$returnAllGroups = 1;
}
if ($ag_group) {
$filters['group'] = array_flip($ag_groups);
}
$favorite_array = visual_map_get_user_layouts(
$config['id_user'],
false,
$filters,
$returnAllGroups,
true true
); ),
],
true
);
$searchForm .= '</form>';
echo "<div id='is_favourite'>"; ui_toggle(
if ($favorite_array == false) { $searchForm,
ui_print_info_message(__('No favourite consoles defined')); '<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
$favorite_array = visual_map_get_user_layouts(
$config['id_user'],
false,
$filters,
$returnAllGroups,
true
);
echo "<div id='is_favourite'>";
if ($favorite_array == false) {
ui_print_info_message(__('No favourite consoles defined'));
} else {
echo "<ul class='container'>";
foreach ($favorite_array as $favorite_k => $favourite_v) {
if (is_metaconsole() === true) {
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap='.$favourite_v['id'];
} else { } else {
echo "<ul class='container'>"; $url = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='.$favourite_v['id'];
foreach ($favorite_array as $favorite_k => $favourite_v) {
if (is_metaconsole() === true) {
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap='.$favourite_v['id'];
} else {
$url = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='.$favourite_v['id'];
}
echo "<a href='".$url."' title='Visual console".$favourite_v['name']."' alt='".$favourite_v['name']."'><li>";
echo "<div class='icon_img'>";
echo html_print_image(
'images/'.groups_get_icon($favourite_v['id_group']).'.png',
true,
['style' => '']
);
echo '</div>';
echo "<div class='text'>";
echo $favourite_v['name'];
echo '</div>';
echo '</li></a>';
}
echo '</ul>';
} }
echo '</div>'; echo "<a href='".$url."' title='Visual console".$favourite_v['name']."' alt='".$favourite_v['name']."'><li>";
echo "<div class='icon_img'>";
echo html_print_image(
'images/'.groups_get_icon($favourite_v['id_group']).'.png',
true,
['style' => '']
);
echo '</div>';
echo "<div class='text'>";
echo $favourite_v['name'];
echo '</div>';
echo '</li></a>';
}
echo '</ul>';
}
echo '</div>';

View File

@ -332,8 +332,6 @@ if ($filemanager) {
$sec = 'gservers'; $sec = 'gservers';
if (empty($create) === false || empty($view) === false) { if (empty($create) === false || empty($view) === false) {
enterprise_hook('open_meta_frame');
$management_allowed = is_management_allowed(); $management_allowed = is_management_allowed();
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
@ -708,11 +706,7 @@ if (empty($create) === false || empty($view) === false) {
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
echo '</td></tr>'; echo '</td></tr>';
} }
enterprise_hook('close_meta_frame');
} else { } else {
enterprise_hook('open_meta_frame');
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
components_meta_print_header(); components_meta_print_header();
$sec = 'advanced'; $sec = 'advanced';
@ -1087,8 +1081,6 @@ if (empty($create) === false || empty($view) === false) {
// The '%s' will be replaced in the javascript code of the function 'show_locked_dialog'. // The '%s' will be replaced in the javascript code of the function 'show_locked_dialog'.
echo "<div id='dialog_locked' title='".__('List of modules and components created by "%s" ')."' class='invisible left'>"; echo "<div id='dialog_locked' title='".__('List of modules and components created by "%s" ')."' class='invisible left'>";
echo '</div>'; echo '</div>';
enterprise_hook('close_meta_frame');
} }
ui_require_javascript_file('pandora_modules'); ui_require_javascript_file('pandora_modules');

View File

@ -50,7 +50,6 @@ ui_require_css_file('first_task');
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
enterprise_include_once('meta/include/functions_components_meta.php'); enterprise_include_once('meta/include/functions_components_meta.php');
enterprise_hook('open_meta_frame');
components_meta_print_header(); components_meta_print_header();
$sec = 'advanced'; $sec = 'advanced';
$management_allowed = is_management_allowed(); $management_allowed = is_management_allowed();
@ -565,7 +564,3 @@ if ($error !== null && $error !== '') {
) )
); );
} }
if (is_metaconsole() === true) {
enterprise_hook('close_meta_frame');
}

View File

@ -42,22 +42,24 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
$update_settings = (bool) get_parameter_post('update_settings'); $update_settings = (bool) get_parameter_post('update_settings');
if (is_metaconsole()) { ui_require_javascript_file_enterprise('load_enterprise', is_metaconsole() === true);
// Metaconsole. enterprise_include_once('include/functions_license.php');
ui_require_javascript_file_enterprise('load_enterprise', true);
enterprise_include_once('include/functions_license.php');
} else {
ui_print_page_header(
__('License management'),
'images/extensions.png',
false,
'',
true
);
ui_require_javascript_file_enterprise('load_enterprise'); // Header.
enterprise_include_once('include/functions_license.php'); ui_print_standard_header(
} __('License management'),
'images/extensions.png',
false,
'',
true,
[],
[
[
'link' => '',
'label' => __('License'),
],
]
);
enterprise_include_once('include/functions_crypto.php'); enterprise_include_once('include/functions_crypto.php');
@ -135,81 +137,201 @@ if (enterprise_installed()) {
</script> </script>
<?php <?php
echo '<form method="post" id="form-license">'; echo '<form method="post" id="form-license" class="max_floating_element_size">';
// Retrieve UM url configured (or default). // Retrieve UM url configured (or default).
$url = get_um_url(); $url = get_um_url();
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filter-table-adv';
$table->size = [];
if (is_metaconsole()) { $table->size[0] = '50%';
$table->head[0] = __('Licence'); $table->size[1] = '50%';
$table->head_colspan[0] = 3;
$table->headstyle[0] = 'text-align: center';
$table->style[0] = 'font-weight: bold;';
}
$table->data = []; $table->data = [];
$table->colspan = [];
$table->data[0][0] = '<strong>'.__('Customer key').'</strong>'; $table->colspan[0][0] = 2;
$table->data[0][1] = html_print_textarea('keys[customer_key]', 10, 255, $settings->customer_key, 'style="width: 450px" class="height_50px w450px"', true); $table->data[-1][0] = '<div class="section_table_title">'.__('Licence').'</div>';
$table->data[1][0] = '<strong>'.__($license['expiry_caption']).'</strong>'; $table->colspan[0][0] = 2;
$table->data[1][1] = html_print_input_text('expires', $license['expiry_date'], '', 10, 255, true, true); $table->data[0][0] = html_print_label_input_block(
__('Customer key'),
$table->data[2][0] = '<strong>'.__('Platform Limit').'</strong>'; html_print_textarea(
$table->data[2][1] = html_print_input_text('expires', $license['limit'], '', 10, 255, true, true).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules')); 'keys[customer_key]',
10,
$table->data[3][0] = '<strong>'.__('Current Platform Count').'</strong>'; 255,
$table->data[3][1] = html_print_input_text('expires', $license['count'], '', 10, 255, true, true).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules')); $settings->customer_key,
'style="width: 100%; height:80px;"',
$table->data[4][0] = '<strong>'.__('Current Platform Count (enabled: items)').'</strong>';
$table->data[4][1] = html_print_input_text('expires', $license['count_enabled'], '', 10, 255, true, true).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'));
$table->data[5][0] = '<strong>'.__('Current Platform Count (disabled: items)').'</strong>';
$table->data[5][1] = html_print_input_text('expires', $license['count_disabled'], '', 10, 255, true, true).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'));
$table->data[6][0] = '<strong>'.__('License Mode').'</strong>';
$table->data[6][1] = html_print_input_text('expires', $license['license_mode'], '', 10, 255, true, true);
$table->data[7][0] = '<strong>'.__('NMS').'</strong>';
$table->data[7][1] = html_print_input_text('expires', ($license['nms'] == 1 ? __('enabled') : __('disabled')), '', 10, 255, true, true);
$table->data[8][0] = '<strong>'.__('Satellite').'</strong>';
$table->data[8][1] = html_print_input_text('expires', ($license['dhpm'] == 1 ? __('enabled') : __('disabled')), '', 10, 255, true, true);
if ($license['dhpm'] == 1) {
$table->data[9][0] = '<strong>'.__('License encryption key').'</strong>'.ui_print_help_tip(
__('This key is used to encrypt your Pandora FMS license when it is shared with other Pandora FMS components'),
true true
); )
$table->data[9][1] = html_print_input_password( );
'license_encryption_key',
io_safe_output($settings->license_encryption_key), $table->data[1][0] = html_print_label_input_block(
__($license['expiry_caption']),
html_print_input_text(
'expires',
$license['expiry_date'],
'', '',
10, 10,
255, 255,
true, true,
false true
)
);
$table->data[1][1] = html_print_label_input_block(
__('Platform Limit'),
html_print_input_text(
'expires',
$license['limit'],
'',
10,
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[2][0] = html_print_label_input_block(
__('Current Platform Count'),
html_print_input_text(
'expires',
$license['count'],
'',
10,
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[2][1] = html_print_label_input_block(
__('Current Platform Count (enabled: items)'),
html_print_input_text(
'expires',
$license['count_enabled'],
'',
10,
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[3][0] = html_print_label_input_block(
__('Current Platform Count (disabled: items)'),
html_print_input_text(
'expires',
$license['count_disabled'],
'',
10,
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[3][1] = html_print_label_input_block(
__('License Mode'),
html_print_input_text(
'expires',
$license['license_mode'],
'',
10,
255,
true,
true
)
);
$table->data[4][0] = html_print_label_input_block(
__('NMS'),
html_print_input_text(
'expires',
($license['nms'] == 1 ? __('enabled') : __('disabled')),
'',
10,
255,
true,
true
)
);
$table->data[4][1] = html_print_label_input_block(
__('Satellite'),
html_print_input_text(
'expires',
($license['dhpm'] == 1 ? __('enabled') : __('disabled')),
'',
10,
255,
true,
true
)
);
$table->data[5][0] = html_print_label_input_block(
__('Licensed to'),
html_print_input_text(
'licensed_to',
$license['licensed_to'],
'',
64,
255,
true,
true
)
);
if ($license['dhpm'] == 1) {
$table->data[5][1] = html_print_label_input_block(
__('License encryption key').'</strong>'.ui_print_help_tip(
__('This key is used to encrypt your Pandora FMS license when it is shared with other Pandora FMS components'),
true
),
html_print_input_password(
'license_encryption_key',
io_safe_output($settings->license_encryption_key),
'',
10,
255,
true,
false
)
); );
} }
$table->data[10][0] = '<strong>'.__('Licensed to').'</strong>';
$table->data[10][1] = html_print_input_text('licensed_to', $license['licensed_to'], '', 64, 255, true, true);
html_print_table($table); html_print_table($table);
// If DESTDIR is defined the enterprise license is expired. // If DESTDIR is defined the enterprise license is expired.
if (enterprise_installed() || defined('DESTDIR')) { if (enterprise_installed() || defined('DESTDIR')) {
echo '<div class="action-buttons" style="width: '.$table->width.'">'; $buttons = html_print_input_hidden('update_settings', 1, true);
html_print_input_hidden('update_settings', 1); $buttons .= html_print_submit_button(
html_print_submit_button(__('Validate'), 'update_button', false, 'class="sub upd"'); __('Validate'),
echo '&nbsp;&nbsp;'; 'update_button',
html_print_button(__('Request new license'), 'license', false, 'generate_request_code()', [ 'fixed_id' => 'button-', 'icon' => 'next']); false,
echo '</div>'; ['icon' => 'next'],
true
);
$buttons .= html_print_button(
__('Request new license'),
'license',
false,
'generate_request_code()',
[
'fixed_id' => 'button-',
'icon' => 'next',
'mode' => 'secondary',
],
true
);
html_print_action_buttons(
$buttons
);
} }
echo '</form>';
if (is_metaconsole()) { if (is_metaconsole()) {
ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/include/styles/'); ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/include/styles/');
ui_require_css_file('register', 'include/styles/'); ui_require_css_file('register', 'include/styles/');
@ -220,7 +342,6 @@ if (is_metaconsole()) {
} }
if (enterprise_hook('print_activate_licence_dialog') == ENTERPRISE_NOT_HOOK) { if (enterprise_hook('print_activate_licence_dialog') == ENTERPRISE_NOT_HOOK) {
echo '</form>';
echo '<div id="code_license_dialog" class="invisible left" title="'.__('Request new license').'">'; echo '<div id="code_license_dialog" class="invisible left" title="'.__('Request new license').'">';
echo '<div id="logo">'; echo '<div id="logo">';
html_print_image(ui_get_custom_header_logo(true)); html_print_image(ui_get_custom_header_logo(true));

View File

@ -198,10 +198,12 @@ if ($edit_filter > -2) {
$table->id = 'filter_table'; $table->id = 'filter_table';
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->rowclass[0] = 'row-title-font-child';
$table->rowclass[1] = 'row-title-font-child';
$table->data[0][0] = __('Description'); $table->data[0][0] = __('Description');
$table->data[0][1] = html_print_input_text('description', $description, '', 60, 100, true); $table->data[0][1] = html_print_input_text('description', $description, '', 60, 100, true);
$table->data[0][1] .= html_print_image( $table->data[0][1] .= html_print_image(
'images/add.png', 'images/plus.png',
true, true,
[ [
'id' => 'add_filter', 'id' => 'add_filter',
@ -243,7 +245,7 @@ if ($edit_filter > -2) {
} }
$index++; $index++;
echo '<form action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters" method="post">'; echo '<form class="max_floating_element_size" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters" method="post">';
html_print_input_hidden('update_filter', $edit_filter); html_print_input_hidden('update_filter', $edit_filter);
html_print_input_hidden('index_post', $index); html_print_input_hidden('index_post', $index);
if ($edit_filter > -1) { if ($edit_filter > -1) {

View File

@ -77,7 +77,7 @@ if ($generate_trap) {
} }
$table = new stdClass(); $table = new stdClass();
$traps_generator = '<form method="POST" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_trap_generator">'; $traps_generator = '<form class="max_floating_element_size" method="POST" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_trap_generator">';
$table->width = '100%'; $table->width = '100%';
$table->class = 'filter-table-adv databox'; $table->class = 'filter-table-adv databox';
$table->size = []; $table->size = [];

View File

@ -27,8 +27,6 @@ global $config;
check_login(); check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'UM')) { if (! check_acl($config['id_user'], 0, 'UM')) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
@ -437,8 +435,6 @@ if ($id_profile || $new_profile) {
echo '</form>'; echo '</form>';
} }
enterprise_hook('close_meta_frame');
?> ?>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">

View File

@ -222,8 +222,6 @@ if (is_ajax() === true) {
} }
} }
enterprise_hook('open_meta_frame');
$tab = get_parameter('tab', 'user'); $tab = get_parameter('tab', 'user');
// Save autorefresh list. // Save autorefresh list.
@ -1886,8 +1884,6 @@ html_print_action_buttons(implode('', $actionButtons), ['type' => 'form_action']
echo '</div>'; echo '</div>';
enterprise_hook('close_meta_frame');
// This is an image generated for JS. // This is an image generated for JS.
$delete_image = html_print_input_image( $delete_image = html_print_input_image(
'del', 'del',

View File

@ -31,8 +31,6 @@ global $config;
check_login(); check_login();
enterprise_hook('open_meta_frame');
require_once $config['homedir'].'/include/functions_profile.php'; require_once $config['homedir'].'/include/functions_profile.php';
require_once $config['homedir'].'/include/functions_users.php'; require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/functions_groups.php'; require_once $config['homedir'].'/include/functions_groups.php';
@ -495,5 +493,3 @@ if ($is_management_allowed === true) {
} }
unset($table); unset($table);
enterprise_hook('close_meta_frame');

View File

@ -132,8 +132,6 @@ if (is_ajax()) {
} }
} }
enterprise_hook('open_meta_frame');
$sortField = get_parameter('sort_field'); $sortField = get_parameter('sort_field');
$sort = get_parameter('sort', 'none'); $sort = get_parameter('sort', 'none');
$tab = get_parameter('tab', 'user'); $tab = get_parameter('tab', 'user');
@ -1051,8 +1049,6 @@ if ($is_management_allowed === true) {
); );
} }
enterprise_hook('close_meta_frame');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
function showGroups(id_user) { function showGroups(id_user) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -132,32 +132,24 @@ class AuditLog extends HTML
$this->tableId = 'audit_logs'; $this->tableId = 'audit_logs';
// Header (only in Node). ui_print_standard_header(
if (is_metaconsole() === false) { __('%s audit', get_product_name()).' &raquo; '.__('Review Logs'),
ui_print_standard_header( 'images/gm_log.png',
__('%s audit', get_product_name()).' &raquo; '.__('Review Logs'), false,
'images/gm_log.png', '',
false, false,
'', [],
false, [
[],
[ [
[ 'link' => '',
'link' => '', 'label' => __('Admin Tools'),
'label' => __('Admin Tools'), ],
], [
[ 'link' => '',
'link' => '', 'label' => __('System Audit log'),
'label' => __('System Audit log'), ],
], ]
] );
);
}
if (is_metaconsole() === true) {
// Only in case of Metaconsole, format the frame.
open_meta_frame();
}
$buttons = []; $buttons = [];
@ -265,11 +257,6 @@ class AuditLog extends HTML
echo $e->getMessage(); echo $e->getMessage();
} }
if (is_metaconsole() === true) {
// Close the frame.
close_meta_frame();
}
// Load own javascript file. // Load own javascript file.
echo $this->loadJS(); echo $this->loadJS();

View File

@ -20,7 +20,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC230301'; $build_version = 'PC230302';
$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

@ -5838,3 +5838,58 @@ function get_events_get_response_target(
} }
} }
} }
/**
* Gets the count of events by criticity.
*
* @param integer $utimestamp Utimestamp to search.
* @param integer $eventType Event type.
* @param array $groupId Groups.
* @param integer $eventStatus Event status.
* @param array $criticityId Criticity to search.
*
* @return array
*/
function get_count_event_criticity(
$utimestamp,
$eventType,
$groupId,
$eventStatus,
$criticityId
) {
$type = ' ';
if ($eventType !== '0') {
$type = 'AND event_type = "'.$eventType.'"';
}
$groups = ' ';
if ((int) $groupId !== 0) {
$groups = 'AND id_grupo IN ('.$groupId.')';
}
$status = ' ';
if ((int) $eventStatus !== -1) {
$status = 'AND estado = '.$eventStatus;
}
$criticity = ' ';
if (empty($criticityId) === false) {
$criticity = 'AND criticity IN ('.$criticityId.')';
}
$sql_meta = sprintf(
'SELECT COUNT(id_evento) AS count,
criticity
FROM tevento
WHERE utimestamp >= %d %s %s %s %s
GROUP BY criticity',
$utimestamp,
$type,
$groups,
$status,
$criticity
);
return db_get_all_rows_sql($sql_meta);
}

View File

@ -6749,21 +6749,29 @@ function html_print_label_input_block(
$label_class = ''; $label_class = '';
$div_id = ''; $div_id = '';
$divAttributes = [];
if (empty($options) === false) { if (empty($options) === false) {
if (isset($options['div_class']) === true) { if (isset($options['div_class']) === true) {
$div_class = $options['div_class']; $divAttributes[] = 'class="'.$options['div_class'].'"';
}
if (isset($options['div_id']) === true) {
$divAttributes[] = 'id="'.$options['div_id'].'"';
}
if (isset($options['div_style']) === true) {
$divAttributes[] = 'style="'.$options['div_style'].'"';
} }
if (isset($options['label_class']) === true) { if (isset($options['label_class']) === true) {
$label_class = $options['label_class']; $label_class = $options['label_class'];
} }
if (isset($options['div_id']) === true) {
$div_id = 'id="'.$options['div_id'].'"';
}
} }
$output = '<div class="'.$div_class.'" '.$div_id.'>'; $content = (empty($divAttributes) === false) ? implode(' ', $divAttributes) : '';
$output = '<div '.$content.'>';
if ($label !== null) { if ($label !== null) {
$output .= '<label class="'.$label_class.'">'.$label.'</label>'; $output .= '<label class="'.$label_class.'">'.$label.'</label>';
} }

View File

@ -68,6 +68,7 @@ define('REPORT_STATUS_IGNORED', 5);
// Clases. // Clases.
use PandoraFMS\Enterprise\Metaconsole\Node; use PandoraFMS\Enterprise\Metaconsole\Node;
use PandoraFMS\Enterprise\Metaconsole\Synchronizer;
use PandoraFMS\Event; use PandoraFMS\Event;
use PandoraFMS\Module; use PandoraFMS\Module;
@ -7421,6 +7422,14 @@ function reporting_text($report, $content)
} }
/**
* Build SQL report item.
*
* @param array $report Report info.
* @param array $content Content info.
*
* @return array
*/
function reporting_sql($report, $content) function reporting_sql($report, $content)
{ {
global $config; global $config;
@ -7438,15 +7447,97 @@ function reporting_sql($report, $content)
$return['description'] = $content['description']; $return['description'] = $content['description'];
$return['date'] = reporting_get_date_text(); $return['date'] = reporting_get_date_text();
if ($config['metaconsole'] && !empty($content['server_name'])) { if (is_metaconsole() === true
$id_meta = metaconsole_get_id_server( && empty($content['server_name']) === false
&& $content['server_name'] !== 'all'
) {
$id_server = metaconsole_get_id_server(
$content['server_name'] $content['server_name']
); );
$server = metaconsole_get_connection_by_id($id_meta);
metaconsole_connect($server);
} }
if (is_metaconsole() === true && $content['server_name'] === 'all') {
$sync = new Synchronizer();
$results = $sync->apply(
function ($node) use ($report, $content) {
try {
$node->connect();
$rs = reporting_sql_auxiliary($report, $content);
$node->disconnect();
} catch (Exception $e) {
return [
'error' => __(
'Failed to connect to node %s',
$node->server_name()
),
];
}
if ($rs === false) {
return ['result' => []];
}
return ['result' => $rs];
},
false
);
$data = [];
$return['correct'] = 1;
$return['error'] = '';
foreach ($results as $id_node => $items) {
foreach ($items['result']['data'] as $key => $item) {
$items['result']['data'][$key] = ['node_id' => $id_node] + $items['result']['data'][$key];
}
if ((int) $items['result']['correct'] !== 1) {
$return['correct'] = 0;
}
if ($items['result']['error'] !== '') {
$return['error'] = $items['result']['error'];
}
$return['sql'] = $items['result']['sql'];
$data = array_merge($data, $items['result']['data']);
}
$return['data'] = $data;
} else {
try {
if (is_metaconsole() === true && $id_server > 0) {
$node = new Node($id_server);
$node->connect();
}
$query_result = reporting_sql_auxiliary($report, $content);
$return = array_merge($return, $query_result);
if (is_metaconsole() === true && $id_server > 0) {
$node->disconnect();
}
} catch (\Exception $e) {
if (is_metaconsole() === true && $id_server > 0) {
$node->disconnect();
}
}
}
return reporting_check_structure_content($return);
}
/**
* Auxiliary function for reporting_sql.
*
* @param array $report Report info.
* @param array $content Content info.
*
* @return array
*/
function reporting_sql_auxiliary($report, $content) {
if ($content['treport_custom_sql_id'] != 0) { if ($content['treport_custom_sql_id'] != 0) {
$sql = io_safe_output( $sql = io_safe_output(
db_get_value_filter( db_get_value_filter(
@ -7459,7 +7550,7 @@ function reporting_sql($report, $content)
$sql = $content['external_source']; $sql = $content['external_source'];
} }
// Check if exist sql macro. // Check if SQL macro exists.
$sql = reporting_sql_macro($report, $sql); $sql = reporting_sql_macro($report, $sql);
// Do a security check on SQL coming from the user. // Do a security check on SQL coming from the user.
@ -7514,11 +7605,7 @@ function reporting_sql($report, $content)
$return['error'] = __('Illegal query: Due security restrictions, there are some tokens or words you cannot use: *, delete, drop, alter, modify, password, pass, insert or update.'); $return['error'] = __('Illegal query: Due security restrictions, there are some tokens or words you cannot use: *, delete, drop, alter, modify, password, pass, insert or update.');
} }
if ($config['metaconsole'] && !empty($content['server_name'])) { return $return;
metaconsole_restore_db();
}
return reporting_check_structure_content($return);
} }

View File

@ -583,7 +583,7 @@ function initialiceLayout(data) {
success: function(data) { success: function(data) {
$("#modal-add-widget").empty(); $("#modal-add-widget").empty();
$("#modal-add-widget").append(data); $("#modal-add-widget").append(data);
$("a.pagination").click(function() { $("a.pandora_pagination").click(function() {
var offset = $(this) var offset = $(this)
.attr("href") .attr("href")
.split("=") .split("=")

View File

@ -420,6 +420,7 @@ class Widget
case 'ColorModuleTabs': case 'ColorModuleTabs':
case 'BlockHistogram': case 'BlockHistogram':
case 'DataMatrix': case 'DataMatrix':
case 'EventCardboard':
$className .= '\\'.$name; $className .= '\\'.$name;
break; break;

View File

@ -0,0 +1,664 @@
<?php
/**
* Widget Event cardboard Pandora FMS Console
*
* @category Console Class
* @package Pandora FMS
* @subpackage Widget Event cardboard
* @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.
* ============================================================================
*/
namespace PandoraFMS\Dashboard;
use PandoraFMS\Enterprise\Metaconsole\Node;
/**
* Event cardboard Widgets.
*/
class EventCardboard extends Widget
{
/**
* Name widget.
*
* @var string
*/
protected $name;
/**
* Title widget.
*
* @var string
*/
protected $title;
/**
* Page widget;
*
* @var string
*/
protected $page;
/**
* Class name widget.
*
* @var [type]
*/
protected $className;
/**
* Values options for each widget.
*
* @var [type]
*/
protected $values;
/**
* Configuration required.
*
* @var boolean
*/
protected $configurationRequired;
/**
* Error load widget.
*
* @var boolean
*/
protected $loadError;
/**
* Width.
*
* @var integer
*/
protected $width;
/**
* Heigth.
*
* @var integer
*/
protected $height;
/**
* Grid Width.
*
* @var integer
*/
protected $gridWidth;
/**
* Cell ID.
*
* @var integer
*/
protected $cellId;
/**
* Construct.
*
* @param integer $cellId Cell ID.
* @param integer $dashboardId Dashboard ID.
* @param integer $widgetId Widget ID.
* @param integer|null $width New width.
* @param integer|null $height New height.
* @param integer|null $gridWidth Grid width.
*/
public function __construct(
int $cellId,
int $dashboardId=0,
int $widgetId=0,
?int $width=0,
?int $height=0,
?int $gridWidth=0
) {
global $config;
include_once $config['homedir'].'/include/functions_agents.php';
include_once $config['homedir'].'/include/functions_modules.php';
// WARNING: Do not edit. This chunk must be in the constructor.
parent::__construct(
$cellId,
$dashboardId,
$widgetId
);
// Width.
$this->width = $width;
// Height.
$this->height = $height;
// Grid Width.
$this->gridWidth = $gridWidth;
// Cell Id.
$this->cellId = $cellId;
// Options.
$this->values = $this->decoders($this->getOptionsWidget());
// Positions.
$this->position = $this->getPositionWidget();
// Page.
$this->page = basename(__FILE__);
// ClassName.
$class = new \ReflectionClass($this);
$this->className = $class->getShortName();
// Title.
$this->title = __('Event cardboard');
// Name.
if (empty($this->name) === true) {
$this->name = 'EventCardboard';
}
// This forces at least a first configuration.
$this->configurationRequired = false;
if (isset($this->values['groupId']) === false) {
$this->configurationRequired = true;
}
$this->overflow_scrollbars = false;
}
/**
* Decoders hack for retrocompability.
*
* @param array $decoder Values.
*
* @return array Returns the values with the correct key.
*/
public function decoders(array $decoder): array
{
$values = [];
// Retrieve global - common inputs.
$values = parent::decoders($decoder);
if (isset($decoder['eventType']) === true) {
$values['eventType'] = $decoder['eventType'];
}
if (isset($decoder['maxHours']) === true) {
$values['maxHours'] = $decoder['maxHours'];
}
if (isset($decoder['eventStatus']) === true) {
$values['eventStatus'] = $decoder['eventStatus'];
}
if (isset($decoder['severity']) === true) {
$values['severity'] = $decoder['severity'];
}
if (isset($decoder['groupId']) === true) {
$values['groupId'] = $decoder['groupId'];
}
if (isset($decoder['nodes']) === true) {
$values['nodes'] = $decoder['nodes'];
}
return $values;
}
/**
* Generates inputs for form (specific).
*
* @return array Of inputs.
*
* @throws Exception On error.
*/
public function getFormInputs(): array
{
$values = $this->values;
// Retrieve global - common inputs.
$inputs = parent::getFormInputs();
// Remove background field, this widget doesn't use it.
foreach ($inputs as $kIn => $vIn) {
if ($vIn['label'] === 'Background') {
unset($inputs[$kIn]);
}
}
$blocks = [
'row1',
'row2',
];
$inputs['blocks'] = $blocks;
foreach ($inputs as $kInput => $vInput) {
$inputs['inputs']['row1'][] = $vInput;
}
// Event Type.
$fields = get_event_types();
$fields['not_normal'] = __('Not normal');
$inputs['inputs']['row1'][] = [
'label' => __('Event type'),
'arguments' => [
'type' => 'select',
'fields' => $fields,
'class' => 'event-widget-input',
'name' => 'eventType',
'selected' => $values['eventType'],
'return' => true,
'nothing' => __('Any'),
'nothing_value' => 0,
],
];
// Max. hours old. Default 8.
if (isset($values['maxHours']) === false) {
$values['maxHours'] = 8;
}
$inputs['inputs']['row1'][] = [
'label' => __('Max. hours old'),
'arguments' => [
'name' => 'maxHours',
'type' => 'number',
'class' => 'event-widget-input',
'value' => $values['maxHours'],
'return' => true,
'min' => 0,
],
];
// Event status.
$fields = [
-1 => __('All event'),
1 => __('Only validated'),
0 => __('Only pending'),
];
$inputs['inputs']['row1'][] = [
'label' => __('Event status'),
'arguments' => [
'type' => 'select',
'fields' => $fields,
'class' => 'event-widget-input',
'name' => 'eventStatus',
'selected' => $values['eventStatus'],
'return' => true,
],
];
// Groups.
$return_all_group = false;
$selected_groups_array = explode(',', $values['groupId'][0]);
if (empty($values['groupId'][0]) === true) {
$selected_groups_array = [0];
}
if ((bool) \users_can_manage_group_all('RM') === true
|| ($selected_groups_array[0] !== ''
&& in_array(0, $selected_groups_array) === true)
) {
// Return all group if user has permissions or it is a currently
// selected group.
$return_all_group = true;
}
$inputs['inputs']['row1'][] = [
'label' => __('Groups'),
'arguments' => [
'type' => 'select_groups',
'name' => 'groupId[]',
'class' => 'event-widget-input',
'returnAllGroup' => true,
'privilege' => 'AR',
'selected' => $selected_groups_array,
'return' => true,
'multiple' => true,
'returnAllGroup' => $return_all_group,
'required' => true,
],
];
// Nodes.
if (is_metaconsole() === true) {
$nodes_fields = [];
$servers_ids = metaconsole_get_servers();
foreach ($servers_ids as $server) {
$nodes_fields[$server['id']] = $server['server_name'];
}
$nodes_fields[0] = __('Metaconsola');
$nodes_selected = explode(',', $values['nodes']);
(isset($values['nodes']) === false) ? $nodes_selected = $servers_ids : '';
$nodes_height = count($nodes_fields);
if (count($nodes_fields) > 5) {
$nodes_height = 5;
}
$inputs['inputs']['row2'][] = [
'label' => __('Servers'),
'arguments' => [
'name' => 'nodes',
'type' => 'select',
'fields' => $nodes_fields,
'selected' => $nodes_selected,
'return' => true,
'multiple' => true,
'class' => 'overflow-hidden',
'size' => $nodes_height,
'select_all' => false,
'required' => true,
],
];
}
// Severity.
$fields = get_priorities();
$severity_selected = explode(',', $values['severity']);
if (isset($values['severity']) === false) {
$severity_selected = array_keys($fields);
}
$inputs['inputs']['row2'][] = [
'label' => __('Severity'),
'arguments' => [
'type' => 'select',
'fields' => $fields,
'class' => 'event-widget-input',
'name' => 'severity',
'selected' => $severity_selected,
'return' => true,
'multiple' => true,
],
];
return $inputs;
}
/**
* Get Post for widget.
*
* @return array
*/
public function getPost():array
{
// Retrieve global - common inputs.
$values = parent::getPost();
$values['eventType'] = \get_parameter('eventType', 0);
$values['maxHours'] = \get_parameter('maxHours', 8);
$values['eventStatus'] = \get_parameter('eventStatus', -1);
$values['groupId'] = \get_parameter('groupId', []);
$values['severity'] = \get_parameter('severity', -1);
$values['nodes'] = \get_parameter('nodes', 0);
return $values;
}
/**
* Draw widget.
*
* @return string;
*/
public function load()
{
$output = '';
ui_require_css_file('events', 'include/styles/', true);
ui_require_javascript_file('pandora_events', 'include/javascript/', true);
$eventType = $this->values['eventType'];
$groupId = implode(',', $this->values['groupId']);
$utimestamp = strtotime('-'.$this->values['maxHours'].' hours');
$eventStatus = $this->values['eventStatus'];
$severity = $this->values['severity'];
$priorities = explode(',', $severity);
// Sort criticity array.
asort($priorities);
$count_meta = [];
$count_meta_tmp = [];
if (is_metaconsole() === true) {
$meta = false;
$nodes = $this->values['nodes'];
if (isset($nodes) === true) {
$servers_ids = explode(',', $nodes);
}
if (in_array(0, $servers_ids) === true) {
$meta = true;
unset($servers_ids[0]);
}
if (is_metaconsole() === true && $meta === true) {
$events_meta_rows = get_count_event_criticity(
$utimestamp,
$eventType,
$groupId,
$eventStatus,
$severity
);
array_push($count_meta_tmp, $events_meta_rows);
}
foreach ($servers_ids as $server_id) {
try {
$node = new Node((int) $server_id);
$node->connect();
$events_meta_rows = get_count_event_criticity(
$utimestamp,
$eventType,
$groupId,
$eventStatus,
$severity
);
array_push($count_meta_tmp, $events_meta_rows);
$node->disconnect();
} catch (\Exception $e) {
// Unexistent envents.
$node->disconnect();
}
}
foreach ($count_meta_tmp as $tmpValue) {
foreach ($tmpValue as $value) {
array_push($count_meta, $value);
}
}
$events_rows = [];
foreach ($priorities as $pKey) {
$count = 0;
$tmp['criticity'] = $pKey;
foreach ($count_meta as $kEventMeta => $vEventMeta) {
if ((int) $pKey === (int) $vEventMeta['criticity']) {
$count += (int) $vEventMeta['count'];
}
}
$tmp['count'] = $count;
array_push($events_rows, $tmp);
}
} else {
$events_rows = get_count_event_criticity(
$utimestamp,
$eventType,
$groupId,
$eventStatus,
$severity
);
}
$output .= '<table class="w100p h100p table-border-0"><tbody><tr>';
$width_td = (100 / count(explode(',', $severity)));
$td_count = 0;
foreach ($priorities as $key) {
$count = 0;
foreach ($events_rows as $event) {
if ((int) $key === (int) $event['criticity']) {
$count = $event['count'];
}
}
switch ((int) $key) {
case 0:
$text = __('Maintenance');
$color = get_priority_class((int) $key);
break;
case 1:
$text = __('Informational');
$color = get_priority_class((int) $key);
break;
case 2:
$text = __('Normal');
$color = get_priority_class((int) $key);
break;
case 3:
$text = __('Warning');
$color = get_priority_class((int) $key);
break;
case 4:
$text = __('Critical');
$color = get_priority_class((int) $key);
break;
case 5:
$text = __('Minor');
$color = get_priority_class((int) $key);
break;
case 6:
$text = __('Major');
$color = get_priority_class((int) $key);
break;
case 20:
$text = __('Not normal');
$color = get_priority_class((int) $key);
break;
case 21:
$text = __('Critical').'/'.__('Normal');
$color = get_priority_class((int) $key);
break;
case 34:
$text = __('Warning').'/'.__('Critical');
$color = get_priority_class((int) $key);
break;
default:
return false;
}
$border = '';
$td_count++;
if (count($priorities) > $td_count) {
$border = ' border-right: 1px solid white; border-collapse: collapse;';
}
$output .= '<td class="'.$color.'" style="width: '.$width_td.'%;'.$border.'"><span class="med_data">';
$output .= $count;
$output .= '</span><br>';
$output .= $text;
$output .= '</td>';
}
$output .= '</tr></tbody></table>';
return $output;
}
/**
* Get description.
*
* @return string.
*/
public static function getDescription()
{
return __('Event cardboard');
}
/**
* Get Name.
*
* @return string.
*/
public static function getName()
{
return 'EventCardboard';
}
/**
* Get size Modal Configuration.
*
* @return array
*/
public function getSizeModalConfiguration(): array
{
if (is_metaconsole() === true) {
$size = [
'width' => 950,
'height' => 450,
];
} else {
$size = [
'width' => 900,
'height' => 450,
];
}
return $size;
}
}

View File

@ -28,6 +28,10 @@ ul.mn {
justify-content: center; justify-content: center;
} }
#menu_tab {
margin: 0px;
}
#menu_tab li.nomn.tab_operation img, #menu_tab li.nomn.tab_operation img,
#menu_tab li.nomn.tab_godmode img, #menu_tab li.nomn.tab_godmode img,
#menu_tab li.nomn_high.tab_operation img, #menu_tab li.nomn_high.tab_operation img,
@ -111,8 +115,6 @@ h1 {
} }
.grid-stack-item .grid-stack-item-content .header-widget { .grid-stack-item .grid-stack-item-content .header-widget {
background-color: black;
color: #fff;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;

View File

@ -138,13 +138,13 @@ div.arrow_box:before {
#menu_tab_frame_view_bc .breadcrumbs_container { #menu_tab_frame_view_bc .breadcrumbs_container {
align-self: flex-start; align-self: flex-start;
} }
/*
.breadcrumbs_container { .breadcrumbs_container {
padding-top: 4px; padding-top: 4px;
text-indent: 0.25em; text-indent: 0.25em;
padding-left: 2.5em; padding-left: 2.5em;
} }
*/
.breadcrumb_link { .breadcrumb_link {
color: #848484; color: #848484;
font-size: 10pt; font-size: 10pt;

View File

@ -29,3 +29,18 @@ li#select_multiple_modules_filtered {
#menu_tab li.nomn form#form-select-dashboard { #menu_tab li.nomn form#form-select-dashboard {
margin-top: 0px !important; margin-top: 0px !important;
} }
.table-border-0 {
border: none !important;
border-spacing: 0px !important;
}
.big_data {
text-decoration: none;
font-size: 2em;
}
.med_data {
text-decoration: none;
font-size: 1.5em;
}

View File

@ -8299,7 +8299,6 @@ div.graph div.legend table {
.report_info { .report_info {
border: 1px dashed #999; border: 1px dashed #999;
padding: 10px 15px; padding: 10px 15px;
margin-top: 20px;
margin-bottom: 20px; margin-bottom: 20px;
} }
@ -10649,12 +10648,14 @@ table tr td:first-child {
input[type="color"] { input[type="color"] {
background: transparent; background: transparent;
padding: 0 10px;
width: 50px;
box-sizing: initial; box-sizing: initial;
border: 2px solid #14524f; height: 25px;
box-shadow: 0px 3px 6px #c7c7c7; width: 50px;
border-radius: 16px; padding: 0px;
margin: 0px;
border: 0px;
border-radius: 0px;
box-shadow: none;
} }
span.ColorPickerDivSample { span.ColorPickerDivSample {

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 = '230301'; $build = '230302';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -359,7 +359,7 @@ if (is_ajax() === true) {
'te.warning_instructions', 'te.warning_instructions',
'te.unknown_instructions', 'te.unknown_instructions',
'te.owner_user', 'te.owner_user',
'if(te.ack_utimestamp > 0, from_unixtime(te.ack_utimestamp),"") as ack_utimestamp', 'if(te.ack_utimestamp > 0, te.ack_utimestamp,"") as ack_utimestamp',
'te.custom_data', 'te.custom_data',
'te.data', 'te.data',
'te.module_status', 'te.module_status',
@ -389,7 +389,7 @@ if (is_ajax() === true) {
$order['field'] = 'agent_name'; $order['field'] = 'agent_name';
break; break;
case 'if(te.ack_utimestamp > 0, from_unixtime(te.ack_utimestamp),"") as ack_utimestamp': case 'if(te.ack_utimestamp > 0, te.ack_utimestamp,"") as ack_utimestamp':
$order['field'] = 'ack_utimestamp'; $order['field'] = 'ack_utimestamp';
break; break;
@ -530,14 +530,14 @@ if (is_ajax() === true) {
$tmp->agent_name = io_safe_output($tmp->agent_name); $tmp->agent_name = io_safe_output($tmp->agent_name);
$tmp->ack_utimestamp_raw = strtotime($tmp->ack_utimestamp); $tmp->ack_utimestamp_raw = $tmp->ack_utimestamp;
$tmp->ack_utimestamp = ui_print_timestamp( $tmp->ack_utimestamp = ui_print_timestamp(
(empty($tmp->ack_utimestamp) === true) ? 0 : $tmp->ack_utimestamp, (empty($tmp->ack_utimestamp) === true) ? 0 : $tmp->ack_utimestamp,
true true
); );
$tmp->timestamp = ui_print_timestamp( $tmp->timestamp = ui_print_timestamp(
$tmp->timestamp, $tmp->utimestamp,
true true
); );

View File

@ -229,7 +229,7 @@ ui_print_standard_header(
$table = new stdClass(); $table = new stdClass();
$table->id = 'controls_table'; $table->id = 'controls_table';
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox'; $table->class = 'filter-table-adv';
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
@ -240,7 +240,7 @@ if (defined('METACONSOLE')) {
} }
$table->style = []; $table->style = [];
$table->style[0] = 'width: 60px;'; $table->style[0] = 'vertical-align: middle';
$table->rowspan[0][0] = 2; $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
@ -257,9 +257,7 @@ if (!$enable_init_date) {
} }
$table->size = []; $table->size = [];
$table->size[0] = '60px';
$table->colspan[0][1] = 2; $table->colspan[0][1] = 2;
$table->style[0] = 'text-align:center;';
$table->data = []; $table->data = [];
$table->data[0][0] = html_print_image( $table->data[0][0] = html_print_image(
'images/reporting32.png', 'images/reporting32.png',
@ -276,7 +274,7 @@ if (reporting_get_description($id_report)) {
$table->data[0][1] = '<div class="float-left">'.reporting_get_name($id_report).'</div>'; $table->data[0][1] = '<div class="float-left">'.reporting_get_name($id_report).'</div>';
} }
$table->data[0][1] .= '<div class="flex-content-right">'.__('Set initial date').html_print_checkbox('enable_init_date', 1, $enable_init_date, true).'</br>'; $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) {
@ -296,12 +294,42 @@ $table->data[1][2] = '<div style="display:'.$display_item.'" id="string_items">'
$table->data[1][2] .= '<div style="display:'.$display_to.'" id="string_to">'.__('to').':</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('date', $date, '', 12, 10, true).' ';
$table->data[1][2] .= html_print_input_text('time', $time, '', 10, 7, true).' '; $table->data[1][2] .= html_print_input_text('time', $time, '', 10, 7, true).' ';
$table->data[1][2] .= html_print_submit_button(__('Update'), 'date_submit', false, 'class="sub next"', true);
echo '<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">';
html_print_table($table); $searchForm .= html_print_table($table, true);
html_print_input_hidden('id_report', $id_report); $searchForm .= html_print_input_hidden('id_report', $id_report, true);
echo '</form>';
$Actionbuttons .= html_print_submit_button(
__('Update'),
'date_submit',
false,
[
'mode' => 'mini',
'icon' => 'next',
],
true
);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => $Actionbuttons,
],
true
);
$searchForm .= '</form>';
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
// ------------------------ END FORM ------------------------------------ // ------------------------ END FORM ------------------------------------
if ($enable_init_date) { if ($enable_init_date) {
if ($datetime_init > $datetime) { if ($datetime_init > $datetime) {

View File

@ -1052,8 +1052,6 @@ if (!empty($table->data)) {
// Close edit_user_profiles. // Close edit_user_profiles.
echo '</div>'; echo '</div>';
enterprise_hook('close_meta_frame');
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
?> ?>

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
@ -121,11 +121,11 @@ if ($aclRead === false && $aclWrite === false && $aclManage === false) {
$options = []; $options = [];
$options['consoles_list']['text'] = '<a href="index.php?sec=network&sec2=godmode/reporting/map_builder">'.html_print_image( $options['consoles_list']['text'] = '<a href="index.php?sec=network&sec2=godmode/reporting/map_builder">'.html_print_image(
'images/visual_console.png', 'images/logs@svg.svg',
true, true,
[ [
'title' => __('Visual consoles list'), 'title' => __('Visual consoles list'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
@ -149,29 +149,29 @@ if ($aclWrite === true || $aclManage === true) {
$options['public_link']['text'] = '<a href="'.ui_get_full_url( $options['public_link']['text'] = '<a href="'.ui_get_full_url(
'operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$visualConsoleId.'&refr='.$refr.'&id_user='.$config['id_user'] 'operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$visualConsoleId.'&refr='.$refr.'&id_user='.$config['id_user']
).'" target="_blank">'.html_print_image( ).'" target="_blank">'.html_print_image(
'images/camera_mc.png', 'images/item-icon.svg',
true, true,
[ [
'title' => __('Show link to public Visual Console'), 'title' => __('Show link to public Visual Console'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
$options['public_link']['active'] = false; $options['public_link']['active'] = false;
$options['data']['text'] = '<a href="'.$baseUrl.'&tab=data&id_visual_console='.$visualConsoleId.'">'.html_print_image( $options['data']['text'] = '<a href="'.$baseUrl.'&tab=data&id_visual_console='.$visualConsoleId.'">'.html_print_image(
'images/op_reporting.png', 'images/bars-graph.svg',
true, true,
[ [
'title' => __('Main data'), 'title' => __('Main data'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
$options['list_elements']['text'] = '<a href="'.$baseUrl.'&tab=list_elements&id_visual_console='.$visualConsoleId.'">'.html_print_image( $options['list_elements']['text'] = '<a href="'.$baseUrl.'&tab=list_elements&id_visual_console='.$visualConsoleId.'">'.html_print_image(
'images/list.png', 'images/edit_columns@svg.svg',
true, true,
[ [
'title' => __('List elements'), 'title' => __('List elements'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
@ -181,27 +181,27 @@ if ($aclWrite === true || $aclManage === true) {
true, true,
[ [
'title' => __('Services wizard'), 'title' => __('Services wizard'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
} }
$options['wizard']['text'] = '<a href="'.$baseUrl.'&tab=wizard&id_visual_console='.$visualConsoleId.'">'.html_print_image( $options['wizard']['text'] = '<a href="'.$baseUrl.'&tab=wizard&id_visual_console='.$visualConsoleId.'">'.html_print_image(
'images/wand.png', 'images/wizard@svg.svg',
true, true,
[ [
'title' => __('Wizard'), 'title' => __('Wizard'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
} }
$options['view']['text'] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$visualConsoleId.'&refr='.$refr.'">'.html_print_image( $options['view']['text'] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$visualConsoleId.'&refr='.$refr.'">'.html_print_image(
'images/eye.png', 'images/enable.svg',
true, true,
[ [
'title' => __('View'), 'title' => __('View'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';
$options['view']['active'] = true; $options['view']['active'] = true;
@ -209,11 +209,11 @@ $options['view']['active'] = true;
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
if (!$config['pure']) { if (!$config['pure']) {
$options['pure']['text'] = '<a id ="full_screen" href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$visualConsoleId.'&pure=1&refr='.$refr.'">'.html_print_image( $options['pure']['text'] = '<a id ="full_screen" href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$visualConsoleId.'&pure=1&refr='.$refr.'">'.html_print_image(
'images/full_screen.png', 'images/fullscreen@svg.svg',
true, true,
[ [
'title' => __('Full screen mode'), 'title' => __('Full screen mode'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'; ).'</a>';

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 230301 %define release 230302
# 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 230301 %define release 230302
# 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 230301 %define release 230302
%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

@ -29,7 +29,6 @@
// Extras required. // Extras required.
\ui_require_css_file('wizard'); \ui_require_css_file('wizard');
\enterprise_include_once('meta/include/functions_alerts_meta.php'); \enterprise_include_once('meta/include/functions_alerts_meta.php');
\enterprise_hook('open_meta_frame');
if (\is_metaconsole() === true) { if (\is_metaconsole() === true) {
\alerts_meta_print_header($tabs); \alerts_meta_print_header($tabs);
@ -142,5 +141,3 @@ HTML::printForm(
false, false,
true true
); );
\enterprise_hook('close_meta_frame');

View File

@ -28,7 +28,6 @@
\ui_require_css_file('wizard'); \ui_require_css_file('wizard');
\enterprise_include_once('meta/include/functions_alerts_meta.php'); \enterprise_include_once('meta/include/functions_alerts_meta.php');
\enterprise_hook('open_meta_frame');
if (\is_metaconsole() === true) { if (\is_metaconsole() === true) {
\alerts_meta_print_header($tabs); \alerts_meta_print_header($tabs);
@ -150,5 +149,3 @@ if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
] ]
); );
} }
\enterprise_hook('close_meta_frame');

View File

@ -30,7 +30,6 @@ global $config;
\ui_require_css_file('wizard'); \ui_require_css_file('wizard');
\enterprise_include_once('meta/include/functions_alerts_meta.php'); \enterprise_include_once('meta/include/functions_alerts_meta.php');
\enterprise_hook('open_meta_frame');
if (\is_metaconsole() === true) { if (\is_metaconsole() === true) {
\alerts_meta_print_header($tabs); \alerts_meta_print_header($tabs);
@ -491,7 +490,6 @@ if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
echo '<div id="modal-alert-templates" class="invisible"></div>'; echo '<div id="modal-alert-templates" class="invisible"></div>';
ui_require_javascript_file('pandora_alerts'); ui_require_javascript_file('pandora_alerts');
\enterprise_hook('close_meta_frame');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready (function () { $(document).ready (function () {

View File

@ -29,7 +29,6 @@
// Extras required. // Extras required.
\ui_require_css_file('wizard'); \ui_require_css_file('wizard');
\enterprise_include_once('meta/include/functions_alerts_meta.php'); \enterprise_include_once('meta/include/functions_alerts_meta.php');
\enterprise_hook('open_meta_frame');
if (\is_metaconsole() === true) { if (\is_metaconsole() === true) {
\alerts_meta_print_header($tabs); \alerts_meta_print_header($tabs);
@ -186,7 +185,6 @@ echo '<div id="modal-alert-templates" class="invisible"></div>';
ui_require_javascript_file('calendar'); ui_require_javascript_file('calendar');
ui_require_javascript_file('pandora_alerts'); ui_require_javascript_file('pandora_alerts');
\enterprise_hook('close_meta_frame');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready (function () { $(document).ready (function () {

View File

@ -49,7 +49,7 @@ if ($manageDashboards !== 0 || $writeDashboards !== 0) {
if ((int) $cellData['id_widget'] !== 0) { if ((int) $cellData['id_widget'] !== 0) {
$output .= '<a id="configure-widget-'.$cellData['id'].'" class="">'; $output .= '<a id="configure-widget-'.$cellData['id'].'" class="">';
$output .= html_print_image( $output .= html_print_image(
'images/input_cog_white.png', 'images/configuration@svg.svg',
true, true,
[ [
'width' => '16px', 'width' => '16px',
@ -61,7 +61,7 @@ if ($manageDashboards !== 0 || $writeDashboards !== 0) {
$output .= '<a id="delete-widget-'.$cellData['id'].'" class="">'; $output .= '<a id="delete-widget-'.$cellData['id'].'" class="">';
$output .= html_print_image( $output .= html_print_image(
'images/input_delete_white.png', 'images/delete.svg',
true, true,
[ [
'width' => '16px', 'width' => '16px',

View File

@ -273,22 +273,20 @@ if (isset($config['public_dashboard']) === true
} }
if ($publicLink === false) { if ($publicLink === false) {
if ((bool) is_metaconsole() === true) { ui_print_standard_header(
ui_meta_print_header( $dashboardName,
__('Dashboards').' » '.__('List'), '',
false, false,
$buttons '',
); true,
} else { $buttons,
ui_print_page_header( [
$dashboardName, [
'', 'link' => '',
false, 'label' => __('Dashboard'),
'', ],
false, ]
$buttons );
);
}
} else { } else {
$output = '<div id="dashboard-controls">'; $output = '<div id="dashboard-controls">';
foreach ($buttons as $key => $value) { foreach ($buttons as $key => $value) {

View File

@ -36,7 +36,10 @@ if ((int) $cellData['id_widget'] !== 0 || $widgetId !== 0) {
'add-widget-'.$cellData['id'], 'add-widget-'.$cellData['id'],
false, false,
'', '',
'class="sub cog add-widget"', [
'icon' => 'cog',
'mode' => 'secondary mini',
],
true true
); );

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.769-230301 Version: 7.0NG.769-230302
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-230301" pandora_version="7.0NG.769-230302"
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 = "230301"; my $pandora_build = "230302";
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 = "230301"; my $pandora_build = "230302";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );
@ -118,12 +118,12 @@ sub check_lib_version {
$plugin_version = "0NG.0" if empty($plugin_version); $plugin_version = "0NG.0" if empty($plugin_version);
my ($main,$oum) = split /NG./, $plugin_version; my ($main,$oum) = ($plugin_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/);
$main = 0 if empty($main) || !looks_like_number($main); $main = 0 if empty($main) || !looks_like_number($main);
$oum = 0 if empty($oum) || !looks_like_number($oum); $oum = 0 if empty($oum) || !looks_like_number($oum);
my ($libmain,$liboum) = split /NG./, $pandora_version; my ($libmain,$liboum) = ($pandora_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/);
if (($liboum < $oum) if (($liboum < $oum)
|| ($libmain != $main)) { || ($libmain != $main)) {

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 230301 %define release 230302
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 230301 %define release 230302
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="230301" PI_BUILD="230302"
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 230301"; my $version = "7.0NG.769 Build 230302";
# 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 230301"; my $version = "7.0NG.769 Build 230302";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);