管理员可以直观查看白名单
This commit is contained in:
@@ -109,3 +109,18 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-
|
|||||||
.fullscreen-overlay .fullscreen-text th {background: #f0f0f0;}
|
.fullscreen-overlay .fullscreen-text th {background: #f0f0f0;}
|
||||||
|
|
||||||
.detail-row { margin-bottom: 8px; }
|
.detail-row { margin-bottom: 8px; }
|
||||||
|
|
||||||
|
.white-list-tag {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #555;
|
||||||
|
background: #f0f0f0;
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-right: 6px;
|
||||||
|
max-width: 80px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|||||||
@@ -72,6 +72,12 @@ function renderChatList() {
|
|||||||
container.innerHTML = Store.rooms.map(room => {
|
container.innerHTML = Store.rooms.map(room => {
|
||||||
const lastMsg = room.last_message || '暂无消息';
|
const lastMsg = room.last_message || '暂无消息';
|
||||||
const lastTime = room.last_time || '';
|
const lastTime = room.last_time || '';
|
||||||
|
// 处理白名单(管理员可见)
|
||||||
|
let whiteListHtml = '';
|
||||||
|
if (isAdmin && room.white_list && room.white_list.trim() !== '') {
|
||||||
|
const members = room.white_list.split(',').map(s => s.trim()).filter(Boolean).join(', ');
|
||||||
|
whiteListHtml = `<span class="white-list-tag" title="${escapeHtml(members)}">${escapeHtml(members)}</span>`;
|
||||||
|
}
|
||||||
return `
|
return `
|
||||||
<div class="chat-item" data-room-id="${room.id}">
|
<div class="chat-item" data-room-id="${room.id}">
|
||||||
<div class="avatar" onclick="openChat('${room.id}')">${escapeHtml(room.name.charAt(0))}</div>
|
<div class="avatar" onclick="openChat('${room.id}')">${escapeHtml(room.name.charAt(0))}</div>
|
||||||
@@ -82,6 +88,7 @@ function renderChatList() {
|
|||||||
<div class="chat-right">
|
<div class="chat-right">
|
||||||
<div class="chat-time" onclick="openChat('${room.id}')">${lastTime}</div>
|
<div class="chat-time" onclick="openChat('${room.id}')">${lastTime}</div>
|
||||||
${isAdmin ? `<div class="room-actions">
|
${isAdmin ? `<div class="room-actions">
|
||||||
|
${whiteListHtml}
|
||||||
<button class="edit-room-btn" onclick="event.stopPropagation(); openManageRoom('${room.id}')" title="编辑群聊">
|
<button class="edit-room-btn" onclick="event.stopPropagation(); openManageRoom('${room.id}')" title="编辑群聊">
|
||||||
<svg viewBox="0 0 24 24"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
<svg viewBox="0 0 24 24"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user