Skip to content

Commit

Permalink
Merge pull request #458 from fengyangsy/issue-#457
Browse files Browse the repository at this point in the history
[#issue-457]Modify node operation list
  • Loading branch information
zhuyuanmao authored Jun 16, 2022
2 parents 155e938 + c9e3e69 commit 31188e9
Showing 1 changed file with 25 additions and 36 deletions.
61 changes: 25 additions & 36 deletions src/dashboard/src/pages/Operator/Node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,39 +566,11 @@ class Index extends PureComponent {
</a>
</Menu.Item>
)}
{
record.status === 'stopped' &&
<Menu.Item>
<a onClick={() => this.operationForNode('start', record)}>
{intl.formatMessage({
id: 'app.operator.node.table.operation.start',
defaultMessage: 'Start',
})}
</a>
</Menu.Item>
}
{
record.status === 'running' &&
<Menu.Item>
<a onClick={() => this.operationForNode('stop', record)}>
{intl.formatMessage({
id: 'app.operator.node.table.operation.stop',
defaultMessage: 'Stop',
})}
</a>
</Menu.Item>
}
{
record.status === 'stopped' &&
<Menu.Item>
<a onClick={() => this.operationForNode('restart', record)}>
{intl.formatMessage({
id: 'app.operator.node.table.operation.restart',
defaultMessage: 'Restart',
})}
</a>
</Menu.Item>
}
<Menu.Item>
<a onClick={() => this.handleDeleteNode(record)}>
{intl.formatMessage({ id: 'form.menu.item.delete', defaultMessage: 'Delete' })}
</a>
</Menu.Item>
</Menu>
);

Expand Down Expand Up @@ -652,9 +624,26 @@ class Index extends PureComponent {
}),
render: (text, record) => (
<Fragment>
<a className={styles.danger} onClick={() => this.handleDeleteNode(record)}>
{intl.formatMessage({ id: 'form.menu.item.delete', defaultMessage: 'Delete' })}
</a>
{
record.status === 'running' &&
<a onClick={() => this.operationForNode('stop', record)}>
{intl.formatMessage({
id: 'app.operator.node.table.operation.stop',
defaultMessage: 'Stop',
})}
</a>
}
{
record.status === 'stopped' &&
<Menu.Item>
<a onClick={() => this.operationForNode('start', record)}>
{intl.formatMessage({
id: 'app.operator.node.table.operation.start',
defaultMessage: 'Start',
})}
</a>
</Menu.Item>
}
<Divider type="vertical" />
<MoreBtn {...record} />
</Fragment>
Expand Down

0 comments on commit 31188e9

Please sign in to comment.