Merge pull request #39 from ZhangNguyen
Browse filesDetach admin and ingest APIs from UI and public router
- src/app/api/router.py +0 -4
- src/app/statistic/index.html +1 -43
src/app/api/router.py
CHANGED
|
@@ -2,13 +2,9 @@ from __future__ import annotations
|
|
| 2 |
|
| 3 |
from fastapi import APIRouter
|
| 4 |
|
| 5 |
-
from src.app.api.admin import router as admin_router
|
| 6 |
from src.app.api.benchmark import router as benchmark_router
|
| 7 |
from src.app.api.chat import router as chat_router
|
| 8 |
-
from src.app.api.ingest import router as ingest_router
|
| 9 |
|
| 10 |
api_router = APIRouter()
|
| 11 |
-
api_router.include_router(admin_router)
|
| 12 |
api_router.include_router(benchmark_router)
|
| 13 |
api_router.include_router(chat_router)
|
| 14 |
-
api_router.include_router(ingest_router)
|
|
|
|
| 2 |
|
| 3 |
from fastapi import APIRouter
|
| 4 |
|
|
|
|
| 5 |
from src.app.api.benchmark import router as benchmark_router
|
| 6 |
from src.app.api.chat import router as chat_router
|
|
|
|
| 7 |
|
| 8 |
api_router = APIRouter()
|
|
|
|
| 9 |
api_router.include_router(benchmark_router)
|
| 10 |
api_router.include_router(chat_router)
|
|
|
src/app/statistic/index.html
CHANGED
|
@@ -124,23 +124,7 @@
|
|
| 124 |
<button class="ghost" onclick="backToLanding()">← Quay lại chọn vai trò</button>
|
| 125 |
</div>
|
| 126 |
</div>
|
| 127 |
-
<p class="subtitle">
|
| 128 |
-
</div>
|
| 129 |
-
|
| 130 |
-
<div class="grid grid-2">
|
| 131 |
-
<div class="card">
|
| 132 |
-
<h3>Runtime / Graph</h3>
|
| 133 |
-
<button onclick="adminStatus()">/api/admin/status</button>
|
| 134 |
-
<button class="success" onclick="adminReloadGraph()">/api/admin/reload-graph</button>
|
| 135 |
-
<button onclick="adminSaveSnapshot()">/api/admin/save-snapshot</button>
|
| 136 |
-
<button onclick="adminVersioning()">/api/admin/versioning</button>
|
| 137 |
-
</div>
|
| 138 |
-
|
| 139 |
-
<div class="card">
|
| 140 |
-
<h3>Ingest</h3>
|
| 141 |
-
<button onclick="ingestReindex()">/api/ingest/reindex</button>
|
| 142 |
-
<button class="success" onclick="ingestRebuildAll()">/api/ingest/rebuild-all</button>
|
| 143 |
-
</div>
|
| 144 |
</div>
|
| 145 |
|
| 146 |
<div class="card">
|
|
@@ -239,32 +223,6 @@
|
|
| 239 |
printAdmin(data);
|
| 240 |
}
|
| 241 |
|
| 242 |
-
async function adminStatus() {
|
| 243 |
-
const res = await fetch('/api/admin/status');
|
| 244 |
-
printAdmin(await res.json());
|
| 245 |
-
}
|
| 246 |
-
|
| 247 |
-
async function adminReloadGraph() {
|
| 248 |
-
printAdmin(await postJson('/api/admin/reload-graph', {}));
|
| 249 |
-
}
|
| 250 |
-
|
| 251 |
-
async function adminVersioning() {
|
| 252 |
-
const res = await fetch('/api/admin/versioning?limit=20');
|
| 253 |
-
printAdmin(await res.json());
|
| 254 |
-
}
|
| 255 |
-
|
| 256 |
-
async function adminSaveSnapshot() {
|
| 257 |
-
printAdmin(await postJson('/api/admin/save-snapshot', {}));
|
| 258 |
-
}
|
| 259 |
-
|
| 260 |
-
async function ingestReindex() {
|
| 261 |
-
printAdmin(await postJson('/api/ingest/reindex', {}));
|
| 262 |
-
}
|
| 263 |
-
|
| 264 |
-
async function ingestRebuildAll() {
|
| 265 |
-
printAdmin(await postJson('/api/ingest/rebuild-all', {}));
|
| 266 |
-
}
|
| 267 |
-
|
| 268 |
async function runBenchmark() {
|
| 269 |
const question = document.getElementById('benchQuestion').value.trim();
|
| 270 |
const answer = document.getElementById('benchAnswer').value.trim();
|
|
|
|
| 124 |
<button class="ghost" onclick="backToLanding()">← Quay lại chọn vai trò</button>
|
| 125 |
</div>
|
| 126 |
</div>
|
| 127 |
+
<p class="subtitle">Admin dùng chat debug và benchmark để kiểm thử chất lượng phản hồi.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
</div>
|
| 129 |
|
| 130 |
<div class="card">
|
|
|
|
| 223 |
printAdmin(data);
|
| 224 |
}
|
| 225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
async function runBenchmark() {
|
| 227 |
const question = document.getElementById('benchQuestion').value.trim();
|
| 228 |
const answer = document.getElementById('benchAnswer').value.trim();
|