Metasetup

This commit is contained in:
Pablo Aragon 2023-03-23 17:44:04 +01:00
parent 1ac37dd538
commit 122f45fcaa
6 changed files with 333 additions and 272 deletions

View File

@ -65,7 +65,7 @@ switch ($action) {
$table = new stdClass();
$table->class = 'info_table';
$table->width = '98%';
$table->width = '100%';
$table->head[0] = __('Map connection name');
$table->head[1] = __('Group');
$table->head[3] = __('Delete');
@ -84,7 +84,7 @@ if ($mapsConnections !== false) {
'<a href="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2&amp;action=edit_connection_map&amp;id_connection_map='.$mapsConnection['id_tmap_connection'].'">'.$mapsConnection['conection_name'].'</a>',
ui_print_group_icon($mapsConnection['group_id'], true),
'<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=gis&amp;id_connection_map='.$mapsConnection['id_tmap_connection'].'&amp;action=delete_connection"
onClick="javascript: if (!confirm(\''.__('Do you wan delete this connection?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter']).'</a>',
onClick="javascript: if (!confirm(\''.__('Do you wan delete this connection?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter main_menu_icon']).'</a>',
];
$table->cellclass[][2] = 'table_action_buttons';
}
@ -95,6 +95,14 @@ html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<form action="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2" method="post">';
html_print_input_hidden('action', 'create_connection_map');
html_print_submit_button(__('Create'), '', false, 'class="sub next"');
html_print_action_buttons(
html_print_submit_button(
__('Create'),
'',
false,
['icon' => 'wand'],
true
)
);
echo '</form>';
echo '</div>';

View File

