Fixed views

This commit is contained in:
jose.gonzalez@pandorafms.com 2022-10-25 13:13:52 +02:00
parent ab865cd133
commit 13b0c7d0c8
12 changed files with 218 additions and 76 deletions

View File

@ -202,7 +202,7 @@ function quickShell()
'arguments' => [ 'arguments' => [
'type' => 'submit', 'type' => 'submit',
'label' => __('Connect'), 'label' => __('Connect'),
'attributes' => 'class="sub next"', 'attributes' => ['icon' => 'cog'],
], ],
], ],
], ],

View File

@ -185,7 +185,21 @@ echo "<tr><td class='datos w50p'>";
html_print_select($select, 'template_id', '', '', '', 0, false, false, true, '', false, 'max-width: 200px !important'); html_print_select($select, 'template_id', '', '', '', 0, false, false, true, '', false, 'max-width: 200px !important');
echo '</td>'; echo '</td>';
echo '<td class="datos">'; echo '<td class="datos">';
html_print_submit_button(__('Assign'), 'crt', false, 'class="sub next mgn_tp_0"'); html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Assign'),
'crt',
false,
[
'icon' => 'wand',
'mode' => 'mini',
],
true
),
]
);
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo '</form>'; echo '</form>';

View File

@ -375,7 +375,7 @@ html_print_submit_button(
false, false,
[ [
'icon' => 'search', 'icon' => 'search',
'mode' => 'mini', 'mode' => 'secondary mini',
] ]
); );
echo '</form>'; echo '</form>';
@ -963,10 +963,7 @@ if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
__('Create agent'), __('Create agent'),
'crt-2', 'crt-2',
false, false,
[ [ 'icon' => 'next' ],
'icon' => 'cog',
'mode' => 'secondary',
],
true true
), ),
] ]

View File

@ -80,7 +80,15 @@ if (($policy_page !== false) || (isset($agent) === true)) {
echo '</td>'; echo '</td>';
echo "<td class='datos w10p'>"; echo "<td class='datos w10p'>";
html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"'); html_print_submit_button(
__('Filter'),
'filter',
false,
[
'icon' => 'search',
'mode' => 'secondary mini',
]
);
echo '</td>'; echo '</td>';
echo "<td class='datos w10p'></td>"; echo "<td class='datos w10p'></td>";
echo '</form>'; echo '</form>';
@ -232,7 +240,7 @@ if (($policy_page) || (isset($agent))) {
false, false,
[ [
'icon' => 'next', 'icon' => 'next',
'mode' => 'secondary', 'mode' => 'mini secondary',
] ]
); );
echo '</td>'; echo '</td>';
@ -1283,33 +1291,43 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
html_print_table($table); html_print_table($table);
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('submit_modules_action', 1); html_print_input_hidden('submit_modules_action', 1);
html_print_select( html_print_div(
[ [
'disable' => 'Disable selected modules', 'class' => 'action-buttons',
'delete' => 'Delete selected modules', 'content' => html_print_submit_button(
], __('Execute action'),
'module_action', 'submit_modules_action',
'', false,
'', [
'', 'icon' => 'next',
0, 'mode' => 'link',
false, ],
false, true
false ).html_print_select(
[
'disable' => 'Disable selected modules',
'delete' => 'Delete selected modules',
],
'module_action',
'',
'',
'',
0,
true,
false,
false,
'',
false,
false,
false,
300
),
]
); );
html_print_submit_button(
__('Execute action'),
'submit_modules_action',
false,
'class="sub next"'
);
echo '</div>';
echo '</form>'; echo '</form>';
} }
?> ?>

View File

@ -189,21 +189,45 @@ if ($own_info['is_admin']) {
true true
); );
if (!isset($step)) { if (isset($step) === false) {
echo '<form class="add_alert_form" method="post">'; echo '<form class="add_alert_form" method="post">';
html_print_table($table); html_print_table($table);
} }
echo '<div class="action-buttons" style="width: '.$table->width.'">'; if (isset($step) === false) {
$output = '';
if (!isset($step)) {
if ($id_cluster) { if ($id_cluster) {
echo "<input onclick='window.location.replace(\"index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id=".$id_cluster."\");' type=button name='store' class='sub upd right mrgn_lft_20px' value='".__('Finish and view cluster')."'>"; $output .= html_print_button(
__('Finish and view cluster'),
'store',
false,
'window.location.replace(\"index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id=".$id_cluster."\");',
[
'icon' => 'update',
'mode' => 'secondary mini',
],
true
);
} }
html_print_submit_button(__('Add alert'), 'add', false, 'class="sub wand"'); $output .= html_print_submit_button(
__('Add alert'),
'add',
false,
[ 'icon' => 'wand' ],
true
);
html_print_div(
[
'class' => 'action-buttons',
'content' => $output,
]
);
html_print_input_hidden('create_alert', 1); html_print_input_hidden('create_alert', 1);
echo '</div></form>'; echo '</form>';
} }
ui_require_css_file('cluetip', 'include/styles/js/'); ui_require_css_file('cluetip', 'include/styles/js/');

