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:
Jonathan 2023-02-27 16:34:02 +01:00
commit 1d930dccc7
10 changed files with 214 additions and 189 deletions

View File

@ -834,7 +834,7 @@ function mainAgentsModules()
return; return;
} }
echo '<table cellpadding="4" cellspacing="4" border="0" class="agents_modules_table w100p mrgn_btn_20px">'; echo '<table cellpadding="4" cellspacing="4" border="0" class="info_table mrgn_btn_20px">';
echo '<tr>'; echo '<tr>';

View File

@ -343,26 +343,35 @@ function mainModuleGroups()
if ($info && $array_module_group) { if ($info && $array_module_group) {
$table = new StdClass(); $table = new StdClass();
$table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;'; $table->class = 'info_table';
$table->style[0] = 'font-weight: bolder; min-width: 230px;';
$table->width = '100%'; $table->width = '100%';
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
$background_color = '#333';
} else {
$background_color = '#fff';
}
$head[0] = __('Groups'); $head[0] = __('Groups');
$headstyle[0] = 'width: 20%; font-weight: bolder;'; $headstyle[0] = 'width: 20%; font-weight: bolder;';
foreach ($array_module_group as $key => $value) { foreach ($array_module_group as $key => $value) {
$headstyle[] = 'min-width: 60px;max-width: 5%;text-align:center; color: #ffffff; background-color: #373737; font-weight: bolder;'; $headstyle[] = 'min-width: 60px;max-width: 5%;text-align:center; font-weight: bolder;';
$head[] = ui_print_truncate_text($value, GENERIC_SIZE_TEXT, true, true, true, '&hellip;', 'color:#FFF'); $head[] = ui_print_truncate_text(
$value,
GENERIC_SIZE_TEXT,
true,
true,
true,
'&hellip;'
);
} }
$i = 0; $i = 0;
foreach ($array_for_defect as $key => $value) { foreach ($array_for_defect as $key => $value) {
$deep = groups_get_group_deep($key); $deep = groups_get_group_deep($key);
$data[$i][0] = $deep.ui_print_truncate_text($value['data']['name'], GENERIC_SIZE_TEXT, true, true, true, '&hellip;', 'color:#FFF'); $data[$i][0] = $deep.ui_print_truncate_text(
$value['data']['name'],
GENERIC_SIZE_TEXT,
true,
true,
true,
'&hellip;'
);
$j = 1; $j = 1;
if (isset($array_data[$key])) { if (isset($array_data[$key])) {
foreach ($value['gm'] as $k => $v) { foreach ($value['gm'] as $k => $v) {

View File

@ -1802,56 +1802,54 @@ if (check_login()) {
$filters[$event_filter['id_filter']] = $event_filter['id_name']; $filters[$event_filter['id_filter']] = $event_filter['id_name'];
} }
echo '<div id="load-filter-select" class="load-filter-modal">'; echo '<div id="load-filter-select" class="load-filter-modal" title="'.__('Load').'">';
echo '<form method="post" id="form_load_filter" action="index.php?sec=view&sec2=operation/agentes/status_monitor&pure=">'; echo '<form method="post" id="form_load_filter" action="index.php?sec=view&sec2=operation/agentes/status_monitor&pure=">';
$table = new StdClass; $table = new StdClass;
$table->id = 'load_filter_form'; $table->id = 'load_filter_form';
$table->width = '100%'; $table->width = '100%';
$table->cellspacing = 4; $table->class = 'filter-table-adv';
$table->cellpadding = 4;
$table->class = 'databox';
if (is_metaconsole()) {
$table->cellspacing = 0;
$table->cellpadding = 0;
$table->class = 'databox filters';
}
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
$filter_id_width = '200px';
if (is_metaconsole()) {
$filter_id_width = '150px';
}
$data = []; $data = [];
$table->rowid[3] = 'update_filter_row1'; $table->rowid[3] = 'update_filter_row1';
$data[0] = __('Load filter').$jump; $data[0] = html_print_label_input_block(
$data[0] .= html_print_select(
$filters,
'filter_id',
$current,
'',
__('None'),
0,
true,
false,
true,
'',
false,
'margin-left:5px; width:'.$filter_id_width.';'
);
$data[1] = html_print_submit_button(
__('Load filter'), __('Load filter'),
'load_filter', html_print_select(
false, $filters,
'class="sub upd"', 'filter_id',
true $current,
'',
__('None'),
0,
true,
false,
true,
'',
false
)
); );
$data[1] .= html_print_input_hidden('load_filter', 1, true);
$table->data[] = $data; $table->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';
html_print_table($table); html_print_table($table);
html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Load filter'),
'srcbutton',
false,
[
'icon' => 'search',
'mode' => 'mini',
],
true
),
],
false
);
echo html_print_input_hidden('load_filter', 1, true);
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';
?> ?>
@ -1877,55 +1875,49 @@ if (check_login()) {
} }
if ($save_filter_modal) { if ($save_filter_modal) {
echo '<div id="save-filter-select">'; echo '<div id="save-filter-select" title="'.__('Save').'">';
if (check_acl($config['id_user'], 0, 'AW')) { if (check_acl($config['id_user'], 0, 'AW')) {
echo '<div id="#info_box"></div>'; echo '<div id="#info_box"></div>';
$table = new StdClass; $table = new StdClass;
$table->id = 'save_filter_form'; $table->id = 'save_filter_form';
$table->width = '100%'; $table->size = [];
$table->cellspacing = 4; $table->size[0] = '50%';
$table->cellpadding = 4; $table->size[1] = '50%';
$table->class = 'databox'; $table->class = 'filter-table-adv';
if (is_metaconsole()) {
$table->class = 'databox filters';
$table->cellspacing = 0;
$table->cellpadding = 0;
}
$table->styleTable = 'font-weight: bold; text-align:left;';
if (!is_metaconsole()) {
$table->style[0] = 'width: 50%; width:50%;';
}
$data = []; $data = [];
$table->rowid[0] = 'update_save_selector'; $table->rowid[0] = 'update_save_selector';
$data[0] = html_print_radio_button( $data[0][0] = html_print_label_input_block(
'filter_mode', __('New filter'),
'new', html_print_radio_button(
'', 'filter_mode',
true, 'new',
true '',
).__('New filter').''; true,
true
)
);
$data[1] = html_print_radio_button( $data[0][1] = html_print_label_input_block(
'filter_mode', __('Update filter'),
'update', html_print_radio_button(
'', 'filter_mode',
false, 'update',
true '',
).__('Update filter').''; false,
true
)
);
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$table->rowid[1] = 'save_filter_row1'; $table->rowid[1] = 'save_filter_row1';
$data[0] = __('Filter name').$jump; $data[1][0] = html_print_label_input_block(
$data[0] .= html_print_input_text('id_name', '', '', 15, 255, true); __('Filter name'),
if (is_metaconsole()) { html_print_input_text('id_name', '', '', 15, 255, true)
$data[1] = __('Save in Group').$jump; );
} else {
$data[1] = __('Filter group').$jump; $labelInput = __('Filter group');
if (is_metaconsole() === true) {
$labelInput = __('Save in Group');
} }
$user_groups_array = users_get_groups_for_select( $user_groups_array = users_get_groups_for_select(
@ -1935,32 +1927,22 @@ if (check_login()) {
true true
); );
$data[1] .= html_print_select( $data[1][1] = html_print_label_input_block(
$user_groups_array, $labelInput,
'id_group_filter_dialog', html_print_select(
$id_group_filter, $user_groups_array,
'', 'id_group_filter_dialog',
'', $id_group_filter,
0, '',
true, '',
false, 0,
false, true,
'w130' false,
false
)
); );
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$table->rowid[2] = 'save_filter_row2'; $table->rowid[2] = 'save_filter_row2';
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$table->rowid[3] = 'update_filter_row1';
$data[0] = __('Overwrite filter').$jump;
$sql = 'SELECT id_filter, id_name FROM tmonitor_filter'; $sql = 'SELECT id_filter, id_name FROM tmonitor_filter';
$monitor_filters = db_get_all_rows_sql($sql); $monitor_filters = db_get_all_rows_sql($sql);
@ -1972,36 +1954,60 @@ if (check_login()) {
} }
} }
$data[0] .= html_print_select( $data[2][0] = html_print_label_input_block(
$_filters_update, __('Overwrite filter'),
'overwrite_filter', html_print_select(
'', $_filters_update,
'', 'overwrite_filter',
'', '',
0, '',
true '',
); 0,
$data[1] = html_print_submit_button( true
__('Update filter'), )
'update_filter',
false,
'class="sub upd" onclick="save_update_filter();"',
true
); );
$table->data[] = $data; $table->data = $data;
$table->rowclass[] = '';
html_print_table($table); html_print_table($table);
echo '<div>';
echo html_print_submit_button( html_print_div(
__('Save filter'), [
'save_filter', 'id' => 'submit-save_filter',
false, 'class' => 'action-buttons',
'class="sub upd float-right" onclick="save_new_filter();"', 'content' => html_print_submit_button(
true __('Save filter'),
); 'srcbutton',
echo '</div>'; false,
[
'icon' => 'search',
'mode' => 'mini',
'onclick' => 'save_new_filter();',
],
true
),
],
false
);
html_print_div(
[
'id' => 'update_filter_row',
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Update filter'),
'srcbutton',
false,
[
'icon' => 'search',
'mode' => 'mini',
'onclick' => 'save_update_filter();',
],
true
),
],
false
);
} else { } else {
include 'general/noaccess.php'; include 'general/noaccess.php';
} }
@ -2010,21 +2016,18 @@ if (check_login()) {
?> ?>
<script type="text/javascript"> <script type="text/javascript">
function show_save_filter() { function show_save_filter() {
$('#save_filter_row1').show(); $('#save_filter_row2').hide();
$('#save_filter_row2').show(); $('#update_filter_row').hide();
$('#update_filter_row1').hide();
// Filter save mode selector // Filter save mode selector
$("[name='filter_mode']").click(function() { $("[name='filter_mode']").click(function() {
if ($(this).val() == 'new') { if ($(this).val() == 'new') {
$('#save_filter_row1').show(); $('#save_filter_row2').hide();
$('#save_filter_row2').show();
$('#submit-save_filter').show(); $('#submit-save_filter').show();
$('#update_filter_row1').hide(); $('#update_filter_row').hide();
} }
else { else {
$('#save_filter_row1').hide(); $('#save_filter_row2').show();
$('#save_filter_row2').hide(); $('#update_filter_row').show();
$('#update_filter_row1').show();
$('#submit-save_filter').hide(); $('#submit-save_filter').hide();
} }
}); });
@ -2032,7 +2035,9 @@ if (check_login()) {
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: false, modal: false,
closeOnEscape: true closeOnEscape: true,
width: 450,
height: 350
}); });
} }

