Websocket engine and quickshell

This commit is contained in:
Jose Gonzalez 2023-03-16 17:49:57 +01:00
parent bbb1855d81
commit 211f29c0f9
2 changed files with 109 additions and 96 deletions

View File

@ -441,84 +441,95 @@ function quickShellSettings()
} }
// Form. Using old style. // Form. Using old style.
echo '<fieldset>'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Quickshell').'</legend>'; echo '<legend>'.__('Quickshell').'</legend>';
$t = new StdClass(); $t = new StdClass();
$t->data = []; $t->data = [];
$t->width = '100%'; $t->width = '100%';
$t->class = 'databox filters'; $t->class = 'filter-table-adv';
$t->data = []; $t->data = [];
$t->style = []; $t->style = [];
$t->style[0] = 'font-weight: bold; width: 40%;'; $t->style[0] = 'width: 50%;';
$t->data[0][0] = __('Gotty path'); $t->data[0][] = html_print_label_input_block(
$t->data[0][1] = html_print_input_text( __('Gotty path'),
'gotty', html_print_input_text(
$config['gotty'], 'gotty',
'', $config['gotty'],
30, '',
100, 30,
true 100,
true
)
); );
$t->data[1][0] = __('Gotty host'); $t->data[0][] = html_print_label_input_block(
$t->data[1][1] = html_print_input_text( __('Gotty host'),
'gotty_host', html_print_input_text(
$config['gotty_host'], 'gotty_host',
'', $config['gotty_host'],
30, '',
100, 30,
true 100,
true
)
); );
$t->data[2][0] = __('Gotty ssh port'); $t->data[1][] = html_print_label_input_block(
$t->data[2][1] = html_print_input_text( __('Gotty ssh port'),
'gotty_ssh_port', html_print_input_text(
$config['gotty_ssh_port'], 'gotty_ssh_port',
'', $config['gotty_ssh_port'],
30, '',
100, 30,
true 100,
true
)
); );
$t->data[3][0] = __('Gotty telnet port'); $t->data[1][] = html_print_label_input_block(
$t->data[3][1] = html_print_input_text( __('Gotty telnet port'),
'gotty_telnet_port', html_print_input_text(
$config['gotty_telnet_port'], 'gotty_telnet_port',
'', $config['gotty_telnet_port'],
30, '',
100, 30,
true 100,
true
)
); );
$hidden = new StdClass(); $hidden = new stdClass();
$hidden->data = []; $hidden->data = [];
$hidden->width = '100%'; $hidden->width = '100%';
$hidden->class = 'databox filters'; $hidden->class = 'filter-table-adv';
$hidden->data = []; $hidden->data = [];
$hidden->style[0] = 'font-weight: bold;width: 40%;'; $hidden->style[0] = 'width: 50%;';
$hidden->data[0][0] = __('Gotty user'); $hidden->data[0][] = html_print_label_input_block(
$hidden->data[0][1] = html_print_input_text( __('Gotty user'),
'gotty_user', html_print_input_text(
$config['gotty_user'], 'gotty_user',
'', $config['gotty_user'],
30, '',
100, 30,
true 100,
true
)
); );
$hidden->data[1][0] = __('Gotty password'); $hidden->data[0][] = html_print_label_input_block(
$hidden->data[1][1] = html_print_input_password( __('Gotty password'),
'gotty_pass', html_print_input_password(
io_output_password($config['gotty_pass']), 'gotty_pass',
'', io_output_password($config['gotty_pass']),
30, '',
100, 30,
true 100,
true
)
); );
$hidden->data[1][1] .= ui_print_reveal_password('gotty_pass', true);
html_print_table($t); html_print_table($t);

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -32,68 +32,70 @@ $url = ui_get_full_url(
'index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=websocket_engine&amp;pure='.$config['pure'] 'index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=websocket_engine&amp;pure='.$config['pure']
); );
echo '<form id="form_setup" method="post" action="'.$url.'">'; echo '<form class="max_floating_element_size" id="form_setup" method="post" action="'.$url.'">';
echo '<fieldset>'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('WebSocket settings').'</legend>'; echo '<legend>'.__('WebSocket settings').'</legend>';
$t = new StdClass(); $t = new StdClass();
$t->data = []; $t->data = [];
$t->width = '100%'; $t->width = '100%';
$t->class = 'databox filters'; $t->class = 'databox filter-table-adv';
$t->data = []; $t->data = [];
$t->style[0] = 'font-weight: bold';
$t->data[0][0] = __('Bind address'); $t->data[0][] = html_print_label_input_block(
$t->data[0][1] = html_print_input_text( __('Bind address'),
'ws_bind_address', html_print_input_text(
$config['ws_bind_address'], 'ws_bind_address',
'', $config['ws_bind_address'],
30, '',
100, 30,
true 100,
true
)
); );
$t->data[1][0] = __('Bind port'); $t->data[0][] = html_print_label_input_block(
$t->data[1][2] = html_print_input_text( __('Bind port'),
'ws_port', html_print_input_text(
$config['ws_port'], 'ws_port',
'', $config['ws_port'],
30, '',
100, 30,
true 100,
true
)
); );
$t->data[2][0] = __('WebSocket proxy url'); $t->data[1][] = html_print_label_input_block(
$t->data[2][2] = html_print_input_text( __('WebSocket proxy url'),
'ws_proxy_url', html_print_input_text(
$config['ws_proxy_url'], 'ws_proxy_url',
'', $config['ws_proxy_url'],
30, '',
100, 30,
true 100,
true
)
); );
html_print_input_hidden('update_config', 1); html_print_input_hidden('update_config', 1);
html_print_table($t); html_print_table($t);
echo '</fieldset>'; echo '</fieldset>';
if (function_exists('quickShellSettings') === true) { if (function_exists('quickShellSettings') === true) {
quickShellSettings(); quickShellSettings();
} }
html_print_div( html_print_action_buttons(
[ html_print_submit_button(
'class' => 'action-buttons w100p', __('Update'),
'content' => html_print_submit_button( 'update_button',
__('Update'), false,
'update_button', [ 'icon' => 'update' ],
false, true
[ 'icon' => 'update' ], )
true
),
]
); );
echo '</form>'; echo '</form>';