修复 MinIO 端口冲突并优化顶栏 IP 展示
- MinIO 宿主机端口改为 9100/9101,避免与 hfb-minio 冲突 - 测试与配置默认 PublicBase 同步为 9100 - 工作台顶栏固定展示 IP|地区,详情回填会话元数据 - 种子数据补充访客 IP/地区示例
This commit is contained in:
@@ -175,9 +175,24 @@ const Dashboard = () => {
|
||||
const response = await getSession(id)
|
||||
const data = response.data
|
||||
setDetail({ messages: data.messages || [], events: data.events || [], pendingCount: data.pending_count || 0 })
|
||||
// 用详情接口的完整会话字段(含 IP/地区)回填列表,保证顶栏展示准确
|
||||
if (data.session) {
|
||||
setSessions(previous => previous.map(session =>
|
||||
session.id === id
|
||||
? {
|
||||
...session,
|
||||
...data.session,
|
||||
unread_count: markRead ? 0 : session.unread_count,
|
||||
last_message: session.last_message,
|
||||
last_message_at: session.last_message_at,
|
||||
}
|
||||
: session,
|
||||
))
|
||||
} else if (markRead) {
|
||||
setSessions(previous => previous.map(session => session.id === id ? { ...session, unread_count: 0 } : session))
|
||||
}
|
||||
if (markRead) {
|
||||
await markSessionRead(id)
|
||||
setSessions(previous => previous.map(session => session.id === id ? { ...session, unread_count: 0 } : session))
|
||||
}
|
||||
} catch {
|
||||
antMsg.error('加载消息失败')
|
||||
@@ -615,10 +630,7 @@ const Dashboard = () => {
|
||||
<section className="flex-1 flex flex-col min-w-0 h-full bg-neutral-50">
|
||||
{selected && selectedCustomer ? (
|
||||
<>
|
||||
<div
|
||||
className="shrink-0 flex items-center justify-between px-5 bg-white border-b border-neutral-200"
|
||||
style={{ height: 'var(--header-height)' }}
|
||||
>
|
||||
<div className="shrink-0 flex items-center justify-between px-5 py-2.5 bg-white border-b border-neutral-200 min-h-14">
|
||||
<div className="flex items-center gap-3 min-w-0">
|
||||
<div
|
||||
className="w-[38px] h-[38px] rounded-full flex items-center justify-center shrink-0 text-base font-semibold"
|
||||
@@ -640,24 +652,15 @@ const Dashboard = () => {
|
||||
{selectedCustomer.status === 'online' ? '在线' : selectedCustomer.status === 'busy' ? '忙碌' : '离线'}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 mt-0.5 text-xs text-neutral-400 flex-wrap">
|
||||
{selected.visitor_ip ? (
|
||||
<span className="truncate">IP: {selected.visitor_ip}</span>
|
||||
) : (
|
||||
<span className="truncate">会话 #{selected.id}</span>
|
||||
)}
|
||||
{selected.visitor_region && (
|
||||
<>
|
||||
<span>|</span>
|
||||
<span className="truncate">{selected.visitor_region}</span>
|
||||
</>
|
||||
)}
|
||||
{!selected.visitor_ip && selectedCustomer.source && (
|
||||
<>
|
||||
<span>|</span>
|
||||
<span className="truncate">{selectedCustomer.source}</span>
|
||||
</>
|
||||
)}
|
||||
{/* 与设计稿一致:姓名下方展示 IP | 地区 */}
|
||||
<div className="flex items-center gap-1.5 mt-0.5 text-xs text-neutral-400 min-w-0">
|
||||
<span className="truncate">
|
||||
IP: {selected.visitor_ip || '—'}
|
||||
</span>
|
||||
<span className="shrink-0 text-neutral-300">|</span>
|
||||
<span className="truncate">
|
||||
{selected.visitor_region || '未知'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -898,10 +901,6 @@ const Dashboard = () => {
|
||||
<span className="shrink-0 text-neutral-400 min-w-12">地区</span>
|
||||
<span className="truncate text-neutral-800">{selected?.visitor_region || '—'}</span>
|
||||
</div>
|
||||
<div className="flex items-start gap-2">
|
||||
<span className="shrink-0 text-neutral-400 min-w-12">IP</span>
|
||||
<span className="truncate text-neutral-800 font-mono text-xs">{selected?.visitor_ip || '—'}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user