safesight-control/internal/web/ui/templates/face_gallery.html

58 lines
2.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.

{{define "face_gallery"}}
<div class="card">
<div class="section-title">
<div>
<h2 class="title-with-icon">{{icon "profile"}}<span>人脸库管理</span></h2>
<div class="form-hint">管理人员信息,所属设备统一通过资源同步下发。</div>
</div>
<div class="actions compact">
<form method="post" action="/ui/face-gallery/add" style="display:inline">
<input type="text" name="name" placeholder="姓名" required style="width:120px;margin-right:8px">
<button class="btn" type="submit">新增人员</button>
</form>
</div>
</div>
</div>
<div class="card">
<div class="table-wrap">
{{if .FaceGalleryPersons}}
<table>
<thead>
<tr><th>ID</th><th>姓名</th><th>注册时间</th><th>操作</th></tr>
</thead>
<tbody>
{{range .FaceGalleryPersons}}
<tr>
<td class="mono">{{.ID}}</td>
<td>
<span style="font-weight:500">{{.Name}}</span>
</td>
<td class="small">{{.CreatedAt}}</td>
<td>
<div class="actions compact">
<form method="post" action="/ui/face-gallery/rename" style="display:inline">
<input type="hidden" name="id" value="{{.ID}}">
<input type="text" name="name" placeholder="新姓名" style="width:80px">
<button class="btn ghost" type="submit">改名</button>
</form>
<form method="post" action="/ui/face-gallery/delete" style="display:inline" onsubmit="return confirm('确定删除 {{.Name}}')">
<input type="hidden" name="id" value="{{.ID}}">
<button class="btn ghost" type="submit" style="color:var(--danger-soft-text)">删除</button>
</form>
</div>
</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
<div class="empty-state">
<div class="empty-title">人脸库为空</div>
<div class="muted">请先添加人员。</div>
</div>
{{end}}
</div>
</div>
{{end}}