feat: add API文档 nav item with embedded Swagger UI iframe
This commit is contained in:
@@ -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-label { font-size: 13px; font-weight: 600; min-width: 180px; color: var(--ink); }
|
||||||
.llm-role-select { min-width: 240px; }
|
.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 {
|
.report-actions {
|
||||||
display: flex; justify-content: flex-end; margin: 0 0 12px;
|
display: flex; justify-content: flex-end; margin: 0 0 12px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
<button class="nav-item" data-view="profiles">
|
<button class="nav-item" data-view="profiles">
|
||||||
<span class="nav-ico">⚙</span><span>LLM 配置</span>
|
<span class="nav-ico">⚙</span><span>LLM 配置</span>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="nav-item" data-view="apidocs">
|
||||||
|
<span class="nav-ico">⎔</span><span>API 文档</span>
|
||||||
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="sidebar-foot">
|
<div class="sidebar-foot">
|
||||||
<span class="dot" id="health-dot"></span>
|
<span class="dot" id="health-dot"></span>
|
||||||
@@ -212,6 +215,17 @@
|
|||||||
<p class="muted">点击「新建配置」添加第一个。</p>
|
<p class="muted">点击「新建配置」添加第一个。</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- API 文档视图 -->
|
||||||
|
<section class="view" id="view-apidocs" hidden>
|
||||||
|
<iframe
|
||||||
|
id="apidocs-frame"
|
||||||
|
src="/docs"
|
||||||
|
class="apidocs-frame"
|
||||||
|
title="API 文档"
|
||||||
|
allowfullscreen>
|
||||||
|
</iframe>
|
||||||
|
</section>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
const App = {
|
const App = {
|
||||||
currentRunId: null,
|
currentRunId: null,
|
||||||
activeView: null,
|
activeView: null,
|
||||||
views: ["runs", "new", "report", "profiles"],
|
views: ["runs", "new", "report", "profiles", "apidocs"],
|
||||||
titles: { runs: "运行列表", new: "新建评估", report: "报告详情", profiles: "LLM 配置" },
|
titles: { runs: "运行列表", new: "新建评估", report: "报告详情", profiles: "LLM 配置", apidocs: "API 文档" },
|
||||||
|
|
||||||
// 初始化:绑定导航、从 URL/sessionStorage 恢复上次位置、启动健康检查。
|
// 初始化:绑定导航、从 URL/sessionStorage 恢复上次位置、启动健康检查。
|
||||||
init() {
|
init() {
|
||||||
|
|||||||
Reference in New Issue
Block a user