fix: verwijder dode Flask-stijl legacy route in app_system.py
De route @router.post("/api/<action>/<unit>") gebruikte Flask-syntaxis
die nooit matcht in FastAPI. Dead code verwijderd.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -95,15 +95,6 @@ def init_system_router(session, podman_api_base: str, workloads_dir: str) -> API
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
@router.post("/api/<action>/<unit>")
|
||||
def legacy_api_action(action: str, unit: str):
|
||||
# legacy flask-like path; keep behavior (even if not used by index.html)
|
||||
if action not in ("status", "start", "stop", "restart"):
|
||||
return {"error": "Invalid action"}, 400
|
||||
cmd = ["systemctl", "--user", action, unit]
|
||||
code, out = _run_systemctl_action(action, unit)
|
||||
return {"cmd": " ".join(cmd), "exit": code, "output": out}
|
||||
|
||||
@router.post("/{action}/{unit}")
|
||||
def api_action(action: str, unit: str):
|
||||
if action not in ("status", "start", "stop", "restart"):
|
||||
|
||||
Reference in New Issue
Block a user