feat: 重构处理历史与通知留痕追踪
This commit is contained in:
@@ -1,73 +1,66 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}审计日志详情{% endblock %}
|
||||
{% block title %}处理历史详情{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="page-header">
|
||||
<span class="eyebrow">Audit Snapshot</span>
|
||||
<h1 class="page-title">审计日志 #{{ log.id }}</h1>
|
||||
<p class="page-lead">详情页集中展示当前请求的输入、结构化输出、引用来源、工具调用和原始输出,用来解释这一轮 Agent 执行到底做了什么。</p>
|
||||
<div class="button-row">
|
||||
<a class="button" href="{% url 'audit:list' %}">返回审计列表</a>
|
||||
<a class="button" href="{% url 'platform_ui:command-center' %}">返回工作台大屏</a>
|
||||
<span class="eyebrow">History Detail</span>
|
||||
<h1 class="page-title">处理历史 #{{ log.id }}</h1>
|
||||
<p class="page-lead">集中展示本次执行的业务上下文、结构化结果、引用来源与通知留痕。</p>
|
||||
<div class="badge-row">
|
||||
<span class="pill pill-accent">批次:{{ log.batch_id|default:"-" }}</span>
|
||||
<span class="pill">会话:{{ log.conversation_id|default:"-" }}</span>
|
||||
<span class="pill">产品:{{ log.product_name|default:"-" }}</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="hero-metrics">
|
||||
<article class="metric-card">
|
||||
<div class="metric-label">场景</div>
|
||||
<div class="metric-value">{{ log.scenario_name }}</div>
|
||||
<section class="grid-2">
|
||||
<article class="panel">
|
||||
<h2 class="section-title">执行上下文</h2>
|
||||
<ul class="detail-list">
|
||||
<li class="detail-item"><strong>用户输入</strong><div>{{ log.user_input|linebreaksbr }}</div></li>
|
||||
<li class="detail-item"><strong>最终回答</strong><div>{{ log.final_answer|linebreaksbr }}</div></li>
|
||||
<li class="detail-item"><strong>结构化输出</strong><pre class="code-block">{{ log.structured_output }}</pre></li>
|
||||
</ul>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<div class="metric-label">状态</div>
|
||||
<div class="metric-value">{{ log.get_status_display_text }}</div>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<div class="metric-label">耗时</div>
|
||||
<div class="metric-value">{{ log.latency_ms }} ms</div>
|
||||
|
||||
<article class="panel">
|
||||
<h2 class="section-title">执行证据</h2>
|
||||
<ul class="detail-list">
|
||||
<li class="detail-item"><strong>引用来源</strong><pre class="code-block">{{ log.retrieved_chunks }}</pre></li>
|
||||
<li class="detail-item"><strong>工具调用</strong><pre class="code-block">{{ log.tool_calls }}</pre></li>
|
||||
<li class="detail-item"><strong>原始输出</strong><pre class="code-block">{{ log.raw_output }}</pre></li>
|
||||
</ul>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="layout-two-columns">
|
||||
<div class="stack">
|
||||
<article class="panel">
|
||||
<h2 class="section-title">用户输入</h2>
|
||||
<div class="detail-item">{{ log.user_input|linebreaksbr }}</div>
|
||||
</article>
|
||||
|
||||
<article class="panel">
|
||||
<h2 class="section-title">最终回答</h2>
|
||||
<div class="detail-item">{{ log.final_answer|linebreaksbr }}</div>
|
||||
</article>
|
||||
|
||||
<article class="panel">
|
||||
<h2 class="section-title">结构化输出</h2>
|
||||
<pre class="code-block">{{ log.structured_output }}</pre>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<div class="stack">
|
||||
<article class="panel">
|
||||
<h2 class="section-title">引用来源</h2>
|
||||
<pre class="code-block">{{ log.retrieved_chunks }}</pre>
|
||||
</article>
|
||||
|
||||
<article class="panel">
|
||||
<h2 class="section-title">工具调用</h2>
|
||||
<pre class="code-block">{{ log.tool_calls }}</pre>
|
||||
</article>
|
||||
|
||||
<article class="panel">
|
||||
<h2 class="section-title">原始输出</h2>
|
||||
<pre class="code-block">{{ log.raw_output }}</pre>
|
||||
</article>
|
||||
|
||||
{% if log.error_message %}
|
||||
<article class="panel">
|
||||
<h2 class="section-title">错误信息</h2>
|
||||
<pre class="code-block">{{ log.error_message }}</pre>
|
||||
</article>
|
||||
{% endif %}
|
||||
<section class="panel">
|
||||
<h2 class="section-title">通知留痕</h2>
|
||||
<div class="table-wrap">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>触发原因</th>
|
||||
<th>责任角色</th>
|
||||
<th>飞书用户</th>
|
||||
<th>消息状态</th>
|
||||
<th>详情链接</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in notifications %}
|
||||
<tr>
|
||||
<td>{{ item.notify_reason }}</td>
|
||||
<td>{{ item.owner_role }}</td>
|
||||
<td>{{ item.feishu_user_id }}</td>
|
||||
<td>{{ item.message_status }}</td>
|
||||
<td>{{ item.web_detail_url|default:"-" }}</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="5">当前执行尚无通知留痕。</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user