Skip to content

Commit f891c97

Browse files
author
ssongliu
committed
feat: Panel management adds status and redirection
1 parent 5209db3 commit f891c97

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

frontend/src/views/home/index.vue

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,24 @@
320320
</el-carousel-item>
321321
<el-carousel-item key="simpleNode" v-if="showSimpleNode()">
322322
<CardWithHeader :header="$t('setting.panel')">
323+
<template #header-r>
324+
<el-tooltip :content="$t('xpack.node.panelItem')" placement="top">
325+
<el-button
326+
class="h-button-setting"
327+
@click="routerToNameWithQuery('SimpleNode', { uncached: 'true' })"
328+
link
329+
icon="Setting"
330+
/>
331+
</el-tooltip>
332+
</template>
323333
<template #body>
324334
<el-scrollbar height="286px">
325335
<div class="simple-node cursor-pointer" v-for="row in simpleNodes" :key="row.id">
326336
<el-row :gutter="5">
327337
<el-col :span="21">
328338
<div class="name">
329339
{{ row.name }}
340+
<Status :status="row.status" :msg="row.message" />
330341
</div>
331342
<div class="detail">
332343
{{ loadSource(row) }}
@@ -337,6 +348,7 @@
337348
<el-button
338349
@click="jumpPanel(row)"
339350
size="small"
351+
:disabled="row.status !== 'Healthy'"
340352
class="visit"
341353
round
342354
plain
@@ -385,7 +397,7 @@ import { getIOOptions, getNetworkOptions } from '@/api/modules/host';
385397
import { getSettingInfo, listAllSimpleNodes, loadUpgradeInfo, getMemo, updateMemo } from '@/api/modules/setting';
386398
import { GlobalStore } from '@/store';
387399
import { storeToRefs } from 'pinia';
388-
import { routerToFileWithPath, routerToPath } from '@/utils/router';
400+
import { routerToFileWithPath, routerToNameWithQuery, routerToPath } from '@/utils/router';
389401
import { getWelcomePage } from '@/api/modules/auth';
390402
import { clearDashboardCache, getDashboardCache, setDashboardCache } from '@/utils/dashboardCache';
391403
import { MsgError, MsgSuccess } from '@/utils/message';
@@ -840,7 +852,7 @@ const loadSafeStatus = async () => {
840852
841853
const loadSource = (row: any) => {
842854
if (row.status !== 'Healthy') {
843-
return '-';
855+
return `- ${i18n.global.t('commons.units.core')} (-%) / - GB (-%)`;
844856
}
845857
return (
846858
row.cpuTotal +
@@ -1010,7 +1022,6 @@ onBeforeUnmount(() => {
10101022
10111023
.el-descriptions .el-descriptions__body .el-descriptions__table {
10121024
border-spacing: 0 5px !important;
1013-
/* 垂直间距15px */
10141025
}
10151026
}
10161027
@@ -1024,7 +1035,7 @@ onBeforeUnmount(() => {
10241035
10251036
.name {
10261037
font-weight: 500 !important;
1027-
font-size: 16px !important;
1038+
font-size: 18px !important;
10281039
line-height: 30px;
10291040
color: var(--panel-text-color);
10301041
}

0 commit comments

Comments
 (0)