fix: implement safe badge keys and add dynamic upvote/save badges
This commit is contained in:
@@ -7,7 +7,7 @@ A collection of enhancements, plugins, and prompts for [OpenWebUI](https://githu
|
||||
|
||||
<!-- STATS_START -->
|
||||
## 📊 Community Stats
|
||||
> 🕐 Auto-updated: 2026-02-11 12:35
|
||||
> 🕐 Auto-updated: 2026-02-11 12:41
|
||||
|
||||
| 👤 Author | 👥 Followers | ⭐ Points | 🏆 Contributions |
|
||||
| :---: | :---: | :---: | :---: |
|
||||
@@ -17,6 +17,8 @@ A collection of enhancements, plugins, and prompts for [OpenWebUI](https://githu
|
||||
| :---: | :---: | :---: | :---: | :---: |
|
||||
|  |  |  |  |  |
|
||||
|
||||

|
||||
|
||||
### 🔥 Top 6 Popular Plugins
|
||||
| Rank | Plugin | Version | Downloads | Views | Updated |
|
||||
| :---: | :--- | :---: | :---: | :---: | :---: |
|
||||
|
||||
@@ -6,7 +6,7 @@ OpenWebUI 增强功能集合。包含个人开发与收集的插件、提示词
|
||||
|
||||
<!-- STATS_START -->
|
||||
## 📊 社区统计
|
||||
> 🕐 自动更新于 2026-02-11 12:35
|
||||
> 🕐 自动更新于 2026-02-11 12:41
|
||||
|
||||
| 👤 作者 | 👥 粉丝 | ⭐ 积分 | 🏆 贡献 |
|
||||
| :---: | :---: | :---: | :---: |
|
||||
@@ -16,6 +16,8 @@ OpenWebUI 增强功能集合。包含个人开发与收集的插件、提示词
|
||||
| :---: | :---: | :---: | :---: | :---: |
|
||||
|  |  |  |  |  |
|
||||
|
||||

|
||||
|
||||
### 🔥 热门插件 Top 6
|
||||
| 排名 | 插件 | 版本 | 下载 | 浏览 | 更新日期 |
|
||||
| :---: | :--- | :---: | :---: | :---: | :---: |
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"total_posts": 22,
|
||||
"total_downloads": 4160,
|
||||
"total_views": 45940,
|
||||
"total_views": 45948,
|
||||
"total_upvotes": 231,
|
||||
"total_downvotes": 2,
|
||||
"total_saves": 274,
|
||||
@@ -23,7 +23,7 @@
|
||||
"author": "Fu-Jie",
|
||||
"description": "Intelligently analyzes text content and generates interactive mind maps to help users structure and visualize knowledge.",
|
||||
"downloads": 954,
|
||||
"views": 8389,
|
||||
"views": 8390,
|
||||
"upvotes": 22,
|
||||
"saves": 50,
|
||||
"comments": 13,
|
||||
@@ -87,7 +87,7 @@
|
||||
"author": "Fu-Jie",
|
||||
"description": "Extracts tables from chat messages and exports them to Excel (.xlsx) files with smart formatting.",
|
||||
"downloads": 342,
|
||||
"views": 1671,
|
||||
"views": 1675,
|
||||
"upvotes": 7,
|
||||
"saves": 6,
|
||||
"comments": 0,
|
||||
@@ -295,7 +295,7 @@
|
||||
"author": "Fu-Jie",
|
||||
"description": "A specialized filter to bypass OpenWebUI's default RAG for GitHub Copilot SDK models. It moves uploaded files to a safe location ('copilot_files') so the Copilot Pipe can process them natively without interference.",
|
||||
"downloads": 16,
|
||||
"views": 858,
|
||||
"views": 861,
|
||||
"upvotes": 3,
|
||||
"saves": 0,
|
||||
"comments": 0,
|
||||
@@ -311,7 +311,7 @@
|
||||
"author": "",
|
||||
"description": "",
|
||||
"downloads": 0,
|
||||
"views": 278,
|
||||
"views": 281,
|
||||
"upvotes": 5,
|
||||
"saves": 0,
|
||||
"comments": 0,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# 📊 OpenWebUI Community Stats Report
|
||||
|
||||
> 📅 Updated: 2026-02-11 12:35
|
||||
> 📅 Updated: 2026-02-11 12:40
|
||||
|
||||
### 📈 Growth & Trends (Last 14 Days)
|
||||

|
||||

|
||||
|
||||
> *Blue: Downloads | Purple: Views (Real-time dynamic)*
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
| 👁️ Total Views |  |
|
||||
| 👍 Total Upvotes |  |
|
||||
| 💾 Total Saves |  |
|
||||
| 💬 Total Comments | 55 |
|
||||
| ⭐ Author Points |  |
|
||||
| 👥 Followers |  |
|
||||
|
||||
@@ -37,25 +36,25 @@
|
||||
|
||||
| Rank | Title | Type | Version | Downloads | Views | Upvotes | Saves | Updated |
|
||||
|:---:|------|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
|
||||
| 1 | [Smart Mind Map](https://openwebui.com/posts/turn_any_text_into_beautiful_mind_maps_3094c59a) | action | 0.9.2 |  |  | 22 | 50 | 2026-01-29 |
|
||||
| 2 | [Smart Infographic](https://openwebui.com/posts/smart_infographic_ad6f0c7f) | action | 1.5.0 |  |  | 24 | 34 | 2026-01-31 |
|
||||
| 3 | [Export to Word Enhanced](https://openwebui.com/posts/export_to_word_enhanced_formatting_fca6a315) | action | 0.4.4 |  |  | 14 | 26 | 2026-02-07 |
|
||||
| 4 | [Async Context Compression](https://openwebui.com/posts/async_context_compression_b1655bc8) | filter | 1.2.2 |  |  | 14 | 34 | 2026-01-29 |
|
||||
| 5 | [Export to Excel](https://openwebui.com/posts/export_mulit_table_to_excel_244b8f9d) | action | 0.3.7 |  |  | 7 | 6 | 2026-02-10 |
|
||||
| 6 | [Markdown Normalizer](https://openwebui.com/posts/markdown_normalizer_baaa8732) | filter | 1.2.4 |  |  | 17 | 30 | 2026-01-29 |
|
||||
| 7 | [Flash Card](https://openwebui.com/posts/flash_card_65a2ea8f) | action | 0.2.4 |  |  | 13 | 14 | 2026-01-29 |
|
||||
| 8 | [AI Task Instruction Generator](https://openwebui.com/posts/ai_task_instruction_generator_9bab8b37) | prompt | |  |  | 9 | 6 | 2026-01-28 |
|
||||
| 9 | [Deep Dive](https://openwebui.com/posts/deep_dive_c0b846e4) | action | 1.0.0 |  |  | 6 | 11 | 2026-01-08 |
|
||||
| 10 | [导出为Word增强版](https://openwebui.com/posts/导出为_word_支持公式流程图表格和代码块_8a6306c0) | action | 0.4.4 |  |  | 13 | 7 | 2026-02-07 |
|
||||
| 11 | [GitHub Copilot Official SDK Pipe](https://openwebui.com/posts/github_copilot_official_sdk_pipe_ce96f7b4) | pipe | 0.6.2 |  |  | 14 | 9 | 2026-02-10 |
|
||||
| 12 | [📂 Folder Memory – Auto-Evolving Project Context](https://openwebui.com/posts/folder_memory_auto_evolving_project_context_4a9875b2) | filter | 0.1.0 |  |  | 6 | 8 | 2026-01-20 |
|
||||
| 13 | [智能信息图](https://openwebui.com/posts/智能信息图_e04a48ff) | action | 1.5.0 |  |  | 10 | 1 | 2026-01-29 |
|
||||
| 14 | [思维导图](https://openwebui.com/posts/智能生成交互式思维导图帮助用户可视化知识_8d4b097b) | action | 0.9.2 |  |  | 6 | 2 | 2026-01-29 |
|
||||
| 15 | [异步上下文压缩](https://openwebui.com/posts/异步上下文压缩_5c0617cb) | action | 1.2.2 |  |  | 7 | 5 | 2026-01-29 |
|
||||
| 16 | [闪记卡 (Flash Card)](https://openwebui.com/posts/闪记卡生成插件_4a31eac3) | action | 0.2.4 |  |  | 8 | 1 | 2026-01-29 |
|
||||
| 17 | [精读](https://openwebui.com/posts/精读_99830b0f) | action | 1.0.0 |  |  | 5 | 1 | 2026-01-08 |
|
||||
| 18 | [GitHub Copilot SDK Files Filter](https://openwebui.com/posts/github_copilot_sdk_files_filter_403a62ee) | filter | 0.1.2 |  |  | 3 | 0 | 2026-02-10 |
|
||||
| 19 | [🚀 GitHub Copilot SDK Pipe: AI That Executes, Not Just Talks](https://openwebui.com/posts/github_copilot_sdk_for_openwebui_elevate_your_ai_t_a140f293) | post | |  |  | 5 | 0 | 2026-02-10 |
|
||||
| 20 | [🚀 Open WebUI Prompt Plus: AI-Powered Prompt Manager](https://openwebui.com/posts/open_webui_prompt_plus_ai_powered_prompt_manager_s_15fa060e) | post | |  |  | 12 | 19 | 2026-01-29 |
|
||||
| 21 | [Review of Claude Haiku 4.5](https://openwebui.com/posts/review_of_claude_haiku_45_41b0db39) | review | |  |  | 2 | 0 | 2026-01-14 |
|
||||
| 22 | [ 🛠️ Debug Open WebUI Plugins in Your Browser](https://openwebui.com/posts/debug_open_webui_plugins_in_your_browser_81bf7960) | post | |  |  | 14 | 10 | 2026-01-10 |
|
||||
| 1 | [Smart Mind Map](https://openwebui.com/posts/turn_any_text_into_beautiful_mind_maps_3094c59a) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 2 | [Smart Infographic](https://openwebui.com/posts/smart_infographic_ad6f0c7f) | action |  |  |  |  |  | 2026-01-31 |
|
||||
| 3 | [Export to Word Enhanced](https://openwebui.com/posts/export_to_word_enhanced_formatting_fca6a315) | action |  |  |  |  |  | 2026-02-07 |
|
||||
| 4 | [Async Context Compression](https://openwebui.com/posts/async_context_compression_b1655bc8) | filter |  |  |  |  |  | 2026-01-29 |
|
||||
| 5 | [Export to Excel](https://openwebui.com/posts/export_mulit_table_to_excel_244b8f9d) | action |  |  |  |  |  | 2026-02-10 |
|
||||
| 6 | [Markdown Normalizer](https://openwebui.com/posts/markdown_normalizer_baaa8732) | filter |  |  |  |  |  | 2026-01-29 |
|
||||
| 7 | [Flash Card](https://openwebui.com/posts/flash_card_65a2ea8f) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 8 | [AI Task Instruction Generator](https://openwebui.com/posts/ai_task_instruction_generator_9bab8b37) | prompt |  |  |  |  |  | 2026-01-28 |
|
||||
| 9 | [Deep Dive](https://openwebui.com/posts/deep_dive_c0b846e4) | action |  |  |  |  |  | 2026-01-08 |
|
||||
| 10 | [导出为Word增强版](https://openwebui.com/posts/导出为_word_支持公式流程图表格和代码块_8a6306c0) | action |  |  |  |  |  | 2026-02-07 |
|
||||
| 11 | [GitHub Copilot Official SDK Pipe](https://openwebui.com/posts/github_copilot_official_sdk_pipe_ce96f7b4) | pipe |  |  |  |  |  | 2026-02-10 |
|
||||
| 12 | [📂 Folder Memory – Auto-Evolving Project Context](https://openwebui.com/posts/folder_memory_auto_evolving_project_context_4a9875b2) | filter |  |  |  |  |  | 2026-01-20 |
|
||||
| 13 | [智能信息图](https://openwebui.com/posts/智能信息图_e04a48ff) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 14 | [思维导图](https://openwebui.com/posts/智能生成交互式思维导图帮助用户可视化知识_8d4b097b) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 15 | [异步上下文压缩](https://openwebui.com/posts/异步上下文压缩_5c0617cb) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 16 | [闪记卡 (Flash Card)](https://openwebui.com/posts/闪记卡生成插件_4a31eac3) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 17 | [精读](https://openwebui.com/posts/精读_99830b0f) | action |  |  |  |  |  | 2026-01-08 |
|
||||
| 18 | [GitHub Copilot SDK Files Filter](https://openwebui.com/posts/github_copilot_sdk_files_filter_403a62ee) | filter |  |  |  |  |  | 2026-02-10 |
|
||||
| 19 | [🚀 GitHub Copilot SDK Pipe: AI That Executes, Not Just Talks](https://openwebui.com/posts/github_copilot_sdk_for_openwebui_elevate_your_ai_t_a140f293) | post |  |  |  |  |  | 2026-02-10 |
|
||||
| 20 | [🚀 Open WebUI Prompt Plus: AI-Powered Prompt Manager](https://openwebui.com/posts/open_webui_prompt_plus_ai_powered_prompt_manager_s_15fa060e) | post |  |  |  |  |  | 2026-01-29 |
|
||||
| 21 | [Review of Claude Haiku 4.5](https://openwebui.com/posts/review_of_claude_haiku_45_41b0db39) | review |  |  |  |  |  | 2026-01-14 |
|
||||
| 22 | [ 🛠️ Debug Open WebUI Plugins in Your Browser](https://openwebui.com/posts/debug_open_webui_plugins_in_your_browser_81bf7960) | post |  |  |  |  |  | 2026-01-10 |
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# 📊 OpenWebUI 社区统计报告
|
||||
|
||||
> 📅 更新时间: 2026-02-11 12:35
|
||||
> 📅 更新时间: 2026-02-11 12:40
|
||||
|
||||
### 📈 增长与趋势 (Last 14 Days)
|
||||

|
||||

|
||||
|
||||
> *蓝色: 总下载量 | 紫色: 总浏览量 (实时动态生成)*
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
| 👁️ 总浏览量 |  |
|
||||
| 👍 总点赞数 |  |
|
||||
| 💾 总收藏数 |  |
|
||||
| 💬 总评论数 | 55 |
|
||||
| ⭐ 作者总积分 |  |
|
||||
| 👥 粉丝数量 |  |
|
||||
|
||||
@@ -37,25 +36,25 @@
|
||||
|
||||
| 排名 | 标题 | 类型 | 版本 | 下载 | 浏览 | 点赞 | 收藏 | 更新日期 |
|
||||
|:---:|------|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
|
||||
| 1 | [Smart Mind Map](https://openwebui.com/posts/turn_any_text_into_beautiful_mind_maps_3094c59a) | action | 0.9.2 |  |  | 22 | 50 | 2026-01-29 |
|
||||
| 2 | [Smart Infographic](https://openwebui.com/posts/smart_infographic_ad6f0c7f) | action | 1.5.0 |  |  | 24 | 34 | 2026-01-31 |
|
||||
| 3 | [Export to Word Enhanced](https://openwebui.com/posts/export_to_word_enhanced_formatting_fca6a315) | action | 0.4.4 |  |  | 14 | 26 | 2026-02-07 |
|
||||
| 4 | [Async Context Compression](https://openwebui.com/posts/async_context_compression_b1655bc8) | filter | 1.2.2 |  |  | 14 | 34 | 2026-01-29 |
|
||||
| 5 | [Export to Excel](https://openwebui.com/posts/export_mulit_table_to_excel_244b8f9d) | action | 0.3.7 |  |  | 7 | 6 | 2026-02-10 |
|
||||
| 6 | [Markdown Normalizer](https://openwebui.com/posts/markdown_normalizer_baaa8732) | filter | 1.2.4 |  |  | 17 | 30 | 2026-01-29 |
|
||||
| 7 | [Flash Card](https://openwebui.com/posts/flash_card_65a2ea8f) | action | 0.2.4 |  |  | 13 | 14 | 2026-01-29 |
|
||||
| 8 | [AI Task Instruction Generator](https://openwebui.com/posts/ai_task_instruction_generator_9bab8b37) | prompt | |  |  | 9 | 6 | 2026-01-28 |
|
||||
| 9 | [Deep Dive](https://openwebui.com/posts/deep_dive_c0b846e4) | action | 1.0.0 |  |  | 6 | 11 | 2026-01-08 |
|
||||
| 10 | [导出为Word增强版](https://openwebui.com/posts/导出为_word_支持公式流程图表格和代码块_8a6306c0) | action | 0.4.4 |  |  | 13 | 7 | 2026-02-07 |
|
||||
| 11 | [GitHub Copilot Official SDK Pipe](https://openwebui.com/posts/github_copilot_official_sdk_pipe_ce96f7b4) | pipe | 0.6.2 |  |  | 14 | 9 | 2026-02-10 |
|
||||
| 12 | [📂 Folder Memory – Auto-Evolving Project Context](https://openwebui.com/posts/folder_memory_auto_evolving_project_context_4a9875b2) | filter | 0.1.0 |  |  | 6 | 8 | 2026-01-20 |
|
||||
| 13 | [智能信息图](https://openwebui.com/posts/智能信息图_e04a48ff) | action | 1.5.0 |  |  | 10 | 1 | 2026-01-29 |
|
||||
| 14 | [思维导图](https://openwebui.com/posts/智能生成交互式思维导图帮助用户可视化知识_8d4b097b) | action | 0.9.2 |  |  | 6 | 2 | 2026-01-29 |
|
||||
| 15 | [异步上下文压缩](https://openwebui.com/posts/异步上下文压缩_5c0617cb) | action | 1.2.2 |  |  | 7 | 5 | 2026-01-29 |
|
||||
| 16 | [闪记卡 (Flash Card)](https://openwebui.com/posts/闪记卡生成插件_4a31eac3) | action | 0.2.4 |  |  | 8 | 1 | 2026-01-29 |
|
||||
| 17 | [精读](https://openwebui.com/posts/精读_99830b0f) | action | 1.0.0 |  |  | 5 | 1 | 2026-01-08 |
|
||||
| 18 | [GitHub Copilot SDK Files Filter](https://openwebui.com/posts/github_copilot_sdk_files_filter_403a62ee) | filter | 0.1.2 |  |  | 3 | 0 | 2026-02-10 |
|
||||
| 19 | [🚀 GitHub Copilot SDK Pipe: AI That Executes, Not Just Talks](https://openwebui.com/posts/github_copilot_sdk_for_openwebui_elevate_your_ai_t_a140f293) | post | |  |  | 5 | 0 | 2026-02-10 |
|
||||
| 20 | [🚀 Open WebUI Prompt Plus: AI-Powered Prompt Manager](https://openwebui.com/posts/open_webui_prompt_plus_ai_powered_prompt_manager_s_15fa060e) | post | |  |  | 12 | 19 | 2026-01-29 |
|
||||
| 21 | [Review of Claude Haiku 4.5](https://openwebui.com/posts/review_of_claude_haiku_45_41b0db39) | review | |  |  | 2 | 0 | 2026-01-14 |
|
||||
| 22 | [ 🛠️ Debug Open WebUI Plugins in Your Browser](https://openwebui.com/posts/debug_open_webui_plugins_in_your_browser_81bf7960) | post | |  |  | 14 | 10 | 2026-01-10 |
|
||||
| 1 | [Smart Mind Map](https://openwebui.com/posts/turn_any_text_into_beautiful_mind_maps_3094c59a) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 2 | [Smart Infographic](https://openwebui.com/posts/smart_infographic_ad6f0c7f) | action |  |  |  |  |  | 2026-01-31 |
|
||||
| 3 | [Export to Word Enhanced](https://openwebui.com/posts/export_to_word_enhanced_formatting_fca6a315) | action |  |  |  |  |  | 2026-02-07 |
|
||||
| 4 | [Async Context Compression](https://openwebui.com/posts/async_context_compression_b1655bc8) | filter |  |  |  |  |  | 2026-01-29 |
|
||||
| 5 | [Export to Excel](https://openwebui.com/posts/export_mulit_table_to_excel_244b8f9d) | action |  |  |  |  |  | 2026-02-10 |
|
||||
| 6 | [Markdown Normalizer](https://openwebui.com/posts/markdown_normalizer_baaa8732) | filter |  |  |  |  |  | 2026-01-29 |
|
||||
| 7 | [Flash Card](https://openwebui.com/posts/flash_card_65a2ea8f) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 8 | [AI Task Instruction Generator](https://openwebui.com/posts/ai_task_instruction_generator_9bab8b37) | prompt |  |  |  |  |  | 2026-01-28 |
|
||||
| 9 | [Deep Dive](https://openwebui.com/posts/deep_dive_c0b846e4) | action |  |  |  |  |  | 2026-01-08 |
|
||||
| 10 | [导出为Word增强版](https://openwebui.com/posts/导出为_word_支持公式流程图表格和代码块_8a6306c0) | action |  |  |  |  |  | 2026-02-07 |
|
||||
| 11 | [GitHub Copilot Official SDK Pipe](https://openwebui.com/posts/github_copilot_official_sdk_pipe_ce96f7b4) | pipe |  |  |  |  |  | 2026-02-10 |
|
||||
| 12 | [📂 Folder Memory – Auto-Evolving Project Context](https://openwebui.com/posts/folder_memory_auto_evolving_project_context_4a9875b2) | filter |  |  |  |  |  | 2026-01-20 |
|
||||
| 13 | [智能信息图](https://openwebui.com/posts/智能信息图_e04a48ff) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 14 | [思维导图](https://openwebui.com/posts/智能生成交互式思维导图帮助用户可视化知识_8d4b097b) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 15 | [异步上下文压缩](https://openwebui.com/posts/异步上下文压缩_5c0617cb) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 16 | [闪记卡 (Flash Card)](https://openwebui.com/posts/闪记卡生成插件_4a31eac3) | action |  |  |  |  |  | 2026-01-29 |
|
||||
| 17 | [精读](https://openwebui.com/posts/精读_99830b0f) | action |  |  |  |  |  | 2026-01-08 |
|
||||
| 18 | [GitHub Copilot SDK Files Filter](https://openwebui.com/posts/github_copilot_sdk_files_filter_403a62ee) | filter |  |  |  |  |  | 2026-02-10 |
|
||||
| 19 | [🚀 GitHub Copilot SDK Pipe: AI That Executes, Not Just Talks](https://openwebui.com/posts/github_copilot_sdk_for_openwebui_elevate_your_ai_t_a140f293) | post |  |  |  |  |  | 2026-02-10 |
|
||||
| 20 | [🚀 Open WebUI Prompt Plus: AI-Powered Prompt Manager](https://openwebui.com/posts/open_webui_prompt_plus_ai_powered_prompt_manager_s_15fa060e) | post |  |  |  |  |  | 2026-01-29 |
|
||||
| 21 | [Review of Claude Haiku 4.5](https://openwebui.com/posts/review_of_claude_haiku_45_41b0db39) | review |  |  |  |  |  | 2026-01-14 |
|
||||
| 22 | [ 🛠️ Debug Open WebUI Plugins in Your Browser](https://openwebui.com/posts/debug_open_webui_plugins_in_your_browser_81bf7960) | post |  |  |  |  |  | 2026-01-10 |
|
||||
|
||||
@@ -504,6 +504,12 @@ class OpenWebUIStats:
|
||||
|
||||
print("=" * 60)
|
||||
|
||||
def _safe_key(self, key: str) -> str:
|
||||
"""生成安全的文件名 Key (MD5 hash) 以避免中文字符问题"""
|
||||
import hashlib
|
||||
|
||||
return hashlib.md5(key.encode("utf-8")).hexdigest()
|
||||
|
||||
def generate_markdown(self, stats: dict, lang: str = "zh") -> str:
|
||||
"""
|
||||
生成 Markdown 格式报告 (全动态徽章与 Kroki 图表)
|
||||
@@ -582,7 +588,6 @@ class OpenWebUIStats:
|
||||
f"| {t['upvotes']} | {self.get_badge('upvotes', stats, user, delta)} |"
|
||||
)
|
||||
md.append(f"| {t['saves']} | {self.get_badge('saves', stats, user, delta)} |")
|
||||
md.append(f"| {t['saves']} | {self.get_badge('saves', stats, user, delta)} |")
|
||||
|
||||
# 作者信息
|
||||
if user:
|
||||
@@ -610,20 +615,33 @@ class OpenWebUIStats:
|
||||
|
||||
for i, post in enumerate(stats["posts"], 1):
|
||||
title_link = f"[{post['title']}]({post['url']})"
|
||||
slug = post["slug"]
|
||||
slug_hash = self._safe_key(post["slug"])
|
||||
|
||||
# 使用针对每个帖子的动态徽章
|
||||
# 使用针对每个帖子的动态徽章 (使用 Hash 保证文件名安全)
|
||||
dl_badge = self.get_badge(
|
||||
f"post_{slug}_dl", stats, user, delta, is_post=True
|
||||
f"post_{slug_hash}_dl", stats, user, delta, is_post=True
|
||||
)
|
||||
vw_badge = self.get_badge(
|
||||
f"post_{slug}_vw", stats, user, delta, is_post=True
|
||||
f"post_{slug_hash}_vw", stats, user, delta, is_post=True
|
||||
)
|
||||
up_badge = self.get_badge(
|
||||
f"post_{slug_hash}_up", stats, user, delta, is_post=True
|
||||
)
|
||||
sv_badge = self.get_badge(
|
||||
f"post_{slug_hash}_sv", 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""
|
||||
)
|
||||
|
||||
md.append(
|
||||
f"| {i} | {title_link} | {post['type']} | {post['version']} | "
|
||||
f"{dl_badge} | {vw_badge} | {post['upvotes']} | "
|
||||
f"{post['saves']} | {post['updated_at']} |"
|
||||
f"| {i} | {title_link} | {post['type']} | {ver_badge} | "
|
||||
f"{dl_badge} | {vw_badge} | {up_badge} | "
|
||||
f"{sv_badge} | {post['updated_at']} |"
|
||||
)
|
||||
|
||||
md.append("")
|
||||
@@ -793,16 +811,18 @@ class OpenWebUIStats:
|
||||
)
|
||||
}
|
||||
|
||||
# 生成所有帖子的个体徽章 (用于详细报表)
|
||||
# 生成所有帖子的个体徽章 (用于详细报表)
|
||||
for post in stats.get("posts", []):
|
||||
slug = post["slug"]
|
||||
diff = post_deltas.get(slug, 0)
|
||||
slug_hash = self._safe_key(post["slug"])
|
||||
diff = post_deltas.get(post["slug"], 0)
|
||||
|
||||
# 1. Downloads
|
||||
dl_msg = f"{post['downloads']}"
|
||||
if diff > 0:
|
||||
dl_msg += f" (+{diff}🚀)"
|
||||
|
||||
files_payload[f"badge_post_{slug}_dl.json"] = {
|
||||
files_payload[f"badge_post_{slug_hash}_dl.json"] = {
|
||||
"content": json.dumps(
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
@@ -812,7 +832,9 @@ class OpenWebUIStats:
|
||||
}
|
||||
)
|
||||
}
|
||||
files_payload[f"badge_post_{slug}_vw.json"] = {
|
||||
|
||||
# 2. Views
|
||||
files_payload[f"badge_post_{slug_hash}_vw.json"] = {
|
||||
"content": json.dumps(
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
@@ -823,6 +845,30 @@ class OpenWebUIStats:
|
||||
)
|
||||
}
|
||||
|
||||
# 3. Upvotes
|
||||
files_payload[f"badge_post_{slug_hash}_up.json"] = {
|
||||
"content": json.dumps(
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "Upvotes",
|
||||
"message": f"{post['upvotes']}",
|
||||
"color": "orange",
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
# 4. Saves
|
||||
files_payload[f"badge_post_{slug_hash}_sv.json"] = {
|
||||
"content": json.dumps(
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "Saves",
|
||||
"message": f"{post['saves']}",
|
||||
"color": "lightgrey",
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
# 将生成的 Markdown 报告也作为一个普通 JSON 文件上传到 Gist
|
||||
for lang in ["zh", "en"]:
|
||||
report_content = self.generate_markdown(stats, lang=lang)
|
||||
|
||||
Reference in New Issue
Block a user