- Global connection badge in app header (persistent dashboard SSE via ConnectionProvider) - LogProvider keeps log data and SSE stream alive across page switches (no reload spinner) - Config drawer: password reveal toggle, array-type row editor for list fields - Plugin management: optimistic updates, race-free loading, reset all group overrides - Logs: load-earlier pagination; backend tail-read optimization (before/end offsets) - web_auth: Web password changes persist (sync_admin seeding only when .env has explicit key) - Dashboard: collect in thread pool + 1s result cache - ErrorBoundary + local Suspense: plugin chunk loading stays inside content area - UI polish: table row hover, mobile header/breadcrumb fixes, wider config drawer - config_standard: array type inference for list fields; array env skip - random_jm_code / steam_info: array schema migration; README web frontend note Co-Authored-By: Claude Code <noreply@anthropic.com>
30 lines
915 B
Python
30 lines
915 B
Python
"""触发器(Trigger)层:接触发 → 鉴权 → 调 service → 出 View。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from nonebot import on_command
|
|
from nonebot.adapters import Message
|
|
from nonebot.rule import to_me
|
|
from nonebot.params import CommandArg
|
|
from nonebot_plugin_alconna import UniMessage
|
|
|
|
from hexi.web_config import get_effective_value
|
|
|
|
from ..services.main import do_something
|
|
|
|
_PLUGIN_ID = __package__.rsplit(".", 1)[0]
|
|
|
|
cmd = on_command("模板指令", aliases={"模板"}, rule=to_me(), priority=10, block=True)
|
|
|
|
|
|
@cmd.handle()
|
|
async def handle(arg: Message = CommandArg()):
|
|
if not get_effective_value(_PLUGIN_ID, "enable", True):
|
|
await cmd.finish("模板插件已停用")
|
|
return
|
|
text = arg.extract_plain_text().strip()
|
|
if not text:
|
|
await cmd.finish("请提供要记录的内容")
|
|
result = await do_something(text)
|
|
await UniMessage.text(result).send()
|