Commit Graph

41 Commits

Author SHA1 Message Date
Rumio
07be73c1b7
feat(avatar): 引入头像缓存服务并优化头像获取 (#2055)
Some checks failed
检查bot是否运行正常 / bot check (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
Sequential Lint and Type Check / ruff-call (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Force Sync to Aliyun / sync (push) Has been cancelled
Update Version / update-version (push) Has been cancelled
Sequential Lint and Type Check / pyright-call (push) Has been cancelled
Co-authored-by: webjoin111 <455457521@qq.com>
2025-09-28 08:53:10 +08:00
Rumio
7472cabd48
feat!(ui): 重构图表组件架构,实现数据与样式分离 (#2035)
*  feat!(ui): 重构图表组件架构,实现数据与样式分离

🏗️ **架构重构**
- 移除charts.py中所有硬编码样式参数(grid、tooltip、legend等)
- 将样式配置迁移至主题层style.json文件
- 统一图表模板消费样式文件的能力

📊 **图表组件优化**
- bar_chart: 移除grid和坐标轴show参数
- pie_chart: 移除tooltip、legend样式和series视觉参数
- line_chart: 移除tooltip、grid和坐标轴配置
- radar_chart: 移除tooltip硬编码

🎨 **主题系统增强**
- 新增pie_chart、line_chart、radar_chart的style.json配置
- 更新bar_chart/style.json,添加grid、xAxis、yAxis样式
- 所有图表模板支持deepMerge样式合并逻辑

🔧 **Breaking Changes**
- 图表工厂函数不再接受样式参数
- 主题开发者现可通过style.json完全定制图表外观
- 提升组件可维护性和主题灵活性

* 📦️ build(pyinstaller): 引入 resources.spec 并更新 .gitignore 规则

* 🚨 auto fix by pre-commit hooks

---------

Co-authored-by: webjoin111 <455457521@qq.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-08-28 09:20:15 +08:00
Rumio
6124e217d0
♻️ refactor(UI): 重构UI渲染服务为组件化分层架构 (#2025)
Some checks failed
检查bot是否运行正常 / bot check (push) Waiting to run
Sequential Lint and Type Check / ruff-call (push) Waiting to run
Sequential Lint and Type Check / pyright-call (push) Blocked by required conditions
Release Drafter / Update Release Draft (push) Waiting to run
Force Sync to Aliyun / sync (push) Waiting to run
Update Version / update-version (push) Waiting to run
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
* ♻️ refactor(UI): 重构UI渲染服务为组件化分层架构

♻️ **架构重构**
- UI渲染服务重构为组件化分层架构
- 解耦主题管理、HTML生成、截图功能

 **新增功能**
- `zhenxun.ui` 统一入口,提供 `render`、`markdown`、`vstack` 等API
- `RenderableComponent` 基类和渲染协议抽象
- 新增主题管理器和截图引擎模块

⚙️ **配置优化**
- UI配置迁移至 `superuser/ui_manager.py`
- 新增"重载UI主题"管理指令

🔧 **性能改进**
- 优化渲染缓存,支持组件级透明缓存
- 所有UI组件适配新渲染流程

* 🚨 auto fix by pre-commit hooks

---------

Co-authored-by: webjoin111 <455457521@qq.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-08-18 23:08:22 +08:00
Rumio
11524bcb04
♻️ refactor: 统一图片渲染架构并引入通用UI组件系统 (#2019)
Some checks failed
检查bot是否运行正常 / bot check (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
Sequential Lint and Type Check / ruff-call (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Force Sync to Aliyun / sync (push) Has been cancelled
Update Version / update-version (push) Has been cancelled
Sequential Lint and Type Check / pyright-call (push) Has been cancelled
* ♻️ refactor: 统一图片渲染架构并引入通用UI组件系统

🎨 **渲染服务重构**
- 统一图片渲染入口,引入主题系统支持
- 优化Jinja2环境管理,支持主题覆盖和插件命名空间
- 新增UI缓存机制和主题重载功能

 **通用UI组件系统**
- 新增 zhenxun.ui 模块,提供数据模型和构建器
- 引入BaseBuilder基类,支持链式调用
- 新增多种UI构建器:InfoCard, Markdown, Table, Chart, Layout等
- 新增通用组件:Divider, Badge, ProgressBar, UserInfoBlock

🔄 **插件迁移**
- 迁移9个内置插件至新渲染系统
- 移除各插件中分散的图片生成工具
- 优化数据处理和渲染逻辑

💥 **Breaking Changes**
- 移除旧的图片渲染接口和模板路径
- TEMPLATE_PATH 更名为 THEMES_PATH
- 插件需适配新的RendererService和zhenxun.ui模块

*  test(check): 更新自检插件测试中的渲染服务模拟

* ♻️ refactor(renderer): 将缓存文件名哈希算法切换到 SHA256

* ♻️ refactor(shop): 移除商店HTML图片生成模块

* 🚨 auto fix by pre-commit hooks

---------

Co-authored-by: webjoin111 <455457521@qq.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-08-15 16:34:37 +08:00
HibiKier
67a2560de4
增强权限检查,更新请求管理命令和数据库配置逻辑 (#2011) 2025-08-06 09:02:07 +08:00
Rumio
a0b57b6bea
feat(help): 引入LLM智能帮助并优化其功能 (#1982)
- 【新功能】引入LLM智能帮助功能,当传统帮助未找到结果时,可自动调用LLM提供智能回复
- 【配置项】新增多项LLM帮助相关配置:
    - `ENABLE_LLM_HELPER`: 控制LLM智能帮助的启用与禁用
    - `DEFAULT_LLM_MODEL`: 配置智能帮助使用的LLM模型
    - `LLM_HELPER_STYLE`: 设置LLM回复的口吻或风格
    - `LLM_HELPER_REPLY_AS_IMAGE_THRESHOLD`: 定义LLM回复字数超过此阈值时转为图片发送
- 【逻辑优化】帮助指令处理流程调整:
    - 优先尝试传统插件帮助查询
    - 若传统查询无结果且LLM智能帮助已启用,则调用LLM进行自然语言回答

Co-authored-by: webjoin111 <455457521@qq.com>
Co-authored-by: HibiKier <45528451+HibiKier@users.noreply.github.com>
2025-07-16 13:48:13 +08:00
HibiKier
8649aaaa54
引入缓存机制 (#1889)
* 添加全局cache

*  构建缓存,hook使用缓存

*  新增数据库Model方法监控

*  数据库添加semaphore锁

* 🩹 优化webapi返回数据

*  添加增量缓存与缓存过期

* 🎨 优化检测代码结构

*  优化hook权限检测性能

* 🐛 添加新异常判断跳过权限检测

*  添加插件limit缓存

* 🎨 代码格式优化

* 🐛  修复代码导入

* 🐛 修复刷新时检查

* 👽 Rename exception for missing database URL in initialization

*  Update default database URL to SQLite in configuration

* 🔧 Update tortoise-orm and aiocache dependencies restrictions; add optional redis and asyncpg support

* 🐛 修复ban检测

* 🐛 修复所有插件关闭时缓存更新

* 🐛 尝试迁移至aiocache

* 🐛 完善aiocache缓存

*  代码性能优化

* 🐛 移除获取封禁缓存时的日志记录

* 🐛 修复缓存类型声明,优化封禁用户处理逻辑

* 🐛 优化LevelUser权限更新逻辑及数据库迁移

*  cache支持redis连接

* 🚨 auto fix by pre-commit hooks

*  :增强获取群组的安全性和准确性。同时,优化了缓存管理中的相关逻辑,确保缓存操作的一致性。

*  feat(auth_limit): 将插件初始化逻辑的启动装饰器更改为优先级管理器

* 🔧 修复日志记录级别

* 🔧 更新数据库连接字符串

* 🔧 更新数据库连接字符串为内存数据库,并优化权限检查逻辑

*  feat(cache): 增加缓存功能配置项,并新增数据访问层以支持缓存逻辑

* ♻️ 重构cache

*  feat(cache): 增强缓存管理,新增缓存字典和缓存列表功能,支持过期时间管理

* 🔧 修复Notebook类中的viewport高度设置,将其从1000调整为10

*  更新插件管理逻辑,替换缓存服务为CacheRoot并优化缓存失效处理

*  更新RegisterConfig类中的type字段

*  修复清理重复记录逻辑,确保检查记录的id属性有效性

*  超级无敌大优化,解决延迟与卡死问题

*  更新封禁功能,增加封禁时长参数和描述,优化插件信息返回结构

*  更新zhenxun_help.py中的viewport高度,将其从453调整为10,以优化页面显示效果

*  优化插件分类逻辑,增加插件ID排序,并更新插件信息返回结构

---------

Co-authored-by: BalconyJH <balconyjh@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-07-14 22:35:29 +08:00
HibiKier
d0f296bc9c
新增html详细帮助模板以及md模板和文本模板 (#1919)
*  添加markdown构建类

*  添加html帮助样式和文本模板
2025-06-23 15:33:46 +08:00
HibiKier
13579f5842
使用道具允许at目标用户 (#1877)
*  使用道具允许at目标用户

*  修改帮助配置项默认值

*  修改帮助配置项默认值

* 🎨 优化广播方法

* 💡 添加广播方法注释
2025-06-16 09:18:58 +08:00
HibiKier
9cda0e5d8f
适配新版本webui (#1905)
Co-authored-by: molanp <104612722+molanp@users.noreply.github.com>
Co-authored-by: BalconyJH <73932916+BalconyJH@users.noreply.github.com>
2025-05-15 23:52:20 +08:00
HibiKier
264929e5cb
新增好感度/金币设置和详细帮助 (#1831)
*  新增好感度/金币设置和详细帮助

* 🔧 修复html帮助
2025-01-10 18:39:23 +08:00
HibiKier
e814469b75 Compatible with pydantic 2.0 using the pydantic compatibility layer provided by nonebot 2025-01-10 12:19:11 +08:00
BalconyJH
a34e433ebf
🐛 Fix help_type in create_help_img may be none and cause AttributeError. (#1791) 2024-12-21 20:46:00 +08:00
BalconyJH
bc5a9c4fcc
Develop: 完全使用 ruff 替代 isort 与 black (#1757)
* 🚨 完全使用 ruff 替代 isort 与 black

* 🚨 ruff lint&format
2024-12-10 19:49:11 +08:00
HibiKier
c7c759f2b1
插件配置新增is_show控制是否显示在菜单中 (#1749) 2024-11-29 10:01:50 +08:00
HibiKier
900cf6fa53
🎨 对zhenxun版本帮助进行排序优化页面效果 (#1748) 2024-11-28 23:02:12 +08:00
HibiKier
75e10fe38a 🎨 修改早安时间 2024-10-19 18:12:35 +08:00
HibiKier
6dfebaae96 🎨 帮助界面优化 2024-10-19 01:26:30 +08:00
HibiKier
3d3a2a5f7f
部分功能适配QQ BOT (#1701) 2024-10-18 18:57:55 +08:00
HibiKier
28b61e57cd
新增超级用户与管理员帮助模板 (#1655) 2024-09-27 16:59:41 +08:00
HibiKier
6be9e477b1
🐛 修复群组中帮助功能状态显示问题 (#1650) 2024-09-25 18:29:01 +08:00
HibiKier
029a731fb9
重构帮助,限制普通用户查询管理插件 (#1626) 2024-09-14 05:23:55 +08:00
HibiKier
94ef33264b
🐛 签到文本适应 (#1622) 2024-09-11 12:53:12 +08:00
HibiKier
a8355fbab9
🐛 修复功能少时zhenxun帮助图片排序问题 (#1620) 2024-09-11 11:53:49 +08:00
HibiKier
62fd93c1ff 🐛 过滤父插件 2024-09-07 13:54:25 +08:00
HibiKier
e10fee74b3 新版帮助ui 2024-08-28 19:08:22 +08:00
HibiKier
99774adc87 插件商店 2024-08-20 21:29:42 +08:00
HibiKier
862c977eda ️ 优化权限判断 2024-08-18 22:26:53 +08:00
HibiKier
23bfaa530b 🎨 代码优化 2024-08-15 23:52:19 +08:00
HibiKier
8aa719cce7 🎨 代码优化 2024-08-15 21:29:49 +08:00
HibiKier
e0a3fe526e 🎨 统一发送格式 2024-08-10 02:25:04 +08:00
HibiKier
f86bc50dba ️ 修改帮助命令匹配优先级 2024-08-06 00:00:55 +08:00
HibiKier
21b73b085e 🎨 删除多余包引入 2024-08-04 19:34:02 +08:00
HibiKier
3b2273e75b 🐛 修复帮助功能中的菜单类型重复及图片模糊处理 2024-07-31 19:10:31 +08:00
HibiKier
2a49d86d9f feat: 新增功能ID搜索及修复相关错误 2024-07-31 18:34:22 +08:00
HibiKier
ebec169e67 feat: 画廊操作 2024-05-15 23:24:35 +08:00
HibiKier
aa68553539 fix🐛: 修改图片bytes发送 2024-02-28 00:38:54 +08:00
HibiKier
f6bc6f3481 feat: 添加单个插件帮助图片 2024-02-27 16:13:06 +08:00
HibiKier
993ff81130 feat: 添加shortcut和usage 2024-02-27 16:12:56 +08:00
HibiKier
7b3793728a feat: 添加hook,更新其他 2024-02-26 03:04:32 +08:00
HibiKier
eb0572ea77 feat: 更新内置插件 2024-02-25 03:18:34 +08:00