fix: 构建人脸库按钮样式对齐、显示构建结果消息、已构建时提示重新确认

This commit is contained in:
tian 2026-07-23 18:49:30 +08:00
parent 3c9f4ec98b
commit 2ba159c71c
2 changed files with 7 additions and 2 deletions

View File

@ -204,6 +204,8 @@ textarea{min-height:140px;line-height:1.55}
.msg{background:var(--surface-soft);border:1px solid var(--border-strong);color:var(--green)}
.error{background:var(--danger-soft);border:1px solid var(--danger-soft-hover);color:var(--danger-soft-text)}
.inline-form{display:inline-flex;margin:0;padding:0}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.stat{padding:14px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.stat .k{font-size:12px;color:var(--muted)}

View File

@ -16,11 +16,14 @@
<input type="search" id="person-search" class="input" placeholder="搜索人员..." style="width:180px" oninput="filterPersons()">
<button class="btn secondary" type="button" onclick="showImport()">批量导入</button>
<button class="btn" type="button" onclick="showAdd()">新增人员</button>
<form method="post" action="/face-gallery/build" style="display:inline" onsubmit="return confirm('确认从已导入的照片构建人脸库?')">
<button class="btn" type="submit">构建人脸库</button>
{{$built := false}}{{range .StandardResources}}{{if eq .ResourceType "face_gallery"}}{{$built = true}}{{end}}{{end}}
<form method="post" action="/face-gallery/build" class="inline-form" {{if $built}}onsubmit="return confirm('已存在构建记录,重新构建将覆盖。确定继续?')"{{else}}onsubmit="return confirm('确认从已导入的照片构建人脸库?')"{{end}}>
<button class="btn {{if $built}}secondary{{end}}" type="submit">{{if $built}}重新构建人脸库{{else}}构建人脸库{{end}}</button>
</form>
</div>
</div>
{{if .Message}}<div class="msg {{if .Error}}error{{end}}">{{.Message}}</div>{{end}}
{{if .Error}}<div class="error">{{.Error}}</div>{{end}}
{{if .FaceGalleryPersons}}
<div class="person-grid" style="display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:16px;margin-top:12px">
{{range .FaceGalleryPersons}}