-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(xo-web/pool): ability to do a rolling pool reboot (#7243)
- Loading branch information
Showing
6 changed files
with
107 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
packages/xo-web/src/common/xo/rolling-pool-reboot-modal/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import _ from 'intl' | ||
import addSubscriptions from 'add-subscriptions' | ||
import BaseComponent from 'base-component' | ||
import Icon from 'icon' | ||
import React from 'react' | ||
import { connectStore } from 'utils' | ||
import { createGetObjectsOfType } from 'selectors' | ||
|
||
import { subscribePlugins } from '../' | ||
|
||
@addSubscriptions(() => ({ | ||
plugins: subscribePlugins, | ||
})) | ||
@connectStore( | ||
{ | ||
pools: createGetObjectsOfType('pool'), | ||
}, | ||
{ withRef: true } | ||
) | ||
export default class RollingPoolRebootModal extends BaseComponent { | ||
render() { | ||
const pool = this.props.pools[this.props.pool] | ||
const loadBalancerPlugin = | ||
this.props.plugins !== undefined && this.props.plugins.find(plugin => plugin.name === 'load-balancer') | ||
|
||
return ( | ||
<div> | ||
<p>{_('rollingPoolRebootMessage')}</p> | ||
{pool.HA_enabled && ( | ||
<p> | ||
<em className='text-warning'> | ||
<Icon icon='alarm' /> {_('rollingPoolRebootHaWarning')} | ||
</em> | ||
</p> | ||
)} | ||
{loadBalancerPlugin !== undefined && loadBalancerPlugin.loaded && ( | ||
<p> | ||
<em className='text-warning'> | ||
<Icon icon='alarm' /> {_('rollingPoolRebootLoadBalancerWarning')} | ||
</em> | ||
</p> | ||
)} | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters