Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import { useParams } from 'react-router-dom';
import CardBar, { healthDataProps } from './index';
import { Utils } from 'knowdesign';
import { Tooltip, Utils } from 'knowdesign';
import api from '@src/api';
import { HealthStateEnum } from '../HealthState';

Expand Down Expand Up @@ -81,7 +81,22 @@ const ZookeeperCard = () => {
{
title: 'Leader',
value() {
return <span style={{ fontSize: 24 }}>{leaderNode || '-'}</span>;
return (
<Tooltip title={leaderNode}>
<span
style={{
fontSize: 24,
overflow: 'hidden',
display: 'block',
width: '100%',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
}}
>
{leaderNode || '-'}
</span>
</Tooltip>
);
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,21 @@
margin-left: 12px;
padding: 12px 20px;
.card-bar-colunms-header {
font-size: 14px;
color: #74788d;
letter-spacing: 0;
text-align: justify;
line-height: 20px;
.anticon-question-circle {
padding: 3px 3px 2px 3px;
margin-left: -3px;
font-size: 14px;
color: #74788d;
letter-spacing: 0;
text-align: justify;
line-height: 20px;
.anticon-question-circle {
padding: 3px 3px 2px 3px;
margin-left: -3px;
font-size: 14px;
border-radius: 50%;
&:hover {
background: rgba(33, 37, 41, 0.04);
}
border-radius: 50%;
&:hover {
background: rgba(33, 37, 41, 0.04);
}
}
}
.card-bar-colunms-body {
font-size: 40px;
color: #212529;
Expand All @@ -89,6 +89,7 @@
margin-top: 5px;
.num {
font-family: DIDIFD-Medium;
overflow: hidden;
}
.sub-title {
font-family: @font-family;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,21 @@ const CardBar = (props: CardBarProps) => {
dataIndex: 'passed',
width: '30%',
render(value: boolean, record: any) {
const icon = value ? <IconFont type="icon-zhengchang"></IconFont> : <IconFont type="icon-yichang"></IconFont>;
const txt = value ? '已通过' : '未通过';
const notPassedResNameList = record.notPassedResNameList || [];
return (
<div style={{ display: 'flex', width: 240 }}>
<div style={{ marginRight: 6 }}>
{icon} {txt}
if (record?.updateTime) {
const icon = value ? <IconFont type="icon-zhengchang"></IconFont> : <IconFont type="icon-yichang"></IconFont>;
const txt = value ? '已通过' : '未通过';
const notPassedResNameList = record.notPassedResNameList || [];
return (
<div style={{ display: 'flex', width: 240 }}>
<div style={{ marginRight: 6 }}>
{icon} {txt}
</div>
{<TagsWithHide list={notPassedResNameList} expandTagContent="更多" />}
</div>
{<TagsWithHide list={notPassedResNameList} expandTagContent="更多" />}
</div>
);
);
} else {
return '-';
}
},
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export const getDetailColumn = (clusterId: number) => [
width: 190,
dataIndex: 'updateTime',
render: (text: string) => {
return moment(text).format(timeFormat);
return text ? moment(text).format(timeFormat) : '-';
},
},
{
Expand All @@ -224,21 +224,25 @@ export const getDetailColumn = (clusterId: number) => [
width: 280,
// eslint-disable-next-line react/display-name
render: (passed: boolean, record: any) => {
if (passed) {
if (record?.updateTime) {
if (passed) {
return (
<>
<IconFont type="icon-zhengchang" />
<span style={{ marginLeft: 4 }}>通过</span>
</>
);
}
return (
<>
<IconFont type="icon-zhengchang" />
<span style={{ marginLeft: 4 }}>通过</span>
</>
<div style={{ display: 'flex', alignItems: 'center', width: '240px' }}>
<IconFont type="icon-yichang" />
<div style={{ marginLeft: 4, marginRight: 6, flexShrink: 0 }}>未通过</div>
<TagsWithHide list={record.notPassedResNameList || []} expandTagContent="更多" />
</div>
);
} else {
return '-';
}
return (
<div style={{ display: 'flex', alignItems: 'center', width: '240px' }}>
<IconFont type="icon-yichang" />
<div style={{ marginLeft: 4, marginRight: 6, flexShrink: 0 }}>未通过</div>
<TagsWithHide list={record.notPassedResNameList || []} expandTagContent="更多" />
</div>
);
},
},
];
Expand Down