优化硬盘识别
This commit is contained in:
@@ -1259,6 +1259,62 @@ input:checked+.slider:before {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.detail-partitions-container {
|
||||
padding: 20px;
|
||||
border-top: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.detail-section-title {
|
||||
font-size: 0.8rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.detail-partitions-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.partition-row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.partition-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 0.82rem;
|
||||
}
|
||||
|
||||
.partition-mount {
|
||||
font-family: var(--font-mono);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.partition-usage-text {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.partition-progress {
|
||||
width: 100%;
|
||||
height: 6px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.partition-bar {
|
||||
height: 100%;
|
||||
background: var(--accent-amber);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.chevron-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
|
||||
@@ -479,6 +479,11 @@
|
||||
<span class="info-value" id="detailUptime">0天 0小时</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-partitions-container" id="detailPartitionsContainer" style="display: none;">
|
||||
<h3 class="detail-section-title">磁盘分区详情 (已挂载)</h3>
|
||||
<div class="detail-partitions-list" id="detailPartitionsList"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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