修改排版
This commit is contained in:
@@ -11,8 +11,7 @@
|
||||
// ---- DOM Elements ----
|
||||
const dom = {
|
||||
clock: document.getElementById('clock'), // May be null if removed from UI
|
||||
serverCountText: document.getElementById('serverCountText'),
|
||||
sourceCount: document.getElementById('sourceCount'),
|
||||
totalServersLabel: document.getElementById('totalServersLabel'),
|
||||
totalServers: document.getElementById('totalServers'),
|
||||
cpuPercent: document.getElementById('cpuPercent'),
|
||||
cpuDetail: document.getElementById('cpuDetail'),
|
||||
@@ -347,8 +346,7 @@
|
||||
// ---- Update Dashboard ----
|
||||
function updateDashboard(data) {
|
||||
// Server count
|
||||
dom.totalServers.textContent = data.totalServers;
|
||||
dom.serverCountText.textContent = `${data.activeServers} / ${data.totalServers} 在线`;
|
||||
dom.totalServers.textContent = `${data.activeServers} / ${data.totalServers}`;
|
||||
|
||||
// CPU
|
||||
const cpuPct = data.cpu.percent;
|
||||
@@ -866,7 +864,7 @@
|
||||
try {
|
||||
const response = await fetch('/api/sources');
|
||||
const sources = await response.json();
|
||||
dom.sourceCount.textContent = `${sources.length} 个数据源`;
|
||||
if (dom.totalServersLabel) dom.totalServersLabel.textContent = `服务器总数 (${sources.length} 数据源)`;
|
||||
updateSourceFilterOptions(sources);
|
||||
renderSources(sources);
|
||||
} catch (err) {
|
||||
@@ -1030,7 +1028,7 @@
|
||||
const response = await fetch('/api/sources');
|
||||
const sources = await response.json();
|
||||
const sourcesArray = Array.isArray(sources) ? sources : [];
|
||||
dom.sourceCount.textContent = `${sourcesArray.length} 个数据源`;
|
||||
if (dom.totalServersLabel) dom.totalServersLabel.textContent = `服务器总数 (${sourcesArray.length} 数据源)`;
|
||||
updateSourceFilterOptions(sourcesArray);
|
||||
} catch (err) {
|
||||
// ignore
|
||||
|
||||
Reference in New Issue
Block a user