MCPcopy Create free account
hub / github.com/ZyphrZero/z.ai2api_python / dashboard

Function dashboard

app/admin/routes.py:31–46  ·  view source on GitHub ↗

仪表盘首页

(request: Request)

Source from the content-addressed store, hash-verified

29
30@router.get("/", response_class=HTMLResponse, dependencies=[Depends(require_auth)])
31async def dashboard(request: Request):
32 """仪表盘首页"""
33 stats = await collect_admin_stats(
34 DEFAULT_TOKEN_NAMESPACE,
35 trend_window=DEFAULT_TREND_WINDOW,
36 )
37 stats["uptime"] = get_process_uptime()
38
39 context = {
40 "request": request,
41 "stats": stats,
42 "current_time": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
43 "trend_windows": TREND_WINDOW_OPTIONS,
44 }
45
46 return templates.TemplateResponse("index.html", context)
47
48
49@router.get(

Callers

nothing calls this directly

Calls 2

collect_admin_statsFunction · 0.90
get_process_uptimeFunction · 0.90

Tested by

no test coverage detected