fix(stats): stabilize Top6 version badges and fix Excel version display [skip release]

- replace rank-based p{idx}_version usage with per-post static version badge generation

- set Export to Excel version badge to v0.3.7 in home README and README_CN
This commit is contained in:
fujie
2026-03-04 01:59:31 +08:00
parent 9436364b9a
commit e1dac2219e
3 changed files with 7 additions and 5 deletions

View File

@@ -1263,9 +1263,11 @@ class OpenWebUIStats:
dl_cell = self.get_badge(f"p{idx}_dl", stats, user, delta, is_post=True)
vw_cell = self.get_badge(f"p{idx}_vw", stats, user, delta, is_post=True)
# 版本号使用态 Shields.io 徽章
ver_badge = self.get_badge(
f"p{idx}_version", stats, user, delta, is_post=True
# 版本号使用态 Shields.io 徽章,避免按排名位次 badge 产生错位
ver = post.get("version", "N/A") or "N/A"
ver_color = "blue" if post.get("version") else "gray"
ver_badge = (
f"![v](https://img.shields.io/badge/v-{ver}-{ver_color}?style=flat)"
)
# 更新时间使用静态 Shields.io 徽章