diff --git a/pandora_console/extensions/api_checker.php b/pandora_console/extensions/api_checker.php index 2ffc5ef6c8..9b08815349 100755 --- a/pandora_console/extensions/api_checker.php +++ b/pandora_console/extensions/api_checker.php @@ -195,140 +195,183 @@ function extension_api_checker() ); } - ui_print_page_header( - __('API checker'), + // Header. + ui_print_standard_header( + __('Extensions'), 'images/extensions.png', false, '', true, - '' + [], + [ + [ + 'link' => '', + 'label' => __('Admin tools'), + ], + [ + 'link' => '', + 'label' => __('Extension manager'), + ], + [ + 'link' => '', + 'label' => __('API checker'), + ], + ] ); $table = new stdClass(); + $table->width = '100%'; + $table->class = 'databox filters filter-table-adv'; + $table->size[0] = '50%'; + $table->size[1] = '50%'; $table->data = []; $row = []; - $row[] = __('IP'); - $row[] = html_print_input_text('ip', $ip, '', 50, 255, true); + $row[] = html_print_label_input_block( + __('IP'), + html_print_input_text('ip', $ip, '', 50, 255, true) + ); + + $row[] = html_print_label_input_block( + __('%s Console URL', get_product_name()), + html_print_input_text('pandora_url', $pandora_url, '', 50, 255, true) + ); $table->data[] = $row; $row = []; - $row[] = __('%s Console URL', get_product_name()); - $row[] = html_print_input_text('pandora_url', $pandora_url, '', 50, 255, true); + $row[] = html_print_label_input_block( + __('API Token').ui_print_help_tip(__('Use API Token instead API Pass, User and Password.'), true), + html_print_input_text('token', $token, '', 50, 255, true) + ); + + $row[] = html_print_label_input_block( + __('API Pass'), + html_print_input_password('apipass', $apipass, '', 50, 255, true) + ); $table->data[] = $row; $row = []; - $row[] = __('API Token').ui_print_help_tip(__('Use API Token instead API Pass, User and Password.'), true); - $row[] = html_print_input_text('token', $token, '', 50, 255, true); - $table->data[] = $row; + $row[] = html_print_label_input_block( + __('User'), + html_print_input_text('user', $user, '', 50, 255, true) + ); - $row = []; - $row[] = __('API Pass'); - $row[] = html_print_input_password('apipass', $apipass, '', 50, 255, true); - $table->data[] = $row; - - $row = []; - $row[] = __('User'); - $row[] = html_print_input_text('user', $user, '', 50, 255, true); - $table->data[] = $row; - - $row = []; - $row[] = __('Password'); - $row[] = html_print_input_password('password', $password, '', 50, 255, true); + $row[] = html_print_label_input_block( + __('Password'), + html_print_input_password('password', $password, '', 50, 255, true) + ); $table->data[] = $row; $table2 = new stdClass(); + $table2->width = '100%'; + $table2->class = 'databox filters filter-table-adv'; + $table2->size[0] = '50%'; + $table2->size[1] = '50%'; $table2->data = []; $row = []; - $row[] = __('Action (get or set)'); - $row[] = html_print_input_text('op', $op, '', 50, 255, true); + $row[] = html_print_label_input_block( + __('Action (get or set)'), + html_print_input_text('op', $op, '', 50, 255, true) + ); + + $row[] = html_print_label_input_block( + __('Operation'), + html_print_input_text('op2', $op2, '', 50, 255, true) + ); $table2->data[] = $row; $row = []; - $row[] = __('Operation'); - $row[] = html_print_input_text('op2', $op2, '', 50, 255, true); + $row[] = html_print_label_input_block( + __('ID'), + html_print_input_text('id', $id, '', 50, 255, true) + ); + + $row[] = html_print_label_input_block( + __('ID 2'), + html_print_input_text('id2', $id2, '', 50, 255, true) + ); $table2->data[] = $row; $row = []; - $row[] = __('ID'); - $row[] = html_print_input_text('id', $id, '', 50, 255, true); + $row[] = html_print_label_input_block( + __('Return Type'), + html_print_input_text('return_type', $return_type, '', 50, 255, true) + ); + + $row[] = html_print_label_input_block( + __('Other'), + html_print_input_text('other', $other, '', 50, 255, true) + ); $table2->data[] = $row; $row = []; - $row[] = __('ID 2'); - $row[] = html_print_input_text('id2', $id2, '', 50, 255, true); - $table2->data[] = $row; - - $row = []; - $row[] = __('Return Type'); - $row[] = html_print_input_text('return_type', $return_type, '', 50, 255, true); - $table2->data[] = $row; - - $row = []; - $row[] = __('Other'); - $row[] = html_print_input_text('other', $other, '', 50, 255, true); - $table2->data[] = $row; - - $row = []; - $row[] = __('Other Mode'); - $row[] = html_print_input_text('other_mode', $other_mode, '', 50, 255, true); + $row[] = html_print_label_input_block( + __('Other Mode'), + html_print_input_text('other_mode', $other_mode, '', 50, 255, true) + ); $table2->data[] = $row; $table3 = new stdClass(); + $table3->width = '100%'; + $table3->class = 'databox filters filter-table-adv'; + $table3->size[0] = '50%'; + $table3->size[1] = '50%'; $table3->data = []; $row = []; - $row[] = __('Raw URL'); - $row[] = html_print_input_text('url', $url, '', 50, 2048, true); + $row[] = html_print_label_input_block( + __('Raw URL'), + html_print_input_text('url', $url, '', 50, 2048, true) + ); $table3->data[] = $row; - echo "
"; - echo '
'; + echo ""; + echo '
'; echo ''.__('Credentials').''; html_print_table($table); echo '
'; - echo '
'; + echo '
'; echo ''.__('Call parameters').' '.ui_print_help_tip(__('Action: get Operation: module_last_value id: 63'), true).''; html_print_table($table2); echo '
'; echo "
"; echo '
'; - echo '
'; + echo '
'; echo ''.__('Custom URL').''; html_print_table($table3); echo '
'; html_print_input_hidden('api_execute', 1); - html_print_div( - [ - 'class' => 'action-buttons', - 'content' => html_print_submit_button( - __('Call'), - 'submit', - false, - [ 'icon' => 'next' ], - true - ), - ] + html_print_action_buttons( + html_print_submit_button( + __('Call'), + 'submit', + false, + [ 'icon' => 'next' ], + true + ) ); echo ''; if ($api_execute === true) { - echo '
'; + echo '
'; echo ''.__('Result').''; - echo __('URL').'
'; - html_print_input_password('url', $return_call_api['url'], '', 150, 255, false, true); - echo " "; - html_print_image('images/input_zoom.png'); - echo ''; + echo html_print_label_input_block( + __('URL'), + html_print_input_password('url', $return_call_api['url'], '', 150, 255, true, true, false, 'mrgn_top_10px'), + ['label_class' => 'font-title-font'] + ); echo '
'; - echo __('Result').'
'; - html_print_textarea('result', 30, 20, $return_call_api['result'], 'readonly="readonly"'); + echo html_print_label_input_block( + __('Result'), + html_print_textarea('result', 30, 20, $return_call_api['result'], 'readonly="readonly"', true, 'w100p mrgn_top_10px'), + ['label_class' => 'font-title-font'] + ); echo '
'; } ?> diff --git a/pandora_console/extensions/db_status.php b/pandora_console/extensions/db_status.php index 98b95783be..25965efb0c 100755 --- a/pandora_console/extensions/db_status.php +++ b/pandora_console/extensions/db_status.php @@ -21,13 +21,23 @@ function extension_db_status() $db_name = get_parameter('db_name', ''); $db_status_execute = (bool) get_parameter('db_status_execute', false); - ui_print_page_header( + ui_print_standard_header( __('DB Schema check'), 'images/extensions.png', false, 'db_status_tab', true, - '' + [], + [ + [ + 'link' => '', + 'label' => __('Admin tools'), + ], + [ + 'link' => '', + 'label' => __('Run test'), + ], + ] ); if (!is_user_admin($config['id_user'])) { @@ -46,38 +56,86 @@ function extension_db_status() __('At the moment the checks is for MySQL/MariaDB.') ); - echo "
"; + echo ""; echo '
'; echo ''.__('DB settings').''; $table = new stdClass(); $table->data = []; $row = []; - $row[] = __('DB User with privileges'); - $row[] = html_print_input_text('db_user', $db_user, '', 50, 255, true); - $row[] = __('DB Password for this user'); - $row[] = html_print_input_password('db_password', $db_password, '', 50, 255, true); + $row[] = html_print_label_input_block( + __('DB User with privileges'), + html_print_input_text( + 'db_user', + $db_user, + '', + 50, + 255, + true, + false, + false, + '', + 'w100p mrgn_top_10px' + ) + ); + $row[] = html_print_label_input_block( + __('DB Password for this user'), + html_print_input_password( + 'db_password', + $db_password, + '', + 50, + 255, + true, + false, + false, + 'w100p mrgn_top_10px' + ) + ); $table->data[] = $row; $row = []; - $row[] = __('DB Hostname'); - $row[] = html_print_input_text('db_host', $db_host, '', 50, 255, true); - $row[] = __('DB Name (temporal for testing)'); - $row[] = html_print_input_text('db_name', $db_name, '', 50, 255, true); + $row[] = html_print_label_input_block( + __('DB Hostname'), + html_print_input_text( + 'db_host', + $db_host, + '', + 50, + 255, + true, + false, + false, + '', + 'w100p mrgn_top_10px' + ) + ); + $row[] = html_print_label_input_block( + __('DB Name (temporal for testing)'), + html_print_input_text( + 'db_name', + $db_name, + '', + 50, + 255, + true, + false, + false, + '', + 'w100p mrgn_top_10px' + ) + ); $table->data[] = $row; html_print_table($table); echo '
'; - html_print_div( - [ - 'class' => 'action-buttons', - 'content' => html_print_submit_button( - __('Execute Test'), - 'submit', - false, - [ 'icon' => 'cog' ], - true - ), - ] + html_print_action_buttons( + html_print_submit_button( + __('Execute Test'), + 'submit', + false, + [ 'icon' => 'cog' ], + true + ) ); html_print_input_hidden('db_status_execute', 1); diff --git a/pandora_console/extensions/dbmanager.php b/pandora_console/extensions/dbmanager.php index 3aacc776a0..1ec40b79f1 100644 --- a/pandora_console/extensions/dbmanager.php +++ b/pandora_console/extensions/dbmanager.php @@ -132,47 +132,37 @@ function dbmgr_extension_main() echo $warning_message; } + ui_print_warning_message( + __( + "This is an advanced extension to interface with %s database directly from WEB console + using native SQL sentences. Please note that you can damage your %s installation + if you don't know exactly what are you are doing, + this means that you can severily damage your setup using this extension. + This extension is intended to be used only by experienced users + with a depth knowledge of %s internals.", + get_product_name(), + get_product_name(), + get_product_name() + ) + ); + echo ""; $table = new stdClass(); $table->id = 'db_interface'; - $table->class = 'databox'; + $table->class = 'databox no_border filter-table-adv'; $table->width = '100%'; $table->data = []; - $table->head = []; $table->colspan = []; - $table->rowstyle = []; + $table->style[0] = 'width: 30%;'; + $table->style[1] = 'width: 70%;'; - $table->colspan[0][0] = 2; $table->colspan[1][0] = 2; - $table->rowspan[2][0] = 3; - $table->rowclass[0] = 'notify'; - $table->rowclass[3] = 'pdd_5px'; - $table->rowclass[3] = 'flex-content-right'; - $table->rowclass[4] = 'flex-content-right'; - - $data[0][0] = __( - "This is an advanced extension to interface with %s database directly from WEB console - using native SQL sentences. Please note that you can damage your %s installation - if you don't know exactly what are you are doing, - this means that you can severily damage your setup using this extension. - This extension is intended to be used only by experienced users - with a depth knowledge of %s internals.", - get_product_name(), - get_product_name(), - get_product_name() - ); - - $data[1][0] = "Some samples of usage:
SHOW STATUS;
DESCRIBE tagente
SELECT * FROM tserver
UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'
"; - - $data[2][0] = html_print_textarea( - 'sql', - 5, - 50, - html_entity_decode($sql, ENT_QUOTES), - '', - true + $data[0][0] = "Some samples of usage:
SHOW STATUS;
DESCRIBE tagente
SELECT * FROM tserver
UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'
"; + $data[0][0] = html_print_label_input_block( + __('Some samples of usage:'), + "
SHOW STATUS;
DESCRIBE tagente
SELECT * FROM tserver
UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'
" ); if (is_metaconsole() === true) { @@ -191,35 +181,57 @@ function dbmgr_extension_main() $servers = []; } - $data[3][2] = html_print_input( - [ - 'name' => 'node_id', - 'type' => 'select', - 'fields' => $servers, - 'selected' => $node_id, - 'nothing' => __('This metaconsole'), - 'nothing_value' => -1, - 'return' => true, - 'label' => _('Select query target'), - ] + $data[0][1] = html_print_label_input_block( + __('Select query target'), + html_print_select( + $servers, + 'node_id', + $node_id, + '', + __('This metaconsole'), + -1, + true, + false, + false, + 'w40p', + false, + 'width: 40%;' + ) ); } - $data[4][2] = html_print_div( - [ - 'class' => 'action-buttons', - 'content' => html_print_submit_button( - __('Execute SQL'), - '', - false, - [ 'icon' => 'cog' ], - true - ), - ] + $data[1][0] = html_print_textarea( + 'sql', + 3, + 50, + html_entity_decode($sql, ENT_QUOTES), + 'placeholder="'.__('Type your query here...').'"', + true, + 'w100p' + ); + + $execute_button = html_print_submit_button( + __('Execute SQL'), + '', + false, + [ 'icon' => 'cog' ], + true ); $table->data = $data; - html_print_table($table); + // html_print_table($table); + html_print_action_buttons($execute_button); + ui_toggle( + html_print_table($table, true), + ''.__('SQL query').'', + __('SQL query'), + 'query', + false, + false, + '', + 'white-box-content no_border', + 'box-flat white_table_graph fixed_filter_bar' + ); echo '
'; // Processing SQL Code. @@ -227,10 +239,6 @@ function dbmgr_extension_main() return; } - echo '
'; - echo '
'; - echo '
'; - try { if (\is_metaconsole() === true && $node_id !== -1) { $node = new Node($node_id); diff --git a/pandora_console/extensions/dbmanager/dbmanager.css b/pandora_console/extensions/dbmanager/dbmanager.css index 1e44dce3a8..1882b71e92 100644 --- a/pandora_console/extensions/dbmanager/dbmanager.css +++ b/pandora_console/extensions/dbmanager/dbmanager.css @@ -24,7 +24,6 @@ table.dbmanager th { } textarea { - min-height: 50px; - height: 50px; - width: 95%; + width: 100% !important; + max-width: 100% !important; } diff --git a/pandora_console/extensions/extension_uploader.php b/pandora_console/extensions/extension_uploader.php index f5447703e8..d989a3661b 100644 --- a/pandora_console/extensions/extension_uploader.php +++ b/pandora_console/extensions/extension_uploader.php @@ -25,13 +25,28 @@ function extension_uploader_extensions() return; } - ui_print_page_header( - __('Uploader extension'), + // Header. + ui_print_standard_header( + __('Extensions'), 'images/extensions.png', false, '', true, - '' + [], + [ + [ + 'link' => '', + 'label' => __('Admin tools'), + ], + [ + 'link' => '', + 'label' => __('Extension manager'), + ], + [ + 'link' => '', + 'label' => __('Uploader extension'), + ], + ] ); $upload = (bool) get_parameter('upload', 0); @@ -77,20 +92,52 @@ function extension_uploader_extensions() $table = new stdClass(); $table->width = '100%'; - $table->class = 'databox filters'; + $table->class = 'databox filters filter-table-adv'; + $table->size[0] = '20%'; + $table->size[1] = '20%'; + $table->size[2] = '60%'; $table->data = []; - $table->data[0][0] = __('Upload extension'); - $table->data[0][1] = html_print_input_file('extension', true).ui_print_help_tip(__('Upload the extension as a zip file.'), true); + + $table->data[0][0] = html_print_label_input_block( + __('Upload extension').ui_print_help_tip(__('Upload the extension as a zip file.'), true), + html_print_input_file( + 'extension', + true, + [ + 'required' => true, + 'accept' => '.zip', + ] + ) + ); + if (enterprise_installed()) { - $table->data[0][2] = __('Upload enterprise extension').' '.html_print_checkbox('upload_enterprise', 1, false, true); + $table->data[0][1] = html_print_label_input_block( + __('Upload enterprise extension'), + html_print_checkbox( + 'upload_enterprise', + 1, + false, + true + ) + ); + } else { + $table->data[0][1] = ''; } + $table->data[0][2] = ''; + echo "
"; html_print_table($table); - echo "
"; html_print_input_hidden('upload', 1); - html_print_submit_button(__('Upload'), 'submit', false, 'class="sub add"'); - echo '
'; + html_print_action_buttons( + html_print_submit_button( + __('Upload'), + 'submit', + false, + ['icon' => 'wand'], + true + ) + ); echo '
'; } diff --git a/pandora_console/extensions/files_repo.php b/pandora_console/extensions/files_repo.php index c319954748..0313af90b2 100644 --- a/pandora_console/extensions/files_repo.php +++ b/pandora_console/extensions/files_repo.php @@ -126,8 +126,30 @@ function pandora_files_repo_godmode() 'godmode' => $godmode, 'operation' => $operation, ]; + // Header. - ui_print_page_header(__('Files repository manager'), 'images/extensions.png', false, '', true, $onheader); + ui_print_standard_header( + __('Extensions'), + 'images/extensions.png', + false, + '', + true, + $onheader, + [ + [ + 'link' => '', + 'label' => __('Admin tools'), + ], + [ + 'link' => '', + 'label' => __('Extension manager'), + ], + [ + 'link' => '', + 'label' => __('Files repository manager'), + ], + ] + ); $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/'; include_once $full_extensions_dir.'files_repo/functions_files_repo.php'; diff --git a/pandora_console/extensions/files_repo/files_repo_form.php b/pandora_console/extensions/files_repo/files_repo_form.php index a78606c271..d96357e87b 100644 --- a/pandora_console/extensions/files_repo/files_repo_form.php +++ b/pandora_console/extensions/files_repo/files_repo_form.php @@ -32,17 +32,15 @@ if (isset($file_id) && $file_id > 0) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox filters'; -$table->style = []; -$table->style[0] = 'font-weight: bold;'; -$table->style[2] = 'text-align: center;'; -$table->colspan = []; +$table->class = 'databox filters filter-table-adv'; +$table->size[0] = '50%'; +$table->size[1] = '50%'; $table->data = []; -// GROUPS +// GROUPS. $groups = groups_get_all(); -// Add the All group to the beginning to be always the first -// Use this instead array_unshift to keep the array keys +// Add the All group to the beginning to be always the first. +// Use this instead array_unshift to keep the array keys. $groups = ([0 => __('All')] + $groups); $groups_selected = []; foreach ($groups as $id => $name) { @@ -52,66 +50,110 @@ foreach ($groups as $id => $name) { } $row = []; -$row[0] = __('Groups'); -$row[1] = '
'.html_print_select_groups( - // Id_user. - false, - // Privilege. - 'AR', - // ReturnAllGroup. - true, - // Name. - 'groups[]', - // Selected. - $groups_selected, - // Script. - '', - // Nothing. - '', - // Nothing_value. - 0, - // Return. - true, - // Multiple. - true -).'
'; -$table->data[] = $row; -$table->colspan[][1] = 3; +$row[0] = html_print_label_input_block( + __('Groups'), + html_print_select_groups( + // Id_user. + false, + // Privilege. + 'AR', + // ReturnAllGroup. + true, + // Name. + 'groups[]', + // Selected. + $groups_selected, + // Script. + '', + // Nothing. + '', + // Nothing_value. + 0, + // Return. + true, + // Multiple. + true + ) +); -// DESCRIPTION -$row = []; -$row[0] = __('Description'); -$row[0] .= ui_print_help_tip(__('Only 200 characters are permitted'), true); -$row[1] = html_print_textarea('description', 3, 20, $file['description'], 'class="file_repo_description"', true); +// DESCRIPTION. +$row[1] = html_print_label_input_block( + __('Description').ui_print_help_tip(__('Only 200 characters are permitted'), true), + html_print_textarea( + 'description', + 4, + 20, + $file['description'], + 'class="file_repo_description" style="min-height: 60px; max-height: 60px;"', + true + ) +); $table->data[] = $row; -$table->colspan[][1] = 3; -// FILE and SUBMIT BUTTON +// FILE and SUBMIT BUTTON. $row = []; -// Public checkbox +// Public checkbox. $checkbox = html_print_checkbox('public', 1, (bool) !empty($file['hash']), true); $style = 'class="inline padding-2-10"'; $row[0] = __('File'); if ($file_id > 0) { - $row[1] = $file['name']; - $row[2] = "
".__('Public link')." $checkbox
"; - $row[3] = html_print_submit_button(__('Update'), 'submit', false, 'class="sub upd"', true); - $row[3] .= html_print_input_hidden('update_file', 1, true); - $row[3] .= html_print_input_hidden('file_id', $file_id, true); + $submit_button = html_print_submit_button( + __('Update'), + 'submit', + false, + ['icon' => 'wand'], + true + ); + + $row[0] = html_print_label_input_block( + __('File'), + $file['name'] + ); + + $row[1] = html_print_label_input_block( + __('Public link'), + $checkbox.html_print_input_hidden( + 'file_id', + $file_id, + true + ) + ); } else { - $row[1] = html_print_input_file('upfile', true); - $row[2] = "
".__('Public link')." $checkbox
"; - $row[3] = html_print_submit_button(__('Add'), 'submit', false, 'class="sub add"', true); - $row[3] .= html_print_input_hidden('add_file', 1, true); + $submit_button = html_print_submit_button( + __('Add'), + 'submit', + false, + ['icon' => 'wand'], + true + ); + + $row[0] = html_print_label_input_block( + __('File'), + html_print_input_file( + 'upfile', + true + ) + ); + + $row[1] = html_print_label_input_block( + __('Public link'), + $checkbox.html_print_input_hidden( + 'add_file', + 1, + true + ) + ); } + + $table->data[] = $row; -$table->colspan[][1] = 1; $url = ui_get_full_url('index.php?sec=godmode/extensions&sec2=extensions/files_repo'); echo "
"; html_print_table($table); +html_print_action_buttons($submit_button); echo '
'; ?> diff --git a/pandora_console/extensions/pandora_logs.php b/pandora_console/extensions/pandora_logs.php index 21b817b978..28dcaa0814 100644 --- a/pandora_console/extensions/pandora_logs.php +++ b/pandora_console/extensions/pandora_logs.php @@ -11,11 +11,12 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -function view_logfile($file_name) +function view_logfile($file_name, $toggle=false) { global $config; $memory_limit = ini_get('memory_limit'); + $code = ''; if (strstr($memory_limit, 'M') !== false) { $memory_limit = str_replace('M', '', $memory_limit); @@ -31,21 +32,37 @@ function view_logfile($file_name) $file_size = filesize($file_name); if ($memory_limit < $file_size) { - echo "

$file_name (".__('File is too large than PHP memory allocated in the system.').')

'; - echo '

'.__('The preview file is imposible.').'

'; + $code .= '

'.$file_name.' ('.__('File is too large than PHP memory allocated in the system.').')

'; + $code .= '

'.__('The preview file is imposible.').'

'; } else if ($file_size > ($config['max_log_size'] * 1000)) { $data = file_get_contents($file_name, false, null, ($file_size - ($config['max_log_size'] * 1000))); - echo "

$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).'

'; - echo "

'; + $code .= "

$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).'

