File size: 514 Bytes
3c2da0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * 页头在线人数(由 client-activity 响应更新 #online_count_value)
 */

const VALUE_ID = 'online_count_value';

export function initOnlineCountDisplay(): void {
    const el = document.getElementById(VALUE_ID);
    if (el && !el.textContent?.trim()) el.textContent = '—';
}

export function applyOnlineCount(n: unknown): void {
    const el = document.getElementById(VALUE_ID);
    if (!el) return;
    el.textContent =
        typeof n === 'number' && Number.isFinite(n) ? String(n) : '—';
}