🎨 调整管理帮助宽度

This commit is contained in:
HibiKier 2025-07-15 20:16:23 +08:00
parent a3671aa9b6
commit 135c6d83bf
3 changed files with 21 additions and 2 deletions

View File

@ -25,6 +25,11 @@ __plugin_meta__ = PluginMetadata(
version="0.1", version="0.1",
plugin_type=PluginType.ADMIN, plugin_type=PluginType.ADMIN,
admin_level=1, admin_level=1,
introduction="""这是 群主/群管理 的帮助列表,里面记录了群组内开关功能的
方法帮助以及群管特权方法建议首次时在群组中发送 '管理员帮助' 查看""",
precautions=[
"只有群主/群管理 才能使用哦群主拥有6级权限管理员拥有5级权限"
],
configs=[ configs=[
RegisterConfig( RegisterConfig(
key="type", key="type",

View File

@ -16,7 +16,8 @@ async def get_task() -> dict[str, str] | None:
"name": "被动技能", "name": "被动技能",
"description": "控制群组中的被动技能状态", "description": "控制群组中的被动技能状态",
"usage": "通过 开启/关闭群被动 来控制群被动 <br>" "usage": "通过 开启/关闭群被动 来控制群被动 <br>"
+ " 示例:开启/关闭群被动早晚安 <br> ---------- <br> " + " 示例:开启/关闭群被动早晚安 <br> 示例:开启/关闭全部群被动"
+ " <br> ---------- <br> "
+ "<br>".join([task.name for task in task_list]), + "<br>".join([task.name for task in task_list]),
} }
return None return None
@ -47,7 +48,7 @@ async def build_html_help():
} }
}, },
pages={ pages={
"viewport": {"width": 1024, "height": 1024}, "viewport": {"width": 824, "height": 10},
"base_url": f"file://{TEMPLATE_PATH}", "base_url": f"file://{TEMPLATE_PATH}",
}, },
wait=2, wait=2,

View File

@ -344,6 +344,16 @@ class ShopManage:
if goods_name.isdigit(): if goods_name.isdigit():
try: try:
user = await UserConsole.get_user(user_id=session.user.id) user = await UserConsole.get_user(user_id=session.user.id)
goods_list = await GoodsInfo.filter(uuid__in=user.props.keys()).all()
goods_by_uuid = {item.uuid: item for item in goods_list}
props_str = str(user.props)
user.props = {
uuid: count
for uuid, count in user.props.items()
if count > 0 and goods_by_uuid.get(uuid)
}
if props_str != str(user.props):
await user.save(update_fields=["props"])
uuid = list(user.props.keys())[int(goods_name)] uuid = list(user.props.keys())[int(goods_name)]
goods_info = await GoodsInfo.get_or_none(uuid=uuid) goods_info = await GoodsInfo.get_or_none(uuid=uuid)
except IndexError: except IndexError:
@ -501,11 +511,14 @@ class ShopManage:
goods_list = await GoodsInfo.filter(uuid__in=user.props.keys()).all() goods_list = await GoodsInfo.filter(uuid__in=user.props.keys()).all()
goods_by_uuid = {item.uuid: item for item in goods_list} goods_by_uuid = {item.uuid: item for item in goods_list}
props_str = str(user.props)
user.props = { user.props = {
uuid: count uuid: count
for uuid, count in user.props.items() for uuid, count in user.props.items()
if count > 0 and goods_by_uuid.get(uuid) if count > 0 and goods_by_uuid.get(uuid)
} }
if props_str != str(user.props):
await user.save(update_fields=["props"])
table_rows = [] table_rows = []
for i, prop_uuid in enumerate(user.props): for i, prop_uuid in enumerate(user.props):