diff --git a/README.md b/README.md index 8cdf6e4..1f83017 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ A collection of enhancements, plugins, and prompts for [OpenWebUI](https://githu ## 📊 Community Stats -> > ![updated](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_updated.json&style=flat) | 👤 Author | 👥 Followers | ⭐ Points | 🏆 Contributions | @@ -20,8 +19,8 @@ A collection of enhancements, plugins, and prompts for [OpenWebUI](https://githu | :---: | :---: | :---: | :---: | :---: | | ![posts](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_posts.json&style=flat) | ![downloads](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_downloads.json&style=flat) | ![views](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_views.json&style=flat) | ![upvotes](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_upvotes.json&style=flat) | ![saves](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_saves.json&style=flat) | -### 🔥 Top 6 Popular Plugins +### 🔥 Top 6 Popular Plugins | Rank | Plugin | Version | Downloads | Views | 📅 Updated | | :---: | :--- | :---: | :---: | :---: | :---: | | 🥇 | [Smart Mind Map](https://openwebui.com/posts/turn_any_text_into_beautiful_mind_maps_3094c59a) | ![v](https://img.shields.io/badge/v-0.9.2-blue?style=flat) | ![p1_dl](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_p1_dl.json&style=flat) | ![p1_vw](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_p1_vw.json&style=flat) | ![updated](https://img.shields.io/badge/2026--01--29-gray?style=flat) | @@ -32,8 +31,7 @@ A collection of enhancements, plugins, and prompts for [OpenWebUI](https://githu | 6️⃣ | [Markdown Normalizer](https://openwebui.com/posts/markdown_normalizer_baaa8732) | ![v](https://img.shields.io/badge/v-1.2.4-blue?style=flat) | ![p6_dl](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_p6_dl.json&style=flat) | ![p6_vw](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_p6_vw.json&style=flat) | ![updated](https://img.shields.io/badge/2026--01--29-gray?style=flat) | ### 📈 Total Downloads Trend - -![Activity](https://kroki.io/vegalite/svg/eNqNlsFu2zAMhl8l8Nbb0liULdu9bo_Q27CDEiuxVsXybCVpEeTdR6lN0IU0sEsgSp9Iir8s5px9nTad2evsaZF1IQzT02p1NDv9uLOhO6wfrV-9A2l26Wwwq2P5-HvyffZtkbVm2ox2CBZN9PDsg3aLH_7UO6_bafE8mr6N3Mm2oUOiznO0OmN3XUATkjnotrX9Du0SrbXevOxGf8CN6DGMup8GjX5C9LPx_dZG8pwdrTmlwRRG_2Lu4QvS-tVOCWn9XtuY4Va7yeDKbrTt1bxEtNVBv7vV7mDirp_nOJn8Qg5qmYtlXqYzX4-HS1VR426GVPdkLXOerO7JRpQ8WROyAp5s7kmRC8WiIqdoXfGoIKio-QQEEBTKmQQkQWUhebQgaKH4qgqilChh5liKog2vqiBaCaVmUCKWqNRMBahatSxYFKhaDfASAFWrmTkWELUgn8kViFowdweAqAVQ8hIAUQvkXAWIWlDMfINA1IJSzqBELVDQ8ChRC6qav4SSqAV1xVdAErWgqbgEAOl7VObs24IoEVYK9r4iSoSVIBWPEmGlrAoeJcLKkr2vwLyYUinJo0RYWc0Viwgr62omASKsbBq-AvTRLIQUPCooim_Wr9hz9np8ST0nvA1pE3YuHXFne5MWNt75Ma58wedTmnXqatfJc_Yq4meNU2_XwStcZ-IgT51OtzY2xKd3v3qMEabgh48m57fbyYQP-hbw1GGnz9KRboD4DNwy-pX6p-k3_qOJY17pd2uNSz081QSZ6zGD2Q9-1C773KK3ftzrlOXDfvmQ_jQEG1zc0B-ci1XRa-O-3-IrpbIU-u0u2q3Wn0L-Oege3elgj-afsP8T43L5C23qg4U=) +![Activity](https://kroki.io/vegalite/svg/eNqNUj2T2jAQ_SuMkusCNtzYcLTJpEh9XSbF2lrbG2TJkdYYhuG_ZyUwQ65KY-ut3r63H7qoz6HusAe1X6iOeQj7LDtiC6uWuBurFbnsRkjRpSHG7Fisfgdn1ZeF0hhqTwOTQFF4dwxm8c1N1jjQYfHu0erIm0hzJ4xdngvqkNqOBW4SHEBrsq3gQlAF9aH1bpREUWQPNgwgOhx1amcbisyLOhJO6RDYuwN-JF-FDScKiaJdDxQrbMAElJvWk57hNVI1MCTq6M3zLFoKfJ_FGNCLP4v6qnZ99n1c_iDMdPWq34pyt823Bex2OTRls24q2Ja63L7VZeZhyuoOPC-jyW100bIHf0iWfB5S-VI4xCYNWUwXtTPOx5tPm6J8xSqlzcGLOq3lt5bQeT6cNnMkHvLUKGiK89jfdMFHh8BuiJP5eVGuaQLynf0wnDpZdLR7IqyfCY-KfqXxoa3dfYdSV_o2hCatULrGaDq3ydgPzoNRzxtqnO8hVfnSL1_Sm2FiExPsaEycClRovj78y7JUyfr8wW1-fM-Wf0awIgdMR_zH9n88rte_Foz4-Q==) *See full stats and charts in [Community Stats Report](./docs/community-stats.md)* diff --git a/README_CN.md b/README_CN.md index 94d5895..9688b70 100644 --- a/README_CN.md +++ b/README_CN.md @@ -28,7 +28,7 @@ OpenWebUI 增强功能集合。包含个人开发与收集的插件、提示词 | 6️⃣ | [Markdown Normalizer](https://openwebui.com/posts/markdown_normalizer_baaa8732) | ![v](https://img.shields.io/badge/v-1.2.4-blue?style=flat) | ![p6_dl](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_p6_dl.json&style=flat) | ![p6_vw](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2FFu-Jie%2Fdb3d95687075a880af6f1fba76d679c6%2Fraw%2Fbadge_p6_vw.json&style=flat) | ![updated](https://img.shields.io/badge/2026--01--29-gray?style=flat) | ### 📈 总下载量累计趋势 -![Activity](https://kroki.io/vegalite/svg/eNqNlsFy2yAQhl8loza3OoZFAinXPkadAxLIopGFKiE7GY_fvUBiT-pFM70wWvjYXfbHrM_Z97np9EFmzw9Z59w4P2-3R72XT3vjuqV-Mnb7AcTZTW-c3h6Lp9-zHbIfD5nSczOZ0Rlveg-7hRNW75ZcEz-WrVC7paJNu1uEAj-WtaR-VKVfLaBug4uTUa7zm0tCvNVps--cNyGao1TKDHtvF96qZfO6n-wyqBDMTXKYRznpwQU_jR1aE8hzdjT6FD9mN9lXfQ9fPC3fzBwRZQ_ShORb2c_ar-wno67mJaBKOvnhVvaLDrt-ncNk9AsE-IbQDSliOexp6K1UARJ56XcnSH5PloykSXFPVrRIkyUiBaTJ6p6khPIkSglGS5FGKUJpmU6AAkKhWEmAIZTlLI3mCM15uqoUKUULWDkWx2iVVpUirSjnKygSiwq-UgGsVsnyJApYrQrSEgBWq1o5FiC1gKzkCkgtWLsDgNQCKNISAFIL2FoFkFqQr_wGAakFBVtBkVrAoUqjSC0QZfoSMqQWlCJdAYbUgkqkEgBP36OMJN8WjyJhGU3eV48iYRkwnkaRsIyJPI0iYVmRvK-QeDEZ5yyNImGZWCsWEpaVYiUBJCyrqnQF8KOZU0bTKMWof7NeQs85yOk19hz3PsZNvnPJgPdm0HGhsb2dwso3_3wyXceudp08Z280_Kz91Pv14w2uM-GDxE4nlQkN8fnDr5xChNnZ8bPJ2badtfukbwFPnf8TkMUj3QD6Fbhl9BL7px4a-9nEfV5xbI3uYw-PNfHM9ZhOH0Y7yT772qJbOx1kzPLxsHlUkTeuDxuGpe9DVWSt-5-3-JzzLIZ-v4t2q_WXkH8WOXh30pmj_ifs_8S4XP4CD5SLdw==) +![Activity](https://kroki.io/vegalite/svg/eNqNksuy2jAMhl_lTNqzK-RCc4FtZ7roK5QulFhOXBw79YXAMLx7ZUOY9Ky6USzptz5Jzi35bLsBR0gOb8ng3GQPaXrGHra9cINvt0KnD0GMbqRwmJ7L7W-rVfLlLWFoOyMmJ8ilCkdfZbv26L9iRrbhNTv6fd7xo69ZQbZpISfLGsqWRctDiVkwN9DlJsvIG1D0gyO3iO4EjAnVk1-S10J36o32igWYM6DsBAaVC3U6rbgIyltyFjjHg3VGn_Cj-E5quAgbJUyPIELzHKRFyvRGsMW9BykDB1HqjVyvqRfWPdfkLRriO6q-7fSYfvebHwJT1u7YvqyaOqtLaJoMeMVz3kJdsared1VqYE67AYzbBMhjqwE5gjlFpLtOsX1qHMKQUiiMiU5LbULmU1FWO2zjtSV4Sy45fXIKXZfDpVgi4ZDFQYGJsI_Doy6YQLBOT2EzP2-J5tyie6pfwHmgfyDgVoJ8LXh19CuuD1Wnn29IfUXLBcr4hDQ1BugypsNx0gZksn4hrs0Iscv3cfPOol44GS4oL2XYCrQov734VVUlEX39QNOzkhqYXSP_eFBUDpw44z_Y_2Hc738BAXQA-g==) *完整统计与趋势图请查看 [社区统计报告](./docs/community-stats.zh.md)* diff --git a/scripts/openwebui_stats.py b/scripts/openwebui_stats.py index 7c81611..935338a 100644 --- a/scripts/openwebui_stats.py +++ b/scripts/openwebui_stats.py @@ -1134,22 +1134,50 @@ class OpenWebUIStats: print(f"✅ README 已更新: {readme_path}") - def generate_activity_chart(self, lang: str = "zh") -> str: - """生成 Vega-Lite 趋势图 (更美观)""" + def upload_chart_data(self, stats: dict): + """上传图表数据到 Gist (独立于徽章数据)""" + if not (self.gist_token and self.gist_id): + return + history = self.load_history() if len(history) < 3: + return + + # 准备图表数据点 + chart_data = [] + for item in history: + chart_data.append( + {"date": item["date"], "downloads": item["total_downloads"]} + ) + + try: + url = f"https://api.github.com/gists/{self.gist_id}" + headers = {"Authorization": f"token {self.gist_token}"} + payload = { + "files": { + "chart-data.json": { + "content": json.dumps(chart_data, ensure_ascii=False, indent=2) + } + } + } + resp = requests.patch(url, headers=headers, json=payload) + if resp.status_code == 200: + print(f"✅ 图表数据已同步至 Gist") + except Exception as e: + print(f"⚠️ 图表数据同步失败: {e}") + + def generate_activity_chart(self, lang: str = "zh") -> str: + """生成 Vega-Lite 趋势图 (使用外部数据源,URL 固定)""" + if not (self.gist_token and self.gist_id): return "" - data = history # 使用全量历史数据 - - # 准备数据点 - values = [] - for item in data: - values.append({"date": item["date"], "downloads": item["total_downloads"]}) - title = "Total Downloads Trend" if lang == "en" else "总下载量累计趋势" - # Vega-Lite Spec + # 使用 Gist Raw URL 作为数据源 + gist_user = "Fu-Jie" + data_url = f"https://gist.githubusercontent.com/{gist_user}/{self.gist_id}/raw/chart-data.json" + + # Vega-Lite Spec (数据从外部 URL 加载) vl_spec = { "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "description": title, @@ -1161,7 +1189,7 @@ class OpenWebUIStats: "view": {"stroke": "transparent"}, "axis": {"domain": False, "grid": False}, }, - "data": {"values": values}, + "data": {"url": data_url}, # 外部数据源 "mark": { "type": "area", "line": {"color": "#2563eb"}, @@ -1192,7 +1220,7 @@ class OpenWebUIStats: } try: - # Kroki encoding for Vega-Lite + # Kroki encoding for Vega-Lite (spec 固定,URL 也固定) json_spec = json.dumps(vl_spec) compressed = zlib.compress(json_spec.encode("utf-8"), level=9) encoded = base64.urlsafe_b64encode(compressed).decode("utf-8") @@ -1268,7 +1296,11 @@ def main(): stats_client.save_json(stats, str(json_path)) # 生成 Shields.io endpoint JSON (用于动态徽章) - badges_dir = script_dir / "docs" / "badges" + badges_dir = script_dir / "docs" + # 上传图表数据到 Gist (独立存储) + stats_client.upload_chart_data(stats) + + # 生成徽章 stats_client.generate_shields_endpoints(stats, str(badges_dir)) # 更新 README 文件