View File

@ -781,27 +781,28 @@ class AgentsAlerts extends HTML
], ],
]; ];
if ($this->pure == 0) { /*
if ($this->pure == 0) {
$screenSwitchTitle = __('Full screen mode'); $screenSwitchTitle = __('Full screen mode');
$screenSwitchClass = 'pure_full'; $screenSwitchClass = 'pure_full';
$screenSwitchPure = 1; $screenSwitchPure = 1;
$refreshVisibility = false; $refreshVisibility = false;
} else { } else {
$screenSwitchTitle = __('Back to normal mode'); $screenSwitchTitle = __('Back to normal mode');
$screenSwitchClass = 'pure_normal'; $screenSwitchClass = 'pure_normal';
$screenSwitchPure = 0; $screenSwitchPure = 0;
$refreshVisibility = true; $refreshVisibility = true;
} }
$refreshComboRates = [ $refreshComboRates = [
'30' => __('30 seconds'), '30' => __('30 seconds'),
(string) SECONDS_1MINUTE => __('1 minute'), (string) SECONDS_1MINUTE => __('1 minute'),
(string) SECONDS_2MINUTES => __('2 minutes'), (string) SECONDS_2MINUTES => __('2 minutes'),
(string) SECONDS_5MINUTES => __('5 minutes'), (string) SECONDS_5MINUTES => __('5 minutes'),
(string) SECONDS_10MINUTES => __('10 minutes'), (string) SECONDS_10MINUTES => __('10 minutes'),
]; ];
$headerInputs[] = [ $headerInputs[] = [
'id' => 'pure', 'id' => 'pure',
'arguments' => [ 'arguments' => [
'name' => 'pure', 'name' => 'pure',
@ -809,9 +810,9 @@ class AgentsAlerts extends HTML
'value' => $this->pure, 'value' => $this->pure,
'return' => true, 'return' => true,
], ],
]; ];
$headerInputs[] = [ $headerInputs[] = [
'label' => __('Full screen'), 'label' => __('Full screen'),
'id' => 'img-full-screen', 'id' => 'img-full-screen',
'surround_start' => '<div id="full_screen_refresh_box">', 'surround_start' => '<div id="full_screen_refresh_box">',
@ -823,9 +824,9 @@ class AgentsAlerts extends HTML
'name' => 'pure', 'name' => 'pure',
'attributes' => 'class="full_screen_button '.$screenSwitchClass.'" title="'.$screenSwitchTitle.'"', 'attributes' => 'class="full_screen_button '.$screenSwitchClass.'" title="'.$screenSwitchTitle.'"',
], ],
]; ];
$headerInputs[] = [ $headerInputs[] = [
'label' => __('Refresh'), 'label' => __('Refresh'),
'id' => 'slc-refresh-rate', 'id' => 'slc-refresh-rate',
'class' => ($refreshVisibility === true) ? '' : 'invisible', 'class' => ($refreshVisibility === true) ? '' : 'invisible',
@ -840,7 +841,9 @@ class AgentsAlerts extends HTML
'script' => 'this.form.submit()', 'script' => 'this.form.submit()',
'sort' => false, 'sort' => false,
], ],
]; ];
*/
$filterForm = $this->printForm( $filterForm = $this->printForm(
[ [

View File

@ -162,6 +162,7 @@ class AuditLog extends HTML
'id' => 'load-filter', 'id' => 'load-filter',
'class' => 'float-left margin-right-2 margin-left-2 sub config', 'class' => 'float-left margin-right-2 margin-left-2 sub config',
'text' => __('Load filter'), 'text' => __('Load filter'),
'icon' => 'load',
'onclick' => '', 'onclick' => '',
]; ];
@ -169,6 +170,7 @@ class AuditLog extends HTML
'id' => 'save-filter', 'id' => 'save-filter',
'class' => 'float-left margin-right-2 sub wand', 'class' => 'float-left margin-right-2 sub wand',
'text' => __('Save filter'), 'text' => __('Save filter'),
'icon' => 'save',
'onclick' => '', 'onclick' => '',
]; ];
@ -181,7 +183,7 @@ class AuditLog extends HTML
[ [
'id' => $this->tableId, 'id' => $this->tableId,
'class' => 'info_table', 'class' => 'info_table',
'style' => 'width: 100%', 'style' => 'width: 99%',
'columns' => $columns, 'columns' => $columns,
'column_names' => $column_names, 'column_names' => $column_names,
'ajax_url' => $this->ajaxController, 'ajax_url' => $this->ajaxController,
@ -199,21 +201,21 @@ class AuditLog extends HTML
[ [
'label' => __('Free search').ui_print_help_tip(__('Search filter by User, Action, Date, Source IP or Comments fields content'), true), 'label' => __('Free search').ui_print_help_tip(__('Search filter by User, Action, Date, Source IP or Comments fields content'), true),
'type' => 'text', 'type' => 'text',
'class' => 'w200px', 'class' => 'w100p',
'id' => 'filter_text', 'id' => 'filter_text',
'name' => 'filter_text', 'name' => 'filter_text',
], ],
[ [
'label' => __('Max. hours old'), 'label' => __('Max. hours old'),
'type' => 'text', 'type' => 'text',
'class' => 'w100px', 'class' => 'w100p',
'id' => 'filter_period', 'id' => 'filter_period',
'name' => 'filter_period', 'name' => 'filter_period',
], ],
[ [
'label' => __('IP'), 'label' => __('IP'),
'type' => 'text', 'type' => 'text',
'class' => 'w100px', 'class' => 'w100p',
'id' => 'filter_ip', 'id' => 'filter_ip',
'name' => 'filter_ip', 'name' => 'filter_ip',
], ],
@ -241,6 +243,7 @@ class AuditLog extends HTML
], ],
], ],
], ],
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
] ]
); );
} catch (Exception $e) { } catch (Exception $e) {
@ -254,6 +257,8 @@ class AuditLog extends HTML
// Load own javascript file. // Load own javascript file.
echo $this->loadJS(); echo $this->loadJS();
html_print_action_buttons([], ['type' => 'form_action']);
} }

