[Feature][UI Next][V1.0.0-Alpha] Master adds empty data prompt. (#9233)

migrate-dev-docs-to-main
songjianet 2022-03-28 12:15:44 +08:00 committed by GitHub
parent 994de4c902
commit 052df581f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 3 deletions

View File

@ -152,7 +152,10 @@ const monitor = {
last_heartbeat_time: 'Last Heartbeat Time',
directory_detail: 'Directory Detail',
host: 'Host',
directory: 'Directory'
directory: 'Directory',
master_no_data_result_title: 'No Master Nodes Exist',
master_no_data_result_desc:
'Currently, there are no master nodes exist, please create a master node and refresh this page'
},
worker: {
cpu_usage: 'CPU Usage',

View File

@ -151,7 +151,10 @@ const monitor = {
last_heartbeat_time: '最后心跳时间',
directory_detail: '目录详情',
host: '主机',
directory: '注册目录'
directory: '注册目录',
master_no_data_result_title: 'Master节点不存在',
master_no_data_result_desc:
'目前没有任何Master节点请先创建Master节点再访问该页面'
},
worker: {
cpu_usage: '处理器使用量',

View File

@ -27,6 +27,7 @@ import { useI18n } from 'vue-i18n'
import { useMaster } from './use-master'
import styles from './index.module.scss'
import Card from '@/components/card'
import Result from "@/components/result";
import Gauge from '@/components/chart/modules/Gauge'
import MasterModal from './master-modal'
import type { Ref } from 'vue'
@ -67,7 +68,14 @@ const master = defineComponent({
const { t, clickDetails, onConfirmModal, showModalRef, zkDirectoryRef } =
this
return (
return this.data.length < 1 ? (
<Result
title={t('monitor.master.master_no_data_result_title')}
description={t('monitor.master.master_no_data_result_desc')}
status={'info'}
size={'medium'}
/>
) : (
<>
<NSpace vertical size={25}>
{this.data.map((item: MasterNode) => {