From 8ea2b9c7d29181db4b2a9cfe36a82c27e0e1d061 Mon Sep 17 00:00:00 2001 From: wangwei Date: Wed, 17 Jun 2026 11:09:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20add=20API=E6=96=87=E6=A1=A3=20nav=20ite?= =?UTF-8?q?m=20with=20embedded=20Swagger=20UI=20iframe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/static/css/app.css | 9 ++++++++- webapp/static/index.html | 14 ++++++++++++++ webapp/static/js/app.js | 4 ++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/webapp/static/css/app.css b/webapp/static/css/app.css index 078d148..0b1a7ca 100644 --- a/webapp/static/css/app.css +++ b/webapp/static/css/app.css @@ -308,7 +308,14 @@ table.group-table td { border-bottom: 1px solid #f1f5f9; font-variant-numeric: t .llm-role-label { font-size: 13px; font-weight: 600; min-width: 180px; color: var(--ink); } .llm-role-select { min-width: 240px; } -/* ---------- 报告导出按钮 ---------- */ +/* ---------- API 文档 iframe ---------- */ +#view-apidocs { padding: 0; display: flex; flex-direction: column; flex: 1; } +.apidocs-frame { + flex: 1; + width: 100%; + height: calc(100vh - 64px); /* 64px = topbar 高度 */ + border: none; +} .report-actions { display: flex; justify-content: flex-end; margin: 0 0 12px; } diff --git a/webapp/static/index.html b/webapp/static/index.html index ac11520..67defaf 100644 --- a/webapp/static/index.html +++ b/webapp/static/index.html @@ -28,6 +28,9 @@ + + + + diff --git a/webapp/static/js/app.js b/webapp/static/js/app.js index 485c920..a127244 100644 --- a/webapp/static/js/app.js +++ b/webapp/static/js/app.js @@ -5,8 +5,8 @@ const App = { currentRunId: null, activeView: null, - views: ["runs", "new", "report", "profiles"], - titles: { runs: "运行列表", new: "新建评估", report: "报告详情", profiles: "LLM 配置" }, + views: ["runs", "new", "report", "profiles", "apidocs"], + titles: { runs: "运行列表", new: "新建评估", report: "报告详情", profiles: "LLM 配置", apidocs: "API 文档" }, // 初始化:绑定导航、从 URL/sessionStorage 恢复上次位置、启动健康检查。 init() {