'; + $code .= "

'; } else { $data = file_get_contents($file_name); - echo "

$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).'

'; - echo "

'; + $code .= "

$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).'

'; + $code .= "

'; + } + + if ($toggle === true) { + ui_toggle( + $code, + ''.$file_name.'', + $file_name, + 'a', + false, + false, + '', + 'white-box-content no_border', + 'filter-datatable-main box-flat white_table_graph' + ); + } else { + echo $code; } } } @@ -64,21 +81,45 @@ function pandoralogs_extension_main() return; } - ui_print_page_header(__('System logfile viewer'), 'images/extensions.png', false, '', true, ''); + // Header. + ui_print_standard_header( + __('Extensions'), + 'images/extensions.png', + false, + '', + true, + [], + [ + [ + 'link' => '', + 'label' => __('Admin tools'), + ], + [ + 'link' => '', + 'label' => __('Extension manager'), + ], + [ + 'link' => '', + 'label' => __('System logfile viewer'), + ], + ] + ); - echo '

'.__('Use this tool to view your %s logfiles directly on the console', get_product_name()).'

'; - - echo '

'.__('You can choose the amount of information shown in general setup (Log size limit in system logs viewer extension), '.($config['max_log_size'] * 1000).'B at the moment').'

'; + ui_print_info_message( + __('Use this tool to view your %s logfiles directly on the console', get_product_name()).'
+ '.__('You can choose the amount of information shown in general setup (Log size limit in system logs viewer extension), '.($config['max_log_size'] * 1000).'B at the moment') + ); $logs_directory = (!empty($config['server_log_dir'])) ? io_safe_output($config['server_log_dir']) : '/var/log/pandora'; // Do not attempt to show console log if disabled. if ($config['console_log_enabled']) { - view_logfile($config['homedir'].'/log/console.log'); + view_logfile($config['homedir'].'/log/console.log', true); } - view_logfile($logs_directory.'/pandora_server.log'); - view_logfile($logs_directory.'/pandora_server.error'); + view_logfile($logs_directory.'/pandora_server.log', true); + view_logfile($logs_directory.'/pandora_server.error', true); + } diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index a961a62ecb..1f9a204d95 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -98,6 +98,7 @@ echo ''; ?> diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index fbee4498b4..6002d19cfe 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -2639,7 +2639,8 @@ $class = 'databox filters'; 'render_definition', 3, 25, - $render_definition + $render_definition, + 'style=width:100%' ); ?> diff --git a/pandora_console/godmode/setup/file_manager.php b/pandora_console/godmode/setup/file_manager.php index f54cf7f7f6..dbbd2674be 100644 --- a/pandora_console/godmode/setup/file_manager.php +++ b/pandora_console/godmode/setup/file_manager.php @@ -80,7 +80,7 @@ if (empty($directory) === true) { $real_directory = realpath($config['homedir'].'/'.$directory); -echo '

