feat: 浏览器标签名带环境前缀(dev-设备自动化后台 / 设备自动化后台)

同时开 dev 和生产的标签页时分不清谁是谁。标题取 web_server 注入的
db_env(非 prod 才加前缀),login / monitor / wall 三个页面一致。
This commit is contained in:
2026-09-13 13:03:37 +08:00
parent c6fda262db
commit 5f02edb5c3
4 changed files with 6 additions and 4 deletions
+3 -1
View File
@@ -77,7 +77,9 @@ DB_NAME=auto_control
与 `.env.example` 的「数据库」段):启动时若
「`.env` 声明的环境」与「库名」或「库中登记的 `app_meta.deployment_env`」不符,**直接拒绝启动**并打印
两边分别是什么。每次启动还会打印一条横幅写明当前连的是哪个库(生产用 WARNING 级),
页面顶部也常驻一个环境徽标(生产红底 `PROD · <库>`,开发灰底 `DEV`)。
页面顶部也常驻一个环境徽标(生产红底 `PROD · <库>`,开发灰底 `DEV`),
**浏览器标签名也带环境前缀**(开发 `dev-设备自动化后台`,生产 `设备自动化后台`)——
同时开着两个环境时一眼分得清哪个标签是哪个。
两个逃生阀 `DB_ALLOW_ENV_MISMATCH` / `DB_ALLOW_SQLITE_FALLBACK` 默认关闭。
其余配置项与默认值见 [DEVELOPMENT.md](DEVELOPMENT.md) §配置速查。
+1 -1
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录 · 设备自动化后台</title>
<title>{% if db_env and not db_env.is_prod %}{{ db_env.env }}-{% endif %}登录 · 设备自动化后台</title>
<style>
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:-apple-system,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;
+1 -1
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>设备自动化后台</title>
<title>{% if db_env and not db_env.is_prod %}{{ db_env.env }}-{% endif %}设备自动化后台</title>
<style>
/* ========== 仪表控制台主题(Instrument Console) ==========
自托管字体:Bricolage Grotesque(展示/数字)+ IBM Plex Mono(数据/串号)
+1 -1
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>设备监控大屏</title>
<title>{% if db_env and not db_env.is_prod %}{{ db_env.env }}-{% endif %}设备监控大屏</title>
<style>
/* ========== 监控大屏:深色控制室风格 ========== */
@font-face{font-family:'Bricolage Grotesque';font-style:normal;font-weight:700;font-display:swap;src:url('/static/fonts/bricolage-700.woff2') format('woff2')}