2026-09-02 20:18:58 +08:00

200 lines
8.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="Enterprise Knowledge Platform Demo 管理控制台"
/>
<title>Enterprise Knowledge Platform</title>
<link rel="stylesheet" href="/admin/assets/styles.css" />
<script type="module" src="/admin/assets/app.js"></script>
</head>
<body>
<div class="app-shell">
<aside class="sidebar" aria-label="管理控制台导航">
<a class="brand" href="/admin/upload" aria-label="Enterprise Knowledge Platform 首页">
<svg class="brand-mark" viewBox="0 0 48 36" aria-hidden="true">
<path d="M15 3h17a15 15 0 0 1 0 30H15v-9h17a6 6 0 0 0 0-12H15z" />
<circle cx="11" cy="18" r="8" />
</svg>
<span>
<strong>地瓜机器人</strong>
<small>Knowledge Platform</small>
</span>
</a>
<div class="workspace-label">
<span>CONTROL DESK</span>
<strong>企业知识运营台</strong>
</div>
<nav class="primary-nav">
<a data-nav="upload" href="/admin/upload">
<span aria-hidden="true">01</span>上传文档
</a>
<a data-nav="documents" href="/admin/documents">
<span aria-hidden="true">02</span>文档列表
</a>
<a data-nav="search" href="/admin/search">
<span aria-hidden="true">03</span>Search Lab
</a>
</nav>
<div class="sidebar-foot">
<span class="environment-dot" aria-hidden="true"></span>
DEMO ENVIRONMENT
</div>
</aside>
<main class="workspace">
<header class="topbar">
<div>
<p class="eyebrow">KNOWLEDGE OPERATIONS</p>
<h1 id="page-title">上传文档</h1>
</div>
<div class="topbar-actions">
<span class="system-state"><i aria-hidden="true"></i>API FIRST · V1</span>
<a class="api-link" href="/api/v1/docs" target="_blank" rel="noreferrer">
API 文档 <span aria-hidden="true">↗</span>
</a>
</div>
</header>
<div class="signal-line" aria-hidden="true"><span></span><span></span><span></span></div>
<div id="notice" class="notice" role="status" aria-live="polite" hidden></div>
<section id="upload-page" class="page" data-page="upload" aria-labelledby="page-title">
<div class="page-heading">
<div>
<p class="section-label">01 / INGESTION</p>
<h2>让知识进入检索链路</h2>
<p>上传一个 PDF、DOCX、TXT 或 Markdown 文件,系统将在后台完成解析、切分与索引。</p>
</div>
</div>
<form id="upload-form" class="upload-panel">
<label id="drop-zone" class="drop-zone" for="file-input">
<input
id="file-input"
name="file"
type="file"
accept=".pdf,.docx,.txt,.md,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,text/plain,text/markdown"
required
/>
<span class="upload-icon" aria-hidden="true">↑</span>
<strong>选择知识文件</strong>
<span>支持 PDF、DOCX、TXT、Markdown · 单次一个文件</span>
<span id="selected-file" class="selected-file">尚未选择文件</span>
</label>
<button id="upload-button" class="primary-button" type="submit">上传并处理</button>
</form>
<article id="upload-result" class="result-card" hidden>
<div>
<p class="section-label">LATEST SIGNAL</p>
<h3 id="upload-filename"></h3>
</div>
<span id="upload-status" class="status-pill"></span>
<dl class="metadata-grid">
<div><dt>文件类型</dt><dd id="upload-type"></dd></div>
<div><dt>文件大小</dt><dd id="upload-size"></dd></div>
<div><dt>上传时间</dt><dd id="upload-time"></dd></div>
</dl>
<a class="text-link" href="/admin/search">前往 Search Lab 检索 <span>→</span></a>
</article>
</section>
<section id="documents-page" class="page" data-page="documents" aria-labelledby="page-title" hidden>
<div class="page-heading heading-row">
<div>
<p class="section-label">02 / DOCUMENTS</p>
<h2>文档列表</h2>
<p>查看知识文档的状态、元数据并管理 Demo 数据。</p>
</div>
<button id="refresh-documents" class="secondary-button" type="button">刷新列表</button>
</div>
<div class="table-card">
<div class="table-meta">
<span id="document-count">0 个文档</span>
<span id="document-refresh-time">尚未加载</span>
</div>
<div class="table-scroll">
<table>
<thead>
<tr>
<th>文件名</th>
<th>类型</th>
<th>上传时间</th>
<th>状态</th>
<th aria-label="操作"></th>
</tr>
</thead>
<tbody id="document-rows"></tbody>
</table>
</div>
<div id="document-empty" class="empty-state" hidden>
<strong>还没有文档</strong>
<span>上传第一个文件后,它会出现在这里。</span>
<a class="primary-button compact" href="/admin/upload">上传文档</a>
</div>
</div>
</section>
<section id="search-page" class="page" data-page="search" aria-labelledby="page-title" hidden>
<div class="page-heading">
<div>
<p class="section-label">03 / RETRIEVAL</p>
<h2>Search Lab</h2>
<p>输入问题,检查 Dense 召回与 Reranker 精排后的 Top-K 来源。</p>
</div>
</div>
<form id="search-form" class="search-panel">
<label for="search-query">检索问题</label>
<div class="search-controls">
<textarea
id="search-query"
name="query"
rows="3"
maxlength="1600"
placeholder="例如:产品 A 的退款周期是多少?"
required
></textarea>
<label class="top-k-control" for="search-top-k">
Top-K
<select id="search-top-k" name="top_k">
<option value="3">3</option>
<option value="5" selected>5</option>
<option value="10">10</option>
</select>
</label>
<button id="search-button" class="primary-button" type="submit">开始检索</button>
</div>
</form>
<div class="results-heading">
<div>
<p class="section-label">RESULTS</p>
<h3>来源结果</h3>
</div>
<span id="search-summary">等待检索</span>
</div>
<div id="search-results" class="search-results" aria-live="polite">
<div class="empty-state search-empty">
<strong>检索结果会显示在这里</strong>
<span>结果包含排名、文件、页码、章节、Chunk 内容和两阶段分数。</span>
</div>
</div>
</section>
</main>
</div>
<dialog id="document-dialog" class="document-dialog">
<form method="dialog"><button class="icon-button" aria-label="关闭详情">×</button></form>
<p class="section-label">DOCUMENT DETAIL</p>
<h2 id="dialog-filename"></h2>
<dl id="dialog-metadata" class="dialog-metadata"></dl>
</dialog>
</body>
</html>