'.__('Index of %s', io_safe_input($directory)).'

'; +echo '

'.__('Index of %s', io_safe_input($directory)).'

'; $upload_file = (bool) get_parameter('upload_file'); $create_text_file = (bool) get_parameter('create_text_file'); diff --git a/pandora_console/godmode/setup/news.php b/pandora_console/godmode/setup/news.php index 633e8f224f..efbf574779 100644 --- a/pandora_console/godmode/setup/news.php +++ b/pandora_console/godmode/setup/news.php @@ -170,46 +170,118 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) { $table->id = 'news'; $table->cellpadding = 4; $table->cellspacing = 4; - $table->class = 'databox filters'; + $table->class = 'databox filters filter-table-adv'; $table->head = []; $table->data = []; - $table->style[0] = 'font-weight: bold;'; - $table->style[1] = 'font-weight: bold;'; - $table->style[2] = 'font-weight: bold;'; - $table->style[3] = 'font-weight: bold;'; - $table->style[4] = 'font-weight: bold;'; + $table->size[0] = '33%'; + $table->size[1] = '33%'; + $table->colspan[2][0] = 2; + $table->rowclass[2] = 'w100p'; $data = []; - $data[0] = __('Subject').'
'; - $data[0] .= ''; + $data[0] = html_print_label_input_block( + __('Subject'), + html_print_input_text( + 'subject', + $subject, + '', + 35, + 255, + true + ) + ); - $data[1] = __('Group').'
'; - $data[1] .= '
'; - $data[1] .= html_print_select_groups($config['id_user'], 'ER', users_can_manage_group_all(), 'id_group', $id_group, '', '', 0, true, false, false, ''); - $data[1] .= '
'; + $data[1] = html_print_label_input_block( + __('Group'), + html_print_select_groups( + $config['id_user'], + 'ER', + users_can_manage_group_all(), + 'id_group', + $id_group, + '', + '', + 0, + true, + false, + false, + 'w100p', + false, + 'width: 100%;' + ) + ); + $table->data[] = $data; - $data[2] = __('Modal screen').'
'; - $data[2] .= html_print_checkbox_extended('modal', 1, $modal, false, '', 'class="mrgn_top_5 mrg_btt_7"', true); + $data = []; + $data[0] = html_print_label_input_block( + __('Modal screen'), + html_print_checkbox_extended( + 'modal', + 1, + $modal, + false, + '', + 'class="w100p"', + true + ) + ); - $data[3] = __('Expire').'
'; - $data[3] .= html_print_checkbox_extended('expire', 1, $expire, false, '', 'class="mrgn_top_5 mrg_btt_7"', true); - - $data[4] = __('Expiration').'
'; - $data[4] .= html_print_input_text('expire_date', $expire_date, '', 12, 10, true).' '; - $data[4] .= html_print_input_text('expire_time', $expire_time, '', 10, 7, true).' '; + $data[1] = '
'.html_print_label_input_block( + __('Expire'), + html_print_checkbox_extended( + 'expire', + 1, + $expire, + false, + '', + 'class="w100p"', + true + ), + ['div_class' => 'display-grid'] + ); + $data[1] .= html_print_label_input_block( + __('Expiration'), + '
'.html_print_input_text( + 'expire_date', + $expire_date, + '', + 12, + 10, + true + ).' '.html_print_input_text( + 'expire_time', + $expire_time, + '', + 10, + 7, + true + ).'
', + [ + 'div_class' => 'display-grid mrgn_lft_20px', + 'div_id' => 'news-0-4', + ] + ).'
'; $table->rowclass[] = ''; $table->data[] = $data; $data = []; - $data[0] = __('Text').'
'; - $data[0] .= html_print_textarea('text', 25, 15, $text, '', true); - $table->rowclass[] = ''; - $table->colspan[1][0] = 5; + $data[0] = html_print_label_input_block( + __('Text'), + html_print_textarea( + 'text', + 25, + 100, + $text, + '', + true, + 'w100p' + ) + ); $table->data[] = $data; - echo '
'; + echo ''; if ($creation_mode == 1) { echo ""; } else { @@ -228,11 +300,25 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) { echo ""; echo "
"; if (isset($_GET['form_add'])) { - echo ""; + $submit_button = html_print_submit_button( + __('Create'), + 'crtbutton', + false, + ['icon' => 'wand'], + true + ); } else { - echo ""; + $submit_button = html_print_submit_button( + __('Update'), + 'crtbutton', + false, + ['icon' => 'wand'], + true + ); } + html_print_action_buttons($submit_button); + echo '
'; } else { $rows = db_get_all_rows_in_table('tnews', 'timestamp'); @@ -293,11 +379,17 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) { echo ''; } - echo ""; - echo "
"; echo "
"; - echo ""; - echo '
'; + html_print_action_buttons( + html_print_submit_button( + __('Add'), + 'form_add', + false, + ['icon' => 'wand'], + true + ) + ); + echo ''; } /* diff --git a/pandora_console/images/error-red@svg.svg b/pandora_console/images/error-red@svg.svg new file mode 100644 index 0000000000..f9526f0cb3 --- /dev/null +++ b/pandora_console/images/error-red@svg.svg @@ -0,0 +1,11 @@ + + + + Dark / 14 / info@svg + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index ccdb086f9a..70d6cba47e 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -791,6 +791,10 @@ if ($save_filter_modal) { $table->rowid[1] = 'save_filter_row1'; $table->size[0] = '50%'; $table->size[1] = '50%'; + $table->rowclass[1] = 'flex'; + $table->rowclass[2] = 'flex'; + $table->rowclass[3] = 'flex'; + $table->rowclass[4] = 'flex'; $data[0] = ''.__('Filter name').''.$jump; $data[0] .= html_print_input_text('id_name', '', '', 15, 255, true); if (is_metaconsole()) { diff --git a/pandora_console/include/chart_generator.php b/pandora_console/include/chart_generator.php index c0ba8eb3ac..7bc4785011 100644 --- a/pandora_console/include/chart_generator.php +++ b/pandora_console/include/chart_generator.php @@ -47,6 +47,7 @@ if (json_last_error() === JSON_ERROR_NONE) { $data = $data_decoded['data']; $session_id = $data_decoded['session_id']; $type_graph_pdf = $data_decoded['type_graph_pdf']; + $id_user = $data_decoded['id_user']; $data_combined = []; if (isset($data_decoded['data_combined']) === true) { @@ -62,6 +63,10 @@ if (json_last_error() === JSON_ERROR_NONE) { // Initialize session. global $config; +// Care whit this!!! check_login not working if you remove this. +$config['id_user'] = $id_user; +$_SESSION['id_usuario'] = $id_user; + // Try to initialize session using existing php session id. $user = new PandoraFMS\User(['phpsessionid' => $session_id]); if (check_login(false) === false) { @@ -82,6 +87,7 @@ if (check_login(false) === false) {

Access is not granted

+