feat(audit): 增加审计日志与演示数据管理

This commit is contained in:
2026-05-30 00:10:26 +08:00
parent 4a831ee2c5
commit 5c9718ddb1
13 changed files with 333 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>审计日志详情</title>
</head>
<body>
<h1>审计日志详情 #{{ log.id }}</h1>
<nav><a href="{% url 'audit:list' %}">返回审计列表</a></nav>
<section>
<h2>用户输入</h2>
<p>{{ log.user_input }}</p>
</section>
<section>
<h2>最终回答</h2>
<p>{{ log.final_answer }}</p>
</section>
<section>
<h2>结构化输出</h2>
<pre>{{ log.structured_output }}</pre>
</section>
<section>
<h2>引用来源</h2>
<pre>{{ log.retrieved_chunks }}</pre>
</section>
<section>
<h2>工具调用</h2>
<pre>{{ log.tool_calls }}</pre>
</section>
{% if log.error_message %}
<section>
<h2>错误信息</h2>
<pre>{{ log.error_message }}</pre>
</section>
{% endif %}
</body>
</html>

View File

@@ -0,0 +1,37 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>审计日志</title>
</head>
<body>
<h1>审计日志</h1>
<nav><a href="/">返回首页</a></nav>
<table>
<thead>
<tr>
<th>ID</th>
<th>场景</th>
<th>状态</th>
<th>模型</th>
<th>耗时</th>
<th>详情</th>
</tr>
</thead>
<tbody>
{% for log in logs %}
<tr>
<td>{{ log.id }}</td>
<td>{{ log.scenario_name }}</td>
<td>{{ log.status }}</td>
<td>{{ log.model_name }}</td>
<td>{{ log.latency_ms }} ms</td>
<td><a href="{% url 'audit:detail' log.id %}">查看</a></td>
</tr>
{% empty %}
<tr><td colspan="6">暂无审计日志。</td></tr>
{% endfor %}
</tbody>
</table>
</body>
</html>