feat: restore API文档 nav item (iframe /docs) without touching other 4 modules

This commit is contained in:
2026-06-17 11:24:16 +08:00
parent e8af5b906c
commit 9ad2daff73
3 changed files with 25 additions and 2 deletions

View File

@@ -308,6 +308,15 @@ 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);
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;
} }

View File

@@ -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>

View File

@@ -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() {