Nano and timeout error fix #7 (plus css changes for hide buttons)
This commit is contained in:
@@ -59,8 +59,23 @@ wss.on('connection', (ws) => {
|
|||||||
|
|
||||||
// Forward user input and resize events to the SSH stream
|
// Forward user input and resize events to the SSH stream
|
||||||
ws.on('message', (message) => {
|
ws.on('message', (message) => {
|
||||||
console.log('User Input:', message);
|
let data;
|
||||||
stream.write(message);
|
|
||||||
|
// Try parsing the message as JSON
|
||||||
|
try {
|
||||||
|
data = JSON.parse(message);
|
||||||
|
} catch (err) {
|
||||||
|
// If it's not JSON, it's likely user input. Forward it to the SSH stream.
|
||||||
|
console.log('User Input:', message);
|
||||||
|
stream.write(message);
|
||||||
|
return; // Exit early since it's user input
|
||||||
|
}
|
||||||
|
|
||||||
|
// If it's a resize event, handle it
|
||||||
|
if (data.type === 'resize' && data.rows && data.cols) {
|
||||||
|
console.log('Resize event received:', data);
|
||||||
|
stream.setWindow(data.rows, data.cols, data.height, data.width);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
.hide-sidebar-button {
|
.hide-sidebar-button {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
right: 10px;
|
right: 13px;
|
||||||
background-color: rgb(108, 108, 108);
|
background-color: rgb(108, 108, 108);
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
|
|||||||
Reference in New Issue
Block a user