fixed styles

This commit is contained in:
daniel 2023-03-02 12:46:47 +01:00
parent 6c87ec3c99
commit 5f8e9a3e3c
3 changed files with 222 additions and 108 deletions

View File

@ -76,10 +76,6 @@ function dbmgr_extension_main()
global $config; global $config;
if (is_metaconsole() === true) {
open_meta_frame();
}
if (!is_user_admin($config['id_user'])) { if (!is_user_admin($config['id_user'])) {
db_pandora_audit( db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION, AUDIT_LOG_ACL_VIOLATION,
@ -92,7 +88,21 @@ function dbmgr_extension_main()
$sql = (string) get_parameter('sql'); $sql = (string) get_parameter('sql');
$node_id = (int) get_parameter('node_id', -1); $node_id = (int) get_parameter('node_id', -1);
ui_print_page_header(__('Database interface'), 'images/gm_db.png', false, false, true); // Header.
ui_print_standard_header(
__('Database interface'),
'images/gm_db.png',
false,
'',
true,
[],
[
[
'link' => '',
'label' => __('Extensions'),
],
]
);
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
$img = '../../images/warning_modern.png'; $img = '../../images/warning_modern.png';
@ -285,10 +295,6 @@ function dbmgr_extension_main()
html_print_table($table); html_print_table($table);
echo '</div>'; echo '</div>';
if (is_metaconsole()) {
close_meta_frame();
}
} }

View File

@ -42,22 +42,24 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
$update_settings = (bool) get_parameter_post('update_settings'); $update_settings = (bool) get_parameter_post('update_settings');
if (is_metaconsole()) { ui_require_javascript_file_enterprise('load_enterprise', is_metaconsole() === true);
// Metaconsole. enterprise_include_once('include/functions_license.php');
ui_require_javascript_file_enterprise('load_enterprise', true);
enterprise_include_once('include/functions_license.php'); // Header.
} else { ui_print_standard_header(
ui_print_page_header(
__('License management'), __('License management'),
'images/extensions.png', 'images/extensions.png',
false, false,
'', '',
true true,
); [],
[
ui_require_javascript_file_enterprise('load_enterprise'); [
enterprise_include_once('include/functions_license.php'); 'link' => '',
} 'label' => __('License'),
],
]
);
enterprise_include_once('include/functions_crypto.php'); enterprise_include_once('include/functions_crypto.php');
@ -135,56 +137,159 @@ if (enterprise_installed()) {
</script> </script>
<?php <?php
echo '<form method="post" id="form-license">'; echo '<form method="post" id="form-license" class="max_floating_element_size">';
// Retrieve UM url configured (or default). // Retrieve UM url configured (or default).
$url = get_um_url(); $url = get_um_url();
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filter-table-adv';
$table->size = [];
if (is_metaconsole()) { $table->size[0] = '50%';
$table->head[0] = __('Licence'); $table->size[1] = '50%';
$table->head_colspan[0] = 3;
$table->headstyle[0] = 'text-align: center';
$table->style[0] = 'font-weight: bold;';
}
$table->data = []; $table->data = [];
$table->colspan = [];
$table->data[0][0] = '<strong>'.__('Customer key').'</strong>'; $table->colspan[0][0] = 2;
$table->data[0][1] = html_print_textarea('keys[customer_key]', 10, 255, $settings->customer_key, 'style="width: 450px" class="height_50px w450px"', true); $table->data[-1][0] = '<div class="section_table_title">'.__('Licence').'</div>';
$table->data[1][0] = '<strong>'.__($license['expiry_caption']).'</strong>'; $table->colspan[0][0] = 2;
$table->data[1][1] = html_print_input_text('expires', $license['expiry_date'], '', 10, 255, true, true); $table->data[0][0] = html_print_label_input_block(
__('Customer key'),
html_print_textarea(
'keys[customer_key]',
10,
255,
$settings->customer_key,
'style="width: 100%; height:80px;"',
true
)
);
$table->data[2][0] = '<strong>'.__('Platform Limit').'</strong>'; $table->data[1][0] = html_print_label_input_block(
$table->data[2][1] = html_print_input_text('expires', $license['limit'], '', 10, 255, true, true).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules')); __($license['expiry_caption']),
html_print_input_text(
'expires',
$license['expiry_date'],
'',
10,
255,
true,
true
)
);
$table->data[3][0] = '<strong>'.__('Current Platform Count').'</strong>'; $table->data[1][1] = html_print_label_input_block(
$table->data[3][1] = html_print_input_text('expires', $license['count'], '', 10, 255, true, true).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules')); __('Platform Limit'),
html_print_input_text(
'expires',
$license['limit'],
'',
10,
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[4][0] = '<strong>'.__('Current Platform Count (enabled: items)').'</strong>'; $table->data[2][0] = html_print_label_input_block(
$table->data[4][1] = html_print_input_text('expires', $license['count_enabled'], '', 10, 255, true, true).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules')); __('Current Platform Count'),
html_print_input_text(
'expires',
$license['count'],
'',
10,
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[5][0] = '<strong>'.__('Current Platform Count (disabled: items)').'</strong>'; $table->data[2][1] = html_print_label_input_block(
$table->data[5][1] = html_print_input_text('expires', $license['count_disabled'], '', 10, 255, true, true).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules')); __('Current Platform Count (enabled: items)'),
html_print_input_text(
'expires',
$license['count_enabled'],
'',
10,
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[6][0] = '<strong>'.__('License Mode').'</strong>'; $table->data[3][0] = html_print_label_input_block(
$table->data[6][1] = html_print_input_text('expires', $license['license_mode'], '', 10, 255, true, true); __('Current Platform Count (disabled: items)'),
html_print_input_text(
'expires',
$license['count_disabled'],
'',
10,
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[7][0] = '<strong>'.__('NMS').'</strong>'; $table->data[3][1] = html_print_label_input_block(
$table->data[7][1] = html_print_input_text('expires', ($license['nms'] == 1 ? __('enabled') : __('disabled')), '', 10, 255, true, true); __('License Mode'),
html_print_input_text(
'expires',
$license['license_mode'],
'',
10,
255,
true,
true
)
);
$table->data[8][0] = '<strong>'.__('Satellite').'</strong>'; $table->data[4][0] = html_print_label_input_block(
$table->data[8][1] = html_print_input_text('expires', ($license['dhpm'] == 1 ? __('enabled') : __('disabled')), '', 10, 255, true, true); __('NMS'),
html_print_input_text(
'expires',
($license['nms'] == 1 ? __('enabled') : __('disabled')),
'',
10,
255,
true,
true
)
);
$table->data[4][1] = html_print_label_input_block(
__('Satellite'),
html_print_input_text(
'expires',
($license['dhpm'] == 1 ? __('enabled') : __('disabled')),
'',
10,
255,
true,
true
)
);
$table->data[5][0] = html_print_label_input_block(
__('Licensed to'),
html_print_input_text(
'licensed_to',
$license['licensed_to'],
'',
64,
255,
true,
true
)
);
if ($license['dhpm'] == 1) { if ($license['dhpm'] == 1) {
$table->data[9][0] = '<strong>'.__('License encryption key').'</strong>'.ui_print_help_tip( $table->data[5][1] = html_print_label_input_block(
__('License encryption key').'</strong>'.ui_print_help_tip(
__('This key is used to encrypt your Pandora FMS license when it is shared with other Pandora FMS components'), __('This key is used to encrypt your Pandora FMS license when it is shared with other Pandora FMS components'),
true true
); ),
$table->data[9][1] = html_print_input_password( html_print_input_password(
'license_encryption_key', 'license_encryption_key',
io_safe_output($settings->license_encryption_key), io_safe_output($settings->license_encryption_key),
'', '',
@ -192,24 +297,41 @@ if ($license['dhpm'] == 1) {
255, 255,
true, true,
false false
)
); );
} }
$table->data[10][0] = '<strong>'.__('Licensed to').'</strong>';
$table->data[10][1] = html_print_input_text('licensed_to', $license['licensed_to'], '', 64, 255, true, true);
html_print_table($table); html_print_table($table);
// If DESTDIR is defined the enterprise license is expired. // If DESTDIR is defined the enterprise license is expired.
if (enterprise_installed() || defined('DESTDIR')) { if (enterprise_installed() || defined('DESTDIR')) {
echo '<div class="action-buttons" style="width: '.$table->width.'">'; $buttons = html_print_input_hidden('update_settings', 1, true);
html_print_input_hidden('update_settings', 1); $buttons .= html_print_submit_button(
html_print_submit_button(__('Validate'), 'update_button', false, 'class="sub upd"'); __('Validate'),
echo '&nbsp;&nbsp;'; 'update_button',
html_print_button(__('Request new license'), 'license', false, 'generate_request_code()', [ 'fixed_id' => 'button-', 'icon' => 'next']); false,
echo '</div>'; ['icon' => 'next'],
true
);
$buttons .= html_print_button(
__('Request new license'),
'license',
false,
'generate_request_code()',
[
'fixed_id' => 'button-',
'icon' => 'next',
'mode' => 'secondary',
],
true
);
html_print_action_buttons(
$buttons
);
} }
echo '</form>';
if (is_metaconsole()) { if (is_metaconsole()) {
ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/include/styles/'); ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/include/styles/');
ui_require_css_file('register', 'include/styles/'); ui_require_css_file('register', 'include/styles/');
@ -220,7 +342,6 @@ if (is_metaconsole()) {
} }
if (enterprise_hook('print_activate_licence_dialog') == ENTERPRISE_NOT_HOOK) { if (enterprise_hook('print_activate_licence_dialog') == ENTERPRISE_NOT_HOOK) {
echo '</form>';
echo '<div id="code_license_dialog" class="invisible left" title="'.__('Request new license').'">'; echo '<div id="code_license_dialog" class="invisible left" title="'.__('Request new license').'">';
echo '<div id="logo">'; echo '<div id="logo">';
html_print_image(ui_get_custom_header_logo(true)); html_print_image(ui_get_custom_header_logo(true));

View File

@ -132,8 +132,6 @@ class AuditLog extends HTML
$this->tableId = 'audit_logs'; $this->tableId = 'audit_logs';
// Header (only in Node).
if (is_metaconsole() === false) {
ui_print_standard_header( ui_print_standard_header(
__('%s audit', get_product_name()).' &raquo; '.__('Review Logs'), __('%s audit', get_product_name()).' &raquo; '.__('Review Logs'),
'images/gm_log.png', 'images/gm_log.png',
@ -152,12 +150,6 @@ class AuditLog extends HTML
], ],
] ]
); );
}
if (is_metaconsole() === true) {
// Only in case of Metaconsole, format the frame.
open_meta_frame();
}
$buttons = []; $buttons = [];
@ -265,11 +257,6 @@ class AuditLog extends HTML
echo $e->getMessage(); echo $e->getMessage();
} }
if (is_metaconsole() === true) {
// Close the frame.
close_meta_frame();
}
// Load own javascript file. // Load own javascript file.
echo $this->loadJS(); echo $this->loadJS();