diff options
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/ui/app.py')
| -rw-r--r-- | packages/meshbay-node/src/meshbay_node/ui/app.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/ui/app.py b/packages/meshbay-node/src/meshbay_node/ui/app.py index d5b3f94..18764e8 100644 --- a/packages/meshbay-node/src/meshbay_node/ui/app.py +++ b/packages/meshbay-node/src/meshbay_node/ui/app.py @@ -20,7 +20,7 @@ import time from html import escape from pathlib import Path -from fastapi import FastAPI, WebSocket, WebSocketDisconnect, Query +from fastapi import FastAPI, HTTPException, WebSocket, WebSocketDisconnect, Query from fastapi.responses import HTMLResponse, JSONResponse from meshbay_node import __version__ @@ -361,6 +361,20 @@ def create_ui_app(state: dict) -> FastAPI: state, group_id, bool(payload.get("allowed", False)), )) + # ── Enabled apps (operator only, localhost) ──────────────────────────── + # + # Same loopback shape as member-upload: the Create Group wizard sets this + # once, right after creating the group and before the (potentially long) + # initial scan, so an operator narrowing this down to just Files+Videos + # never briefly has Chat live for other members to notice. + + @app.put("/api/groups/{group_id}/apps") + async def set_enabled_apps(group_id: str, payload: dict): + apps = payload.get("apps") + if not isinstance(apps, list) or not apps: + raise HTTPException(400, "apps must be a non-empty list") + return await _op(lambda: ops.set_enabled_apps(state, group_id, apps)) + # ── Scan settings (operator only, localhost) ────────────────────────── @app.put("/api/groups/{group_id}/scan-settings") |