From a9dbb9655b58abc28abfcab92f8a8a72a3674bd8 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sun, 25 Jan 2026 16:04:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=92=8C=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=8E=9F=E5=A7=8B=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/chat-fragment/ChatMessageContainer.tsx | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/client/ui/chat-fragment/ChatMessageContainer.tsx b/client/ui/chat-fragment/ChatMessageContainer.tsx index 2536edf..87a09e3 100644 --- a/client/ui/chat-fragment/ChatMessageContainer.tsx +++ b/client/ui/chat-fragment/ChatMessageContainer.tsx @@ -1,6 +1,7 @@ import { Message } from 'lingchair-client-protocol' import * as React from 'react' import ChatMessage from './ChatMessage.tsx' +import { dialog } from 'mdui' export default function ChatMessageContainer({ messages }: { messages: Message[] }) { return ( @@ -53,7 +54,51 @@ export default function ChatMessageContainer({ messages }: { messages: Message[] } - + { + const user = await msg.getUser().then((re) => re?.bean) || {} + dialog({ + headline: "Info", + body: `${Object.keys(user) + // @ts-ignore 懒 + .map((k) => `${k} = ${user[k]}`) + .join('

')}`, + closeOnEsc: true, + closeOnOverlayClick: true, + actions: [ + { + text: "关闭", + onClick: () => { + return true + }, + } + ] + }).addEventListener('click', (e) => e.stopPropagation()) + }}>JSON + ]} + messageMenuItems={[ + dialog({ + headline: "Info", + body: `${Object.keys(msg.bean) + // @ts-ignore 懒 + .map((k) => `${k} = ${msg.bean[k]}`) + .join('

')}`, + closeOnEsc: true, + closeOnOverlayClick: true, + actions: [ + { + text: "关闭", + onClick: () => { + return true + }, + } + ] + }).addEventListener('click', (e) => e.stopPropagation())}>Info
+ ]} + /> }) })()