View File

@ -165,17 +165,28 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_
$form_filter .= html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, '', '', 0, true, false, true, '', false); $form_filter .= html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, '', '', 0, true, false, true, '', false);
$form_filter .= '</td></tr>'; $form_filter .= '</td></tr>';
$updateButton = html_print_submit_button(
__('Update'),
'',
false,
[
'icon' => 'update',
'mode' => 'mini',
],
true
);
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
$form_filter .= '<tr>'; $form_filter .= '<tr>';
$form_filter .= "<td colspan='6' align='right'>"; $form_filter .= "<td colspan='6' align='right'>";
$form_filter .= html_print_submit_button(__('Update'), '', false, 'class="sub upd"', true); $form_filter .= $updateButton;
$form_filter .= '</td>'; $form_filter .= '</td>';
$form_filter .= '</tr>'; $form_filter .= '</tr>';
$form_filter .= '</table>'; $form_filter .= '</table>';
} else { } else {
$form_filter .= '</table>'; $form_filter .= '</table>';
$form_filter .= "<div class='right height_100p'>"; $form_filter .= "<div class='right height_100p'>";
$form_filter .= html_print_submit_button(__('Update'), '', false, 'class="sub upd"', true); $form_filter .= $updateButton;
$form_filter .= '</div>'; $form_filter .= '</div>';
} }

View File

@ -389,7 +389,13 @@ class ExternalTools extends HTML
'id' => '', 'id' => '',
'class' => 'action-buttons', 'class' => 'action-buttons',
'style' => 'width: 100%', 'style' => 'width: 100%',
'content' => html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"', true), 'content' => html_print_submit_button(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
true
),
], ],
true true
); );
@ -578,7 +584,22 @@ class ExternalTools extends HTML
true true
); );
$table->data[0][6] = "<input style='margin:0px;' name=submit type=submit class='sub next' value='".__('Execute')."'>"; $table->data[0][6] = html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Execute'),
'submit',
false,
[
'icon' => 'cog',
'mode' => 'mini',
],
true
),
],
true
);
// Output string. // Output string.
$output = ''; $output = '';

View File

@ -423,16 +423,22 @@ if ($free_search != '') {
); );
} }
if (!is_metaconsole()) { if ((is_metaconsole() === false) && ((bool) check_acl($config['id_user'], $id_group, 'AW') === true || (bool) check_acl($config['id_user'], $id_group, 'LM') === true)) {
if (check_acl($config['id_user'], $id_group, 'AW') || check_acl($config['id_user'], $id_group, 'LM')) { html_print_div(
echo '<div class="action-buttons" style="width: '.$table->width.';">'; [
html_print_submit_button(__('Validate'), 'alert_validate', false, 'class="sub ok"', false); 'class' => 'action-buttons',
echo '</div>'; 'content' => html_print_submit_button(
} __('Validate'),
'alert_validate',
false,
[ 'icon' => 'wand' ],
true
),
]
);
} }
$html_content = ob_get_clean();
$html_content = ob_get_clean();
if ($agent_view_page === true) { if ($agent_view_page === true) {
// Create controlled toggle content. // Create controlled toggle content.
@ -451,7 +457,7 @@ if ($free_search != '') {
echo $html_content; echo $html_content;
} }
// strict user hidden // Strict user hidden.
echo '<div id="strict_hidden" class="invisible">'; echo '<div id="strict_hidden" class="invisible">';
html_print_input_text('strict_user_hidden', $strict_user); html_print_input_text('strict_user_hidden', $strict_user);

View File

@ -293,7 +293,7 @@ html_print_submit_button(
false, false,
[ [
'icon' => 'search', 'icon' => 'search',
'mode' => 'secondary', 'mode' => 'secondary mini',
] ]
); );
@ -968,7 +968,12 @@ if (!empty($table->data)) {
if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AM')) { if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AM')) {
echo '<div class="right float-right">'; echo '<div class="right float-right">';
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">'; echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
html_print_submit_button(__('Create agent'), 'crt', false, 'class="sub next"'); html_print_submit_button(
__('Create agent'),
'crt',
false,
[ 'icon' => 'next']
);
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';
} }
@ -978,7 +983,12 @@ if (!empty($table->data)) {
ui_print_info_message([ 'no_close' => true, 'message' => __('There are no defined agents') ]); ui_print_info_message([ 'no_close' => true, 'message' => __('There are no defined agents') ]);
echo '<div class="right float-right">'; echo '<div class="right float-right">';
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">'; echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
html_print_submit_button(__('Create agent'), 'crt', false, 'class="sub next"'); html_print_submit_button(
__('Create agent'),
'crt',
false,
[ 'icon' => 'next']
);
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';
} }

