[#issue-436]Add display node status
Add display node status in node list page
@@ -14,7 +14,8 @@ import {
Form,
Input,
Select,
- InputNumber
+ InputNumber,
+ Badge
} from 'antd';
import { DownOutlined, PlusOutlined } from '@ant-design/icons';
import moment from 'moment';
@@ -546,9 +547,6 @@ class Index extends PureComponent {
case 'stopped':
statusOfBadge = 'warning';
break;
- case 'error':
- statusOfBadge = 'error';
- break;
default:
break;
}
@@ -568,6 +566,8 @@ class Index extends PureComponent {
</a>
</Menu.Item>
)}
+ {
+ record.status === 'stopped' &&
<Menu.Item>
<a onClick={() => this.operationForNode('start', record)}>
{intl.formatMessage({
@@ -576,6 +576,9 @@ class Index extends PureComponent {
})}
</a>
</Menu.Item>
+ }
+ {
+ record.status === 'running' &&
<Menu.Item>
<a onClick={() => this.operationForNode('stop', record)}>
{intl.formatMessage({
@@ -584,6 +587,9 @@ class Index extends PureComponent {
})}
</a>
</Menu.Item>
+ }
+ {
+ record.status === 'stopped' &&
<Menu.Item>
<a onClick={() => this.operationForNode('restart', record)}>
{intl.formatMessage({
@@ -592,6 +598,7 @@ class Index extends PureComponent {
})}
</a>
</Menu.Item>
+ }
</Menu>
);
@@ -630,6 +637,14 @@ class Index extends PureComponent {
dataIndex: 'created_at',
render: text => <span>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</span>,
},
+ {
+ title: intl.formatMessage({
+ id: 'app.operator.node.table.header.status',
+ defaultMessage: 'Status',
+ }),
+ dataIndex: 'status',
+ render: text => <Badge status={badgeStatus(text)} text={text} />,
+ },
{
title: intl.formatMessage({
id: 'form.table.header.operation',
