mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
✨ 添加适配
This commit is contained in:
parent
ff75e2ee92
commit
559a3cc484
@ -46,7 +46,10 @@ class MenuManage:
|
|||||||
icon="database",
|
icon="database",
|
||||||
),
|
),
|
||||||
MenuItem(
|
MenuItem(
|
||||||
name="系统信息", module="system", router="/system", icon="system"
|
name="文件管理", module="system", router="/system", icon="system"
|
||||||
|
),
|
||||||
|
MenuItem(
|
||||||
|
name="关于我们", module="about", router="/about", icon="about"
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
self.save()
|
self.save()
|
||||||
|
|||||||
@ -52,6 +52,10 @@ class ApiDataSource:
|
|||||||
status=plugin.status,
|
status=plugin.status,
|
||||||
author=plugin.author,
|
author=plugin.author,
|
||||||
block_type=plugin.block_type,
|
block_type=plugin.block_type,
|
||||||
|
is_builtin="builtin_plugins" in plugin.module_path
|
||||||
|
or plugin.plugin_type == PluginType.HIDDEN,
|
||||||
|
allow_setting=plugin.plugin_type != PluginType.HIDDEN,
|
||||||
|
allow_switch=plugin.plugin_type != PluginType.HIDDEN,
|
||||||
)
|
)
|
||||||
plugin_list.append(plugin_info)
|
plugin_list.append(plugin_info)
|
||||||
return plugin_list
|
return plugin_list
|
||||||
|
|||||||
@ -78,6 +78,13 @@ class PluginInfo(BaseModel):
|
|||||||
author: str | None = None
|
author: str | None = None
|
||||||
"""作者"""
|
"""作者"""
|
||||||
block_type: BlockType | None = Field(None, description="插件禁用状态 (None: 启用)")
|
block_type: BlockType | None = Field(None, description="插件禁用状态 (None: 启用)")
|
||||||
|
"""禁用状态"""
|
||||||
|
is_builtin: bool = False
|
||||||
|
"""是否为内置插件"""
|
||||||
|
allow_switch: bool = True
|
||||||
|
"""是否允许开关"""
|
||||||
|
allow_setting: bool = True
|
||||||
|
"""是否允许设置"""
|
||||||
|
|
||||||
|
|
||||||
class PluginConfig(BaseModel):
|
class PluginConfig(BaseModel):
|
||||||
|
|||||||
@ -36,6 +36,8 @@ async def _(path: str | None = None) -> Result[list[DirFile]]:
|
|||||||
is_image=is_image,
|
is_image=is_image,
|
||||||
name=file,
|
name=file,
|
||||||
parent=path,
|
parent=path,
|
||||||
|
size=None if file_path.is_dir() else file_path.stat().st_size,
|
||||||
|
mtime=file_path.stat().st_mtime,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return Result.ok(data_list)
|
return Result.ok(data_list)
|
||||||
|
|||||||
@ -14,6 +14,10 @@ class DirFile(BaseModel):
|
|||||||
"""文件夹或文件名称"""
|
"""文件夹或文件名称"""
|
||||||
parent: str | None = None
|
parent: str | None = None
|
||||||
"""父级"""
|
"""父级"""
|
||||||
|
size: int | None = None
|
||||||
|
"""文件大小"""
|
||||||
|
mtime: float | None = None
|
||||||
|
"""修改时间"""
|
||||||
|
|
||||||
|
|
||||||
class DeleteFile(BaseModel):
|
class DeleteFile(BaseModel):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user