From ddd55c1ae0592082e69142406666f9a921f9659c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Tue, 19 Sep 2017 01:28:01 +0200 Subject: [PATCH] added password edit forms & protection options, moved uart cfg to term conf page --- _debug_replacements.php | 1 + lang/en.php | 41 +++++++++++++--- pages/cfg_network.php | 8 ++-- pages/cfg_system.php | 93 +++++++++++++++++++++++-------------- pages/cfg_term.php | 77 +++++++++++++++++++++++++----- pages/cfg_wifi.php | 8 ++-- sass/form/_form_layout.scss | 1 + 7 files changed, 168 insertions(+), 61 deletions(-) diff --git a/_debug_replacements.php b/_debug_replacements.php index cead4c3..ad112b2 100644 --- a/_debug_replacements.php +++ b/_debug_replacements.php @@ -91,4 +91,5 @@ return [ 'uart_parity' => 2, 'theme' => 1, + 'pwlock' => 1, ]; diff --git a/lang/en.php b/lang/en.php index 9c57a65..d2f7991 100644 --- a/lang/en.php +++ b/lang/en.php @@ -156,20 +156,49 @@ return [ 'Restore to firmware default settings? This will reset ' . 'all active settings and switch to AP mode with the default SSID.', 'system.confirm_store_defaults' => - 'Enter admin password to confirm you want to store the current settings as defaults.', + 'Enter admin password to confirm you want to overwrite the default settings.', 'system.password' => 'Admin password:', - 'system.restore_defaults' => 'Reset active settings to defaults', + 'system.restore_defaults' => 'Reset to saved defaults', 'system.write_defaults' => 'Save active settings as defaults', 'system.restore_hard' => 'Reset active settings to firmware defaults', 'system.explain_persist' => ' - ESPTerm contains two persistent memory banks, one for default and - one for active settings. Active settings can be stored as defaults - by the administrator (password required). + ESPTerm saves all settings in Flash. The active settings can be copied to + the "defaults area" and restored later using the blue button below. ', 'system.uart' => 'Serial Port', 'system.explain_uart' => ' - This form controls the primary, communication UART. The debug UART is fixed at 115.200 baud, one stop-bit and no parity. + This form controls the primary, communication UART. The debug UART is fixed + at 115.200 baud, one stop-bit and no parity. ', + + 'system.security' => 'Access Restrictions', + 'system.explain_security' => ' + Some parts, or all of the web interface can be protected by a password prompt. + Leave the new password fields empty if you do not wish to change it. + ', + 'system.pwlock' => 'Protected pages', + 'system.pwlock.none' => 'None, all open', + 'system.pwlock.settings_noterm' => 'WiFi, Net & System settings', + 'system.pwlock.settings' => 'All settings pages', + 'system.pwlock.menus' => 'This entire menu section', + 'system.pwlock.all' => 'Everything, even terminal', + 'system.new_access_pw' => 'New password', + 'system.new_access_pw2' => 'New pass., repeat', + 'system.admin_pw' => 'Admin password', + + 'system.change_adminpw' => 'Change Admin Password', + 'system.explain_adminpw' => + ' + The "admin password" is used to manipulate the stored default settings + and to change access restrictions. This password is not saved as part + of the main config, i.e. using save / restore does not affect this + password. When the admin password is forgotten, the easiest way to + re-gain access is to wipe and re-flash the chip. + ', + 'system.new_admin_pw' => 'New admin pass.', + 'system.new_admin_pw2' => 'New pass., repeat', + 'system.old_admin_pw' => 'Old admin pass.', + 'uart.baud' => 'Baud rate', 'uart.parity' => 'Parity', 'uart.parity.none' => 'None', diff --git a/pages/cfg_network.php b/pages/cfg_network.php index 21fefc1..d9b602d 100644 --- a/pages/cfg_network.php +++ b/pages/cfg_network.php @@ -2,7 +2,7 @@ $ipmask='pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"'; ?> -
+

@@ -31,11 +31,11 @@ $ipmask='pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"';
- +
-
+

@@ -69,7 +69,7 @@ $ipmask='pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}$"';
- +
diff --git a/pages/cfg_system.php b/pages/cfg_system.php index d0287a3..4e8dd97 100644 --- a/pages/cfg_system.php +++ b/pages/cfg_system.php @@ -25,55 +25,78 @@ + -
-

+ +

+ + +
- +
- - + + + + + -  bps
- - + + >
- - + + > +
+ +
+ + +
+ +
+ +
+
+ +
+

+ + + + +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ +
- +
@@ -84,7 +107,5 @@ location.href = + '?pw=' + pw; } - $('#uart_baud').val(%uart_baud%); - $('#uart_parity').val(%uart_parity%); - $('#uart_stopbits').val(%uart_stopbits%); + $('#pwlock').val(%pwlock%); diff --git a/pages/cfg_term.php b/pages/cfg_term.php index faeb00d..5f6b819 100644 --- a/pages/cfg_term.php +++ b/pages/cfg_term.php @@ -2,7 +2,7 @@ -
+

@@ -86,7 +86,7 @@  
@@ -102,6 +102,12 @@ +
+ + +
+
  @@ -124,11 +130,62 @@
- + +
+
+ +
+

+ +
+ +
+ +
+ + +  bps +
+ +
+ + +
+ +
+ + +
+ +
+
-
+

@@ -180,12 +237,6 @@
-
- - -
-
@@ -199,7 +250,7 @@
- +
@@ -209,6 +260,10 @@ $('#cursor_shape').val(%cursor_shape%); $('#theme').val(%theme%); + $('#uart_baud').val(%uart_baud%); + $('#uart_parity').val(%uart_parity%); + $('#uart_stopbits').val(%uart_stopbits%); + function showColor() { var ex = qs('#color-example'); ex.dataset.fg = +$('#default_fg').val(); diff --git a/pages/cfg_wifi.php b/pages/cfg_wifi.php index 804f383..056c3e2 100644 --- a/pages/cfg_wifi.php +++ b/pages/cfg_wifi.php @@ -1,4 +1,4 @@ -
+

@@ -38,11 +38,11 @@
- +
-
+

@@ -85,7 +85,7 @@
- +
diff --git a/sass/form/_form_layout.scss b/sass/form/_form_layout.scss index 9afe4d7..d835bd1 100755 --- a/sass/form/_form_layout.scss +++ b/sass/form/_form_layout.scss @@ -21,6 +21,7 @@ form { @include naked(); } display: flex; flex-direction: row; align-items: center; + flex-wrap: wrap; &:first-child { margin-top: 0;