feat(sr): also display unmanaged VDIs (#2131)
This commit is contained in:
committed by
Julien Fontanet
parent
46e95fe7eb
commit
87087d55aa
@@ -24,6 +24,8 @@ var messages = {
|
||||
onError: 'On error',
|
||||
successful: 'Successful',
|
||||
filterNoSnapshots: 'Full disks only',
|
||||
filterOnlyBaseCopy: 'Base copy only',
|
||||
filterOnlyRegularDisks: 'Regular disks only',
|
||||
filterOnlySnapshots: 'Snapshots only',
|
||||
|
||||
// ----- Copiable component -----
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
.usage-element-highlight {
|
||||
background-color: $brand-primary;
|
||||
background-color: $brand-warning;
|
||||
}
|
||||
|
||||
.usage-element-others {
|
||||
|
||||
@@ -77,6 +77,12 @@ import TabXosan from './tab-xosan'
|
||||
)
|
||||
).groupBy('VDI')
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
const getVdisUnmanaged = createGetObjectsOfType('VDI-unmanaged').pick(
|
||||
createSelector(getSr, sr => sr.VDIs)
|
||||
).sort()
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
const getVdiSnapshots = createGetObjectsOfType('VDI-snapshot').pick(
|
||||
@@ -136,6 +142,7 @@ import TabXosan from './tab-xosan'
|
||||
pbds: getPbds(state, props),
|
||||
logs: getLogs(state, props),
|
||||
vdis: getVdis(state, props),
|
||||
vdisUnmanaged: getVdisUnmanaged(state, props),
|
||||
vdiSnapshots: getVdiSnapshots(state, props),
|
||||
vdisToVmIds: getVdisToVmIds(state, props),
|
||||
sr
|
||||
@@ -216,6 +223,7 @@ export default class Sr extends Component {
|
||||
'pbds',
|
||||
'sr',
|
||||
'vdis',
|
||||
'vdisUnmanaged',
|
||||
'vdiSnapshots',
|
||||
'vdisToVmIds'
|
||||
]))
|
||||
|
||||
@@ -76,17 +76,19 @@ const COLUMNS = [
|
||||
|
||||
const FILTERS = {
|
||||
filterNoSnapshots: 'type:!VDI-snapshot',
|
||||
filterOnlyBaseCopy: 'type:VDI-unmanaged',
|
||||
filterOnlyRegularDisks: 'type:!VDI-unmanaged type:!VDI-snapshot',
|
||||
filterOnlySnapshots: 'type:VDI-snapshot'
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
export default ({ vdis, vdiSnapshots, vdisToVmIds }) => (
|
||||
export default ({ vdis, vdisUnmanaged, vdiSnapshots, vdisToVmIds }) => (
|
||||
<Container>
|
||||
<Row>
|
||||
<Col>
|
||||
{!isEmpty(vdis)
|
||||
? <SortedTable collection={vdis.concat(vdiSnapshots)} userData={vdisToVmIds} columns={COLUMNS} filters={FILTERS} />
|
||||
? <SortedTable collection={vdis.concat(vdiSnapshots, vdisUnmanaged)} userData={vdisToVmIds} columns={COLUMNS} filters={FILTERS} />
|
||||
: <h4 className='text-xs-center'>{_('srNoVdis')}</h4>
|
||||
}
|
||||
</Col>
|
||||
|
||||
@@ -12,6 +12,7 @@ import Usage, { UsageElement } from 'usage'
|
||||
export default ({
|
||||
sr,
|
||||
vdis,
|
||||
vdisUnmanaged,
|
||||
vdisToVmIds
|
||||
}) => <Container>
|
||||
<Row className='text-xs-center'>
|
||||
@@ -34,6 +35,16 @@ export default ({
|
||||
<Row>
|
||||
<Col smallOffset={1} mediumSize={10}>
|
||||
<Usage total={sr.size}>
|
||||
{map(vdisUnmanaged, vdi => <UsageElement
|
||||
highlight
|
||||
key={vdi.id}
|
||||
tooltip={<span>
|
||||
{vdi.name_label}
|
||||
<br />
|
||||
{vdisToVmIds[vdi.id] && renderXoItemFromId(vdisToVmIds[vdi.id])}
|
||||
</span>}
|
||||
value={vdi.usage}
|
||||
/>)}
|
||||
{map(vdis, vdi => <UsageElement
|
||||
key={vdi.id}
|
||||
tooltip={<span>
|
||||
|
||||
Reference in New Issue
Block a user