feat(xo-web/Dashboard): make Overview & Health available on all plans (#5401)

This commit is contained in:
Pierre Donias 2020-11-27 11:10:32 +01:00 committed by GitHub
parent d1d4839a09
commit 00e53f455b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 27 deletions

View File

@ -9,7 +9,6 @@ import NoObjects from 'no-objects'
import React from 'react'
import SortedTable from 'sorted-table'
import Tooltip from 'tooltip'
import Upgrade from 'xoa-upgrade'
import xml2js from 'xml2js'
import { Sr } from 'render-xo-item'
import { SelectPool } from 'select-objects'
@ -564,7 +563,7 @@ export default class Health extends Component {
const userSrs = this._getUserSrs()
const orphanVdis = this._getOrphanVdis()
return process.env.XOA_PLAN > 3 ? (
return (
<Container>
<Row className='mb-1'>
<SelectPool multi onChange={this.linkState('pools')} value={state.pools} />
@ -724,10 +723,6 @@ export default class Health extends Component {
</Col>
</Row>
</Container>
) : (
<Container>
<Upgrade place='health' available={4} />
</Container>
)
}
}

View File

@ -9,7 +9,6 @@ import Link, { BlockLink } from 'link'
import PropTypes from 'prop-types'
import React from 'react'
import ResourceSetQuotas from 'resource-set-quotas'
import Upgrade from 'xoa-upgrade'
import { addSubscriptions, connectStore, formatSize } from 'utils'
import { Card, CardBlock, CardHeader } from 'card'
import { Container, Row, Col } from 'grid'
@ -494,26 +493,24 @@ export default class Overview extends Component {
}
return (
<Upgrade place='dashboard' required={3}>
<Container>
{showResourceSets ? (
map(props.resourceSets, resourceSet => (
<Row key={resourceSet.id}>
<Card>
<CardHeader>
<Icon icon='menu-self-service' /> {resourceSet.name}
</CardHeader>
<CardBlock>
<ResourceSetQuotas limits={resourceSet.limits} />
</CardBlock>
</Card>
</Row>
))
) : (
<DefaultCard isAdmin={props.isAdmin} />
)}
</Container>
</Upgrade>
<Container>
{showResourceSets ? (
map(props.resourceSets, resourceSet => (
<Row key={resourceSet.id}>
<Card>
<CardHeader>
<Icon icon='menu-self-service' /> {resourceSet.name}
</CardHeader>
<CardBlock>
<ResourceSetQuotas limits={resourceSet.limits} />
</CardBlock>
</Card>
</Row>
))
) : (
<DefaultCard isAdmin={props.isAdmin} />
)}
</Container>
)
}
}