diff --git a/server/public/css/style.css b/server/public/css/style.css index ef308a2..9170492 100644 --- a/server/public/css/style.css +++ b/server/public/css/style.css @@ -109,3 +109,18 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans- .fullscreen-overlay .fullscreen-text th {background: #f0f0f0;} .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; +} diff --git a/server/public/js/ws.js b/server/public/js/ws.js index abe5da0..c1b1448 100644 --- a/server/public/js/ws.js +++ b/server/public/js/ws.js @@ -72,6 +72,12 @@ function renderChatList() { container.innerHTML = Store.rooms.map(room => { const lastMsg = room.last_message || '暂无消息'; 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 = `${escapeHtml(members)}`; + } return `
${escapeHtml(room.name.charAt(0))}
@@ -82,6 +88,7 @@ function renderChatList() {
${lastTime}
${isAdmin ? `
+ ${whiteListHtml}