View File

@ -595,7 +595,10 @@ function print_form_filter_monitors(
'filter', 'filter',
false, false,
'filter_modules();', 'filter_modules();',
'class="sub search"', [
'icon' => 'search',
'mode' => 'secondary mini',
],
true true
); );
$table->data[0][8] = html_print_button( $table->data[0][8] = html_print_button(
@ -603,7 +606,10 @@ function print_form_filter_monitors(
'filter', 'filter',
false, false,
'reset_filter_modules();', 'reset_filter_modules();',
'class="sub upd mgn_tp_0"', [
'icon' => 'fail',
'mode' => 'secondary mini',
],
true true
); );
$form_text .= html_print_table($table, true); $form_text .= html_print_table($table, true);

View File

@ -1,24 +1,39 @@
<?php <?php
/**
* Agents Graphs.
*
* @category Graphs.
* @package Pandora FMS
* @subpackage Agent Configuration
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com // Load global vars.
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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.
// Load global vars
global $config; global $config;
require_once 'include/functions_agents.php'; require_once 'include/functions_agents.php';
require_once 'include/functions_custom_graphs.php'; require_once 'include/functions_custom_graphs.php';
ui_require_javascript_file('calendar'); ui_require_javascript_file('calendar');
if (!check_acl($config['id_user'], $id_grupo, 'AR') && !check_acl($config['id_user'], 0, 'AW')) { if ((bool) check_acl($config['id_user'], $id_grupo, 'AR') === false && (bool) check_acl($config['id_user'], 0, 'AW') === false) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
'Trying to access (read) to agent '.agents_get_name($id_agente) 'Trying to access (read) to agent '.agents_get_name($id_agente)
@ -250,20 +265,40 @@ $table->data[7][3] = html_print_select($graph_option_type, 'option_type', $optio
$htmlForm = '<form method="post" action="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=graphs&id_agente='.$id_agente.'" >'; $htmlForm = '<form method="post" action="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=graphs&id_agente='.$id_agente.'" >';
$htmlForm .= html_print_table($table, true); $htmlForm .= html_print_table($table, true);
$htmlForm .= html_print_input_hidden('filter', 1, true); $htmlForm .= html_print_input_hidden('filter', 1, true);
$htmlForm .= '<div class="action-buttons" style="width: '.$table->width.'">';
if (check_acl($config['id_user'], 0, 'RW') || check_acl($config['id_user'], 0, 'RM')) { $outputButtons = html_print_submit_button(
$htmlForm .= html_print_button( __('Filter'),
'filter_button',
false,
[
'icon' => 'update',
'mode' => 'secondary mini',
],
true
);
if ((bool) check_acl($config['id_user'], 0, 'RW') === true || (bool) check_acl($config['id_user'], 0, 'RM') === true) {
$outputButtons .= html_print_button(
__('Save as custom graph'), __('Save as custom graph'),
'save_custom_graph', 'save_custom_graph',
false, false,
'', '',
'class="sub add" ', [
'icon' => 'add',
'mode' => 'secondary mini',
],
true true
); );
} }
$htmlForm .= '&nbsp;&nbsp;'.html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub upd" ', true); $htmlForm .= html_print_div(
$htmlForm .= '</div>'; [
'class' => 'action-buttons',
'content' => $outputButtons,
],
true
);
$htmlForm .= '</form>'; $htmlForm .= '</form>';
ui_toggle($htmlForm, __('Filter graphs'), __('Toggle filter(s)'), '', false); ui_toggle($htmlForm, __('Filter graphs'), __('Toggle filter(s)'), '', false);

View File

@ -1366,7 +1366,7 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
] ]
).'</a>'; ).'</a>';
if ($tab == 'manage') { if ($tab === 'manage') {
$managetab['active'] = true; $managetab['active'] = true;
} else { } else {
$managetab['active'] = false; $managetab['active'] = false;