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
Version: 7.0NG.769-230301
Version: 7.0NG.769-230302
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -1023,7 +1023,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.769';
use constant AGENT_BUILD => '230301';
use constant AGENT_BUILD => '230302';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

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

View File

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

View File

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

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230301}
{230302}
ViewReadme
{Yes}

View File

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

View File

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

View File

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

View File

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

View File

@ -76,10 +76,6 @@ function dbmgr_extension_main()
global $config;
if (is_metaconsole() === true) {
open_meta_frame();
}
if (!is_user_admin($config['id_user'])) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
@ -92,7 +88,21 @@ function dbmgr_extension_main()
$sql = (string) get_parameter('sql');
$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) {
$img = '../../images/warning_modern.png';
@ -285,10 +295,6 @@ function dbmgr_extension_main()
html_print_table($table);
echo '</div>';
if (is_metaconsole()) {
close_meta_frame();
}
}

View File

@ -15,9 +15,6 @@ global $config;
check_login();
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="image_task">
@ -36,7 +33,17 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no custom
?>
</p>
<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>
</div>
</div>

View File

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

View File

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

View File

@ -21,8 +21,6 @@ enterprise_include_once('meta/include/functions_alerts_meta.php');
check_login();
enterprise_hook('open_meta_frame');
if (is_ajax()) {
$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.
if (!$delete_template) {
// Header.
if (defined('METACONSOLE')) {
if (is_metaconsole() === true) {
alerts_meta_print_header();
} else {
ui_print_page_header(
@ -485,5 +483,3 @@ if (is_management_allowed() === true) {
echo '</form>';
echo '</div>';
}
enterprise_hook('close_meta_frame');

View File

@ -48,8 +48,6 @@ if (is_ajax()) {
}
}
enterprise_hook('open_meta_frame');
if (defined('METACONSOLE')) {
$sec = 'advanced';
} else {
@ -412,8 +410,6 @@ if ($is_management_allowed === true) {
echo '</form>';
enterprise_hook('close_meta_frame');
ui_require_javascript_file('pandora_alerts');
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();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
@ -392,7 +390,6 @@ if ($is_management_allowed === true) {
echo '</form>';
enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">

View File

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

View File

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

View File

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

View File

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

View File

@ -30,8 +30,6 @@ global $config;
check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
@ -934,8 +932,6 @@ html_print_action_buttons(
]
);
enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
$( 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';
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 {
$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 .= '<tr>';
$output .= "<td class='datos'><b>".__('Name').'</b></td>';
$output .= "<td class='datos'><input type='text' name='name' size='25' ";
if ($edit_graph === true) {
$output .= "value='".$graphInTgraph['name']."' ";
}
$output .= '>';
$output .= "<table width='100%' cellpadding=4 cellspacing=4 class='filter-table-adv databox'>";
$output .= '<tbody width="100%">';
$output .= '<tr class="datos2">';
$graphInTgraph['name'] = (isset($graphInTgraph['name']) === true) ? $graphInTgraph['name'] : '';
$output .= '<td width="50%">';
$output .= html_print_label_input_block(__('Name'), html_print_input_text('name', $graphInTgraph['name'], '', '', 255, true), ['style' => 'width:50%']);
$output .= '</td>';
$own_info = get_user_info($config['id_user']);
@ -140,9 +138,9 @@ if (users_can_manage_group_all('RW') === false
$return_all_group = false;
}
$output .= '<td><b>'.__('Group').'</b></td><td>';
$output .= '<td width="50%">';
if (check_acl($config['id_user'], 0, 'RW')) {
$output .= html_print_input(
$inputGroup = html_print_input(
[
'type' => 'select_groups',
'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')) {
$output .= html_print_input(
$inputGroup = html_print_input(
[
'type' => 'select_groups',
'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 .= '<tr>';
$output .= "<td class='datos2'><b>".__('Description').'</b></td>';
$output .= "<td class='datos2' colspan=3><textarea name='description' class='height_45px' cols=55 rows=2>";
if ($edit_graph === true) {
$output .= $graphInTgraph['description'];
}
$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 .= '<tr class="datos2">';
$output .= '<td width="100%" colspan="2">';
$graphInTgraph['description'] = (isset($graphInTgraph['description']) === true) ? $graphInTgraph['description'] : '';
$output .= html_print_label_input_block(
__('Description'),
html_print_textarea('description', 10, 5, $graphInTgraph['description'], '', true)
);
$output .= "</td><td class='datos2'>";
$output .= '<b>'.__('Type of graph').'</b></td>';
$output .= "<td class='datos2'> <div class='left inline'>";
$output .= '</td>';
$output .= '</tr><tr class="datos2">';
$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';
@ -221,90 +215,116 @@ $stackeds = [
CUSTOM_GRAPH_VBARS => __('Vertical bars'),
CUSTOM_GRAPH_PIE => __('Pie'),
];
$output .= html_print_select($stackeds, 'stacked', $stacked, '', '', 0, true);
$output .= '</div></td></tr>';
$output .= '<tr>';
$output .= "<td class='datos2 thresholdDiv'><b>";
$output .= __('Equalize maximum thresholds');
$output .= '</b></td>';
$output .= "<td class='datos2 thresholdDiv'>";
$output .= html_print_checkbox(
'threshold',
CUSTOM_GRAPH_BULLET_CHART_THRESHOLD,
$check,
true,
false,
'',
false
$output .= html_print_label_input_block(
__('Type of graph'),
html_print_select(
$stackeds,
'stacked',
$stacked,
'',
'',
0,
true
)
);
$output .= '</td></tr>';
$output .= "<tr><td class='datos2 sparse_graph '><b>";
$output .= __('Percentil');
$output .= '</b></td>';
$output .= "<td class='datos2 sparse_graph'>";
$output .= html_print_checkbox(
'percentil',
1,
$percentil,
true
$output .= '<tr class="datos2">';
$output .= "<td class='datos2 thresholdDiv' width='50%'>";
$output .= html_print_label_input_block(
__('Equalize maximum thresholds'),
html_print_checkbox(
'threshold',
CUSTOM_GRAPH_BULLET_CHART_THRESHOLD,
$check,
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 .= '</tr>';
$output .= "<tr><td class='datos2 sparse_graph'><b>";
$output .= __('Add summatory series');
$output .= '</b></td>';
$output .= "<td class='datos2 sparse_graph'>";
$output .= html_print_checkbox(
'summatory_series',
1,
$summatory_series,
true
$output .= '<tr class="datos2"><td class="datos2 sparse_graph" width="50%">';
$output .= html_print_label_input_block(
__('Add summatory series'),
html_print_checkbox(
'summatory_series',
1,
$summatory_series,
true
)
);
$output .= "</td><td class='datos2 sparse_graph'><b>";
$output .= __('Add average series');
$output .= '</b></td>';
$output .= "<td class='datos2 sparse_graph'>";
$output .= html_print_checkbox(
'average_series',
1,
$average_series,
true
$output .= "</td><td class='datos2 sparse_graph' width='50%'>";
$output .= html_print_label_input_block(
__('Add average series'),
html_print_checkbox(
'average_series',
1,
$average_series,
true
)
);
$output .= '</td></tr>';
$output .= "<tr><td class='datos2 sparse_graph'><b>";
$output .= __('Modules and series');
$output .= '</b></td>';
$output .= "<td class='datos2 sparse_graph'>";
$output .= html_print_checkbox('modules_series', 1, $modules_series, true);
$output .= '<tr class="datos2"><td class="datos2 sparse_graph" width="50%">';
$output .= html_print_label_input_block(
__('Modules and series'),
html_print_checkbox('modules_series', 1, $modules_series, true)
);
$output .= '</td>';
$output .= "<td class='datos2 sparse_graph'><b>";
$output .= __('Show full scale graph (TIP)');
$output .= '</td>';
$output .= "<td class='datos2 sparse_graph'>";
$output .= html_print_checkbox('fullscale', 1, $fullscale, true);
$output .= "<td class='datos2 sparse_graph' width='50%'>";
$output .= html_print_label_input_block(
__('Show full scale graph (TIP)'),
html_print_checkbox('fullscale', 1, $fullscale, true)
);
$output .= '</td>';
$output .= '</tr>';
$output .= '</tbody>';
$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(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
($edit_graph === true) ? __('Update') : __('Create'),
'store',
false,
[ 'icon' => 'next' ],
true
).html_print_go_back_button(
'index.php?sec=reporting&sec2=godmode/reporting/graphs',
[],
true
),
'content' => html_print_action_buttons(implode('', $ActionButtons), ['type' => 'form_action'], true),
],
true
);

View File

@ -222,218 +222,310 @@ $graphs = custom_graphs_get_user($config['id_user'], false, true, $access);
$offset = (int) get_parameter('offset');
$table_aux = new stdClass();
$table_aux->width = '100%';
$table_aux->class = 'databox filters';
$table_aux->cellpadding = 0;
$table_aux->cellspacing = 0;
$table_aux->width = '100%';
if (is_metaconsole() === true) {
$table_aux->class = 'databox filters';
$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] = '<b>'.__('Group').'</b>';
$table_aux->data[0][0] = html_print_label_input_block(
__('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(
__('Search by report name or description, list matches.'),
true
).'</b>';
$table_aux->data[0][3] = html_print_input_text('search', $search, '', 30, '', true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('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()) {
$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 {
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure'
method='post'>";
html_print_table($table_aux);
// Show only selected groups.
if ($id_group > 0) {
$group = ["$id_group" => $id_group];
} else {
$group = false;
}
$own_info = get_user_info($config['id_user']);
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'RM')) {
$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>';
}
// Show only selected groups.
if ($id_group > 0) {
$group = ["$id_group" => $id_group];
} else {
$group = false;
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>';
}
} 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 ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'RM')) {
$return_all_group = true;
} else {
$return_all_group = false;
if (!empty($result_graphs)) {
$ActionButtons[] = "<form method='post' id='form_delete' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
$ActionButtons[] = html_print_input_hidden('multiple_delete', 1, true);
$ActionButtons[] = html_print_submit_button(
__('Delete'),
'delete_btn',
false,
[
'class' => 'secondary',
'icon' => 'delete',
],
true
);
$ActionButtons[] = '</form>';
}
if ($search != '') {
$filter = [
'name' => $search_name,
'order' => 'name',
];
} else {
$filter = ['order' => 'name'];
}
// FALTA METER EL PRINT TABLE.
html_print_table($table);
html_print_action_buttons(
implode('', $ActionButtons),
['type' => 'form_action']
);
}
// 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;
}
echo '</div>';
// Filter normal and metaconsole reports.
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
$filter['metaconsole'] = 1;
} else {
$filter['metaconsole'] = 0;
}
echo '</div>';
} else {
include_once $config['homedir'].'/general/first_task/custom_graphs.php';
}
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">
$( document ).ready(function() {
$('[id^=checkbox-delete_multiple]').change(function(){
if($(this).parent().parent().hasClass('checkselected')){
$(this).parent().parent().removeClass('checkselected');
}
else{
$(this).parent().parent().addClass('checkselected');
$('[id^=checkbox-delete_multiple]').click(function(){
if($(this).prop("checked") === false ){
$(this).prop("checked", false);
} else {
$(this).prop("checked", true);
}
});
$('[id^=checkbox-all_delete]').change(function(){
if ($("#checkbox-all_delete").prop("checked")) {
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
$(".check_delete").prop("checked", true);
$('#checkbox-all_delete').click(function(){
if ($("#checkbox-all_delete").prop("checked") === true) {
$("[id^=checkbox-delete_multiple]").prop("checked", true);
}
else{
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
$(".check_delete").prop("checked", false);
}
$("[id^=checkbox-delete_multiple]").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
* This program is free software; you can redistribute it and/or
* 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);
$hack_metaconsole = '';
if (defined('METACONSOLE')) {
if (is_metaconsole() === true) {
$hack_metaconsole = '../../';
}
$buttons['visual_console'] = [
'active' => true,
'text' => '<a href="'.$url_visual_console.'">'.html_print_image(
'images/visual_console.png',
'images/logs@svg.svg',
true,
[
'title' => __('Visual Console List'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
@ -81,11 +81,11 @@ $buttons['visual_console'] = [
$buttons['visual_console_favorite'] = [
'active' => false,
'text' => '<a href="'.$url_visual_console_favorite.'">'.html_print_image(
'images/list.png',
'images/star@svg.svg',
true,
[
'title' => __('Visual Favourite Console'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
@ -94,11 +94,11 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
$buttons['visual_console_template'] = [
'active' => false,
'text' => '<a href="'.$url_visual_console_template.'">'.html_print_image(
'images/templates.png',
'images/groups@svg.svg',
true,
[
'title' => __('Visual Console Template'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
@ -106,11 +106,11 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
$buttons['visual_console_template_wizard'] = [
'active' => false,
'text' => '<a href="'.$url_visual_console_template_wizard.'">'.html_print_image(
'images/wand.png',
'images/wizard@svg.svg',
true,
[
'title' => __('Visual Console Template Wizard'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</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']);
if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'VR')) {
$return_all_group = false;
@ -353,26 +335,69 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'VR')) {
$return_all_group = true;
}
echo '<div class="w250px inline">';
html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false);
echo '</div>';
echo "<td class='w25p'>";
echo __('Group Recursion').'&nbsp;';
html_print_checkbox('recursion', 1, $recursion, false, false, 'this.form.submit()');
$filterTable = new stdClass();
$filterTable->id = 'map_buider_filter';
$filterTable->class = 'filter-table-adv';
$filterTable->width = '100%';
$filterTable->size = [];
$filterTable->size[0] = '33%';
$filterTable->size[1] = '33%';
echo "</td><td class='w22p'>";
html_print_submit_button(
$filterTable->data = [];
$filterTable->data[0][] = html_print_label_input_block(
__('Search'),
'search_visual_console',
false,
[
'icon' => 'search',
'mode' => 'secondary mini',
]
html_print_input_text('search', $search, '', 50, 255, true)
);
$filterTable->data[0][] = html_print_label_input_block(
__('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->width = '100%';
@ -471,7 +496,6 @@ if (!$maps && is_metaconsole() === false) {
);
}
} else {
ui_pagination($total_maps, $url, $offset, $pagination);
foreach ($maps as $map) {
// ACL for the visual console permission.
$vconsole_write = false;
@ -505,25 +529,25 @@ if (!$maps && is_metaconsole() === false) {
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(
'images/copy.png',
'images/copy.svg',
true,
['class' => 'invert_filter']
['class' => 'main_menu_icon invert_filter']
).'</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(
'images/cross.png',
'images/delete.svg',
true,
['class' => 'invert_filter']
['class' => 'main_menu_icon invert_filter']
).'</a>';
} 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(
'images/copy.png',
'images/copy.svg',
true,
['class' => 'invert_filter']
['class' => 'main_menu_icon invert_filter']
).'</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(
'images/cross.png',
'images/delete.svg',
true,
['class' => 'invert_filter']
['class' => 'main_menu_icon invert_filter']
).'</a>';
}
} else {
@ -535,42 +559,31 @@ if (!$maps && is_metaconsole() === false) {
}
html_print_table($table);
ui_pagination($total_maps, $url, $offset, $pagination, false, 'offset', true, 'pagination-bottom');
}
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">';
}
$tablePagination = ui_pagination($total_maps, $url, $offset, $pagination, true, 'offset', false);
}
if ($maps || is_metaconsole() === true) {
if ($vconsoles_write || $vconsoles_manage) {
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 {
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_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Create'),
'',
false,
[ 'icon' => 'next'],
true
),
]
html_print_action_buttons(
html_print_submit_button(
__('Create'),
'',
false,
[ 'icon' => 'next'],
true
),
[ 'right_content' => $tablePagination ]
);
echo '</form>';
}
echo '</div>';
}

View File

@ -281,7 +281,7 @@ switch ($action) {
$server_name = $item['server_name'];
// Metaconsole db connection.
if ($meta && empty($server_name) === false) {
if ($meta && empty($server_name) === false && $server_name !== 'all') {
$connection = metaconsole_get_connection($server_name);
$server_id = $connection['id'];
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
if ($meta) {
?>
@ -6338,6 +6361,7 @@ function chooseType() {
$("#row_alert_templates").hide();
$("#row_alert_actions").hide();
$("#row_servers").hide();
$("#row_servers_all_opt").hide();
$("#row_multiple_servers").hide();
$("#row_sort").hide();
$("#row_date").hide();
@ -6652,7 +6676,7 @@ function chooseType() {
$("#row_header").show();
$("#row_custom").show();
$("#row_custom_example").show();
$("#row_servers").show();
$("#row_servers_all_opt").show();
$("#row_historical_db_check").show();
break;

View File

@ -821,7 +821,7 @@ switch ($action) {
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Search'),
__('Filter'),
'search_submit',
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
* This program is free software; you can redistribute it and/or
* 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->id = 'wizard_table';
$table->head = [];
if (!is_metaconsole()) {
if (is_metaconsole() === false) {
$metaconsole_hack = '';
$table->width = '100%';
$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
* This program is free software; you can redistribute it and/or
* 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.
require_once $config['homedir'].'/include/class/HTML.class.php';
ui_require_css_file('discovery');
// ACL for the general permission
$vconsoles_read = check_acl($config['id_user'], 0, 'VR');
$vconsoles_write = check_acl($config['id_user'], 0, 'VW');
$vconsoles_manage = check_acl($config['id_user'], 0, 'VM');
// ACL for the general permission.
$vconsoles_read = (bool) check_acl($config['id_user'], 0, 'VR');
$vconsoles_write = (bool) check_acl($config['id_user'], 0, 'VW');
$vconsoles_manage = (bool) check_acl($config['id_user'], 0, 'VM');
$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(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access map builder'
@ -50,8 +49,7 @@ if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) {
exit;
}
if ($is_metaconsole === false) {
if (is_metaconsole() === false) {
$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_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';
}
$buttons = [];
$buttons['visual_console'] = [
'active' => false,
'text' => '<a href="'.$url_visual_console.'">'.html_print_image(
'images/visual_console.png',
'images/logs@svg.svg',
true,
[
'title' => __('Visual Console List'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
@ -78,11 +78,11 @@ $buttons['visual_console'] = [
$buttons['visual_console_favorite'] = [
'active' => true,
'text' => '<a href="'.$url_visual_console_favorite.'">'.html_print_image(
'images/list.png',
'images/star@svg.svg',
true,
[
'title' => __('Visual Favourite Console'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
@ -91,11 +91,11 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
$buttons['visual_console_template'] = [
'active' => false,
'text' => '<a href="'.$url_visual_console_template.'">'.html_print_image(
'images/templates.png',
'images/groups@svg.svg',
true,
[
'title' => __('Visual Console Template'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
@ -103,11 +103,11 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
$buttons['visual_console_template_wizard'] = [
'active' => false,
'text' => '<a href="'.$url_visual_console_template_wizard.'">'.html_print_image(
'images/wand.png',
'images/wizard@svg.svg',
true,
[
'title' => __('Visual Console Template Wizard'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
@ -136,115 +136,132 @@ $search = (string) get_parameter('search', '');
$ag_group = (int) get_parameter('ag_group', 0);
$recursion = (int) get_parameter('recursion', 0);
if (is_metaconsole() === false) {
echo "<form method='post'
action='index.php?sec=network&amp;sec2=godmode/reporting/visual_console_favorite'>";
} else {
echo "<form method='post'
action='index.php?sec=screen&sec2=screens/screens&action=visualmap_favorite'>";
$returnAllGroups = 0;
$filters = [];
if (empty($search) === false) {
$filters['name'] = io_safe_input($search);
}
echo "<ul class='form_flex'><li class='first_elements'>";
echo '<ul><li>';
echo __('Search').'&nbsp;';
html_print_input_text('search', $search, '', 50);
echo '</li><li>';
echo __('Group').'&nbsp;';
$own_info = get_user_info($config['id_user']);
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);
}
$own_info = get_user_info($config['id_user']);
if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) {
$return_all_group = false;
} else {
$return_all_group = true;
}
html_print_select_groups(
false,
'AR',
$return_all_group,
'ag_group',
$ag_group,
'',
'',
0,
false,
false,
true,
'',
false
);
echo "</li></ul></li><li class='second_elements'><ul><li>";
echo __('Group Recursion');
html_print_checkbox('recursion', 1, $recursion, false, false, '');
echo '</li><li>';
html_print_submit_button(
__('Search'),
$filterTable = new stdClass();
$filterTable->id = 'visual_console_favorite_filter';
$filterTable->class = 'filter-table-adv';
$filterTable->width = '100%';
$filterTable->size = [];
$filterTable->size[0] = '33%';
$filterTable->size[1] = '33%';
$filterTable->data = [];
$filterTable->data[0][] = html_print_label_input_block(
__('Search'),
html_print_input_text('search', $search, '', 50, 255, true)
);
$filterTable->data[0][] = html_print_label_input_block(
__('Group'),
html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, '', '', 0, true, false, true, '', false)
);
$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',
false,
[
'icon' => 'search',
'mode' => 'secondary 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,
'mode' => 'mini',
],
true
);
),
],
true
);
$searchForm .= '</form>';
echo "<div id='is_favourite'>";
if ($favorite_array == false) {
ui_print_info_message(__('No favourite consoles defined'));
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'
);
$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 {
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 {
$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>';
$url = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='.$favourite_v['id'];
}
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';
if (empty($create) === false || empty($view) === false) {
enterprise_hook('open_meta_frame');
$management_allowed = is_management_allowed();
if (is_metaconsole() === true) {
@ -708,11 +706,7 @@ if (empty($create) === false || empty($view) === false) {
if (defined('METACONSOLE')) {
echo '</td></tr>';
}
enterprise_hook('close_meta_frame');
} else {
enterprise_hook('open_meta_frame');
if (defined('METACONSOLE')) {
components_meta_print_header();
$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'.
echo "<div id='dialog_locked' title='".__('List of modules and components created by "%s" ')."' class='invisible left'>";
echo '</div>';
enterprise_hook('close_meta_frame');
}
ui_require_javascript_file('pandora_modules');

View File

@ -50,7 +50,6 @@ ui_require_css_file('first_task');
if (is_metaconsole() === true) {
enterprise_include_once('meta/include/functions_components_meta.php');
enterprise_hook('open_meta_frame');
components_meta_print_header();
$sec = 'advanced';
$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');
if (is_metaconsole()) {
// Metaconsole.
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', is_metaconsole() === true);
enterprise_include_once('include/functions_license.php');
ui_require_javascript_file_enterprise('load_enterprise');
enterprise_include_once('include/functions_license.php');
}
// Header.
ui_print_standard_header(
__('License management'),
'images/extensions.png',
false,
'',
true,
[],
[
[
'link' => '',
'label' => __('License'),
],
]
);
enterprise_include_once('include/functions_crypto.php');
@ -135,81 +137,201 @@ if (enterprise_installed()) {
</script>
<?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).
$url = get_um_url();
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
if (is_metaconsole()) {
$table->head[0] = __('Licence');
$table->head_colspan[0] = 3;
$table->headstyle[0] = 'text-align: center';
$table->style[0] = 'font-weight: bold;';
}
$table->class = 'databox filter-table-adv';
$table->size = [];
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
$table->colspan = [];
$table->data[0][0] = '<strong>'.__('Customer key').'</strong>';
$table->data[0][1] = html_print_textarea('keys[customer_key]', 10, 255, $settings->customer_key, 'style="width: 450px" class="height_50px w450px"', true);
$table->colspan[0][0] = 2;
$table->data[-1][0] = '<div class="section_table_title">'.__('Licence').'</div>';
$table->data[1][0] = '<strong>'.__($license['expiry_caption']).'</strong>';
$table->data[1][1] = html_print_input_text('expires', $license['expiry_date'], '', 10, 255, true, true);
$table->data[2][0] = '<strong>'.__('Platform Limit').'</strong>';
$table->data[2][1] = html_print_input_text('expires', $license['limit'], '', 10, 255, true, true).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'));
$table->data[3][0] = '<strong>'.__('Current Platform Count').'</strong>';
$table->data[3][1] = html_print_input_text('expires', $license['count'], '', 10, 255, true, true).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'));
$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'),
$table->colspan[0][0] = 2;
$table->data[0][0] = html_print_label_input_block(
__('Customer key'),
html_print_textarea(
'keys[customer_key]',
10,
255,
$settings->customer_key,
'style="width: 100%; height:80px;"',
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,
255,
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);
// If DESTDIR is defined the enterprise license is expired.
if (enterprise_installed() || defined('DESTDIR')) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('update_settings', 1);
html_print_submit_button(__('Validate'), 'update_button', false, 'class="sub upd"');
echo '&nbsp;&nbsp;';
html_print_button(__('Request new license'), 'license', false, 'generate_request_code()', [ 'fixed_id' => 'button-', 'icon' => 'next']);
echo '</div>';
$buttons = html_print_input_hidden('update_settings', 1, true);
$buttons .= html_print_submit_button(
__('Validate'),
'update_button',
false,
['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()) {
ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/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) {
echo '</form>';
echo '<div id="code_license_dialog" class="invisible left" title="'.__('Request new license').'">';
echo '<div id="logo">';
html_print_image(ui_get_custom_header_logo(true));

View File

@ -198,10 +198,12 @@ if ($edit_filter > -2) {
$table->id = 'filter_table';
$table->width = '100%';
$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][1] = html_print_input_text('description', $description, '', 60, 100, true);
$table->data[0][1] .= html_print_image(
'images/add.png',
'images/plus.png',
true,
[
'id' => 'add_filter',
@ -243,7 +245,7 @@ if ($edit_filter > -2) {
}
$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('index_post', $index);
if ($edit_filter > -1) {

View File

@ -77,7 +77,7 @@ if ($generate_trap) {
}
$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->class = 'filter-table-adv databox';
$table->size = [];

View File

@ -27,8 +27,6 @@ global $config;
check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'UM')) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
@ -437,8 +435,6 @@ if ($id_profile || $new_profile) {
echo '</form>';
}
enterprise_hook('close_meta_frame');
?>
<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');
// Save autorefresh list.
@ -1886,8 +1884,6 @@ html_print_action_buttons(implode('', $actionButtons), ['type' => 'form_action']
echo '</div>';
enterprise_hook('close_meta_frame');
// This is an image generated for JS.
$delete_image = html_print_input_image(
'del',

View File

@ -31,8 +31,6 @@ global $config;
check_login();
enterprise_hook('open_meta_frame');
require_once $config['homedir'].'/include/functions_profile.php';
require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/functions_groups.php';
@ -495,5 +493,3 @@ if ($is_management_allowed === true) {
}
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');
$sort = get_parameter('sort', 'none');
$tab = get_parameter('tab', 'user');
@ -1051,8 +1049,6 @@ if ($is_management_allowed === true) {
);
}
enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
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';
// Header (only in Node).
if (is_metaconsole() === false) {
ui_print_standard_header(
__('%s audit', get_product_name()).' &raquo; '.__('Review Logs'),
'images/gm_log.png',
false,
'',
false,
[],
ui_print_standard_header(
__('%s audit', get_product_name()).' &raquo; '.__('Review Logs'),
'images/gm_log.png',
false,
'',
false,
[],
[
[
[
'link' => '',
'label' => __('Admin Tools'),
],
[
'link' => '',
'label' => __('System Audit log'),
],
]
);
}
if (is_metaconsole() === true) {
// Only in case of Metaconsole, format the frame.
open_meta_frame();
}
'link' => '',
'label' => __('Admin Tools'),
],
[
'link' => '',
'label' => __('System Audit log'),
],
]
);
$buttons = [];
@ -265,11 +257,6 @@ class AuditLog extends HTML
echo $e->getMessage();
}
if (is_metaconsole() === true) {
// Close the frame.
close_meta_frame();
}
// Load own javascript file.
echo $this->loadJS();

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC230301';
$build_version = 'PC230302';
$pandora_version = 'v7.0NG.769';
// 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 = '';
$div_id = '';
$divAttributes = [];
if (empty($options) === false) {
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) {
$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) {
$output .= '<label class="'.$label_class.'">'.$label.'</label>';
}

View File

@ -68,6 +68,7 @@ define('REPORT_STATUS_IGNORED', 5);
// Clases.
use PandoraFMS\Enterprise\Metaconsole\Node;
use PandoraFMS\Enterprise\Metaconsole\Synchronizer;
use PandoraFMS\Event;
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)
{
global $config;
@ -7438,15 +7447,97 @@ function reporting_sql($report, $content)
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text();
if ($config['metaconsole'] && !empty($content['server_name'])) {
$id_meta = metaconsole_get_id_server(
if (is_metaconsole() === true
&& empty($content['server_name']) === false
&& $content['server_name'] !== 'all'
) {
$id_server = metaconsole_get_id_server(
$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) {
$sql = io_safe_output(
db_get_value_filter(
@ -7459,7 +7550,7 @@ function reporting_sql($report, $content)
$sql = $content['external_source'];
}
// Check if exist sql macro.
// Check if SQL macro exists.
$sql = reporting_sql_macro($report, $sql);
// 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.');
}
if ($config['metaconsole'] && !empty($content['server_name'])) {
metaconsole_restore_db();
}
return reporting_check_structure_content($return);
return $return;
}

View File

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

View File

@ -420,6 +420,7 @@ class Widget
case 'ColorModuleTabs':
case 'BlockHistogram':
case 'DataMatrix':
case 'EventCardboard':
$className .= '\\'.$name;
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;
}
#menu_tab {
margin: 0px;
}
#menu_tab li.nomn.tab_operation img,
#menu_tab li.nomn.tab_godmode img,
#menu_tab li.nomn_high.tab_operation img,
@ -111,8 +115,6 @@ h1 {
}
.grid-stack-item .grid-stack-item-content .header-widget {
background-color: black;
color: #fff;
display: flex;
flex-direction: row;
align-items: center;

View File

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

View File

@ -29,3 +29,18 @@ li#select_multiple_modules_filtered {
#menu_tab li.nomn form#form-select-dashboard {
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 {
border: 1px dashed #999;
padding: 10px 15px;
margin-top: 20px;
margin-bottom: 20px;
}
@ -10649,12 +10648,14 @@ table tr td:first-child {
input[type="color"] {
background: transparent;
padding: 0 10px;
width: 50px;
box-sizing: initial;
border: 2px solid #14524f;
box-shadow: 0px 3px 6px #c7c7c7;
border-radius: 16px;
height: 25px;
width: 50px;
padding: 0px;
margin: 0px;
border: 0px;
border-radius: 0px;
box-shadow: none;
}
span.ColorPickerDivSample {

View File

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

View File

@ -359,7 +359,7 @@ if (is_ajax() === true) {
'te.warning_instructions',
'te.unknown_instructions',
'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.data',
'te.module_status',
@ -389,7 +389,7 @@ if (is_ajax() === true) {
$order['field'] = 'agent_name';
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';
break;
@ -530,14 +530,14 @@ if (is_ajax() === true) {
$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(
(empty($tmp->ack_utimestamp) === true) ? 0 : $tmp->ack_utimestamp,
true
);
$tmp->timestamp = ui_print_timestamp(
$tmp->timestamp,
$tmp->utimestamp,
true
);

View File

@ -229,7 +229,7 @@ ui_print_standard_header(
$table = new stdClass();
$table->id = 'controls_table';
$table->width = '100%';
$table->class = 'databox';
$table->class = 'filter-table-adv';
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox filters';
@ -240,7 +240,7 @@ if (defined('METACONSOLE')) {
}
$table->style = [];
$table->style[0] = 'width: 60px;';
$table->style[0] = 'vertical-align: middle';
$table->rowspan[0][0] = 2;
// Set initial conditions for these controls, later will be modified by javascript
@ -257,9 +257,7 @@ if (!$enable_init_date) {
}
$table->size = [];
$table->size[0] = '60px';
$table->colspan[0][1] = 2;
$table->style[0] = 'text-align:center;';
$table->data = [];
$table->data[0][0] = html_print_image(
'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="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');
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] .= 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_submit_button(__('Update'), 'date_submit', false, 'class="sub next"', true);
echo '<form method="post" action="'.$url.'&pure='.$config['pure'].'" class="mrgn_right_0px">';
html_print_table($table);
html_print_input_hidden('id_report', $id_report);
echo '</form>';
$searchForm = '<form method="post" action="'.$url.'&pure='.$config['pure'].'" class="mrgn_right_0px">';
$searchForm .= html_print_table($table, true);
$searchForm .= html_print_input_hidden('id_report', $id_report, true);
$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 ------------------------------------
if ($enable_init_date) {
if ($datetime_init > $datetime) {

View File

@ -1052,8 +1052,6 @@ if (!empty($table->data)) {
// Close edit_user_profiles.
echo '</div>';
enterprise_hook('close_meta_frame');
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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -121,11 +121,11 @@ if ($aclRead === false && $aclWrite === false && $aclManage === false) {
$options = [];
$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,
[
'title' => __('Visual consoles list'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
@ -149,29 +149,29 @@ if ($aclWrite === true || $aclManage === true) {
$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']
).'" target="_blank">'.html_print_image(
'images/camera_mc.png',
'images/item-icon.svg',
true,
[
'title' => __('Show link to public Visual Console'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$options['public_link']['active'] = false;
$options['data']['text'] = '<a href="'.$baseUrl.'&tab=data&id_visual_console='.$visualConsoleId.'">'.html_print_image(
'images/op_reporting.png',
'images/bars-graph.svg',
true,
[
'title' => __('Main data'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$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,
[
'title' => __('List elements'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
@ -181,27 +181,27 @@ if ($aclWrite === true || $aclManage === true) {
true,
[
'title' => __('Services wizard'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
}
$options['wizard']['text'] = '<a href="'.$baseUrl.'&tab=wizard&id_visual_console='.$visualConsoleId.'">'.html_print_image(
'images/wand.png',
'images/wizard@svg.svg',
true,
[
'title' => __('Wizard'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
}
$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,
[
'title' => __('View'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$options['view']['active'] = true;
@ -209,11 +209,11 @@ $options['view']['active'] = true;
if (is_metaconsole() === false) {
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(
'images/full_screen.png',
'images/fullscreen@svg.svg',
true,
[
'title' => __('Full screen mode'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';

View File

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

View File

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

View File

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

View File

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

View File

@ -28,7 +28,6 @@
\ui_require_css_file('wizard');
\enterprise_include_once('meta/include/functions_alerts_meta.php');
\enterprise_hook('open_meta_frame');
if (\is_metaconsole() === true) {
\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');
\enterprise_include_once('meta/include/functions_alerts_meta.php');
\enterprise_hook('open_meta_frame');
if (\is_metaconsole() === true) {
\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>';
ui_require_javascript_file('pandora_alerts');
\enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
$(document).ready (function () {

View File

@ -29,7 +29,6 @@
// Extras required.
\ui_require_css_file('wizard');
\enterprise_include_once('meta/include/functions_alerts_meta.php');
\enterprise_hook('open_meta_frame');
if (\is_metaconsole() === true) {
\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('pandora_alerts');
\enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
$(document).ready (function () {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.769";
my $pandora_build = "230301";
my $pandora_build = "230302";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
@ -118,12 +118,12 @@ sub check_lib_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);
$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)
|| ($libmain != $main)) {

View File

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

View File

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

View File

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

View File

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

View File

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