diff --git a/packages/webui/src/components/debug/action-tester.tsx b/packages/webui/src/components/debug/action-tester.tsx index fd7916db..a463d8ee 100644 --- a/packages/webui/src/components/debug/action-tester.tsx +++ b/packages/webui/src/components/debug/action-tester.tsx @@ -8,7 +8,6 @@ import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'; import { motion } from 'motion/react'; import { AlertTriangle, FlaskConical, History, Loader2, Play, RotateCcw, ShieldCheck, Trash2, Zap } from 'lucide-react'; -import { Select } from '@/components/ui/select'; import { Textarea } from '@/components/ui/textarea'; import { Picker } from '@/components/ui/picker'; import { JsonTree } from '@/components/ui/json-tree'; @@ -27,6 +26,10 @@ const cardCls = 'rounded-2xl border border-border/60 bg-card/80 shadow-[0_1px_2p // stakes (the amber banner already warns that any write is real). const DESTRUCTIVE_RE = /(kick|ban|mute|recall|withdraw|delete|del_|dismiss|disband|leave|quit|remove|revoke)/i; +function qqAvatarUrl(uin: string) { + return `/avatar/${encodeURIComponent(uin)}`; +} + function coerceParam(type: string, raw: string): unknown { if (raw === '') return undefined; if (/int|uint|number|messageId/i.test(type)) { @@ -82,6 +85,18 @@ export function ActionTester({ accounts, docs, presetAction }: { accounts: QQInf const isStream = !!doc?.stream; const isDestructive = DESTRUCTIVE_RE.test(actionName); + const accountOptions = useMemo( + () => accounts.length === 0 + ? [{ value: '', label: '(无在线账号)' }] + : accounts.map((a) => ({ + value: a.uin, + label: a.nickname || a.uin, + sub: a.nickname ? a.uin : undefined, + avatar: qqAvatarUrl(a.uin), + })), + [accounts], + ); + const actionOptions = useMemo( () => docs.map((d) => ({ value: d.name, label: d.name, sub: d.summary })), [docs], @@ -201,10 +216,15 @@ export function ActionTester({ accounts, docs, presetAction }: { accounts: QQInf