优化布局

This commit is contained in:
CN-JS-HuiBai
2026-04-05 18:30:58 +08:00
parent 7c1f0d4e63
commit e91dcc8c02
2 changed files with 5 additions and 4 deletions

View File

@@ -1288,7 +1288,7 @@ input:checked+.slider:before {
.detail-info-grid { .detail-info-grid {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 1px; gap: 1px;
background: var(--border-color); background: var(--border-color);
margin-top: 10px; margin-top: 10px;

View File

@@ -950,10 +950,10 @@
<div class="chart-controls"> <div class="chart-controls">
<div class="time-range-group"> <div class="time-range-group">
<div class="time-range-selector"> <div class="time-range-selector">
<button class="time-range-btn active" onclick="loadMetricHistory('${m.key}', '1h', event)">1h</button> <button class="time-range-btn ${m.key !== 'networkTrend' ? 'active' : ''}" onclick="loadMetricHistory('${m.key}', '1h', event)">1h</button>
<button class="time-range-btn" onclick="loadMetricHistory('${m.key}', '6h', event)">6h</button> <button class="time-range-btn" onclick="loadMetricHistory('${m.key}', '6h', event)">6h</button>
<button class="time-range-btn" onclick="loadMetricHistory('${m.key}', '12h', event)">12h</button> <button class="time-range-btn" onclick="loadMetricHistory('${m.key}', '12h', event)">12h</button>
<button class="time-range-btn" onclick="loadMetricHistory('${m.key}', '24h', event)">24h</button> <button class="time-range-btn ${m.key === 'networkTrend' ? 'active' : ''}" onclick="loadMetricHistory('${m.key}', '24h', event)">24h</button>
</div> </div>
<div class="custom-range-selector"> <div class="custom-range-selector">
<input type="text" class="custom-range-input" id="custom-range-${m.key}" placeholder="相对范围 (如: 2h)" onkeydown="if(event.key==='Enter') loadCustomMetricHistory('${m.key}', event)"> <input type="text" class="custom-range-input" id="custom-range-${m.key}" placeholder="相对范围 (如: 2h)" onkeydown="if(event.key==='Enter') loadCustomMetricHistory('${m.key}', event)">
@@ -1015,7 +1015,8 @@
if (!wasActive) { if (!wasActive) {
el.classList.add('active'); el.classList.add('active');
// Initial load // Initial load
loadMetricHistory(metricKey, '1h'); const defaultRange = metricKey === 'networkTrend' ? '24h' : '1h';
loadMetricHistory(metricKey, defaultRange);
} }
}; };