feat(icon): 补齐 PWA / 错误页 / 登录页图标

漏掉的四处(都实测确认过):
- PWA manifest 的主图标是 /web-icons/dashy-logo.png(512x512),以及
  dashy-pwa_{48,72,96,144,192,512}.png —— 全部仍是上游 Dashy 品牌,
  浏览器「安装到桌面/主屏」时用的就是这批。由 favicon.svg 重新派生。
- portal/404.html、500.html 没有任何 icon 标签(浏览器只能退化去找
  /favicon.ico)。实测两条路径都能取到图标,但仍显式声明更稳妥。
- 登录页模板(admin-server/auth.go)同样缺 icon 标签。

所有派生 PNG 都逐个解码验证(颜色数 111~1603,非空非纯色)。
This commit is contained in:
JianFeeeee
2026-10-03 08:45:47 +08:00
parent 7ebebbc3a9
commit 681393c8ec
10 changed files with 6 additions and 0 deletions

View File

@ -143,6 +143,8 @@ func safePortalRedirect(raw string) string {
var portalLoginTemplate = template.Must(template.New("login").Parse(`<!doctype html>
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>{{.Title}} - 登录</title>
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="icon" href="/favicon.ico" sizes="any">
<script>(function(){var s=localStorage.getItem('theme');var p=window.matchMedia('(prefers-color-scheme:dark)').matches;document.documentElement.setAttribute('data-theme',s||(p?'dark':'light'))})()</script>
<style>
/* 深浅色:默认跟随系统(prefers-color-scheme),手动切换后写入 localStorage。