feat(risk): show live countdown on freeze status badges
Expose freeze_until_ms from risk API and tick hub/instance badges with remaining 1h/4h/daily time. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -529,6 +529,7 @@ STATIC_DIR = DIR / "static"
|
||||
_REPO_STATIC = _REPO_ROOT / "static"
|
||||
_AI_REVIEW_RENDER_JS = _REPO_STATIC / "ai_review_render.js"
|
||||
_ACCOUNT_RISK_BADGE_CSS = _REPO_STATIC / "account_risk_badge.css"
|
||||
_ACCOUNT_RISK_BADGE_JS = _REPO_STATIC / "account_risk_badge.js"
|
||||
|
||||
|
||||
@app.get("/assets/account_risk_badge.css")
|
||||
@@ -542,6 +543,17 @@ def hub_account_risk_badge_css():
|
||||
)
|
||||
|
||||
|
||||
@app.get("/assets/account_risk_badge.js")
|
||||
def hub_account_risk_badge_js():
|
||||
"""与四所实例共用仓库根 static/account_risk_badge.js。"""
|
||||
if not _ACCOUNT_RISK_BADGE_JS.is_file():
|
||||
raise HTTPException(status_code=404, detail="account_risk_badge.js not found")
|
||||
return FileResponse(
|
||||
str(_ACCOUNT_RISK_BADGE_JS),
|
||||
media_type="application/javascript; charset=utf-8",
|
||||
)
|
||||
|
||||
|
||||
@app.get("/assets/ai_review_render.js")
|
||||
def hub_ai_review_render_js():
|
||||
"""与四所实例共用仓库根 static/ai_review_render.js(须在 /assets mount 之前注册)。"""
|
||||
|
||||
Reference in New Issue
Block a user