优化硬盘识别
This commit is contained in:
@@ -83,7 +83,9 @@
|
||||
globeTotalNodes: document.getElementById('globeTotalNodes'),
|
||||
globeTotalRegions: document.getElementById('globeTotalRegions'),
|
||||
sourceFilter: document.getElementById('sourceFilter'),
|
||||
btnResetSort: document.getElementById('btnResetSort')
|
||||
btnResetSort: document.getElementById('btnResetSort'),
|
||||
detailPartitionsContainer: document.getElementById('detailPartitionsContainer'),
|
||||
detailPartitionsList: document.getElementById('detailPartitionsList')
|
||||
};
|
||||
|
||||
// ---- State ----
|
||||
@@ -870,6 +872,24 @@
|
||||
<span style="font-size: 0.7rem; color: var(--text-secondary); font-weight: normal;">(IO Wait: ${data.cpuIowait.toFixed(1)}%)</span>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Render partitions list if any
|
||||
if (data.partitions && data.partitions.length > 0) {
|
||||
dom.detailPartitionsContainer.style.display = 'block';
|
||||
dom.detailPartitionsList.innerHTML = data.partitions.map(p => `
|
||||
<div class="partition-row">
|
||||
<div class="partition-info">
|
||||
<span class="partition-mount">${escapeHtml(p.mountpoint)}</span>
|
||||
<span class="partition-usage-text">${formatBytes(p.used)} / ${formatBytes(p.size)} (${formatPercent(p.percent)})</span>
|
||||
</div>
|
||||
<div class="partition-progress">
|
||||
<div class="partition-bar" style="width: ${Math.min(p.percent, 100)}%; background-color: ${getUsageColor(p.percent)};"></div>
|
||||
</div>
|
||||
</div>
|
||||
`).join('');
|
||||
} else {
|
||||
dom.detailPartitionsContainer.style.display = 'none';
|
||||
}
|
||||
|
||||
const metrics = [
|
||||
{ key: 'cpuBusy', label: 'CPU 使用率', value: cpuValueHtml },
|
||||
|
||||
Reference in New Issue
Block a user