safesight/internal/web/ui/templates/audit.html

52 lines
1.5 KiB
HTML

{{define "audit"}}
<section class="hero-band">
<div>
<div class="eyebrow">操作审计</div>
<h2>所有关键操作的统一留痕入口</h2>
<div class="muted">这里只看谁做了什么、对哪台设备做的、结果如何。</div>
</div>
</section>
<div class="card">
<div class="section-title">
<div>
<h2 class="title-with-icon">{{icon "audit"}}<span>审计记录</span></h2>
<div class="muted small">当前展示后台已记录的任务与设备操作结果。</div>
</div>
</div>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>任务</th>
<th>动作</th>
<th>目标设备</th>
<th>结果</th>
<th>说明</th>
</tr>
</thead>
<tbody>
{{range .Tasks}}
<tr>
<td class="mono">{{.ID}}</td>
<td>{{.Type}}</td>
<td class="mono">{{range $i, $id := .DeviceIDs}}{{if $i}}, {{end}}{{$id}}{{end}}</td>
<td><span class="pill">{{.Status}}</span></td>
<td class="muted small">{{if .Payload}}已记录任务参数{{else}}无附加参数{{end}}</td>
</tr>
{{else}}
<tr>
<td colspan="5">
<div class="empty-state">
<div class="empty-title">暂无审计记录</div>
<div class="muted">当前后台还没有记录到任何任务或设备操作。</div>
</div>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</div>
{{end}}