Add Resos connection status card to Settings — read-only, sourced from central Settings

Replaces the removed API key form with a status card showing whether the
Resos key is configured in the central Settings app, plus a Test Connection
button. Adds back the GET /settings/resos and POST /settings/resos/test
endpoints (now reading from central_settings rather than system_config).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-13 15:02:42 +00:00
parent 3650c92175
commit 1aa52c563e
2 changed files with 101 additions and 1 deletions

View file

@ -137,6 +137,25 @@ async def test_newbook_settings(
return await _test_newbook(db)
# ============================================
# RESOS SETTINGS ENDPOINTS
# ============================================
@router.get("/settings/resos")
async def get_resos_settings(current_user: dict = Depends(get_current_user)):
"""Check whether a Resos API key is configured in the central Settings service"""
from services.central_settings import get_resos_credentials
creds = await get_resos_credentials()
return {"configured": bool(creds and creds.get("api_key"))}
@router.post("/settings/resos/test")
async def test_resos_settings(
db: AsyncSession = Depends(get_db),
current_user: dict = Depends(get_current_user)
):
"""Test Resos connection using credentials from the central Settings service"""
return await _test_resos(db)
# ============================================