fixed styles

This commit is contained in:
daniel 2023-03-23 12:41:39 +01:00
parent 1ac37dd538
commit 95834b2de7
13 changed files with 196 additions and 134 deletions

View File

@ -57,14 +57,33 @@ if ($id_field) {
$combo_values = $field['combo_values'] ? $field['combo_values'] : ''; $combo_values = $field['combo_values'] ? $field['combo_values'] : '';
$is_combo_enable = $config['is_combo_enable']; $is_combo_enable = $config['is_combo_enable'];
$is_link_enabled = $field['is_link_enabled']; $is_link_enabled = $field['is_link_enabled'];
ui_print_page_header(__('Update agent custom field'), 'images/custom_field.png', false, '', true, ''); $header_title = __('Update agent custom field');
} else { } else {
ui_print_page_header(__('Create agent custom field'), 'images/custom_field.png', false, '', true, ''); $header_title = __('Create agent custom field');
} }
$table = new stdClass(); ui_print_standard_header(
$table->class = 'databox'; $header_title,
$table->id = 'configure_field'; 'images/custom_field.png',
false,
'',
true,
[],
[
[
'link' => 'index.php?sec=gagente&sec2=godmode/agentes/fields_manager',
'label' => __('Resources'),
],
[
'link' => 'index.php?sec=gagente&sec2=godmode/agentes/fields_manager',
'label' => __('Custom field'),
],
[
'link' => '',
'label' => __('Edit'),
],
]
);
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>"; echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p class='center bolder'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>'; echo "<p class='center bolder'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
@ -82,42 +101,44 @@ echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Informati
echo "<p class='center bolder'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>'; echo "<p class='center bolder'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
echo '</div>'; echo '</div>';
$table = new stdClass();
$table->class = 'databox filter-table-adv';
$table->id = 'configure_field';
$table->width = '100%';
$table->size = [];
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = []; $table->data = [];
$table->data[0][0] = __('Name'); $table->data[0][0] = html_print_label_input_block(
$table->data[1][0] = html_print_input_text( __('Name'),
html_print_input_text(
'name', 'name',
$name, $name,
'', '',
35, 35,
100, 100,
true true
)
); );
$table->data[2][0] = __('Pass type').ui_print_help_tip( $table->data[0][1] = html_print_label_input_block(
__('The fields with pass type enabled will be displayed like html input type pass in html'), __('Display on front').ui_print_help_tip(
true
);
$table->data[2][1] = __('Display on front').ui_print_help_tip(
__('The fields with display on front enabled will be displayed into the agent details'), __('The fields with display on front enabled will be displayed into the agent details'),
true true
); ),
$table->data[2][2] = __('Link type'); html_print_checkbox_switch(
$table->data[3][0] = html_print_checkbox_switch(
'is_password_type',
1,
$is_password_type,
true
);
$table->data[3][1] = html_print_checkbox_switch(
'display_on_front', 'display_on_front',
1, 1,
$display_on_front, $display_on_front,
true true
)
); );
$table->data[3][2] = html_print_checkbox_switch_extended(
$table->data[1][0] = html_print_label_input_block(
__('Link type'),
html_print_checkbox_switch_extended(
'is_link_enabled', 'is_link_enabled',
1, 1,
$is_link_enabled, $is_link_enabled,
@ -125,9 +146,25 @@ $table->data[3][2] = html_print_checkbox_switch_extended(
'', '',
'', '',
true true
)
); );
$table->data[4][0] = __('Enabled combo');
$table->data[5][0] = html_print_checkbox_switch_extended( $table->data[2][0] = html_print_label_input_block(
__('Pass type').ui_print_help_tip(
__('The fields with pass type enabled will be displayed like html input type pass in html'),
true
),
html_print_checkbox_switch(
'is_password_type',
1,
$is_password_type,
true
)
);
$table->data[2][1] = html_print_label_input_block(
__('Enabled combo'),
html_print_checkbox_switch_extended(
'is_combo_enable', 'is_combo_enable',
0, 0,
$config['is_combo_enable'], $config['is_combo_enable'],
@ -135,27 +172,25 @@ $table->data[5][0] = html_print_checkbox_switch_extended(
'', '',
'', '',
true true
)
); );
$table->data[3][0] = html_print_label_input_block(
$table->cellstyle[4][1] = 'display: none;'; __('Combo values').ui_print_help_tip(
$table->cellstyle[5][1] = 'display: none;';
$table->data[4][1] = __('Combo values').ui_print_help_tip(
__('Set values separated by comma'), __('Set values separated by comma'),
true true
); ),
$table->data[5][1] = html_print_textarea( html_print_textarea(
'combo_values', 'combo_values',
3, 3,
65, 65,
io_safe_output($combo_values), io_safe_output($combo_values),
'', '',
true true
)
); );
echo '<form class="max_floating_element_size" name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
echo '<form name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
html_print_table($table); html_print_table($table);
if ($id_field > 0) { if ($id_field > 0) {
@ -194,65 +229,65 @@ echo '</form>';
<script> <script>
$(document).ready (function () { $(document).ready (function () {
if($('input[type=hidden][name=update_field]').val() == 1 && $('#textarea_combo_values').val() != ''){ if($('input[type=hidden][name=update_field]').val() == 1 && $('#textarea_combo_values').val() != ''){
console.log('entra2');
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true); $('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show(); $('#configure_field-3').show();
$('input[type=checkbox][name=is_password_type]').change(function (e) { $('input[type=checkbox][name=is_password_type]').change(function (e) {
dialog_message("#message_set_password"); dialog_message("#message_set_password");
$('input[type=checkbox][name=is_password_type]').prop('checked', false); $('input[type=checkbox][name=is_password_type]').prop('checked', false);
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true); $('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show(); $('#configure_field-3').show();
e.preventDefault(); e.preventDefault();
}); });
$('input[type=checkbox][name=is_combo_enable]').change(function (e) { $('input[type=checkbox][name=is_combo_enable]').change(function (e) {
if($('#textarea_combo_values').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){ if($('#textarea_combo_values').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
dialog_message("#message_set_combo"); dialog_message("#message_set_combo");
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true); $('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show(); $('#configure_field-3').show();
e.preventDefault(); e.preventDefault();
} }
}); });
} else {
console.log('entra');
$('#configure_field-3').hide();
} }
if ($('input[type=checkbox][name=is_link_enabled]').is(":checked") === true) { if ($('input[type=checkbox][name=is_link_enabled]').is(":checked") === true) {
$('#configure_field-1').hide(); $('#configure_field-2').hide();
$('#configure_field-3').hide();
} else { } else {
$('#configure_field-1').show(); $('#configure_field-2').show();
$('#configure_field-3').show();
} }
$('input[type=checkbox][name=is_link_enabled]').change(function () { $('input[type=checkbox][name=is_link_enabled]').change(function () {
if( $(this).is(":checked") ){ if( $(this).is(":checked") ){
$('#configure_field-1').hide(); $('#configure_field-2').hide();
$('#configure_field-3').hide(); $('#configure_field-3').hide();
} else{ } else{
$('#configure_field-1').show(); $('#configure_field-2').show();
$('#configure_field-3').show(); $('#configure_field-3').show();
} }
}); });
$('input[type=checkbox][name=is_combo_enable]').change(function () { $('input[type=checkbox][name=is_combo_enable]').change(function () {
if( $(this).is(":checked") ){ if( $(this).is(":checked") ){
$('#configure_field-4').show(); $('#configure_field-3').show();
dialog_message("#message_no_set_password"); dialog_message("#message_no_set_password");
$('#configure_field-1').hide(); $('#configure_field-1').hide();
$('#configure_field-5').hide();
} }
else{ else{
$('#configure_field-4').hide(); $('#configure_field-3').hide();
$('#configure_field-1').show(); $('#configure_field-1').show();
$('#configure_field-5').show();
} }
}); });
$('input[type=checkbox][name=is_password_type]').change(function () { $('input[type=checkbox][name=is_password_type]').change(function () {
if( $(this).is(":checked")){ if( $(this).is(":checked")){
dialog_message("#message_no_set_combo"); dialog_message("#message_no_set_combo");
$('#configure_field-3').hide(); $('#configure_field-3').hide();
$('#configure_field-5').hide();
} }
else{ else{
$('#configure_field-3').show(); $('#configure_field-3').show();
$('#configure_field-5').show();
} }
}); });
}); });

View File

@ -704,6 +704,19 @@ if ($step == 2) {
) )
); );
$usr_groups = implode(
',',
array_keys(users_get_groups($config['id_user'], 'LM', true))
);
$sql_query = sprintf(
'SELECT id, name
FROM talert_actions
WHERE id_group IN (%s)
ORDER BY name',
$usr_groups
);
$table->data[2][1] = html_print_label_input_block( $table->data[2][1] = html_print_label_input_block(
__('Default action').ui_print_help_tip( __('Default action').ui_print_help_tip(
__('Unless they\'re left blank, the fields from the action will override those set on the template.'), __('Unless they\'re left blank, the fields from the action will override those set on the template.'),
@ -801,19 +814,6 @@ if ($step == 2) {
) )
); );
$usr_groups = implode(
',',
array_keys(users_get_groups($config['id_user'], 'LM', true))
);
$sql_query = sprintf(
'SELECT id, name
FROM talert_actions
WHERE id_group IN (%s)
ORDER BY name',
$usr_groups
);
$table->data[5][0] = html_print_label_input_block( $table->data[5][0] = html_print_label_input_block(
__('Condition type'), __('Condition type'),
html_print_select( html_print_select(

View File

@ -445,7 +445,7 @@ if ($is_management_allowed === true
if ($aviable_name === true) { if ($aviable_name === true) {
$values = [ $values = [
'nombre' => $name, 'nombre' => $name,
'icon' => empty($icon) ? '' : substr($icon, 0, -4), 'icon' => $icon,
'parent' => $id_parent, 'parent' => $id_parent,
'disabled' => $alerts_disabled, 'disabled' => $alerts_disabled,
'custom_id' => $custom_id, 'custom_id' => $custom_id,
@ -513,7 +513,7 @@ if ($is_management_allowed === true && $update_group === true) {
if ($aviable_name === true) { if ($aviable_name === true) {
$values = [ $values = [
'nombre' => $name, 'nombre' => $name,
'icon' => empty($icon) ? '' : substr($icon, 0, -4), 'icon' => $icon,
'parent' => ($id_parent == -1) ? 0 : $id_parent, 'parent' => ($id_parent == -1) ? 0 : $id_parent,
'disabled' => !$alerts_enabled, 'disabled' => !$alerts_enabled,
'custom_id' => $custom_id, 'custom_id' => $custom_id,
@ -741,12 +741,11 @@ if ($is_management_allowed === true
// Credential store is loaded previously in this document to avoid // Credential store is loaded previously in this document to avoid
// process group tree - list forms. // process group tree - list forms.
ui_print_spinner(__('Loading'));
if ($tab == 'tree') { if ($tab == 'tree') {
/* /*
* Group tree view. * Group tree view.
*/ */
ui_print_spinner(__('Loading'));
echo "<div id='tree-controller-recipient'></div>"; echo "<div id='tree-controller-recipient'></div>";
} else { } else {
/* /*
@ -986,7 +985,7 @@ if ($tab == 'tree') {
true, true,
'offset', 'offset',
false, false,
'pagination-bottom' ''
); );
} else { } else {
ui_print_info_message( ui_print_info_message(
@ -1038,6 +1037,7 @@ $tab = 'group_edition';
<script type="text/javascript"> <script type="text/javascript">
var treeController = TreeController.getController(); var treeController = TreeController.getController();
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0) if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
treeController.recipient.empty(); treeController.recipient.empty();

View File

@ -297,7 +297,7 @@ if (!empty($table->data)) {
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
ui_pagination($count_network_templates, false, $offset); ui_pagination($count_network_templates, false, $offset);
html_print_table($table); html_print_table($table);
ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, 'pagination-bottom'); ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, '');
echo "<div class='pdd_l_5px right'>"; echo "<div class='pdd_l_5px right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>'; echo '</div>';

View File

@ -445,7 +445,7 @@ if (!empty($graphs)) {
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>"; echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table($table); html_print_table($table);
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom'); ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, '');
echo "<div class='right'>"; echo "<div class='right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</form>'; echo '</form>';

View File

@ -146,17 +146,41 @@ foreach ($osList as $os) {
$table->data[] = $data; $table->data[] = $data;
} }
$tablePagination = '';
if (isset($data) === true) { if (isset($data) === true) {
html_print_table($table); html_print_table($table);
ui_pagination($count_osList, ui_get_url_refresh(['message' => false]), $offset, 0, false, 'offset', true, 'pagination-bottom'); $tablePagination = ui_pagination(
$count_osList,
ui_get_url_refresh(['message' => false]),
$offset,
0,
true,
'offset',
false,
''
);
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]);
} }
$buttons = '';
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
echo '<form method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=builder">'; $buttons .= '<form method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=builder">';
echo "<div style='text-align:right;width:".$table->width."'>"; $buttons .= html_print_submit_button(
html_print_submit_button(__('Create OS'), '', false, 'class="sub next"'); __('Create OS'),
echo '</div>'; '',
echo '</form>'; false,
['icon' => 'next'],
true
);
$buttons .= '</form>';
} }
html_print_action_buttons(
$buttons,
[
'type' => 'data_table',
'class' => 'fixed_action_buttons',
'right_content' => $tablePagination,
]
);

View File

@ -393,6 +393,7 @@ if ($create_user === true) {
$values['default_event_filter'] = (int) get_parameter('default_event_filter'); $values['default_event_filter'] = (int) get_parameter('default_event_filter');
$values['default_custom_view'] = (int) get_parameter('default_custom_view'); $values['default_custom_view'] = (int) get_parameter('default_custom_view');
$values['time_autorefresh'] = (int) get_parameter('time_autorefresh', 0); $values['time_autorefresh'] = (int) get_parameter('time_autorefresh', 0);
$values['show_tips_startup'] = (int) get_parameter_switch('show_tips_startup');
$dashboard = get_parameter('dashboard', ''); $dashboard = get_parameter('dashboard', '');
$visual_console = get_parameter('visual_console', ''); $visual_console = get_parameter('visual_console', '');

View File

@ -1390,7 +1390,7 @@ if (check_login()) {
false, false,
'offset', 'offset',
true, true,
'pagination-bottom', '',
'pagination_list_modules(offset_param)', 'pagination_list_modules(offset_param)',
[ [
'count' => '', 'count' => '',

View File

@ -652,10 +652,15 @@ var TreeController = {
typeof element.icon != "undefined" && typeof element.icon != "undefined" &&
element.icon.length > 0 element.icon.length > 0
) { ) {
console.log("a");
console.log(controller);
$content.append( $content.append(
'<div class="node-icon"><div class="node-icon-container"><img src="' + '<div class="node-icon"><div class="node-icon-container"><img src="' +
(controller.baseURL.length > 0 ? controller.baseURL : "") + (controller.baseURL.length > 0 ? controller.baseURL : "") +
"images/" + (treeController.meta != undefined &&
treeController.meta == 1
? "../../images/"
: "images/") +
element.icon + element.icon +
'" class="invert_filter"/></div></div>' '" class="invert_filter"/></div></div>'
); );
@ -679,7 +684,10 @@ var TreeController = {
var $deleteBtn = $( var $deleteBtn = $(
'<a style="float: right; margin-top: 5px;"><img src="' + '<a style="float: right; margin-top: 5px;"><img src="' +
(controller.baseURL.length > 0 ? controller.baseURL : "") + (controller.baseURL.length > 0 ? controller.baseURL : "") +
'images/delete.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/></a>' (controller.meta != undefined && controller.meta == 1
? "../../images/"
: "images/") +
'delete.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/></a>'
); );
$deleteBtn.click(function(event) { $deleteBtn.click(function(event) {
var ok_function = function() { var ok_function = function() {
@ -703,7 +711,10 @@ var TreeController = {
var $updateicon = $( var $updateicon = $(
'<img src="' + '<img src="' +
(controller.baseURL.length > 0 ? controller.baseURL : "") + (controller.baseURL.length > 0 ? controller.baseURL : "") +
'images/edit.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/>' (controller.meta != undefined && controller.meta == 1
? "../../images/"
: "images/") +
'edit.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/>'
); );
var $updatebtn = $( var $updatebtn = $(
'<a style="float: right; margin-top: 5px;" href = "' + '<a style="float: right; margin-top: 5px;" href = "' +

View File

@ -530,15 +530,6 @@ ul li {
width: 35px; width: 35px;
} }
/* Menu height: 601px, 720px, 735px */
@media screen and (max-height: 750px) {
.menu li,
.menu li a,
.menu li div {
min-height: 28px;
}
}
@media screen and (max-height: 750px) { @media screen and (max-height: 750px) {
.operation { .operation {
padding-top: 10px; padding-top: 10px;

View File

@ -791,7 +791,7 @@ function print_table(
html_print_table($table); html_print_table($table);
if (count($selected_interfaces) > $config['block_size']) { if (count($selected_interfaces) > $config['block_size']) {
ui_pagination(count($selected_interfaces), false, $pagination_index, 0, false, 'offset', true, 'pagination-bottom'); ui_pagination(count($selected_interfaces), false, $pagination_index, 0, false, 'offset', true, '');
} }
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('No search parameters')]); ui_print_info_message(['no_close' => true, 'message' => __('No search parameters')]);

View File

@ -643,7 +643,7 @@ if (empty($table->data) === true) {
true, true,
'offset', 'offset',
false, false,
'pagination-bottom' ''
); );
} }

View File

@ -212,7 +212,7 @@ if (empty($dashboards) === true) {
true, true,
'offset', 'offset',
false, false,
'pagination-bottom' ''
); );
} }