fix: display when host is disabled (#2121)

Fixes #2098
This commit is contained in:
BCedric
2017-05-09 17:16:38 +02:00
committed by Julien Fontanet
parent 61179ec67d
commit 8a84cc2627
3 changed files with 20 additions and 6 deletions

View File

@@ -375,6 +375,12 @@
@extend .xo-status-busy;
}
&-disabled {
@extend .fa;
@extend .fa-circle;
@extend .xo-status-busy;
}
&-all-connected {
@extend .fa;
@extend .fa-circle;
@@ -441,6 +447,11 @@
@extend .fa-server;
@extend .text-danger;
}
&-disabled {
@extend .fa;
@extend .fa-server;
@extend .text-warning;
}
&-working {
@extend .fa;
@extend .fa-circle;

View File

@@ -106,6 +106,7 @@ export default class HostItem extends Component {
render () {
const { item: host, container, expandAll, selected, nVms } = this.props
const toolTipContent = host.power_state === `Running` && !host.enabled ? `disabled` : _(`powerState${host.power_state}`)
return <div className={styles.item}>
<BlockLink to={`/hosts/${host.id}`}>
<SingleLineRow>
@@ -115,13 +116,15 @@ export default class HostItem extends Component {
&nbsp;&nbsp;
<Tooltip
content={isEmpty(host.current_operations)
? _(`powerState${host.power_state}`)
: <div>{_(`powerState${host.power_state}`)}{' ('}{map(host.current_operations)[0]}{')'}</div>
? toolTipContent
: <div>{toolTipContent}{' ('}{map(host.current_operations)[0]}{')'}</div>
}
>
{isEmpty(host.current_operations)
? <Icon icon={`${host.power_state.toLowerCase()}`} />
: <Icon icon='busy' />
{!isEmpty(host.current_operations)
? <Icon icon='busy' />
: (host.power_state === 'Running' && !host.enabled)
? <Icon icon='disabled' />
: <Icon icon={`${host.power_state.toLowerCase()}`} />
}
</Tooltip>
&nbsp;&nbsp;

View File

@@ -235,7 +235,7 @@ export default class Host extends Component {
<Row>
<Col mediumSize={6} className='header-title'>
<h2>
<Icon icon={`host-${host.power_state.toLowerCase()}`} />
<Icon icon={host.power_state === 'Running' && !host.enabled ? 'host-disabled' : `host-${host.power_state.toLowerCase()}`} />
{' '}
<Text
value={host.name_label}