| 243 | } |
| 244 | |
| 245 | function renderOsOptions(){ |
| 246 | const select = $('osFilter'); |
| 247 | const labels = [...new Set(S.servers.map(s => osLabel(s.os)).filter(Boolean))].sort((a,b)=>a.localeCompare(b,'zh-CN')); |
| 248 | const signature = labels.join('\u001f'); |
| 249 | const current = labels.includes(S.filters.os) ? S.filters.os : 'all'; |
| 250 | if(document.activeElement === select) return; |
| 251 | if(S.osOptionsSignature !== signature){ |
| 252 | select.innerHTML = '<option value="all">全部系统</option>' + labels.map(label => `<option value="${esc(label)}">${esc(label)}</option>`).join(''); |
| 253 | S.osOptionsSignature = signature; |
| 254 | } |
| 255 | if(select.value !== current) select.value = current; |
| 256 | S.filters.os = select.value; |
| 257 | } |
| 258 | |
| 259 | function protoPill(s){ |
| 260 | const m = metrics(s); |