56 lines
2.0 KiB
HTML
56 lines
2.0 KiB
HTML
{{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" enctype="multipart/form-data" style="display:flex;gap:8px;align-items:center">
|
||
<input type="text" name="name" placeholder="姓名" required style="width:100px">
|
||
<input type="file" name="photo" accept="image/*" required style="width:160px">
|
||
<button class="btn" type="submit">新增人员</button>
|
||
</form>
|
||
<form method="post" action="/ui/face-gallery/build" style="display:inline">
|
||
<button class="btn secondary" type="submit">重新生成人脸库</button>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
{{if .Message}}
|
||
<div class="card"><div class="muted small mono" style="white-space:pre-wrap">{{.Message}}</div></div>
|
||
{{end}}
|
||
|
||
<div class="card">
|
||
<div class="table-wrap">
|
||
{{if .FaceGalleryPersons}}
|
||
<table>
|
||
<thead>
|
||
<tr><th>ID</th><th>姓名</th><th>操作</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
{{range .FaceGalleryPersons}}
|
||
<tr>
|
||
<td class="mono">{{.ID}}</td>
|
||
<td style="font-weight:500">{{.Name}}</td>
|
||
<td>
|
||
<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>
|
||
</td>
|
||
</tr>
|
||
{{end}}
|
||
</tbody>
|
||
</table>
|
||
{{else}}
|
||
<div class="empty-state">
|
||
<div class="empty-title">人脸库为空</div>
|
||
<div class="muted">请先添加人员并上传照片,然后点击"重新生成人脸库"。</div>
|
||
</div>
|
||
{{end}}
|
||
</div>
|
||
</div>
|
||
{{end}}
|