@ -386,14 +386,15 @@ $table_alert_settings->data = [];
$table_alert_settings->width = '100%';
$table_alert_settings->styleTable = 'margin-bottom: 10px;';
$table_alert_settings->id = 'integria-cr-settings-setup';
$table_alert_settings->class = 'databox filters';
$table_alert_settings->size['name'] = '30%';
$table_alert_settings->style['name'] = 'font-weight: bold';
$table_alert_settings->class = 'databox filters filter-table-adv';
$table_alert_settings->size[0] = '50%';
$table_alert_settings->size[1] = '50%';
// Alert incident title.
$row = [];
$row['name'] = __('Title');
$row['control'] = html_print_input_text(
$row[0] = html_print_label_input_block(
__('Title'),
html_print_input_text(
'incident_title',
$config['incident_title'],
__('Name'),
@ -402,26 +403,28 @@ $row['control'] = html_print_input_text(
true,
false,
false
)
);
$table_alert_settings->data['custom_response_incident_title'] = $row;
// Alert incident description.
$row = [];
$row['name'] = __('Ticket body');
$row['control'] = html_print_textarea(
$row[1] = html_print_label_input_block(
__('Ticket body'),
html_print_textarea(
'incident_content',
7,
3,
25,
$config['incident_content'],
'',
true
)
);
$table_alert_settings->data['custom_response_incident_content'] = $row;
$table_alert_settings->data[0] = $row;
// Alert default group.
$row = [];
$row['name'] = __('Group');
$row['control'] = html_print_select(
$row[0] = html_print_label_input_block(
__('Group'),
html_print_select(
$integria_group_values,
'default_group',
$config['default_group'],
@ -433,13 +436,13 @@ $row['control'] = html_print_select(
true,
'',
false
)
);
$table_alert_settings->data['custom_response_def_group'] = $row;
// Alert default criticity.
$row = [];
$row['name'] = __('Priority');
$row['control'] = html_print_select(
$row[1] = html_print_label_input_block(
__('Priority'),
html_print_select(
$integria_criticity_values,
'default_criticity',
$config['default_criticity'],
@ -451,24 +454,30 @@ $row['control'] = html_print_select(
true,
'',
false
)
);
$table_alert_settings->data['custom_response_def_criticity'] = $row;
$table_alert_settings->data[1] = $row;
// Alert default owner.
$row = [];
$row['name'] = __('Owner');
$row['control'] = html_print_autocomplete_users_from_integria(
$row[0] = html_print_label_input_block(
__('Owner'),
html_print_autocomplete_users_from_integria(
'default_owner',
$config['default_owner'],
true
true,
'30',
false,
false,
'w100p'
),
['div_class' => 'inline']
);
$table_alert_settings->data['custom_response_def_owner'] = $row;
// Alert default incident type.
$row = [];
$row['name'] = __('Type');
$row['control'] = html_print_select(
$row[1] = html_print_label_input_block(
__('Type'),
html_print_select(
$integria_types_values,
'incident_type',
$config['incident_type'],
@ -480,13 +489,15 @@ $row['control'] = html_print_select(
true,
'',
false
)
);
$table_alert_settings->data['custom_response_incident_type'] = $row;
$table_alert_settings->data[2] = $row;
// Alert default incident status.
$row = [];
$row['name'] = __('Status');
$row['control'] = html_print_select(
$row[0] = html_print_label_input_block(
__('Status'),
html_print_select(
$integria_status_values,
'incident_status',
$config['incident_status'],
@ -498,8 +509,9 @@ $row['control'] = html_print_select(
true,
'',
false
)
);
$table_alert_settings->data['custom_response_incident_status'] = $row;
$table_alert_settings->data[3] = $row;
// Custom response settings.
$table_cr_settings = new StdClass();
@ -507,14 +519,15 @@ $table_cr_settings->data = [];
$table_cr_settings->width = '100%';
$table_cr_settings->styleTable = 'margin-bottom: 10px;';
$table_cr_settings->id = 'integria-cr-settings-setup';
$table_cr_settings->class = 'databox filters';
$table_cr_settings->size['name'] = '30%';
$table_cr_settings->style['name'] = 'font-weight: bold';
$table_cr_settings->class = 'databox filters filter-table-adv';
$table_cr_settings->size[0] = '50%';
$table_cr_settings->size[1] = '50%';
// Custom response incident title.
$row = [];
$row['name'] = __('Title');
$row['control'] = html_print_input_text(
$row[0] = html_print_label_input_block(
__('Title'),
html_print_input_text(
'cr_incident_title',
$config['cr_incident_title'],
__('Name'),
@ -523,27 +536,29 @@ $row['control'] = html_print_input_text(
true,
false,
false
)
);
$table_cr_settings->data['custom_response_incident_title'] = $row;
// Custom response incident description.
$row = [];
$row['name'] = __('Ticket body');
$row['control'] = html_print_textarea(
$row[1] = html_print_label_input_block(
__('Ticket body'),
html_print_textarea(
'cr_incident_content',
7,
3,
25,
$config['cr_incident_content'],
'',
true
)
);
$table_cr_settings->data['custom_response_incident_content'] = $row;
$table_cr_settings->data[0] = $row;
// Custom response default group.
$row = [];
$row['name'] = __('Group');
$row['control'] = html_print_select(
$row[0] = html_print_label_input_block(
__('Group'),
html_print_select(
$integria_group_values,
'cr_default_group',
$config['cr_default_group'],
@ -555,13 +570,13 @@ $row['control'] = html_print_select(
true,
'',
false
)
);
$table_cr_settings->data['custom_response_def_group'] = $row;
// Custom response default criticity.
$row = [];
$row['name'] = __('Priority');
$row['control'] = html_print_select(
$row[1] = html_print_label_input_block(
__('Priority'),
html_print_select(
$integria_criticity_values,
'cr_default_criticity',
$config['cr_default_criticity'],
@ -573,24 +588,30 @@ $row['control'] = html_print_select(
true,
'',
false
)
);
$table_cr_settings->data['custom_response_def_criticity'] = $row;
$table_cr_settings->data[1] = $row;
// Custom response default owner.
$row = [];
$row['name'] = __('Owner');
$row['control'] = html_print_autocomplete_users_from_integria(
$row[0] = html_print_label_input_block(
__('Owner'),
html_print_autocomplete_users_from_integria(
'cr_default_owner',
$config['cr_default_owner'],
true
true,
'30',
false,
false,
'w100p'
),
['div_class' => 'inline']
);
$table_cr_settings->data['custom_response_def_owner'] = $row;
// Custom response default incident type.
$row = [];
$row['name'] = __('Type');
$row['control'] = html_print_select(
$row[1] = html_print_label_input_block(
__('Type'),
html_print_select(
$integria_types_values,
'cr_incident_type',
$config['cr_incident_type'],
@ -602,13 +623,15 @@ $row['control'] = html_print_select(
true,
'',
false
)
);
$table_cr_settings->data['custom_response_incident_type'] = $row;
$table_cr_settings->data[2] = $row;
// Custom response default incident status.
$row = [];
$row['name'] = __('Status');
$row['control'] = html_print_select(
$row[0] = html_print_label_input_block(
__('Status'),
html_print_select(
$integria_status_values,
'cr_incident_status',
$config['cr_incident_status'],
@ -620,8 +643,9 @@ $row['control'] = html_print_select(
true,
'',
false
)
);
$table_cr_settings->data['custom_response_incident_status'] = $row;
$table_cr_settings->data[3] = $row;
// Test.
$row = [];
@ -682,7 +706,7 @@ echo '</div>';
if ($has_connection != false) {
// Form alert default settings.
echo '<div id="form_alert_settings">';
echo '<fieldset>';
echo '<fieldset class="mrgn_top_15px">';
echo '<legend>'.__('Alert default values').'&nbsp'.ui_print_help_icon('alert_macros', true).'</legend>';
html_print_table($table_alert_settings);
@ -692,7 +716,7 @@ if ($has_connection != false) {
// Form custom response default settings.
echo '<div id="form_custom_response_settings">';
echo '<fieldset>';
echo '<fieldset class="mrgn_top_15px">';
echo '<legend>'.__('Event custom response default values').'&nbsp'.ui_print_help_icon('alert_macros', true).'</legend>';
html_print_table($table_cr_settings);

View File

@ -50,7 +50,7 @@ try {
[
'id' => $tableId,
'class' => 'info_table',
'style' => 'width: 100%',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => 'include/ajax/update_manager',
@ -66,12 +66,13 @@ try {
[
'label' => __('Free search'),
'type' => 'text',
'class' => 'mw250px',
'class' => 'w400px',
'id' => 'free_search',
'name' => 'free_search',
],
],
],
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar ',
]
);
} catch (Exception $e) {

View File

@ -256,20 +256,20 @@ if ((bool) is_metaconsole() === true) {
);
}
echo '<form method="post" action="'.$action.'">';
echo '<form method="post" action="'.$action.'" class="max_floating_element_size">';
html_print_input_hidden('update_config', 1);
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$i = 0;
$table->style[$i] = 'font-weight: bolder;width:250px';
$table->class = 'databox filters filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
$url_update_manager = update_manager_get_url();
$table->data[$i][0] = __('Warp Update URL');
$table->data[$i++][1] = html_print_input_text(
$table->data[0][0] = html_print_label_input_block(
__('Warp Update URL'),
html_print_input_text(
'url_update_manager',
$url_update_manager,
__('URL update manager'),
@ -277,112 +277,137 @@ $table->data[$i++][1] = html_print_input_text(
255,
true,
true
)
);
$table->data[$i][0] = __('Use secured Warp Update');
$table->data[$i++][1] = html_print_input(
$table->data[0][1] = html_print_label_input_block(
__('Use secured Warp Update'),
html_print_input(
[
'type' => 'switch',
'name' => 'secure_update_manager',
'value' => ($secure_update_manager ?? 1),
]
)
);
$table->data[$i][0] = __('Proxy server');
$table->data[$i++][1] = html_print_input_text(
$table->data[1][0] = html_print_label_input_block(
__('Proxy server'),
html_print_input_text(
'update_manager_proxy_server',
$update_manager_proxy_server,
__('Proxy server'),
80,
60,
true
)
);
$table->data[$i][0] = __('Proxy port');
$table->data[$i++][1] = html_print_input_text(
$table->data[1][1] = html_print_label_input_block(
__('Proxy port'),
html_print_input_text(
'update_manager_proxy_port',
$update_manager_proxy_port,
__('Proxy port'),
80,
60,
true
)
);
$table->data[$i][0] = __('Proxy user');
$table->data[$i++][1] = html_print_input_text(
$table->data[2][0] = html_print_label_input_block(
__('Proxy user'),
html_print_input_text(
'update_manager_proxy_user',
$update_manager_proxy_user,
__('Proxy user'),
80,
60,
true
)
);
$table->data[$i][0] = __('Proxy password');
$table->data[$i++][1] = html_print_input_password(
$table->data[2][1] = html_print_label_input_block(
__('Proxy password'),
html_print_input_password(
'update_manager_proxy_password',
$update_manager_proxy_password,
__('Proxy password'),
80,
60,
true
)
);
$table->data[$i][0] = __('Allow no-consecutive patches');
$table->data[$i++][1] = html_print_switch(
$table->data[3][0] = html_print_label_input_block(
__('Allow no-consecutive patches'),
html_print_switch(
[
'name' => 'allow_offline_patches',
'value' => $allow_offline_patches,
'return' => true,
]
)
);
$table->data[$i][0] = __('Limit to LTS updates');
$table->data[$i++][1] = html_print_switch(
$table->data[3][1] = html_print_label_input_block(
__('Limit to LTS updates'),
html_print_switch(
[
'name' => 'lts_updates',
'value' => $lts_updates,
'return' => true,
]
)
);
$table->data[$i][0] = __('Registration ID');
$table->data[$i++][1] = '<i>'.($config['pandora_uid'] ?? __('Not registred yet')).'</i>';
$table->data[4][0] = html_print_label_input_block(
__('Registration ID'),
'<i>'.($config['pandora_uid'] ?? __('Not registred yet')).'</i>'
);
if (update_manager_verify_registration() === true && users_is_admin()) {
$table->data[$i][0] = __('Cancel registration');
$table->data[$i][1] = '<a href="';
$url = '<a href="';
if ((bool) is_metaconsole() === true) {
$table->data[$i][1] .= ui_get_full_url(
$url .= ui_get_full_url(
'index.php?sec=advanced&sec2=advanced/metasetup&pure=0&tab=update_manager_setup&um_disconnect_console=1'
);
} else {
$table->data[$i][1] .= ui_get_full_url(
$url .= ui_get_full_url(
'index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=setup&um_disconnect_console=1'
);
}
$table->data[$i++][1] .= '" onclick="if(confirm(\'Are you sure?\')) {return true;} else { return false; }">'.__('Unregister').'</a>';
$url .= '" onclick="if(confirm(\'Are you sure?\')) {return true;} else { return false; }">'.__('Unregister').'</a>';
$table->data[4][1] = html_print_label_input_block(
__('Cancel registration'),
$url
);
}
if (license_free()) {
$config['identification_reminder'] = isset($config['identification_reminder']) ? $config['identification_reminder'] : 1;
$table->data[$i][0] = __('%s community reminder', get_product_name()).ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this %s instance', get_product_name()), true);
$table->data[$i][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('identification_reminder', 1, '', $config['identification_reminder'], true).'&nbsp;&nbsp;';
$table->data[$i++][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('identification_reminder', 0, '', $config['identification_reminder'], true);
$table->data[4][1] = html_print_label_input_block(
__('%s community reminder', get_product_name()).ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this %s instance', get_product_name()), true),
'<div class="inline-radio-button">
'.__('Yes').html_print_radio_button('realtimestats', 1, '', $config['realtimestats'], true).'&nbsp;&nbsp;
'.__('No').html_print_radio_button('realtimestats', 0, '', $config['realtimestats'], true).'</div>'
);
}
html_print_input_hidden('action_update_url_update_manager', 1);
html_print_input_hidden('update_config', 1);
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'update_button',
false,
'class="sub upd"'
['icon' => 'wand'],
true
)
);
echo '</div>';
echo '</form>';

View File

@ -626,7 +626,7 @@ function filemanager_file_explorer(
$table->width = '100%';
$table->id = 'table_filemanager';
$table->class = (is_metaconsole() === true) ? 'databox_tactical' : 'info_table';
$table->class = 'info_table';
$table->title = '<span>'.__('Index of %s', $relative_directory).'</span>';
$table->colspan = [];
$table->data = [];
@ -751,7 +751,7 @@ function filemanager_file_explorer(
&& ($readOnly === false)
) {
$data[4] .= '<form method="post" action="'.$url.'" style="">';
$data[4] .= '<input type="image" style="margin-top: 2px;height:21px" class="invert_filter" src="images/delete.svg" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[4] .= '<input type="image" style="margin-top: 2px;height:21px" class="invert_filter main_menu_icon" src="../../images/delete.svg" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[4] .= html_print_input_hidden('filename', $fileinfo['realpath'], true);
$data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'].$config['server_unique_identifier']), true);
$data[4] .= html_print_input_hidden('delete_file', 1, true);
@ -896,7 +896,7 @@ function filemanager_file_explorer(
$uploadFileElements .= html_print_input_hidden('upload_file', 1, true);
}
$uploadFileElements .= html_print_submit_button(__('Go'), 'go', false, [ 'class' => 'submitButton', 'style' => 'float:right', 'icon' => 'next'], true);
$uploadFileElements .= html_print_submit_button(__('Go'), 'go', false, [ 'class' => 'submitButton', 'style' => 'float:right; margin-top: 10px;', 'icon' => 'next'], true);
$uploadFileElements .= html_print_input_hidden('real_directory', $real_directory, true);
$uploadFileElements .= html_print_input_hidden('directory', $relative_directory, true);
$uploadFileElements .= html_print_input_hidden('hash', md5($real_directory.$relative_directory.$config['server_unique_identifier']), true);

View File

@ -4787,13 +4787,16 @@ function html_print_input_file($name, $return=false, $options=false)
if (isset($options['accept']) === true) {
$output .= ' accept="'.$options['accept'].'"';
}
$label = '';
if (isset($options['label']) === true) {
$label = $options['label'];
}
}
// Close input.
$output .= '/>';
if (is_metaconsole() === false) {
$output .= ($options['caption'] ?? __('Select a file'));
}
$output .= '</label>';
$output .= '<span class="inputFileSpan" id="span-'.$name.'">&nbsp;</span>';