mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
✨ 插件配置新增is_show控制是否显示在菜单中
This commit is contained in:
parent
900cf6fa53
commit
bab4ab93cc
@ -29,6 +29,7 @@ __plugin_meta__ = PluginMetadata(
|
|||||||
author="HibiKier",
|
author="HibiKier",
|
||||||
version="0.1",
|
version="0.1",
|
||||||
plugin_type=PluginType.DEPENDANT,
|
plugin_type=PluginType.DEPENDANT,
|
||||||
|
is_show=False,
|
||||||
configs=[
|
configs=[
|
||||||
RegisterConfig(
|
RegisterConfig(
|
||||||
key="type",
|
key="type",
|
||||||
|
|||||||
@ -13,6 +13,7 @@ async def sort_type() -> dict[str, list[PluginInfo]]:
|
|||||||
menu_type__not="",
|
menu_type__not="",
|
||||||
load_status=True,
|
load_status=True,
|
||||||
plugin_type__in=[PluginType.NORMAL, PluginType.DEPENDANT],
|
plugin_type__in=[PluginType.NORMAL, PluginType.DEPENDANT],
|
||||||
|
is_show=True,
|
||||||
)
|
)
|
||||||
sort_data = {}
|
sort_data = {}
|
||||||
for plugin in data:
|
for plugin in data:
|
||||||
|
|||||||
@ -136,6 +136,7 @@ async def _():
|
|||||||
"version",
|
"version",
|
||||||
"admin_level",
|
"admin_level",
|
||||||
"plugin_type",
|
"plugin_type",
|
||||||
|
"is_show",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
update_list.append(plugin)
|
update_list.append(plugin)
|
||||||
|
|||||||
@ -203,6 +203,8 @@ class PluginExtraData(BaseModel):
|
|||||||
"""额外名称"""
|
"""额外名称"""
|
||||||
sql_list: list[str] | None = None
|
sql_list: list[str] | None = None
|
||||||
"""常用sql"""
|
"""常用sql"""
|
||||||
|
is_show: bool = True
|
||||||
|
"""是否显示在菜单中"""
|
||||||
|
|
||||||
|
|
||||||
class NoSuchConfig(Exception):
|
class NoSuchConfig(Exception):
|
||||||
|
|||||||
@ -48,6 +48,8 @@ class PluginInfo(Model):
|
|||||||
"""是否删除"""
|
"""是否删除"""
|
||||||
parent = fields.CharField(max_length=255, null=True, description="父插件")
|
parent = fields.CharField(max_length=255, null=True, description="父插件")
|
||||||
"""父插件"""
|
"""父插件"""
|
||||||
|
is_show = fields.BooleanField(default=True, description="是否显示在帮助中")
|
||||||
|
"""是否显示在帮助中"""
|
||||||
|
|
||||||
class Meta: # type: ignore
|
class Meta: # type: ignore
|
||||||
table = "plugin_info"
|
table = "plugin_info"
|
||||||
@ -81,4 +83,5 @@ class PluginInfo(Model):
|
|||||||
async def _run_script(cls):
|
async def _run_script(cls):
|
||||||
return [
|
return [
|
||||||
"ALTER TABLE plugin_info ADD COLUMN parent character varying(255);",
|
"ALTER TABLE plugin_info ADD COLUMN parent character varying(255);",
|
||||||
|
"ALTER TABLE plugin_info ADD COLUMN is_show boolean DEFAULT true;",
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user