Skip to content

Commit 8964730

Browse files
authored
fix: adjust home dashboard styles (#12549)
1 parent 9ebad13 commit 8964730

2 files changed

Lines changed: 98 additions & 53 deletions

File tree

frontend/src/views/home/index.vue

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,22 +1128,6 @@ onBeforeUnmount(() => {
11281128
}
11291129
}
11301130
1131-
.system-label {
1132-
font-weight: 400 !important;
1133-
font-size: 14px !important;
1134-
color: var(--panel-text-color);
1135-
border: none !important;
1136-
background: none !important;
1137-
width: fit-content !important;
1138-
white-space: nowrap !important;
1139-
}
1140-
1141-
.system-content {
1142-
font-size: 13px !important;
1143-
border: none !important;
1144-
width: 100% !important;
1145-
}
1146-
11471131
.my-carousel {
11481132
&.no-indicator {
11491133
:deep(.el-carousel__indicators) {
@@ -1163,6 +1147,22 @@ onBeforeUnmount(() => {
11631147
:deep(.el-descriptions .el-descriptions__body .el-descriptions__table) {
11641148
border-spacing: 0 5px !important;
11651149
}
1150+
1151+
:deep(.h-systemInfo .system-label) {
1152+
font-weight: 400 !important;
1153+
font-size: 14px !important;
1154+
color: var(--panel-text-color);
1155+
border: none !important;
1156+
background: none !important;
1157+
width: fit-content !important;
1158+
white-space: nowrap !important;
1159+
}
1160+
1161+
:deep(.h-systemInfo .system-content) {
1162+
font-size: 13px !important;
1163+
border: none !important;
1164+
width: 100% !important;
1165+
}
11661166
}
11671167
11681168
.simple-node {
@@ -1240,20 +1240,25 @@ onBeforeUnmount(() => {
12401240
.memo-content {
12411241
min-height: 218px;
12421242
border-radius: 4px;
1243-
border: 1px solid var(--el-border-color);
1244-
background-color: var(--el-fill-color-light);
1243+
font-size: 13px;
1244+
margin-top: -15px;
1245+
margin-left: -10px;
12451246
word-wrap: break-word;
12461247
white-space: pre-wrap;
12471248
12481249
:deep(.md-editor) {
12491250
background-color: transparent;
12501251
}
1252+
1253+
:deep(.md-editor-content .md-editor-preview) {
1254+
font-size: 13px;
1255+
}
12511256
}
12521257
12531258
.memo-placeholder {
12541259
color: var(--el-text-color-placeholder);
12551260
display: inline-block;
1256-
font-size: 14px;
1261+
font-size: 13px;
12571262
}
12581263
12591264
.dashboard-carousel-setting {

frontend/src/views/host/monitor/monitor/index.vue

Lines changed: 74 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
></el-date-picker>
4040
</div>
4141
</template>
42-
<div class="chart">
42+
<div class="chart" v-loading="loadingMap.load">
4343
<v-charts
4444
height="400px"
4545
id="loadLoadChart"
@@ -71,7 +71,7 @@
7171
></el-date-picker>
7272
</div>
7373
</template>
74-
<div class="chart">
74+
<div class="chart" v-loading="loadingMap.cpu">
7575
<v-charts
7676
height="400px"
7777
id="loadCPUChart"
@@ -101,7 +101,7 @@
101101
></el-date-picker>
102102
</div>
103103
</template>
104-
<div class="chart">
104+
<div class="chart" v-loading="loadingMap.memory">
105105
<v-charts
106106
height="400px"
107107
id="loadMemoryChart"
@@ -152,7 +152,7 @@
152152
></el-date-picker>
153153
</div>
154154
</template>
155-
<div class="chart">
155+
<div class="chart" v-loading="loadingMap.io">
156156
<v-charts
157157
height="400px"
158158
id="loadIOChart"
@@ -201,7 +201,7 @@
201201
></el-date-picker>
202202
</div>
203203
</template>
204-
<div class="chart">
204+
<div class="chart" v-loading="loadingMap.network">
205205
<v-charts
206206
height="400px"
207207
id="loadNetworkChart"
@@ -246,6 +246,13 @@ const netOptions = ref();
246246
const ioChoose = ref();
247247
const ioOptions = ref();
248248
const chartsOption = ref({ loadLoadChart: null, loadCPUChart: null, loadMemoryChart: null, loadNetworkChart: null });
249+
const loadingMap = reactive({
250+
load: false,
251+
cpu: false,
252+
memory: false,
253+
io: false,
254+
network: false,
255+
});
249256
250257
const searchTime = ref();
251258
const searchInfo = reactive<Host.MonitorSearch>({
@@ -299,36 +306,41 @@ const search = async (param: string) => {
299306
searchInfo.startTime = searchTime.value[0];
300307
searchInfo.endTime = searchTime.value[1];
301308
}
302-
const res = await loadMonitor(searchInfo);
303-
monitorBase.value = res.data;
304-
for (const item of monitorBase.value) {
305-
if (!item.value) {
306-
item.value = [];
307-
item.date = [];
308-
}
309-
switch (item.param) {
310-
case 'base':
311-
let baseDate = item.date.length === 0 ? loadEmptyDate(timeRangeCpu.value) : item.date;
312-
baseDate = baseDate.map(function (item: any) {
313-
return dateFormatWithoutYear(item);
314-
});
315-
if (param === 'cpu' || param === 'all') {
316-
initCPUCharts(baseDate, item);
317-
}
318-
if (param === 'memory' || param === 'all') {
319-
initMemCharts(baseDate, item);
320-
}
321-
if (param === 'load' || param === 'all') {
322-
initLoadCharts(item);
323-
}
324-
break;
325-
case 'io':
326-
initIOCharts(item);
327-
break;
328-
case 'network':
329-
initNetCharts(item);
330-
break;
309+
setChartLoading(param, true);
310+
try {
311+
const res = await loadMonitor(searchInfo);
312+
monitorBase.value = res.data;
313+
for (const item of monitorBase.value) {
314+
if (!item.value) {
315+
item.value = [];
316+
item.date = [];
317+
}
318+
switch (item.param) {
319+
case 'base':
320+
let baseDate = item.date.length === 0 ? loadEmptyDate(timeRangeCpu.value) : item.date;
321+
baseDate = baseDate.map(function (item: any) {
322+
return dateFormatWithoutYear(item);
323+
});
324+
if (param === 'cpu' || param === 'all') {
325+
initCPUCharts(baseDate, item);
326+
}
327+
if (param === 'memory' || param === 'all') {
328+
initMemCharts(baseDate, item);
329+
}
330+
if (param === 'load' || param === 'all') {
331+
initLoadCharts(item);
332+
}
333+
break;
334+
case 'io':
335+
initIOCharts(item);
336+
break;
337+
case 'network':
338+
initNetCharts(item);
339+
break;
340+
}
331341
}
342+
} finally {
343+
setChartLoading(param, false);
332344
}
333345
};
334346
@@ -356,6 +368,34 @@ const loadOptions = async () => {
356368
search('all');
357369
};
358370
371+
const setChartLoading = (param: string, value: boolean) => {
372+
if (param === 'all') {
373+
loadingMap.load = value;
374+
loadingMap.cpu = value;
375+
loadingMap.memory = value;
376+
loadingMap.io = value;
377+
loadingMap.network = value;
378+
return;
379+
}
380+
switch (param) {
381+
case 'load':
382+
loadingMap.load = value;
383+
break;
384+
case 'cpu':
385+
loadingMap.cpu = value;
386+
break;
387+
case 'memory':
388+
loadingMap.memory = value;
389+
break;
390+
case 'io':
391+
loadingMap.io = value;
392+
break;
393+
case 'network':
394+
loadingMap.network = value;
395+
break;
396+
}
397+
};
398+
359399
function initLoadCharts(item: Host.MonitorData) {
360400
let itemLoadDate = item.date.length === 0 ? loadEmptyDate(timeRangeLoad.value) : item.date;
361401
let loadDate = itemLoadDate.map(function (item: any) {

0 commit comments

Comments
 (0)