Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions backend/app/api/v1/stats_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

不走 DuckDB —— job_execution_logs 在 OLTP DB(PG/SQLite),
和 stats.py 的 DuckDB 分析路径独立。复用 json_cache 做轻量缓存。

2026-10-19(#121):admin-only。流水线健康是运维信息,消费端已迁至
管理后台 /admin/jobs(前端迁移见同 issue);此前挂在用户侧 /stats/jobs
只是历史摆位,用户侧并无入口。router 级守卫与 users.py 同模式。
"""

from __future__ import annotations
Expand All @@ -12,7 +16,7 @@
from fastapi import APIRouter, Depends, Query
from fastapi.responses import Response

from app.api.v1.auth import get_current_user
from app.api.v1.auth import get_current_admin_user
from app.core.config import settings
from app.core.database import async_session
from app.repositories.job_execution_log_repo import JobExecutionLogRepository
Expand All @@ -21,7 +25,7 @@
router = APIRouter(
prefix="/stats/jobs",
tags=["stats"],
dependencies=[Depends(get_current_user)],
dependencies=[Depends(get_current_admin_user)],
)


Expand Down
17 changes: 17 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"next": "^16.3.8",
"react": "19.2.4",
"react-dom": "19.2.4",
"sonner": "^2.0.8",
"zustand": "^5.0.14"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion frontend/scripts/check-navigation-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ for (const pathName of ['/daily', '/weekly', '/monthly', '/stats', '/my-topics',
assert.strictEqual(canAccessPath(pathName, user, enabledFeatures), true, `${pathName} should allow user`);
}

for (const pathName of ['/admin', '/admin/sources', '/admin/model-eval', '/admin/contents', '/admin/mother-topics']) {
for (const pathName of ['/admin', '/admin/sources', '/admin/model-eval', '/admin/contents', '/admin/mother-topics', '/admin/jobs']) {
assert(ADMIN_ONLY_PATHS.includes(pathName), `ADMIN_ONLY_PATHS should include ${pathName}`);
assert.strictEqual(requiredAccessForPath(pathName), 'admin');
assert.strictEqual(canAccessPath(pathName, null), false, `${pathName} should require admin login`);
Expand Down
Loading
Loading