diff --git a/pandora_console/extensions/quick_shell.php b/pandora_console/extensions/quick_shell.php index 08d002f55e..8228c9f59d 100644 --- a/pandora_console/extensions/quick_shell.php +++ b/pandora_console/extensions/quick_shell.php @@ -309,7 +309,7 @@ function quickShellSettings() } // Parser. - if (get_parameter('qs_update', false) !== false) { + if (get_parameter('update_config', false) !== false) { // Gotty settings. Internal communication (WS). $gotty = get_parameter( 'gotty', @@ -389,100 +389,104 @@ function quickShellSettings() ui_print_success_message($msg); } - // Form. - $wiz = new Wizard(); + // Form. Using old style. + echo '
'; + echo ''.__('Quickshell').''; - $wiz->printForm( - [ - 'form' => [ - 'action' => '#', - 'class' => 'wizard', - 'method' => 'post', - ], - 'inputs' => [ - [ - 'label' => __('Gotty path').ui_print_help_tip( - __('Leave blank if using an external Gotty service'), - true - ), - 'arguments' => [ - 'type' => 'text', - 'name' => 'gotty', - 'value' => $config['gotty'], - ], - ], - [ - 'label' => __('Gotty host'), - 'arguments' => [ - 'type' => 'text', - 'name' => 'gotty_host', - 'value' => $config['gotty_host'], - ], - ], - [ - 'label' => __('Gotty ssh port'), - 'arguments' => [ - 'type' => 'text', - 'name' => 'gotty_ssh_port', - 'value' => $config['gotty_ssh_port'], - ], - ], - [ - 'label' => __('Gotty telnet port'), - 'arguments' => [ - 'type' => 'text', - 'name' => 'gotty_telnet_port', - 'value' => $config['gotty_telnet_port'], - ], - ], - [ - 'toggle' => true, - 'toggle_name' => 'Advanced', - 'block_content' => [ - [ - 'label' => __('Gotty user').ui_print_help_tip( - __('Optional, set a user to access gotty service'), - true - ), - 'arguments' => [ - 'type' => 'text', - 'name' => 'gotty_user', - 'value' => $config['gotty_user'], - ], - ], - [ - 'label' => __('Gotty password').ui_print_help_tip( - __('Optional, set a password to access gotty service'), - true - ), - 'arguments' => [ - 'type' => 'password', - 'name' => 'gotty_pass', - 'value' => io_output_password($config['gotty_pass']), - ], - ], - ], - ], - [ - 'arguments' => [ - 'type' => 'hidden', - 'name' => 'qs_update', - 'value' => 1, - ], - ], - [ - 'arguments' => [ - 'type' => 'submit', - 'label' => __('Update'), - 'attributes' => 'class="sub next"', - ], - ], - ], - ], - false, + $t = new StdClass(); + $t->data = []; + $t->width = '100%'; + $t->class = 'databox filters'; + $t->data = []; + $t->style[0] = 'font-weight: bold'; + + $t->data[0][0] = __('Gotty path'); + $t->data[0][1] = html_print_input_text( + 'gotty', + $config['gotty'], + '', + 30, + 100, true ); + $t->data[1][0] = __('Gotty host'); + $t->data[1][1] = html_print_input_text( + 'gotty_host', + $config['gotty_host'], + '', + 30, + 100, + true + ); + + $t->data[2][0] = __('Gotty ssh port'); + $t->data[2][1] = html_print_input_text( + 'gotty_ssh_port', + $config['gotty_ssh_port'], + '', + 30, + 100, + true + ); + + $t->data[3][0] = __('Gotty telnet port'); + $t->data[3][1] = html_print_input_text( + 'gotty_telnet_port', + $config['gotty_telnet_port'], + '', + 30, + 100, + true + ); + + $hidden = new StdClass(); + $hidden->data = []; + $hidden->width = '100%'; + $hidden->class = 'databox filters'; + $hidden->data = []; + $hidden->style[0] = 'font-weight: bold'; + + $hidden->data[0][0] = __('Gotty user').ui_print_help_tip( + __('Optional, set a user to access gotty service'), + true + ); + $hidden->data[0][1] = html_print_input_text( + 'gotty_user', + $config['gotty_user'], + '', + 30, + 100, + true + ); + + $hidden->data[1][0] = __('Gotty password').ui_print_help_tip( + __('Optional, set a password to access gotty service'), + true + ); + $hidden->data[1][1] = html_print_input_password( + 'gotty_pass', + io_output_password($config['gotty_pass']), + '', + 30, + 100, + true + ); + + html_print_table($t); + + ui_print_toggle( + [ + 'content' => html_print_table($hidden, true), + 'name' => __('Advanced options'), + 'clean' => false, + 'main_class' => 'no-border-imp', + 'container_class' => 'no-border-imp', + ] + ); + + echo '
'; + } diff --git a/pandora_console/godmode/extensions.php b/pandora_console/godmode/extensions.php index abb41cd60e..9a86444910 100644 --- a/pandora_console/godmode/extensions.php +++ b/pandora_console/godmode/extensions.php @@ -129,6 +129,7 @@ if ($disabled != '') { $extensions = extensions_get_extension_info(); +$table = new StdClass; $table->width = '98%'; $table->head = []; diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index d396bbd953..e9b8160fdd 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -133,13 +133,10 @@ $buttons['notifications'] = [ 'text' => ''.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'', ]; -// Enable only if quickshell is enabled. -if (function_exists('quickShellSettings') === true) { - $buttons['quickshell'] = [ - 'active' => false, - 'text' => ''.html_print_image('images/ehorus/terminal.png', true, ['title' => __('Quickshell')]).'', - ]; -} +$buttons['websocket_engine'] = [ + 'active' => false, + 'text' => ''.html_print_image('images/websocket_small.png', true, ['title' => __('Websocket engine')]).'', +]; $help_header = ''; if (enterprise_installed()) { @@ -191,9 +188,9 @@ switch ($section) { $subpage = ' » '.__('Notifications'); break; - case 'quickshell': - $buttons['quickshell']['active'] = true; - $subpage = ' » '.__('QuickShell'); + case 'websocket_engine': + $buttons['websocket_engine']['active'] = true; + $subpage = ' » '.__('Pandora Websocket Engine'); $help_header = 'quickshell_settings'; break; @@ -261,8 +258,8 @@ switch ($section) { include_once $config['homedir'].'/godmode/setup/setup_notifications.php'; break; - case 'quickshell': - quickShellSettings(); + case 'websocket_engine': + include_once $config['homedir'].'/godmode/setup/setup_websocket_engine.php'; break; default: diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 46c2c00e44..def984d6af 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -403,50 +403,6 @@ html_print_table($table_mail_conf); echo ''; echo '
'; -echo ''.__('WebSocket settings').''; - -$t = new StdClass(); -$t->data = []; -$t->width = '100%'; -$t->class = 'databox filters'; -$t->data = []; -$t->style[0] = 'font-weight: bold'; - -$t->data[0][0] = __('Bind address'); -$t->data[0][1] = html_print_input_text( - 'ws_bind_address', - $config['ws_bind_address'], - '', - 30, - 100, - true -); - -$t->data[1][0] = __('Bind port'); -$t->data[1][2] = html_print_input_text( - 'ws_port', - $config['ws_port'], - '', - 30, - 100, - true -); - -$t->data[2][0] = __('WebSocket proxy url').ui_print_help_tip(__('If you had configured a wsproxy set here target URL (for instance ws://your.public.fqdn/ws).'), true); -$t->data[2][2] = html_print_input_text( - 'ws_proxy_url', - $config['ws_proxy_url'], - '', - 30, - 100, - true -); - -html_print_input_hidden('update_config', 1); -html_print_table($t); - - -echo '
'; echo '
'; html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"'); diff --git a/pandora_console/godmode/setup/setup_websocket_engine.php b/pandora_console/godmode/setup/setup_websocket_engine.php new file mode 100644 index 0000000000..4dec1ac9e7 --- /dev/null +++ b/pandora_console/godmode/setup/setup_websocket_engine.php @@ -0,0 +1,89 @@ +'; + +echo '
'; +echo ''.__('WebSocket settings').''; + +$t = new StdClass(); +$t->data = []; +$t->width = '100%'; +$t->class = 'databox filters'; +$t->data = []; +$t->style[0] = 'font-weight: bold'; + +$t->data[0][0] = __('Bind address'); +$t->data[0][1] = html_print_input_text( + 'ws_bind_address', + $config['ws_bind_address'], + '', + 30, + 100, + true +); + +$t->data[1][0] = __('Bind port'); +$t->data[1][2] = html_print_input_text( + 'ws_port', + $config['ws_port'], + '', + 30, + 100, + true +); + +$t->data[2][0] = __('WebSocket proxy url').ui_print_help_tip(__('If you had configured a wsproxy set here target URL (for instance ws://your.public.fqdn/ws).'), true); +$t->data[2][2] = html_print_input_text( + 'ws_proxy_url', + $config['ws_proxy_url'], + '', + 30, + 100, + true +); + +html_print_input_hidden('update_config', 1); +html_print_table($t); + + +echo '
'; + +quickShellSettings(); + + +echo '
'; +html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"'); +echo '
'; +echo ''; diff --git a/pandora_console/images/websocket_big.png b/pandora_console/images/websocket_big.png new file mode 100644 index 0000000000..0caac15bb8 Binary files /dev/null and b/pandora_console/images/websocket_big.png differ diff --git a/pandora_console/images/websocket_small.png b/pandora_console/images/websocket_small.png new file mode 100644 index 0000000000..30a0478abf Binary files /dev/null and b/pandora_console/images/websocket_small.png differ diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 579cb5ebb5..5a014cbd4b 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -590,6 +590,10 @@ select:-internal-list-box { .no-border { border: none; } +.no-border-imp, +.no-border-imp > div { + border: none !important; +} .no-padding { padding: 0; }