webssh2_client 0.2.20 → 0.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -78,16 +78,6 @@ window.webssh2Config = {
78
78
  sshTerm: 'xterm-color', // Terminal type
79
79
  readyTimeout: 20000, // SSH connection timeout (ms)
80
80
  },
81
- terminal: {
82
- cursorBlink: true, // Whether the cursor should blink
83
- scrollback: 10000, // Number of rows to keep in scrollback
84
- tabStopWidth: 8, // Tab width
85
- bellStyle: 'sound', // Terminal bell style ('sound' or 'none')
86
- fontSize: 14, // Font size in pixels
87
- fontFamily: 'courier-new, courier, monospace', // Font family
88
- letterSpacing: 0, // Letter spacing
89
- lineHeight: 1, // Line height
90
- },
91
81
  header: {
92
82
  text: null, // Custom header text
93
83
  background: 'green', // Header background color
@@ -131,18 +121,7 @@ When `autoConnect` is not used, ensure your server is configured to prompt for o
131
121
 
132
122
  ### Customization Examples
133
123
 
134
- 1. Changing terminal appearance:
135
- ```javascript
136
- window.webssh2Config = {
137
- terminal: {
138
- fontSize: 16,
139
- fontFamily: 'Fira Code, monospace',
140
- cursorBlink: false
141
- }
142
- };
143
- ```
144
-
145
- 2. Setting a custom header:
124
+ 1. Setting a custom header:
146
125
  ```javascript
147
126
  window.webssh2Config = {
148
127
  header: {
@@ -152,7 +131,7 @@ When `autoConnect` is not used, ensure your server is configured to prompt for o
152
131
  };
153
132
  ```
154
133
 
155
- 3. Configuring for a specific SSH server with auto-connect:
134
+ 2. Configuring for a specific SSH server with auto-connect:
156
135
  ```javascript
157
136
  window.webssh2Config = {
158
137
  ssh: {
@@ -251,40 +230,6 @@ The WebSSH2 client supports various URL parameters to customize the SSH connecti
251
230
  - `password`: The password for SSH authentication (not recommended for production use).
252
231
  - Example: `?password=secretpassword`
253
232
 
254
- ### Terminal Configuration
255
-
256
- - `sshTerm`: The terminal type to request (default is "xterm-color").
257
- - Example: `?sshTerm=xterm-256color`
258
-
259
- - `readyTimeout`: The timeout (in milliseconds) for the SSH handshake (default is 20000).
260
- - Example: `?readyTimeout=30000`
261
-
262
- - `cursorBlink`: Whether the cursor should blink (true/false).
263
- - Example: `?cursorBlink=true`
264
-
265
- - `scrollback`: The number of lines to keep in the scrollback buffer (default is 10000).
266
- - Example: `?scrollback=5000`
267
-
268
- - `tabStopWidth`: The width of tab stops (default is 8).
269
- - Example: `?tabStopWidth=4`
270
-
271
- - `bellStyle`: The style of the terminal bell ("sound" or "none", default is "sound").
272
- - Example: `?bellStyle=none`
273
-
274
- ### Display Options
275
-
276
- - `fontSize`: The font size for the terminal (in pixels).
277
- - Example: `?fontSize=14`
278
-
279
- - `fontFamily`: The font family to use for the terminal.
280
- - Example: `?fontFamily=Consolas,Monaco,Lucida%20Console,Liberation%20Mono,DejaVu%20Sans%20Mono,Bitstream%20Vera%20Sans%20Mono,Courier%20New,monospace`
281
-
282
- - `letterSpacing`: The letter spacing for the terminal font.
283
- - Example: `?letterSpacing=1`
284
-
285
- - `lineHeight`: The line height for the terminal.
286
- - Example: `?lineHeight=1.2`
287
-
288
233
  ### UI Customization
289
234
 
290
235
  - `header`: Custom text to display in the header.
@@ -310,6 +255,68 @@ This URL would connect to a SSH server at 192.168.1.100 on port 2222, with a red
310
255
 
311
256
  Note: Be cautious about including sensitive information like passwords in URL parameters, especially in production environments.
312
257
 
258
+ ## Terminal Configuration
259
+
260
+ WebSSH2 Client allows users to customize their terminal experience through a set of configurable options. These settings are stored in the browser's localStorage under the key `webssh2.settings.global`, ensuring your preferences persist across sessions.
261
+
262
+ ### Accessing Terminal Settings
263
+
264
+ You can access the terminal configuration in two ways:
265
+
266
+ 1. **From an Active Session:**
267
+ - Click on the menu icon (☰) in the bottom-left corner of the terminal.
268
+ - Select "Settings" from the dropdown menu.
269
+
270
+ 2. **During Login:**
271
+ - In the login dialog, click on the gear icon (⚙️) next to the "Connect" button.
272
+
273
+ ### Available Settings
274
+
275
+ The terminal settings dialog offers the following customization options:
276
+
277
+ 1. **Font Size**
278
+ - Range: 8-72 pixels
279
+ - Adjusts the size of the text in the terminal.
280
+
281
+ 2. **Font Family**
282
+ - Specifies the font used in the terminal.
283
+ - Example: "Courier New, monospace"
284
+
285
+ 3. **Cursor Blink**
286
+ - Options: On / Off
287
+ - Determines whether the cursor blinks in the terminal.
288
+
289
+ 4. **Scrollback**
290
+ - Range: 1-200000 lines
291
+ - Sets the number of lines kept in the terminal's scrollback buffer.
292
+
293
+ 5. **Tab Stop Width**
294
+ - Range: 1-100 spaces
295
+ - Defines the width of tab stops in the terminal.
296
+
297
+ 6. **Bell Style**
298
+ - Options: Sound / None
299
+ - Configures the audible bell behavior in the terminal.
300
+
301
+ ### Applying Settings
302
+
303
+ After adjusting your preferences:
304
+
305
+ 1. Click "Save" to apply the new settings.
306
+ 2. The changes will take effect immediately for the current session and all future sessions.
307
+ 3. Click "Cancel" to close the dialog without saving changes.
308
+
309
+ ### Resetting to Defaults
310
+
311
+ To reset all settings to their default values:
312
+
313
+ 1. Clear your browser's localStorage for the WebSSH2 Client site.
314
+ 2. Refresh the page.
315
+
316
+ ### Note on Persistence
317
+
318
+ These settings are stored locally in your browser. If you use WebSSH2 Client on a different device or browser, you'll need to reconfigure your preferences.
319
+
313
320
  ## Debugging
314
321
 
315
322
  This project uses the `debug` module for logging. To enable debugging in the browser:
package/client/index.js CHANGED
@@ -1,5 +1,5 @@
1
- // webssh2-client
2
- // /client/index.js
1
+ // client
2
+ // client/index.js
3
3
  const path = require('path');
4
4
 
5
5
  module.exports = {
@@ -1,4 +1,4 @@
1
- <!-- Version Version 0.2.20 - 2024-08-18T12:58:07.614Z - 284a3fb -->
1
+ <!-- Version Version 0.2.21 - 2024-08-19T10:59:07.452Z - 134b4fb -->
2
2
  <!-- webssh2-client -->
3
3
  <!-- /client/src/client.htm -->
4
4
  <!DOCTYPE html>
@@ -38,10 +38,10 @@
38
38
  <p id="errorMessage"></p>
39
39
  </div>
40
40
  </dialog>
41
- <dialog id="terminalOptionsDialog" class="modal">
41
+ <dialog id="terminalSettingsDialog" class="modal">
42
42
  <div class="modal-content">
43
- <h2>Terminal Options</h2>
44
- <form id="terminalOptionsForm" class="pure-form pure-form-stacked">
43
+ <h2>Terminal Settings</h2>
44
+ <form id="terminalSettingsForm" class="pure-form pure-form-stacked">
45
45
  <fieldset>
46
46
  <label for="fontSize">Font Size</label>
47
47
  <input type="number" id="fontSize" name="fontSize" min="8" max="72" required>
@@ -68,7 +68,7 @@
68
68
  </select>
69
69
 
70
70
  <button type="submit" class="pure-button pure-button-primary">Save</button>
71
- <button type="button" id="closeTerminalOptionsBtn" class="pure-button">Cancel</button>
71
+ <button type="button" id="closeterminalSettingsBtn" class="pure-button">Cancel</button>
72
72
  </fieldset>
73
73
  </form>
74
74
  </div>
@@ -88,7 +88,7 @@
88
88
  <button id="downloadLogBtn" class="menu-button"><i class="fas fa-download fa-fw"></i> Download Log</button>
89
89
  <button id="replayCredentialsBtn" class="menu-button"><i class="fas fa-key fa-fw"></i> Credentials</button>
90
90
  <button id="reauthBtn" class="menu-button"><i class="fas fa-key fa-fw"></i> Switch User</button>
91
- <button id="terminalOptionsBtn" class="menu-button"><i class="fas fa-cog fa-fw"></i> Settings</button>
91
+ <button id="terminalSettingsBtn" class="menu-button"><i class="fas fa-cog fa-fw"></i> Settings</button>
92
92
  </div>
93
93
  </div>
94
94
  <div id="footer"></div>