mirror of
https://github.com/myronblair/kino-app
synced 2026-07-29 14:02:50 -05:00
Add admin-only service status panel with restart, wired to Docker directly
This commit is contained in:
@@ -32,6 +32,7 @@ from seed import SAMPLE_MOVIES
|
||||
import tmdb as tmdb_client
|
||||
import radarr as radarr_client
|
||||
import sonarr as sonarr_client
|
||||
import services as services_client
|
||||
import trakt as trakt_client
|
||||
import opensubtitles as opensubs_client
|
||||
from transcode import transcode_quick, transcode_abr, srt_to_vtt
|
||||
@@ -1495,6 +1496,20 @@ async def _auto_fetch_subtitle(content_type: str, content_id: str, tmdb_id: Opti
|
||||
logger.info(f"Auto-attached subtitle for {content_type} {content_id[:8]}")
|
||||
|
||||
|
||||
# ============ SERVICES (admin) ============
|
||||
@api.get("/services")
|
||||
async def services_status(user: dict = Depends(require_admin)):
|
||||
return await asyncio.to_thread(services_client.list_service_status)
|
||||
|
||||
|
||||
@api.post("/services/{key}/restart")
|
||||
async def services_restart(key: str, user: dict = Depends(require_admin)):
|
||||
ok = await asyncio.to_thread(services_client.restart_service, key)
|
||||
if not ok:
|
||||
raise HTTPException(status_code=404, detail="Unknown service")
|
||||
return {"ok": True}
|
||||
|
||||
|
||||
# ============ HEALTH ============
|
||||
@api.get("/")
|
||||
async def root():
|
||||
|
||||
Reference in New Issue
Block a user