返回仪表盘趋势图数据。
(request: Request)
| 235 | dependencies=[Depends(require_auth)], |
| 236 | ) |
| 237 | async def get_dashboard_usage_trend(request: Request): |
| 238 | """返回仪表盘趋势图数据。""" |
| 239 | trend_window = normalize_trend_window( |
| 240 | request.query_params.get("window") |
| 241 | ) |
| 242 | dao = get_request_log_dao() |
| 243 | trend_points = await dao.get_provider_usage_trend( |
| 244 | DEFAULT_TOKEN_NAMESPACE, |
| 245 | window=trend_window, |
| 246 | ) |
| 247 | return JSONResponse( |
| 248 | { |
| 249 | "window": trend_window, |
| 250 | "points": trend_points, |
| 251 | } |
| 252 | ) |
| 253 | |
| 254 | |
| 255 | def _validate_directory_path(source_dir: str) -> str: |
nothing calls this directly
no test coverage detected