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' => [
'type' => 'submit',
'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');
echo '</td>';
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 '</tr>';
echo '</form>';

View File

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

View File

@ -80,7 +80,15 @@ if (($policy_page !== false) || (isset($agent) === true)) {
echo '</td>';
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 class='datos w10p'></td>";
echo '</form>';
@ -232,7 +240,7 @@ if (($policy_page) || (isset($agent))) {
false,
[
'icon' => 'next',
'mode' => 'secondary',
'mode' => 'mini secondary',
]
);
echo '</td>';
@ -1283,33 +1291,43 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
html_print_table($table);
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true) {
html_print_input_hidden('submit_modules_action', 1);
html_print_select(
html_print_div(
[
'disable' => 'Disable selected modules',
'delete' => 'Delete selected modules',
],
'module_action',
'',
'',
'',
0,
false,
false,
false
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Execute action'),
'submit_modules_action',
false,
[
'icon' => 'next',
'mode' => 'link',
],
true
).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>';
}
?>
@ -1317,7 +1335,7 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
<script type="text/javascript">
$(document).ready (function () {
$('[id^=checkbox-id_delete]').change(function(){
if($(this).parent().parent().hasClass('checkselected')){
$(this).parent().parent().removeClass('checkselected');

View File

@ -189,21 +189,45 @@ if ($own_info['is_admin']) {
true
);
if (!isset($step)) {
if (isset($step) === false) {
echo '<form class="add_alert_form" method="post">';
html_print_table($table);
}
echo '<div class="action-buttons" style="width: '.$table->width.'">';
if (isset($step) === false) {
$output = '';
if (!isset($step)) {
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);
echo '</div></form>';
echo '</form>';
}
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 .= '</td></tr>';
$updateButton = html_print_submit_button(
__('Update'),
'',
false,
[
'icon' => 'update',
'mode' => 'mini',
],
true
);
if (is_metaconsole() === true) {
$form_filter .= '<tr>';
$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 .= '</tr>';
$form_filter .= '</table>';
} else {
$form_filter .= '</table>';
$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>';
}

View File

@ -389,7 +389,13 @@ class ExternalTools extends HTML
'id' => '',
'class' => 'action-buttons',
'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
);
@ -578,7 +584,22 @@ class ExternalTools extends HTML
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 = '';

View File

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

View File

@ -293,7 +293,7 @@ html_print_submit_button(
false,
[
'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')) {
echo '<div class="right float-right">';
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 '</div>';
}
@ -978,7 +983,12 @@ if (!empty($table->data)) {
ui_print_info_message([ 'no_close' => true, 'message' => __('There are no defined agents') ]);
echo '<div class="right float-right">';
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 '</div>';
}

View File

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

View File

@ -1,24 +1,39 @@
<?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
// ==================================================
// 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
// Load global vars.
global $config;
require_once 'include/functions_agents.php';
require_once 'include/functions_custom_graphs.php';
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(
AUDIT_LOG_ACL_VIOLATION,
'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 .= html_print_table($table, 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')) {
$htmlForm .= html_print_button(
$outputButtons = html_print_submit_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_custom_graph',
false,
'',
'class="sub add" ',
[
'icon' => 'add',
'mode' => 'secondary mini',
],
true
);
}
$htmlForm .= '&nbsp;&nbsp;'.html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub upd" ', true);
$htmlForm .= '</div>';
$htmlForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => $outputButtons,
],
true
);
$htmlForm .= '</form>';
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>';
if ($tab == 'manage') {
if ($tab === 'manage') {
$managetab['active'] = true;
} else {
$managetab['active'] = false;