修改排版
This commit is contained in:
@@ -121,7 +121,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-card-content">
|
<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>
|
<span class="stat-card-value" id="totalServers">0</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -286,13 +286,6 @@
|
|||||||
<option value="100">100</option>
|
<option value="100">100</option>
|
||||||
</select>
|
</select>
|
||||||
<span>条</span>
|
<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>
|
||||||
<div class="pagination-controls" id="paginationControls">
|
<div class="pagination-controls" id="paginationControls">
|
||||||
<!-- Pagination buttons will be injected here -->
|
<!-- Pagination buttons will be injected here -->
|
||||||
@@ -384,7 +377,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Server Detail Modal -->
|
<!-- Server Detail Modal -->
|
||||||
<div class="modal-overlay" id="serverDetailModal">
|
<div class="modal-overlay" id="serverDetailModal">
|
||||||
<div class="modal" style="max-width: 800px; width: 95%;">
|
<div class="modal" style="max-width: 800px; width: 95%;">
|
||||||
@@ -396,13 +389,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body" id="serverDetailBody" style="padding: 0;">
|
<div class="modal-body" id="serverDetailBody" style="padding: 0;">
|
||||||
<div id="detailLoading" style="text-align: center; padding: 40px; display: none;">
|
<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>
|
<span style="margin-left: 10px; color: var(--text-secondary);">正在从数据源读取详情...</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="detail-container" id="detailContainer">
|
<div class="detail-container" id="detailContainer">
|
||||||
<!-- Metric Items are injected here -->
|
<!-- Metric Items are injected here -->
|
||||||
<div class="detail-metrics-list" id="detailMetricsList"></div>
|
<div class="detail-metrics-list" id="detailMetricsList"></div>
|
||||||
|
|
||||||
<div class="detail-info-grid" id="detailInfoGrid">
|
<div class="detail-info-grid" id="detailInfoGrid">
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<span class="info-label">CPU 核心总数</span>
|
<span class="info-label">CPU 核心总数</span>
|
||||||
|
|||||||
@@ -11,8 +11,7 @@
|
|||||||
// ---- DOM Elements ----
|
// ---- DOM Elements ----
|
||||||
const dom = {
|
const dom = {
|
||||||
clock: document.getElementById('clock'), // May be null if removed from UI
|
clock: document.getElementById('clock'), // May be null if removed from UI
|
||||||
serverCountText: document.getElementById('serverCountText'),
|
totalServersLabel: document.getElementById('totalServersLabel'),
|
||||||
sourceCount: document.getElementById('sourceCount'),
|
|
||||||
totalServers: document.getElementById('totalServers'),
|
totalServers: document.getElementById('totalServers'),
|
||||||
cpuPercent: document.getElementById('cpuPercent'),
|
cpuPercent: document.getElementById('cpuPercent'),
|
||||||
cpuDetail: document.getElementById('cpuDetail'),
|
cpuDetail: document.getElementById('cpuDetail'),
|
||||||
@@ -347,8 +346,7 @@
|
|||||||
// ---- Update Dashboard ----
|
// ---- Update Dashboard ----
|
||||||
function updateDashboard(data) {
|
function updateDashboard(data) {
|
||||||
// Server count
|
// Server count
|
||||||
dom.totalServers.textContent = data.totalServers;
|
dom.totalServers.textContent = `${data.activeServers} / ${data.totalServers}`;
|
||||||
dom.serverCountText.textContent = `${data.activeServers} / ${data.totalServers} 在线`;
|
|
||||||
|
|
||||||
// CPU
|
// CPU
|
||||||
const cpuPct = data.cpu.percent;
|
const cpuPct = data.cpu.percent;
|
||||||
@@ -866,7 +864,7 @@
|
|||||||
try {
|
try {
|
||||||
const response = await fetch('/api/sources');
|
const response = await fetch('/api/sources');
|
||||||
const sources = await response.json();
|
const sources = await response.json();
|
||||||
dom.sourceCount.textContent = `${sources.length} 个数据源`;
|
if (dom.totalServersLabel) dom.totalServersLabel.textContent = `服务器总数 (${sources.length} 数据源)`;
|
||||||
updateSourceFilterOptions(sources);
|
updateSourceFilterOptions(sources);
|
||||||
renderSources(sources);
|
renderSources(sources);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -1030,7 +1028,7 @@
|
|||||||
const response = await fetch('/api/sources');
|
const response = await fetch('/api/sources');
|
||||||
const sources = await response.json();
|
const sources = await response.json();
|
||||||
const sourcesArray = Array.isArray(sources) ? sources : [];
|
const sourcesArray = Array.isArray(sources) ? sources : [];
|
||||||
dom.sourceCount.textContent = `${sourcesArray.length} 个数据源`;
|
if (dom.totalServersLabel) dom.totalServersLabel.textContent = `服务器总数 (${sourcesArray.length} 数据源)`;
|
||||||
updateSourceFilterOptions(sourcesArray);
|
updateSourceFilterOptions(sourcesArray);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// ignore
|
// ignore
|
||||||
|
|||||||
Reference in New Issue
Block a user