From 89647304bb6f16dc6eca1ecdbcc3f69b1e0da9c3 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Tue, 21 Apr 2026 16:35:04 +0800 Subject: [PATCH] fix: adjust home dashboard styles (#12549) --- frontend/src/views/home/index.vue | 43 ++++--- .../src/views/host/monitor/monitor/index.vue | 108 ++++++++++++------ 2 files changed, 98 insertions(+), 53 deletions(-) diff --git a/frontend/src/views/home/index.vue b/frontend/src/views/home/index.vue index 6e2f9c953..9253cda80 100644 --- a/frontend/src/views/home/index.vue +++ b/frontend/src/views/home/index.vue @@ -1128,22 +1128,6 @@ onBeforeUnmount(() => { } } -.system-label { - font-weight: 400 !important; - font-size: 14px !important; - color: var(--panel-text-color); - border: none !important; - background: none !important; - width: fit-content !important; - white-space: nowrap !important; -} - -.system-content { - font-size: 13px !important; - border: none !important; - width: 100% !important; -} - .my-carousel { &.no-indicator { :deep(.el-carousel__indicators) { @@ -1163,6 +1147,22 @@ onBeforeUnmount(() => { :deep(.el-descriptions .el-descriptions__body .el-descriptions__table) { border-spacing: 0 5px !important; } + + :deep(.h-systemInfo .system-label) { + font-weight: 400 !important; + font-size: 14px !important; + color: var(--panel-text-color); + border: none !important; + background: none !important; + width: fit-content !important; + white-space: nowrap !important; + } + + :deep(.h-systemInfo .system-content) { + font-size: 13px !important; + border: none !important; + width: 100% !important; + } } .simple-node { @@ -1240,20 +1240,25 @@ onBeforeUnmount(() => { .memo-content { min-height: 218px; border-radius: 4px; - border: 1px solid var(--el-border-color); - background-color: var(--el-fill-color-light); + font-size: 13px; + margin-top: -15px; + margin-left: -10px; word-wrap: break-word; white-space: pre-wrap; :deep(.md-editor) { background-color: transparent; } + + :deep(.md-editor-content .md-editor-preview) { + font-size: 13px; + } } .memo-placeholder { color: var(--el-text-color-placeholder); display: inline-block; - font-size: 14px; + font-size: 13px; } .dashboard-carousel-setting { diff --git a/frontend/src/views/host/monitor/monitor/index.vue b/frontend/src/views/host/monitor/monitor/index.vue index e30ac5715..612be9c10 100644 --- a/frontend/src/views/host/monitor/monitor/index.vue +++ b/frontend/src/views/host/monitor/monitor/index.vue @@ -39,7 +39,7 @@ > -
+
-
+
-
+
-
+
-
+
({ @@ -299,36 +306,41 @@ const search = async (param: string) => { searchInfo.startTime = searchTime.value[0]; searchInfo.endTime = searchTime.value[1]; } - const res = await loadMonitor(searchInfo); - monitorBase.value = res.data; - for (const item of monitorBase.value) { - if (!item.value) { - item.value = []; - item.date = []; - } - switch (item.param) { - case 'base': - let baseDate = item.date.length === 0 ? loadEmptyDate(timeRangeCpu.value) : item.date; - baseDate = baseDate.map(function (item: any) { - return dateFormatWithoutYear(item); - }); - if (param === 'cpu' || param === 'all') { - initCPUCharts(baseDate, item); - } - if (param === 'memory' || param === 'all') { - initMemCharts(baseDate, item); - } - if (param === 'load' || param === 'all') { - initLoadCharts(item); - } - break; - case 'io': - initIOCharts(item); - break; - case 'network': - initNetCharts(item); - break; + setChartLoading(param, true); + try { + const res = await loadMonitor(searchInfo); + monitorBase.value = res.data; + for (const item of monitorBase.value) { + if (!item.value) { + item.value = []; + item.date = []; + } + switch (item.param) { + case 'base': + let baseDate = item.date.length === 0 ? loadEmptyDate(timeRangeCpu.value) : item.date; + baseDate = baseDate.map(function (item: any) { + return dateFormatWithoutYear(item); + }); + if (param === 'cpu' || param === 'all') { + initCPUCharts(baseDate, item); + } + if (param === 'memory' || param === 'all') { + initMemCharts(baseDate, item); + } + if (param === 'load' || param === 'all') { + initLoadCharts(item); + } + break; + case 'io': + initIOCharts(item); + break; + case 'network': + initNetCharts(item); + break; + } } + } finally { + setChartLoading(param, false); } }; @@ -356,6 +368,34 @@ const loadOptions = async () => { search('all'); }; +const setChartLoading = (param: string, value: boolean) => { + if (param === 'all') { + loadingMap.load = value; + loadingMap.cpu = value; + loadingMap.memory = value; + loadingMap.io = value; + loadingMap.network = value; + return; + } + switch (param) { + case 'load': + loadingMap.load = value; + break; + case 'cpu': + loadingMap.cpu = value; + break; + case 'memory': + loadingMap.memory = value; + break; + case 'io': + loadingMap.io = value; + break; + case 'network': + loadingMap.network = value; + break; + } +}; + function initLoadCharts(item: Host.MonitorData) { let itemLoadDate = item.date.length === 0 ? loadEmptyDate(timeRangeLoad.value) : item.date; let loadDate = itemLoadDate.map(function (item: any) {