Minor fixes over module data tables

This commit is contained in:
jose.gonzalez@pandorafms.com 2022-12-16 12:55:56 +01:00
parent 4fd0115d80
commit 2b896bcd17
11 changed files with 90 additions and 50 deletions

View File

@ -377,6 +377,7 @@ if ($new_agent === true) {
$tableAgent->data['additional_alias'][0] = html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true); $tableAgent->data['additional_alias'][0] = html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true);
$tableAgent->data['additional_alias'][1] = __('Use alias as name'); $tableAgent->data['additional_alias'][1] = __('Use alias as name');
} else { } else {
if ($remote_agent === true) {
$tableAgent->data['alias'][0] .= html_print_anchor( $tableAgent->data['alias'][0] .= html_print_anchor(
[ [
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$id_agente.'&disk_conf='.$agent_md5, 'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$id_agente.'&disk_conf='.$agent_md5,
@ -392,6 +393,7 @@ if ($new_agent === true) {
], ],
true true
); );
}
} }
// Ip adress. // Ip adress.
@ -794,29 +796,30 @@ $tableAdvancedAgent->data['agent_quiet'][0] = html_print_checkbox_switch('quiet'
// Remote configuration. // Remote configuration.
if ($new_agent === false && isset($filename) === true && file_exists($filename['md5']) === true) { if ($new_agent === false && isset($filename) === true && file_exists($filename['md5']) === true) {
$tableAdvancedAgent->data['caption_remote_configuration'][0] = __('Remote configuration'); $tableAdvancedAgent->data['caption_remote_configuration'][0] = __('Remote configuration');
$tableAdvancedAgent->rowclass['remote_configuration'] = 'w540px'; $tableAdvancedAgent->cellstyle['remote_configuration'][0] = 'display: flex; align-items: center;';
$tableAdvancedAgent->cellclass['remote_configuration'][0] = 'w540px';
$tableAdvancedAgent->data['remote_configuration'][0] = html_print_input_text( $tableAdvancedAgent->data['remote_configuration'][0] = html_print_input_text(
'remote_file_timestamp', 'remote_file_timestamp',
date('F d Y H:i:s', fileatime($filename['md5'])), date('F d Y H:i:s', fileatime($filename['md5'])),
'', '',
68, 0,
255, 100,
true, true,
true, true,
false, false,
'', '',
'' 'w540px'
); );
$tableAdvancedAgent->data['remote_configuration'][0] .= html_print_anchor( $tableAdvancedAgent->data['remote_configuration'][0] .= html_print_anchor(
[ [
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&disk_conf_delete=1&id_agente='.$id_agente, 'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&disk_conf_delete=1&id_agente='.$id_agente,
'class' => 'after_input_icon',
'content' => html_print_image( 'content' => html_print_image(
'images/cross.png', 'images/delete.svg',
true, true,
[ [
'border' => 0,
'title' => __('Delete remote configuration file'), 'title' => __('Delete remote configuration file'),
'class' => 'vertical_middle invert_filter mrgn_lft_5px', 'class' => 'invert_filter after_input_icon',
] ]
), ),
], ],

View File

@ -910,7 +910,7 @@ if (isset($_GET['fix_module'])) {
} }
$update_agent = (bool) get_parameter('update_agent'); $update_agent = (bool) get_parameter('update_agent');
hd($_REQUEST, true);
// Update AGENT. // Update AGENT.
if ($update_agent) { if ($update_agent) {
// If modified some agent paramenter. // If modified some agent paramenter.

View File

@ -55,21 +55,25 @@ $sec2 = (string) get_parameter('sec2');
$filterTable = new stdClass(); $filterTable = new stdClass();
$filterTable->class = 'fixed_filter_bar'; $filterTable->class = 'fixed_filter_bar';
$filterTable->data = []; $filterTable->data = [];
$filterTable->cellstyle[0][0] = 'flex: 0 1 20%;'; $filterTable->cellstyle[0][0] = 'flex: 0 1 20%;align-items: center;';
$filterTable->data[0][0] = '<span>'.__('Search').'</span>'; $filterTable->data[0][0] = html_print_div([ 'content' => __('Search') ], true);
$filterTable->data[0][0] .= html_print_input_text( $filterTable->data[0][0] .= html_print_input_text(
'search_string', 'search_string',
$search_string, $search_string,
'', '',
15, 0,
255, 255,
true true,
false,
false,
'',
'w100p'
); );
$filterTable->data[0][0] .= html_print_input_hidden('search', 1, true); $filterTable->data[0][0] .= html_print_input_hidden('search', 1, true);
if ((bool) $policy_page === false) { if ((bool) $policy_page === false) {
$filterTable->cellstyle[0][1] = 'flex: 0 1 20%'; $filterTable->cellstyle[0][1] = 'flex: 0 1 20%';
$filterTable->data[0][1] = '<span>'.__('Show in hierachy mode').'</span>'; $filterTable->data[0][1] = html_print_div([ 'content' => __('Show in hierachy mode') ], true);
$filterTable->data[0][1] .= html_print_checkbox_switch( $filterTable->data[0][1] .= html_print_checkbox_switch(
'status_hierachy_mode', 'status_hierachy_mode',
'', '',
@ -1205,7 +1209,7 @@ foreach ($modules as $module) {
} }
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module" echo '<form class="datatable_form" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module"
onsubmit="if (! confirm (\''.__('Are you sure?').'\')) return false">'; onsubmit="if (! confirm (\''.__('Are you sure?').'\')) return false">';
} }
@ -1249,9 +1253,7 @@ if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === tr
false, false,
'', '',
false, false,
false, 'width: 260px;',
false,
300
); );
html_print_action_buttons( html_print_action_buttons(

View File

@ -372,8 +372,6 @@ if ($edit === false) {
); );
} }
hd($type_names_hash);
hd($_REQUEST);
// Store the relation between id and name of the types on a hidden field. // Store the relation between id and name of the types on a hidden field.
$table_simple->data['module_n_type'][1] .= html_print_input_hidden( $table_simple->data['module_n_type'][1] .= html_print_input_hidden(
'type_names', 'type_names',
@ -866,17 +864,31 @@ $tagsCompleteData = html_print_div(
true true
); );
$sqlGetTags = sprintf(
'SELECT a.id_tag, name FROM ttag a, %s b WHERE a.id_tag = b.id_tag AND %s = %s %s ORDER BY name',
$__table_modules,
$__id_where,
$__id,
$__sql
);
$listSelectedTags = db_get_all_rows_sql($sqlGetTags);
$listSelectedTagShow = array_reduce(
$listSelectedTags,
function ($carry, $item) {
$carry[] = $item['id_tag'];
return $carry;
}
);
$tagsCompleteData .= html_print_div( $tagsCompleteData .= html_print_div(
[ [
'class' => 'tags_selected_container', 'class' => 'tags_selected_container',
'content' => html_print_select_from_sql( 'content' => html_print_select_from_sql(
"SELECT a.id_tag, name $sqlGetTags,
FROM ttag a, $__table_modules b
WHERE a.id_tag = b.id_tag AND $__id_where = $__id
$__sql
ORDER BY name",
'id_tag_selected[]', 'id_tag_selected[]',
'', $listSelectedTagShow,
'', '',
'', '',
'', '',
@ -890,7 +902,22 @@ $tagsCompleteData .= html_print_div(
], ],
true true
); );
/*
$tagsCompleteData .= html_print_select(
$listSelectedTags,
'id_tag_selected[]',
$listSelectedTagShow,
'',
'',
0,
true,
true,
false,
'',
$disabledBecauseInPolicy,
'width: 200px;'
);
*/
$table_advanced->data['tags_module_parent'][0] .= html_print_div( $table_advanced->data['tags_module_parent'][0] .= html_print_div(
[ [
'class' => 'tags_complete_container', 'class' => 'tags_complete_container',

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com --> <!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / close@svg</title> <title>Dark / 20 / close@svg</title>
<desc>Created with Sketch.</desc> <desc>Created with Sketch.</desc>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com --> <!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / delete-v2@svg</title> <title>Dark / 20 / delete-v2@svg</title>
<desc>Created with Sketch.</desc> <desc>Created with Sketch.</desc>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com --> <!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / house@svg</title> <title>Dark / 20 / house@svg</title>
<desc>Created with Sketch.</desc> <desc>Created with Sketch.</desc>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com --> <!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 14 / info@svg</title> <title>Dark / 14 / info@svg</title>
<desc>Created with Sketch.</desc> <desc>Created with Sketch.</desc>

Before

Width:  |  Height:  |  Size: 986 B

After

Width:  |  Height:  |  Size: 959 B

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com --> <!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / star@svg</title> <title>Dark / 20 / star@svg</title>
<desc>Created with Sketch.</desc> <desc>Created with Sketch.</desc>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -10666,7 +10666,6 @@ pre.external_tools_output {
.fixed_filter_bar { .fixed_filter_bar {
position: sticky; position: sticky;
height: 60px;
top: 114px; top: 114px;
border: 1px solid #e5e9ed; border: 1px solid #e5e9ed;
background-color: #fff; background-color: #fff;
@ -10689,8 +10688,13 @@ pre.external_tools_output {
justify-content: flex-start; justify-content: flex-start;
} }
.fixed_filter_bar span { .fixed_filter_bar td > div {
margin-right: 15px; margin-right: 10px;
font-size: 10pt;
}
.fixed_filter_bar input {
height: 32px;
} }
.fixed_filter_content { .fixed_filter_content {

View File

@ -446,3 +446,7 @@ a.pandora_pagination.current:hover {
.ff_thresholds_line input { .ff_thresholds_line input {
width: 100%; width: 100%;
} }
.datatable_form {
margin: 0 1em;
}