修改排版
This commit is contained in:
@@ -121,7 +121,7 @@
|
||||
</svg>
|
||||
</div>
|
||||
<div class="stat-card-content">
|
||||
<span class="stat-card-label">服务器总数</span>
|
||||
<span class="stat-card-label" id="totalServersLabel">服务器总数</span>
|
||||
<span class="stat-card-value" id="totalServers">0</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -286,13 +286,6 @@
|
||||
<option value="100">100</option>
|
||||
</select>
|
||||
<span>条</span>
|
||||
<div class="header-meta" style="margin-left: 20px; padding-left: 20px; border-left: 1px solid var(--border-color);">
|
||||
<span class="server-count" id="serverCount">
|
||||
<span class="dot dot-pulse"></span>
|
||||
<span id="serverCountText">0 台服务器</span>
|
||||
</span>
|
||||
<span class="source-count" id="sourceCount">0 个数据源</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pagination-controls" id="paginationControls">
|
||||
<!-- Pagination buttons will be injected here -->
|
||||
@@ -384,7 +377,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Server Detail Modal -->
|
||||
<div class="modal-overlay" id="serverDetailModal">
|
||||
<div class="modal" style="max-width: 800px; width: 95%;">
|
||||
@@ -396,13 +389,14 @@
|
||||
</div>
|
||||
<div class="modal-body" id="serverDetailBody" style="padding: 0;">
|
||||
<div id="detailLoading" style="text-align: center; padding: 40px; display: none;">
|
||||
<div class="dot dot-pulse" style="display: inline-block; width: 12px; height: 12px; background: var(--accent-indigo);"></div>
|
||||
<div class="dot dot-pulse"
|
||||
style="display: inline-block; width: 12px; height: 12px; background: var(--accent-indigo);"></div>
|
||||
<span style="margin-left: 10px; color: var(--text-secondary);">正在从数据源读取详情...</span>
|
||||
</div>
|
||||
<div class="detail-container" id="detailContainer">
|
||||
<!-- Metric Items are injected here -->
|
||||
<div class="detail-metrics-list" id="detailMetricsList"></div>
|
||||
|
||||
|
||||
<div class="detail-info-grid" id="detailInfoGrid">
|
||||
<div class="info-item">
|
||||
<span class="info-label">CPU 核心总数</span>
|
||||
|
||||
@@ -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