View File

@ -3573,8 +3573,7 @@ function ui_print_datatable(array $parameters)
$filter .= html_print_input(($input + ['return' => true]), 'li'); $filter .= html_print_input(($input + ['return' => true]), 'li');
} }
$filter .= '<li>'; $filter .= '</ul>';
// Extra buttons. // Extra buttons.
$extra_buttons = ''; $extra_buttons = '';
if (isset($parameters['form']['extra_buttons']) === true if (isset($parameters['form']['extra_buttons']) === true
@ -3616,9 +3615,7 @@ function ui_print_datatable(array $parameters)
true true
); );
$filter .= '</li>'; $filter .= '<div id="both"></div></form>';
$filter .= '</ul><div id="both"></div></form>';
if (isset($parameters['form']['no_toggle']) === false) { if (isset($parameters['form']['no_toggle']) === false) {
$filter = ui_toggle( $filter = ui_toggle(
$filter, $filter,

View File

@ -561,12 +561,13 @@ table.filter-table-adv td > div .label-thin {
font-weight: 400; font-weight: 400;
} }
table.filter-table-adv td input[type="radio"] {
height: 20px;
}
table.databox.filter-table-adv { table.databox.filter-table-adv {
padding: 10px; padding: 10px;
} }
/*
padding-right: calc(100% - 1024px);
*/
div.filter-datatable-submain { div.filter-datatable-submain {
padding: 10px 25px; padding: 10px 25px;

View File

@ -1,5 +1,5 @@
.white-box-content { .white-box-content {
padding: 0px; padding: 5px;
border-radius: 5px; border-radius: 5px;
} }

View File

@ -175,7 +175,7 @@ if ($total_agentes > 0) {
$total_not_init = format_numeric((($agents_notinit * 100) / $total_agentes), 2); $total_not_init = format_numeric((($agents_notinit * 100) / $total_agentes), 2);
} }
echo '<table cellpadding="0" cellspacing="0" border="0" width="100%" class="databox">'; echo '<table width="100%" class="info_table">';
echo '<tr>'; echo '<tr>';
echo "<th colspan=2 class='center'>".__('Summary of the status groups').'</th>'; echo "<th colspan=2 class='center'>".__('Summary of the status groups').'</th>';
echo '</tr>'; echo '</tr>';
@ -223,11 +223,11 @@ if (empty($result_groups) === false) {
[ 'right_content' => $pagination ] [ 'right_content' => $pagination ]
); );
echo '<table cellpadding="0" cellspacing="0" class="databox data mrgn_top_10px" border="0" width="100%">'; echo '<table class="info_table mrgn_top_10px" border="0" width="100%">';
echo '<tr>'; echo '<tr>';
echo '<th colspan=2 ></th>'; echo '<th colspan=2 ></th>';
echo "<th colspan=6 class='difference center'>".__('Agents').'</th>'; echo '<th colspan=6>'.__('Agents').'</th>';
echo "<th colspan=6 class='center'>".__('Modules').'</th>'; echo '<th colspan=6>'.__('Modules').'</th>';
echo '</tr>'; echo '</tr>';
echo '<tr>'; echo '<tr>';

View File

@ -2168,25 +2168,30 @@ if (empty($result) === false) {
} }
if (check_acl_one_of_groups($config['id_user'], $agent_groups, 'AW')) { if (check_acl_one_of_groups($config['id_user'], $agent_groups, 'AW')) {
if (defined('METACONSOLE')) { $url_edit_module = $row['server_url'];
$url_edit_module = $row['server_url'].'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&'; $url_edit_module .= 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&';
$url_edit_module .= 'loginhash=auto&id_agente='.$row['id_agent']; $url_edit_module .= '&id_agente='.$row['id_agent'];
$url_edit_module .= '&tab=module&id_agent_module='.$row['id_agente_modulo'].'&edit_module=1&'; $url_edit_module .= '&tab=module&id_agent_module='.$row['id_agente_modulo'].'&edit_module=1';
$url_edit_module .= 'loginhash_data='.$row['hashdata'].'&loginhash_user='.str_rot13($row['user']); if (is_metaconsole() === true) {
$url_edit_module .= '&loginhash=auto';
$url_edit_module .= '&loginhash_data='.$row['hashdata'].'&loginhash_user='.str_rot13($row['user']);
}
$table->cellclass[][2] = 'action_buttons';
$data[12] .= '<a href="'.$url_edit_module.'">'.html_print_image(
'images/config.png',
true,
[
'alt' => '0',
'border' => '',
'title' => __('Edit'),
]
).'</a>';
if (is_metaconsole() === false) {
$url_delete_module = $row['server_url'].'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente'; $url_delete_module = $row['server_url'].'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente';
$url_delete_module .= '&id_agente='.$row['id_agent'].'&delete_module='.$row['id_agente_modulo']; $url_delete_module .= '&id_agente='.$row['id_agent'].'&delete_module='.$row['id_agente_modulo'];
$table->cellclass[][2] = 'action_buttons';
$data[12] .= '<a href="'.$url_edit_module.'">'.html_print_image(
'images/config.png',
true,
[
'alt' => '0',
'border' => '',
'title' => __('Edit'),
]
).'</a>';
$onclick = 'onclick="javascript: if (!confirm(\''.__('Are you sure to delete?').'\')) return false;'; $onclick = 'onclick="javascript: if (!confirm(\''.__('Are you sure to delete?').'\')) return false;';
$data[12] .= '<a href="'.$url_delete_module.'" '.$onclick.'" target="_blank">'.html_print_image( $data[12] .= '<a href="'.$url_delete_module.'" '.$onclick.'" target="_blank">'.html_print_image(
'images/delete.png', 'images/delete.png',