Merge branch 'ent-9662-second-round' of brutus.artica.es:artica/pandorafms into ent-9662-second-round

This commit is contained in:
Jose Gonzalez 2023-03-13 16:21:35 +01:00
commit 3ebfee9ccb
10 changed files with 448 additions and 223 deletions

View File

@ -61,79 +61,110 @@ ui_print_warning_message(
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox filter-table-adv mrgn_top_15px pdd_t_0px_important';
$table->data = [];
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->head[0] = __('Agent position');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align:center';
$table->style[0] = 'font-weight: bold; ';
$table->style[2] = 'font-weight: bold; ';
$table->size[0] = '50%';
$table->size[2] = '50%';
$table->data[1][0] = __('Latitude: ');
$table->data[1][1] = html_print_input_text_extended(
'latitude',
$agentData['stored_latitude'],
'text-latitude',
'',
20,
20,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
$table->data[1][0] = html_print_label_input_block(
__('Latitude: '),
html_print_input_text_extended(
'latitude',
$agentData['stored_latitude'],
'text-latitude',
'',
20,
20,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
)
);
$table->data[1][2] = __('Longitude: ');
$table->data[1][3] = html_print_input_text_extended(
'longitude',
$agentData['stored_longitude'],
'text-longitude',
'',
20,
20,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
$table->data[1][1] = html_print_label_input_block(
__('Longitude: '),
html_print_input_text_extended(
'longitude',
$agentData['stored_longitude'],
'text-longitude',
'',
20,
20,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
)
);
$table->data[2][0] = __('Altitude: ');
$table->data[2][1] = html_print_input_text_extended(
'altitude',
$agentData['stored_altitude'],
'text-altitude',
'',
10,
10,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
$table->data[2][0] = html_print_label_input_block(
__('Altitude: '),
html_print_input_text_extended(
'altitude',
$agentData['stored_altitude'],
'text-altitude',
'',
10,
10,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
)
);
$table->data[2][2] = __('Ignore new GIS data:');
$table->data[2][3] = __('Yes').' '.html_print_radio_button_extended('update_gis_data', 0, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true);
$table->data[2][3] .= __('No').' '.html_print_radio_button_extended('update_gis_data', 1, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true);
$table->data[2][1] = html_print_label_input_block(
__('Ignore new GIS data: '),
'<div class="flex mrgn_top_5px">'.__('Yes').' '.html_print_radio_button_extended(
'update_gis_data',
0,
'',
$updateGisData,
false,
'',
'class="mrgn_right_40px"',
true
).__('No').' '.html_print_radio_button_extended(
'update_gis_data',
1,
'',
$updateGisData,
false,
'',
'class="mrgn_right_40px"',
true
).'</div>'
);
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente;
echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();'>";
echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();' class='max_floating_element_size'>";
html_print_input_hidden('update_gis', 1);
html_print_table($table);
echo '<div class="action-buttons float-left" style="width: '.$table->width.';">';
html_print_submit_button(__('Update'), '', false, 'class="sub upd"');
echo '</div>';
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'',
false,
['icon' => 'wand'],
true
)
);
echo '</form>';
?>
<script type="text/javascript">

View File

@ -196,29 +196,52 @@ foreach ($nps as $row) {
$filterTable = new stdClass();
$filterTable->width = '100%';
$filterTable->class = 'fixed_filter_bar';
$filterTable->class = 'filter-table-adv';
$filterTable->size[0] = '100%';
$filterTable->data = [];
$filterTable->data[0][0] = __('Module templates');
$filterTable->data[1][0] = html_print_select($select, 'template_id', '', '', '', 0, true, false, true, '', false, 'max-width: 200px !important');
$filterTable->data[1][1] = html_print_div(
$filterTable->data[0][0] = html_print_label_input_block(
__('Module templates'),
html_print_select(
$select,
'template_id',
'',
'',
'',
0,
true,
false,
true,
'',
false,
'width: 250px '
)
);
$filterTable->data[1][0] = html_print_submit_button(
__('Assign'),
'crt',
false,
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Assign'),
'crt',
false,
[
'icon' => 'wand',
'mode' => 'secondary mini',
],
true
),
'class' => 'float-right',
'icon' => 'wand',
'mode' => 'mini',
],
true
);
$outputFilterTable = '<form style="border:0" class="fixed_filter_bar" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">';
$outputFilterTable .= html_print_table($filterTable, true);
$outputFilterTable = '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">';
$outputFilterTable .= ui_toggle(
html_print_table($filterTable, true),
'<span class="subsection_header_title">'.__('Assign').'</span>',
__('Assign'),
'assign',
true,
true,
'',
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
);
$outputFilterTable .= '</form>';
echo $outputFilterTable;

View File

@ -180,14 +180,26 @@ if ($load_inventory_module) {
$form_buttons = '';
if ($load_inventory_module) {
$form_buttons .= html_print_input_hidden('id_agent_module_inventory', $id_agent_module_inventory, true);
$form_buttons .= html_print_submit_button(__('Update'), 'update_inventory_module', false, 'class="sub next"', true);
$form_buttons .= html_print_submit_button(
__('Update'),
'update_inventory_module',
false,
['icon' => 'wand'],
true
);
} else {
$form_buttons .= html_print_submit_button(__('Add'), 'add_inventory_module', false, 'class="sub next"', true);
$form_buttons .= html_print_submit_button(
__('Add'),
'add_inventory_module',
false,
['icon' => 'wand'],
true
);
}
echo ui_get_inventory_module_add_form(
'index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente,
$form_buttons,
html_print_action_buttons($form_buttons, [], true),
$load_inventory_module,
$id_os,
$target,
@ -213,10 +225,10 @@ if (db_get_num_rows($sql) == 0) {
} else {
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox info_trable';
$table->data = [];
$table->head = [];
$table->styleTable = 'margin-top: 20px;';
$table->styleTable = '';
$table->head[0] = "<span title='".__('Policy')."'>".__('P.').'</span>';
$table->head[1] = __('Name');
$table->head[2] = __('Description');

View File

@ -302,92 +302,122 @@ foreach ($pre_fields as $key => $value) {
// Filter table.
$filterTable = new stdClass();
$filterTable->class = 'fixed_filter_bar';
$filterTable->class = 'filter-table-adv w100p';
$filterTable->size[0] = '20%';
$filterTable->size[1] = '20%';
$filterTable->size[2] = '20%';
$filterTable->size[3] = '20%';
$filterTable->size[4] = '20%';
$filterTable->data = [];
$filterTable->cellstyle[0][0] = 'width:0';
$filterTable->cellstyle[0][1] = 'width:0';
$filterTable->cellstyle[0][2] = 'width:0';
$filterTable->cellstyle[0][3] = 'width:0';
$filterTable->data[0][0] = __('Group');
$filterTable->data[1][0] = html_print_select_groups(
false,
'AR',
$return_all_group,
'ag_group',
$ag_group,
'this.form.submit();',
'',
0,
true,
false,
true,
'',
false
$filterTable->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'AR',
$return_all_group,
'ag_group',
$ag_group,
'this.form.submit();',
'',
0,
true,
false,
true,
'',
false
)
);
$filterTable->data[0][1] = __('Recursion');
$filterTable->data[1][1] = html_print_checkbox_switch(
'recursion',
1,
$recursion,
true,
false,
'this.form.submit()'
$filterTable->data[0][1] = html_print_label_input_block(
__('Recursion'),
'<div class="mrgn_top_10px">'.html_print_checkbox_switch(
'recursion',
1,
$recursion,
true,
false,
'this.form.submit()'
).'</div>'
);
$filterTable->data[0][2] = __('Show agents');
$filterTable->data[1][2] = html_print_select(
$showAgentFields,
'disabled',
$disabled,
'this.form.submit()',
'',
0,
true
$filterTable->data[0][2] = html_print_label_input_block(
__('Show agents'),
html_print_select(
$showAgentFields,
'disabled',
$disabled,
'this.form.submit()',
'',
0,
true,
false,
true,
'w100p',
false,
'width: 100%'
)
);
$filterTable->data[0][3] = __('Operating System');
$filterTable->data[1][3] = html_print_select(
$fields,
'os',
$os,
'this.form.submit()',
'All',
0,
true
$filterTable->data[0][3] = html_print_label_input_block(
__('Operating System'),
html_print_select(
$fields,
'os',
$os,
'this.form.submit()',
'All',
0,
true,
false,
true,
'w100p',
false,
'width: 100%'
)
);
$filterTable->data[0][4] = __('Free search');
$filterTable->data[0][4] .= ui_print_help_tip(
__('Search filter by alias, name, description, IP address or custom fields content'),
true
);
$filterTable->data[1][4] = html_print_input_text(
'search',
$search,
'',
12,
255,
true
$filterTable->data[0][4] = html_print_label_input_block(
__('Free search').ui_print_help_tip(
__('Search filter by alias, name, description, IP address or custom fields content'),
true
),
html_print_input_text(
'search',
$search,
'',
12,
255,
true
)
);
$filterTable->cellstyle[1][5] = 'vertical-align: bottom';
$filterTable->data[1][5] = html_print_submit_button(
$filterTable->colspan[1][0] = 5;
$filterTable->data[1][0] = html_print_submit_button(
__('Filter'),
'srcbutton',
false,
[
'icon' => 'search',
'class' => 'float-right',
'mode' => 'secondary mini',
'class' => 'float-right mrgn_right_10px',
'mode' => 'mini',
],
true
);
// Print filter table.
echo '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>';
html_print_table($filterTable);
ui_toggle(
html_print_table($filterTable, true),
'<span class="subsection_header_title">'.__('Filter').'</span>',
__('Filter'),
'filter',
true,
false,
'',
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
);
echo '</form>';
// Data table.

View File

@ -675,7 +675,7 @@ foreach ($simple_alerts as $alert) {
$data[2] .= ' <a class="template_details patatas"
href="'.ui_get_full_url(false, false, false, false).'ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$alert['id_alert_template'].'">';
$data[2] .= html_print_image(
'images/zoom.png',
'images/details.svg',
true,
[
'id' => 'template-details-'.$alert['id_alert_template'],
@ -753,7 +753,7 @@ foreach ($simple_alerts as $alert) {
'delete',
'images/delete.svg',
1,
'padding:0px; margin-left:5px; margin-right:5px;',
'padding:0px; margin-left:5px; margin-right:5px; width: 22px;',
true,
[
'title' => __('Delete action'),
@ -913,7 +913,7 @@ foreach ($simple_alerts as $alert) {
'enable',
'images/lightbulb_off.png',
1,
'padding:0px',
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'filter_none main_menu_icon']
);
@ -923,7 +923,7 @@ foreach ($simple_alerts as $alert) {
'disable',
'images/lightbulb.png',
1,
'padding:0px;',
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'main_menu_icon']
);
@ -941,7 +941,7 @@ foreach ($simple_alerts as $alert) {
'standby_off',
'images/bell.png',
1,
'padding:0px;',
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'invert_filter main_menu_icon']
);
@ -951,7 +951,7 @@ foreach ($simple_alerts as $alert) {
'standby_on',
'images/bell_pause.png',
1,
'padding:0px;',
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'invert_filter main_menu_icon']
);

View File

@ -497,44 +497,46 @@ if (is_metaconsole() === false) {
$buttons = '';
}
if ($tab === 'list') {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
if ($tab !== 'alert') {
if ($tab === 'list') {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('List'),
],
]
);
} else {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
'link' => '',
'label' => __('List'),
],
]
);
} else {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('Create'),
],
]
);
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('Create'),
],
]
);
}
}
} else {
alerts_meta_print_header();

View File

@ -601,6 +601,7 @@ class AgentWizard extends HTML
'action' => $this->sectionUrl,
'id' => 'form-main-wizard',
'method' => 'POST',
'class' => 'white_box pdd_20px filter-list-adv',
];
// Inputs.
@ -829,24 +830,22 @@ class AgentWizard extends HTML
];
}
$inputs[] = [
'arguments' => [
'label' => $this->actionLabel,
'name' => 'sub-protocol',
'type' => 'submit',
'attributes' => [
html_print_action_buttons(
html_print_submit_button(
$this->actionLabel,
'sub-protocol',
false,
[
'icon' => 'cog',
'onclick' => '$(\'#form-main-wizard\').submit();',
'onclick' => '$("#form-main-wizard").submit();',
],
'return' => true,
],
];
true
)
);
// Prints main form.
html_print_div(
[
'class' => 'white_box',
'style' => 'padding: 20px',
'content' => $this->printForm(
[
'form' => $form,
@ -5980,7 +5979,7 @@ class AgentWizard extends HTML
});
// Loading.
$('#submit-sub-protocol').click(function() {
$('#button-sub-protocol').click(function() {
$('.wizard-result').remove();
$('#form-create-modules').remove();
$('.textodialogo').remove();

View File

@ -7313,22 +7313,22 @@ function ui_get_inventory_module_add_form(
$table = new stdClass();
$table->id = 'inventory-module-form';
$table->width = '100%';
$table->class = 'databox filters';
$table->style['module-title'] = 'font-weight: bold;';
$table->style['interval-title'] = 'font-weight: bold;';
$table->style['target-title'] = 'font-weight: bold;';
$table->style['chkbx-custom-fields-title'] = 'font-weight: bold;';
$table->style['username-title'] = 'font-weight: bold;';
$table->style['password-title'] = 'font-weight: bold;';
$table->class = 'databox filters filter-table-adv';
$table->size['module'] = '50%';
$table->size['interval'] = '50%';
$table->size['target'] = '50%';
$table->size['chkbx-custom-fields'] = '50%';
$table->size['username'] = '50%';
$table->size['password'] = '50%';
$table->rowstyle = [];
$table->rowstyle['hidden-custom-field-row'] = 'display: none;';
$table->colspan = [];
$table->colspan['custom-fields-row'] = [];
$table->colspan['custom-fields-row']['custom-fields-column'] = 4;
$table->rowstyle['custom-fields-button'] = 'display: none;';
// $table->colspan = [];
// $table->colspan['custom-fields-row'] = [];
// $table->colspan['custom-fields-row']['custom-fields-column'] = 2;
$table->data = [];
$row = [];
$row['module-title'] = __('Module');
if (empty($inventory_module_id)) {
if (empty($os_id)) {
$sql = 'SELECT mi.id_module_inventory AS id, mi.name AS name, co.name AS os
@ -7360,33 +7360,111 @@ function ui_get_inventory_module_add_form(
}
}
$row['module-input'] = html_print_select($inventory_modules, 'id_module_inventory', 0, '', __('Select inventory module'), 0, true, false, false);
$row['module'] = html_print_label_input_block(
__('Module'),
html_print_select(
$inventory_modules,
'id_module_inventory',
0,
'',
__('Select inventory module'),
0,
true,
false,
false,
'w100p',
false,
'width: 100%'
)
);
} else {
$row['module-input'] = db_get_sql('SELECT name FROM tmodule_inventory WHERE id_module_inventory = '.$inventory_module_id);
$row['module'] = html_print_label_input_block(
__('Module'),
db_get_sql('SELECT name FROM tmodule_inventory WHERE id_module_inventory = '.$inventory_module_id)
);
}
$row['interval-title'] = __('Interval');
$row['interval-input'] = html_print_extended_select_for_time('interval', $interval, '', '', '', false, true);
$row['interval'] = html_print_label_input_block(
__('Interval'),
html_print_extended_select_for_time(
'interval',
$interval,
'',
'',
'',
false,
true,
false,
true,
'w100p'
)
);
$table->data['first-row'] = $row;
$row = [];
if ($target !== false) {
$row['target-title'] = __('Target');
$row['target-input'] = html_print_input_text('target', $target, '', 25, 40, true);
$row['target'] = html_print_label_input_block(
__('Target'),
html_print_input_text(
'target',
$target,
'',
25,
40,
true,
false,
false,
'',
'w100p'
)
);
}
$row['chkbx-custom-fields-title'] = __('Use custom fields');
$row['chkbx-custom-fields-input'] = html_print_checkbox('custom_fields_enabled', 1, $custom_fields_enabled, true);
$row['chkbx-custom-fields'] = html_print_label_input_block(
__('Use custom fields'),
html_print_checkbox(
'custom_fields_enabled',
1,
$custom_fields_enabled,
true
)
);
$table->data['second-row'] = $row;
$row = [];
$row['username-title'] = __('Username');
$row['username-input'] = html_print_input_text('username', $username, '', 25, 40, true);
$row['password-title'] = __('Password');
$row['password-input'] = html_print_input_password('password', $password, '', 25, 40, true);
$row['username'] = html_print_label_input_block(
__('Username'),
html_print_input_text(
'username',
$username,
'',
25,
40,
true,
false,
false,
'',
'w100p'
)
);
$row['password'] = html_print_label_input_block(
__('Password'),
html_print_input_password(
'password',
$password,
'',
25,
40,
true,
false,
false,
'w100p'
)
);
$table->data['userpass-row'] = $row;
@ -7394,8 +7472,18 @@ function ui_get_inventory_module_add_form(
$row['hidden-title'] = '';
$row['hidden-input'] = html_print_input_hidden('hidden-custom-field-name', '', true);
$row['hidden-input'] .= html_print_input_hidden('hidden-custom-field-is-secure', 0, true);
$row['hidden-input'] .= html_print_input_text('hidden-custom-field-input', '', '', 25, 40, true);
$row['hidden-input'] .= '<span>&nbsp;</span>';
$row['hidden-input'] .= html_print_input_text(
'hidden-custom-field-input',
'',
'',
25,
40,
true,
false,
false,
'',
'w93p'
);
$row['hidden-input'] .= html_print_image(
'images/delete.svg',
true,
@ -7460,13 +7548,48 @@ function ui_get_inventory_module_add_form(
}
$row = [];
$row['custom-fields-column'] = '<b>'.__('Field name').'</b>'.'&nbsp;&nbsp;'.html_print_input_text('field-name', '', '', 25, 40, true).'&nbsp;&nbsp;&nbsp;'.html_print_checkbox('field-is-password', 1, false, true).__("It's a password").'&nbsp;&nbsp;&nbsp;'.html_print_button(__('Add field'), 'add-field', false, '', 'class="sub add"', true);
$row['custom-fields-column'] = html_print_label_input_block(
__('Field name'),
'<div class="flex">'.html_print_input_text(
'field-name',
'',
'',
25,
40,
true,
false,
false,
'',
'w60p mrgn_right_10px'
).html_print_checkbox(
'field-is-password',
1,
false,
true
).'&nbsp;'.__("It's a password").'</div>'
);
$table->data['custom-fields-row'] = $row;
$row = [];
$row['custom-fields-button-title'] = '';
$row['custom-fields-button'] = html_print_button(
__('Add field'),
'add-field',
false,
'',
[
'class' => 'mini float-right',
'icon' => 'plus',
],
true
);
$table->data['custom-fields-button'] = $row;
ob_start();
echo '<form name="modulo" method="post" action="'.$form_action.'">';
echo '<form name="modulo" method="post" action="'.$form_action.'" class="max_floating_element_size">';
echo html_print_table($table);
echo '<div class="action-buttons w100p">';
echo $form_buttons;

View File

@ -10532,6 +10532,11 @@ button div.preview {
-webkit-mask: url(../../images/eye.png) no-repeat center / contain;
}
button div.plus {
mask: url(../../images/plus-black.svg) no-repeat center / contain;
-webkit-mask: url(../../images/plus-black.svg) no-repeat center / contain;
}
button div.cog.rotation {
animation: rotation 4s infinite linear;
}

View File

@ -18,7 +18,7 @@
border-radius: 5px;
}
.ui-dialog .tips_header.ui-dialog-titlebar {
display: flex;
display: flex !important;
padding: 0px 20px;
justify-content: space-between;
height: fit-content;