mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 15:25:50 +00:00
@@ -4133,3 +4133,169 @@
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 消息信息弹窗
|
||||||
|
.message-info-overlay {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.4);
|
||||||
|
backdrop-filter: blur(4px);
|
||||||
|
z-index: 2000;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-info-modal {
|
||||||
|
width: 360px;
|
||||||
|
max-width: 90vw;
|
||||||
|
max-height: 80vh;
|
||||||
|
background: var(--card-bg);
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: 12px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.detail-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 16px;
|
||||||
|
border-bottom: 1px solid var(--border-color);
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text-primary);
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-btn {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
border-radius: 6px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--bg-hover);
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-content {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 16px;
|
||||||
|
|
||||||
|
&::-webkit-scrollbar { width: 4px; }
|
||||||
|
&::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: 2px; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-section {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
&:last-child { margin-bottom: 0; }
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
margin-bottom: 12px;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
|
||||||
|
svg { opacity: 0.7; }
|
||||||
|
|
||||||
|
.copy-btn {
|
||||||
|
margin-left: auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
padding: 0;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
cursor: pointer;
|
||||||
|
&:hover { background: var(--bg-secondary); color: var(--text-primary); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 8px 0;
|
||||||
|
border-bottom: 1px solid var(--border-color);
|
||||||
|
font-size: 13px;
|
||||||
|
|
||||||
|
&:last-child { border-bottom: none; }
|
||||||
|
|
||||||
|
svg { color: var(--text-tertiary); flex-shrink: 0; }
|
||||||
|
|
||||||
|
.label { color: var(--text-secondary); flex-shrink: 0; }
|
||||||
|
|
||||||
|
.value {
|
||||||
|
flex: 1;
|
||||||
|
text-align: right;
|
||||||
|
color: var(--text-primary);
|
||||||
|
word-break: break-all;
|
||||||
|
user-select: text;
|
||||||
|
|
||||||
|
&.highlight { color: var(--primary); font-weight: 600; }
|
||||||
|
&.mono { font-family: 'Consolas', 'Monaco', monospace; font-size: 12px; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
padding: 0;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
cursor: pointer;
|
||||||
|
flex-shrink: 0;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.15s, color 0.15s, background 0.15s;
|
||||||
|
|
||||||
|
&:hover { background: var(--bg-secondary); color: var(--text-primary); }
|
||||||
|
svg { color: inherit; }
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover .copy-btn { opacity: 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.raw-content-box {
|
||||||
|
background: var(--bg-tertiary);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 12px;
|
||||||
|
max-height: 200px;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
pre {
|
||||||
|
margin: 0;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-all;
|
||||||
|
font-family: 'Consolas', 'Monaco', monospace;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-primary);
|
||||||
|
user-select: text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -324,6 +324,7 @@ function ChatPage(_props: ChatPageProps) {
|
|||||||
|
|
||||||
// 消息右键菜单
|
// 消息右键菜单
|
||||||
const [contextMenu, setContextMenu] = useState<{ x: number, y: number, message: Message } | null>(null)
|
const [contextMenu, setContextMenu] = useState<{ x: number, y: number, message: Message } | null>(null)
|
||||||
|
const [showMessageInfo, setShowMessageInfo] = useState<Message | null>(null)
|
||||||
const [editingMessage, setEditingMessage] = useState<{ message: Message, content: string } | null>(null)
|
const [editingMessage, setEditingMessage] = useState<{ message: Message, content: string } | null>(null)
|
||||||
|
|
||||||
// 多选模式
|
// 多选模式
|
||||||
@@ -2735,11 +2736,143 @@ function ChatPage(_props: ChatPageProps) {
|
|||||||
<Trash2 size={16} />
|
<Trash2 size={16} />
|
||||||
<span>删除消息</span>
|
<span>删除消息</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="menu-item" onClick={() => { setShowMessageInfo(contextMenu.message); setContextMenu(null) }}>
|
||||||
|
<Info size={16} />
|
||||||
|
<span>查看消息信息</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>,
|
</>,
|
||||||
document.body
|
document.body
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* 消息信息弹窗 */}
|
||||||
|
{showMessageInfo && createPortal(
|
||||||
|
<div className="message-info-overlay" onClick={() => setShowMessageInfo(null)}>
|
||||||
|
<div className="message-info-modal" onClick={(e) => e.stopPropagation()}>
|
||||||
|
<div className="detail-header">
|
||||||
|
<h4>消息详情</h4>
|
||||||
|
<button className="close-btn" onClick={() => setShowMessageInfo(null)}>
|
||||||
|
<X size={16} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="detail-content">
|
||||||
|
<div className="detail-section">
|
||||||
|
<div className="detail-item">
|
||||||
|
<Hash size={14} />
|
||||||
|
<span className="label">Local ID</span>
|
||||||
|
<span className="value">{showMessageInfo.localId}</span>
|
||||||
|
<button className="copy-btn" title="复制" onClick={() => handleCopyField(String(showMessageInfo.localId), 'msgLocalId')}>
|
||||||
|
{copiedField === 'msgLocalId' ? <Check size={12} /> : <Copy size={12} />}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="detail-item">
|
||||||
|
<Hash size={14} />
|
||||||
|
<span className="label">Server ID</span>
|
||||||
|
<span className="value">{showMessageInfo.serverId}</span>
|
||||||
|
</div>
|
||||||
|
<div className="detail-item">
|
||||||
|
<span className="label">消息类型</span>
|
||||||
|
<span className="value highlight">{showMessageInfo.localType}</span>
|
||||||
|
</div>
|
||||||
|
<div className="detail-item">
|
||||||
|
<span className="label">发送者</span>
|
||||||
|
<span className="value">{showMessageInfo.senderUsername || '-'}</span>
|
||||||
|
{showMessageInfo.senderUsername && (
|
||||||
|
<button className="copy-btn" title="复制" onClick={() => handleCopyField(showMessageInfo.senderUsername!, 'msgSender')}>
|
||||||
|
{copiedField === 'msgSender' ? <Check size={12} /> : <Copy size={12} />}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="detail-item">
|
||||||
|
<Calendar size={14} />
|
||||||
|
<span className="label">创建时间</span>
|
||||||
|
<span className="value">{new Date(showMessageInfo.createTime * 1000).toLocaleString()}</span>
|
||||||
|
</div>
|
||||||
|
<div className="detail-item">
|
||||||
|
<span className="label">发送状态</span>
|
||||||
|
<span className="value">{showMessageInfo.isSend === 1 ? '发送' : '接收'}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{(showMessageInfo.imageMd5 || showMessageInfo.videoMd5 || showMessageInfo.voiceDurationSeconds != null) && (
|
||||||
|
<div className="detail-section">
|
||||||
|
<div className="section-title">
|
||||||
|
<ImageIcon size={14} />
|
||||||
|
<span>媒体信息</span>
|
||||||
|
</div>
|
||||||
|
{showMessageInfo.imageMd5 && (
|
||||||
|
<div className="detail-item">
|
||||||
|
<span className="label">Image MD5</span>
|
||||||
|
<span className="value mono">{showMessageInfo.imageMd5}</span>
|
||||||
|
<button className="copy-btn" title="复制" onClick={() => handleCopyField(showMessageInfo.imageMd5!, 'imgMd5')}>
|
||||||
|
{copiedField === 'imgMd5' ? <Check size={12} /> : <Copy size={12} />}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{showMessageInfo.imageDatName && (
|
||||||
|
<div className="detail-item">
|
||||||
|
<span className="label">DAT 文件</span>
|
||||||
|
<span className="value mono">{showMessageInfo.imageDatName}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{showMessageInfo.videoMd5 && (
|
||||||
|
<div className="detail-item">
|
||||||
|
<span className="label">Video MD5</span>
|
||||||
|
<span className="value mono">{showMessageInfo.videoMd5}</span>
|
||||||
|
<button className="copy-btn" title="复制" onClick={() => handleCopyField(showMessageInfo.videoMd5!, 'vidMd5')}>
|
||||||
|
{copiedField === 'vidMd5' ? <Check size={12} /> : <Copy size={12} />}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{showMessageInfo.voiceDurationSeconds != null && (
|
||||||
|
<div className="detail-item">
|
||||||
|
<Mic size={14} />
|
||||||
|
<span className="label">语音时长</span>
|
||||||
|
<span className="value">{showMessageInfo.voiceDurationSeconds}秒</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{(showMessageInfo.emojiMd5 || showMessageInfo.emojiCdnUrl) && (
|
||||||
|
<div className="detail-section">
|
||||||
|
<div className="section-title">
|
||||||
|
<span>表情包信息</span>
|
||||||
|
</div>
|
||||||
|
{showMessageInfo.emojiMd5 && (
|
||||||
|
<div className="detail-item">
|
||||||
|
<span className="label">MD5</span>
|
||||||
|
<span className="value mono">{showMessageInfo.emojiMd5}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{showMessageInfo.emojiCdnUrl && (
|
||||||
|
<div className="detail-item">
|
||||||
|
<span className="label">CDN URL</span>
|
||||||
|
<span className="value mono">{showMessageInfo.emojiCdnUrl}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{showMessageInfo.localType !== 1 && (showMessageInfo.rawContent || showMessageInfo.content) && (
|
||||||
|
<div className="detail-section">
|
||||||
|
<div className="section-title">
|
||||||
|
<span>原始消息内容</span>
|
||||||
|
<button className="copy-btn" title="复制" onClick={() => handleCopyField(showMessageInfo.rawContent || showMessageInfo.content || '', 'rawContent')}>
|
||||||
|
{copiedField === 'rawContent' ? <Check size={12} /> : <Copy size={12} />}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="raw-content-box">
|
||||||
|
<pre>{showMessageInfo.rawContent || showMessageInfo.content}</pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>,
|
||||||
|
document.body
|
||||||
|
)}
|
||||||
|
|
||||||
{/* 修改消息弹窗 */}
|
{/* 修改消息弹窗 */}
|
||||||
{editingMessage && createPortal(
|
{editingMessage && createPortal(
|
||||||
<div className="modal-overlay">
|
<div className="modal-overlay">
|
||||||
|
|||||||
Reference in New Issue
Block a user