Files
writing-agent/web/stats.html
moran 6392af54b4 完善配方驱动的创作编排
为可重复技能补充参数校验与展示,统一配方、编排器和执行单元术语。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 17:59:20 +08:00

113 lines
3.1 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.0" />
<title>Token 统计 · Writing Agent</title>
<link rel="stylesheet" href="/styles.css" />
<link rel="stylesheet" href="/settings.css" />
<style>
.stats-page {
max-width: 920px;
margin: 0 auto;
padding: 1.5rem 1.25rem 3rem;
}
.stats-filters {
display: flex;
flex-wrap: wrap;
gap: 0.75rem 1rem;
align-items: end;
margin: 1rem 0 1.25rem;
}
.stats-filters label {
display: flex;
flex-direction: column;
gap: 0.25rem;
font-size: 0.85rem;
}
.stats-filters input {
min-width: 11rem;
padding: 0.35rem 0.5rem;
}
.stats-summary {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
gap: 0.75rem;
margin-bottom: 1.25rem;
}
.stats-metric {
border: 1px solid var(--border, #ddd);
padding: 0.75rem;
}
.stats-metric strong {
display: block;
font-size: 1.25rem;
}
.stats-table {
width: 100%;
border-collapse: collapse;
font-size: 0.85rem;
}
.stats-table th,
.stats-table td {
border-bottom: 1px solid var(--border, #ddd);
padding: 0.4rem 0.5rem;
text-align: left;
vertical-align: top;
}
.stats-table th {
font-weight: 600;
}
.stats-muted {
color: var(--muted, #666);
font-size: 0.85rem;
}
</style>
</head>
<body>
<div class="stats-page">
<header>
<p><a href="/">← 对话</a> · <a href="/modules.html">技能</a> · <a href="/settings.html">设置</a></p>
<h1>Token 统计</h1>
<p class="stats-muted">按时间戳筛选调用记录(存于本地 stats/*.jsonl</p>
</header>
<div class="stats-filters">
<label>
<input type="datetime-local" id="from" />
</label>
<label>
<input type="datetime-local" id="to" />
</label>
<label>
上限条数
<input type="number" id="limit" value="200" min="10" max="5000" step="10" />
</label>
<button type="button" class="btn-sm" id="btn-load">查询</button>
<button type="button" class="btn-sm" id="btn-today">今天</button>
<button type="button" class="btn-sm" id="btn-7d">近 7 天</button>
</div>
<div class="stats-summary" id="summary"></div>
<p class="stats-muted" id="status"></p>
<table class="stats-table">
<thead>
<tr>
<th>时间</th>
<th>caller</th>
<th>model</th>
<th>prompt</th>
<th>completion</th>
<th>total</th>
<th>cached</th>
</tr>
</thead>
<tbody id="rows"></tbody>
</table>
</div>
<script type="module" src="/stats.js"></script>
</body>
</html>