From a67d12120b7f088e7360a0e8979257c928eacd53 Mon Sep 17 00:00:00 2001 From: gentpan Date: Sun, 13 Sep 2026 08:14:36 +0500 Subject: [PATCH] =?UTF-8?q?=E5=AE=98=E7=BD=91=E5=8E=BB=E6=8E=89=E6=8C=87?= =?UTF-8?q?=E5=90=91=E7=A7=81=E6=9C=89=E4=BB=93=E5=BA=93=E7=9A=84=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=EF=BC=8C=E5=AE=8C=E6=95=B4=E6=9B=B4=E6=96=B0=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=8A=98=E5=8F=A0=E5=9C=A8=E9=A1=B5=E9=9D=A2=E5=86=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- README.md | 19 ++++++- README.zh-CN.md | 19 ++++++- Scripts/release.sh | 4 ++ Scripts/sync_changelog.py | 55 +++++++++++++------ web/index.html | 112 ++++++++++++++++++++++++++------------ web/styles.css | 11 ++-- 7 files changed, 164 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 968ebca..42a61bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ 记录 OpenStats 应用的功能新增、样式调整和问题修复,按版本与日期倒序排列。 官网、构建与发布脚本等不影响应用本身的改动不在此记录。 -## 0.3.0 · 2026-09-13 +## 未发布 ### 2026-09-13 diff --git a/README.md b/README.md index 760918c..47235fd 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,26 @@ Developed and tested on Apple Silicon. The interface is in Simplified Chinese. -Latest release **0.2.0** (2026-09-13) · [full changelog](CHANGELOG.md) (kept in Chinese) +Latest release **0.2.0** (2026-09-13) · **6** changes in development · [full changelog](CHANGELOG.md) (kept in Chinese)
+2026-09-13 · Unreleased · 3 added · 3 changed + +**Added** + +- 在线升级:启动时和之后每天检查官网版本清单,发现新版本时弹出版本号与更新摘要,可一键安装、以后再说或跳过此版本;下载后依次核对 sha256、包名与版本、开发者签名团队和 Apple 公证,任何一项不通过都放弃安装;旧版先备份再原地替换,失败自动还原,装完自动重启到新版。「设置 · 关于」与应用菜单里可以手动检查更新。 +- 辅助工具版本检查:启动时核对正在运行的辅助工具版本;旧进程还在运行时先断开让它退出,由系统启动新版本,仍然旧时在风扇、合盖运行和辅助工具设置里提示“重新安装”,侧边栏对应项目显示提醒圆点;有新版本时“关于”旁同样显示圆点。 +- 导出诊断信息(设置 · 关于):把版本、系统与辅助工具状态、主要设置、最近 3 天的运行日志、清理记录和最近的崩溃报告打包成 zip,反馈问题时附上;自动去掉用户目录名、IP 与硬件地址,不含序列号。应用与辅助工具的关键操作和错误写入系统日志。 + +**Changed** + +- 连接探测更省电:打开网络详情时按设置的间隔探测;详情关闭、只在菜单栏显示网速时改为每 10 秒低频探测,并允许系统合并唤醒,也可以在设置里关闭后台探测。 +- 进程页每 2 秒刷新一次(读取全系统进程需要启动 ps),其他页面仍为每秒。 +- 菜单栏图标用 ⌘ 拖动调整的顺序会被记住,重启应用或切换显示项目后保持不变。 + +
+ +
2026-09-13 · 0.2.0 · 30 added · 12 style · 6 fixed **Added** diff --git a/README.zh-CN.md b/README.zh-CN.md index b5603ba..716d269 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -46,9 +46,26 @@ brew install --cask gentpan/tap/openstats -最新版本 **0.2.0**(2026-09-13) · [完整更新日志](CHANGELOG.md) +最新版本 **0.2.0**(2026-09-13) · 开发中 **6** 项改动尚未发布 · [完整更新日志](CHANGELOG.md)
+2026-09-13 · 未发布 · 新增 3 · 调整 3 + +**新增** + +- 在线升级:启动时和之后每天检查官网版本清单,发现新版本时弹出版本号与更新摘要,可一键安装、以后再说或跳过此版本;下载后依次核对 sha256、包名与版本、开发者签名团队和 Apple 公证,任何一项不通过都放弃安装;旧版先备份再原地替换,失败自动还原,装完自动重启到新版。「设置 · 关于」与应用菜单里可以手动检查更新。 +- 辅助工具版本检查:启动时核对正在运行的辅助工具版本;旧进程还在运行时先断开让它退出,由系统启动新版本,仍然旧时在风扇、合盖运行和辅助工具设置里提示“重新安装”,侧边栏对应项目显示提醒圆点;有新版本时“关于”旁同样显示圆点。 +- 导出诊断信息(设置 · 关于):把版本、系统与辅助工具状态、主要设置、最近 3 天的运行日志、清理记录和最近的崩溃报告打包成 zip,反馈问题时附上;自动去掉用户目录名、IP 与硬件地址,不含序列号。应用与辅助工具的关键操作和错误写入系统日志。 + +**调整** + +- 连接探测更省电:打开网络详情时按设置的间隔探测;详情关闭、只在菜单栏显示网速时改为每 10 秒低频探测,并允许系统合并唤醒,也可以在设置里关闭后台探测。 +- 进程页每 2 秒刷新一次(读取全系统进程需要启动 ps),其他页面仍为每秒。 +- 菜单栏图标用 ⌘ 拖动调整的顺序会被记住,重启应用或切换显示项目后保持不变。 + +
+ +
2026-09-13 · 0.2.0 · 新增 30 · 样式 12 · 修复 6 **新增** diff --git a/Scripts/release.sh b/Scripts/release.sh index bdd9aa3..1ae549b 100755 --- a/Scripts/release.sh +++ b/Scripts/release.sh @@ -24,6 +24,10 @@ APP="build/DerivedData/Build/Products/Release/OpenStats.app" DMG_NAME="OpenStats-${VERSION}.dmg" ZIP_NAME="OpenStats-${VERSION}.zip" +# 在线升级的更新摘要取自该版本的更新日志:发版前把 “## 未发布” 改成 “## 版本 · 日期” +grep -q "^## ${VERSION} · " CHANGELOG.md \ + || { echo "error: CHANGELOG.md 里没有 “## ${VERSION} · 日期” 标题,先把 “## 未发布” 改成正式版本。" >&2; exit 1; } + if [ -z "$SIGN_ID" ]; then echo "error: 钥匙串里没有 Developer ID Application 证书,无法发布。" >&2 exit 1 diff --git a/Scripts/sync_changelog.py b/Scripts/sync_changelog.py index 2dfa180..efcc3c5 100644 --- a/Scripts/sync_changelog.py +++ b/Scripts/sync_changelog.py @@ -27,9 +27,8 @@ ROOT = pathlib.Path(__file__).resolve().parent.parent RECENT_DAYS = 3 WEEKS = 26 -KIND_EN = {"新增": "Added", "样式": "Style", "修复": "Fixed"} +KIND_EN = {"新增": "Added", "样式": "Style", "调整": "Changed", "修复": "Fixed"} WEB_ITEMS_PER_DAY = 8 -CHANGELOG_URL = "https://github.com/gentpan/OpenStats/blob/main/CHANGELOG.md" # ── CHANGELOG.md ────────────────────────────────────────────────────────── @@ -170,24 +169,48 @@ def inline_html(text): return out +def web_day(release, day, lines): + items = [(g["kind"], item) for g in day["groups"] for item in g["items"]] + lines.append('
') + lines.append(f'
' + f'{html.escape(release["version"])}
') + lines.append(f'

