fix: handle text+bytes in terminal WS; mkdir -p before SFTP upload; robust conda path detection
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import asyncio
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
import tempfile
|
||||
@@ -368,8 +368,11 @@ async def ws_terminal(websocket: WebSocket):
|
||||
async def ws_to_ssh():
|
||||
try:
|
||||
while True:
|
||||
data = await websocket.receive_bytes()
|
||||
channel.send(data)
|
||||
msg = await websocket.receive()
|
||||
if "bytes" in msg and msg["bytes"]:
|
||||
channel.send(msg["bytes"])
|
||||
elif "text" in msg and msg["text"]:
|
||||
channel.send(msg["text"].encode())
|
||||
except WebSocketDisconnect:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user