Frontend created and rewritten a few times, with some backend fixes #1

Merged
leo merged 110 commits from plaintable into main 2023-11-08 20:38:40 +00:00
2 changed files with 5 additions and 2 deletions
Showing only changes of commit a26dc42d88 - Show all commits

View File

@ -6,7 +6,7 @@ from sanic import Blueprint
from cista import watching from cista import watching
from cista.fileio import FileServer from cista.fileio import FileServer
from cista.protocol import ControlBase, FileRange, StatusMsg from cista.protocol import ControlTypes, FileRange, StatusMsg
from cista.util.apphelpers import asend, websocket_wrapper from cista.util.apphelpers import asend, websocket_wrapper
bp = Blueprint("api", url_prefix="/api") bp = Blueprint("api", url_prefix="/api")
@ -76,7 +76,7 @@ async def download(req, ws):
@bp.websocket("control") @bp.websocket("control")
@websocket_wrapper @websocket_wrapper
async def control(req, ws): async def control(req, ws):
cmd = msgspec.json.decode(await ws.recv(), type=ControlBase) cmd = msgspec.json.decode(await ws.recv(), type=ControlTypes)
await asyncio.to_thread(cmd) await asyncio.to_thread(cmd)
await asend(ws, StatusMsg(status="ack", req=cmd)) await asend(ws, StatusMsg(status="ack", req=cmd))

View File

@ -78,6 +78,9 @@ class Cp(ControlBase):
) )
ControlTypes = MkDir | Rename | Rm | Mv | Cp
## File uploads and downloads ## File uploads and downloads