{html.escape(counts(day, False))}

') + + def item_lines(chunk, indent): + return [f'{indent}
  • {html.escape(kind)}{inline_html(item)}
  • ' + for kind, item in chunk] + + lines.append('
      ') + lines += item_lines(items[:WEB_ITEMS_PER_DAY], " ") + lines.append("
    ") + rest = items[WEB_ITEMS_PER_DAY:] + if rest: + # 仓库是私有的,完整条目直接折叠在官网上,不链接到 GitHub + lines.append('
    ') + lines.append(f' 还有 {len(rest)} 项') + lines.append('
      ') + lines += item_lines(rest, " ") + lines.append("
    ") + lines.append("
    ") + lines.append("
    ") + + def web_block(releases, indent=" "): + """官网只展示已发布的版本:最近几天直接显示,更早的折叠。""" + released = [r for r in releases if r["version"]] + entries = day_entries(released) lines = ["", "", '
    '] - for release, day in day_entries(releases)[:RECENT_DAYS]: - label = release["version"] or "未发布" - items = [(g["kind"], item) for g in day["groups"] for item in g["items"]] - lines.append('
    ') - lines.append(f'
    ' - f'{html.escape(label)}
    ') - lines.append(f'

    {html.escape(counts(day, False))}

    ') - lines.append('
      ') - for kind, item in items[:WEB_ITEMS_PER_DAY]: - lines.append(f'
    • {html.escape(kind)}{inline_html(item)}
    • ') - lines.append("
    ") - if len(items) > WEB_ITEMS_PER_DAY: - lines.append(f' 还有 {len(items) - WEB_ITEMS_PER_DAY} 项 →') - lines.append("
    ") + for release, day in entries[:RECENT_DAYS]: + web_day(release, day, lines) + older = entries[RECENT_DAYS:] + if older: + lines.append('
    ') + lines.append(f' 更早的更新({len(older)} 天)') + for release, day in older: + web_day(release, day, lines) + lines.append("
    ") lines.append("
    ") lines.append("") return "\n".join(lines[:1] + [indent + line for line in lines[1:]]) diff --git a/web/index.html b/web/index.html index a1a2522..6597cfa 100644 --- a/web/index.html +++ b/web/index.html @@ -15,9 +15,9 @@ - - - + + + - - + + @@ -46,8 +46,6 @@ @@ -108,7 +104,7 @@
    +
    + 怎么安装、卸载? +

    下载 DMG 后把 OpenStats 拖进“应用程序”;也可以用 Homebrew:brew install --cask gentpan/tap/openstats。卸载时先在“设置 › 辅助工具”里卸载辅助工具,再把应用移到废纸篓;用 Homebrew 安装的执行 brew uninstall --zap --cask openstats。

    +
    支持 Intel Mac 吗?

    目前在 Apple Silicon 上开发和测试,Intel 机型的风扇与温度读取尚未验证。

    @@ -401,13 +443,13 @@
    - - + + diff --git a/web/styles.css b/web/styles.css index c54db85..bbe23a2 100644 --- a/web/styles.css +++ b/web/styles.css @@ -232,8 +232,8 @@ p { margin: 0; } .download h2 { font-size: var(--text-2xl); } .download p { color: var(--color-text-secondary); } .download__brew { font-size: var(--text-sm); } -.download__brew code { font-family: var(--font-mono); font-size: var(--text-xs); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--color-neutral-100); color: var(--color-text); } -:root[data-theme="dark"] .download__brew code { background: #25282d; } +.download__brew code, .faq code { font-family: var(--font-mono); font-size: var(--text-xs); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--color-neutral-100); color: var(--color-text); } +:root[data-theme="dark"] .download__brew code, :root[data-theme="dark"] .faq code { background: #25282d; } /* 更新日志(由 Scripts/sync_changelog.py 生成) */ .log { display: grid; gap: var(--space-4); } @@ -246,8 +246,11 @@ p { margin: 0; } .log__list { margin: var(--space-3) 0 0; padding-left: var(--space-4); font-size: var(--text-sm); color: var(--color-text-secondary); display: grid; gap: var(--space-2); } .log__kind { display: inline-block; margin-right: var(--space-2); font-size: var(--text-xs); font-weight: 600; color: var(--color-primary); } .log__list code { font-family: var(--font-mono); font-size: var(--text-xs); } -.log__more { display: inline-block; margin-top: var(--space-3); font-size: var(--text-sm); } -.log__all { margin-top: var(--space-6); font-size: var(--text-sm); } +.log__rest { margin-top: var(--space-3); } +.log__rest > summary, .log__older > summary { cursor: pointer; font-size: var(--text-sm); color: var(--color-primary); } +.log__rest[open] > summary { margin-bottom: var(--space-1); } +.log__older { display: grid; gap: var(--space-4); } +.log__older[open] > summary { margin-bottom: var(--space-2); } .faq { border-bottom: 1px solid var(--color-border); padding: var(--space-4) 0; } .faq summary { cursor: pointer; font-weight: 600; list-style: none; }