diff --git a/.github/workflows/community-stats.yml b/.github/workflows/community-stats.yml index a422c29..dee17dc 100644 --- a/.github/workflows/community-stats.yml +++ b/.github/workflows/community-stats.yml @@ -95,12 +95,7 @@ jobs: echo "📦 New plugin detected: $OLD_POSTS -> $NEW_POSTS" fi - # 检查版本变更 - if [ "$OLD_VERSIONS" != "$NEW_VERSIONS" ]; then - SHOULD_COMMIT="true" - CHANGE_REASON="${CHANGE_REASON:+$CHANGE_REASON, }plugin version updated" - echo "🔄 Plugin version changed" - fi + diff --git a/scripts/openwebui_stats.py b/scripts/openwebui_stats.py index b56e709..c7f276f 100644 --- a/scripts/openwebui_stats.py +++ b/scripts/openwebui_stats.py @@ -812,6 +812,19 @@ class OpenWebUIStats: } ) } + # 版本号徽章 + ver = post.get("version", "N/A") or "N/A" + ver_color = "blue" if post.get("version") else "gray" + files_payload[f"badge_p{idx}_version.json"] = { + "content": json.dumps( + { + "schemaVersion": 1, + "label": "v", + "message": ver, + "color": ver_color, + } + ) + } # 生成所有帖子的个体徽章 (用于详细报表) # 生成所有帖子的个体徽章 (用于详细报表) @@ -834,7 +847,6 @@ class OpenWebUIStats: } ) } - # 2. Views files_payload[f"badge_post_{slug_hash}_vw.json"] = { "content": json.dumps( @@ -1040,11 +1052,9 @@ 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 = post["version"] if post["version"] else "N/A" - ver_color = "blue" if post["version"] else "gray" - ver_badge = ( - f"![v](https://img.shields.io/badge/v-{ver}-{ver_color}?style=flat)" + # 版本号使用动态 Shields.io 徽章 + ver_badge = self.get_badge( + f"p{idx}_version", stats, user, delta, is_post=True ) # 更新时间使用静态 Shields.io 徽章