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 json
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
@@ -368,8 +368,11 @@ async def ws_terminal(websocket: WebSocket):
|
|||||||
async def ws_to_ssh():
|
async def ws_to_ssh():
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
data = await websocket.receive_bytes()
|
msg = await websocket.receive()
|
||||||
channel.send(data)
|
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:
|
except WebSocketDisconnect:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user