8000 fix(pwa): replace blank navigation wait with local boot shell by InfinityPacer · Pull Request #78 · InfinityPacer/meterleaf · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ docker compose up -d --no-build --pull never

完成后用 `docker compose ps` 检查状态,默认访问 `http://127.0.0.1:4318`。镜像以 Bun 用户运行,挂载目录必须可写;不要让多个 Meterleaf 进程共用同一账本。发布流程见[版本与发布](releasing.md)。

生产构建包含 PWA 清单、图标和离线页,浏览器可将应用安装为独立窗口,无需额外安装插件。首页在脚本加载期间显示启动提示;构建会为文本静态资源生成 Brotli/Gzip 变体,服务器按浏览器能力返回。除本机地址外,需要 HTTPS;反向代理须允许访问 `/manifest.webmanifest`、`/sw.js`、`/offline.html` 和 `/icons/*`。离线资源不缓存 API 或账户数据,断网后重新打开不会展示旧账本。
生产构建包含 PWA 清单、图标和离线页,浏览器可将应用安装为独立窗口,无需额外安装插件。首页在脚本加载和慢网连接期间显示启动提示,连接超时或断网后自动切为离线提示并在恢复后重新打开账本,构建还会为文本静态资源生成 Brotli/Gzip 变体并按浏览器能力返回。除本机地址外需要 HTTPS,反向代理须允许访问 `/manifest.webmanifest`、`/sw.js`、`/offline.html` 和 `/icons/*`。离线资源不缓存 API 或账户数据,断网后重新打开不会展示旧账本。

随附 Compose 仅绑定宿主机回环地址。如果反向代理在其他容器中,应加入共享 Docker 网络并访问 `meterleaf:4318`,或显式调整宿主机绑定地址。对外开放前按[GitHub 登录](#github-登录)开启登录保护。

Expand Down
25 changes: 22 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,24 @@
:root {
background: #f7f7f8;
color-scheme: light;
--boot-accent: #0e8a55;
}
:root.dark {
background: #0f0f11;
color-scheme: dark;
--boot-accent: #3ccb8a;
}
:root[data-palette="indigo"] {
--boot-accent: #4f46e5;
}
:root.dark[data-palette="indigo"] {
--boot-accent: #8b8cf6;
}
:root[data-palette="mono"] {
--boot-accent: #18181b;
}
:root.dark[data-palette="mono"] {
--boot-accent: #f2f2f3;
}
body {
margin: 0;
Expand All @@ -24,12 +38,15 @@
min-height: 100dvh;
display: grid;
place-items: center;
padding: 24px;
padding: max(24px, env(safe-area-inset-top)) 24px
max(24px, env(safe-area-inset-bottom));
color: #18181b;
font:
500 15px/1.5 -apple-system,
BlinkMacSystemFont,
"Segoe UI",
"PingFang SC",
"Microsoft YaHei",
sans-serif;
}
.boot-shell__content {
Expand All @@ -38,10 +55,12 @@
gap: 14px;
}
.boot-shell__mark {
box-sizing: border-box;
width: 34px;
height: 34px;
border: 3px solid color-mix(in srgb, #0e8a55 22%, transparent);
border-top-color: #0e8a55;
border: 3px solid
color-mix(in srgb, var(--boot-accent) 22%, transparent);
border-top-color: var(--boot-accent);
border-radius: 50%;
animation: boot-shell-spin 900ms linear infinite;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json 870F
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meterleaf",
"version": "0.16.5",
"version": "0.16.6",
"private": true,
"type": "module",
"license": "Apache-2.0",
Expand Down
Loading
Loading
0