feat(sr/disks): provide filters for snapshots (#2103)

Fixes #2102
This commit is contained in:
Olivier Lambert
2017-04-24 15:26:29 +02:00
committed by Julien Fontanet
parent 2e0ea51c30
commit cf45ffddf1
2 changed files with 8 additions and 1 deletions

View File

@@ -23,6 +23,8 @@ var messages = {
// ----- Filters -----
onError: 'On error',
successful: 'Successful',
filterNoSnapshots: 'Full disks only',
filterOnlySnapshots: 'Snapshots only',
// ----- Copiable component -----
copyToClipboard: 'Copy to clipboard',

View File

@@ -74,6 +74,11 @@ const COLUMNS = [
}
]
const FILTERS = {
filterNoSnapshots: 'type:!VDI-snapshot',
filterOnlySnapshots: 'type:VDI-snapshot'
}
// ===================================================================
export default ({ vdis, vdiSnapshots, vdisToVmIds }) => (
@@ -81,7 +86,7 @@ export default ({ vdis, vdiSnapshots, vdisToVmIds }) => (
<Row>
<Col>
{!isEmpty(vdis)
? <SortedTable collection={vdis.concat(vdiSnapshots)} userData={vdisToVmIds} columns={COLUMNS} />
? <SortedTable collection={vdis.concat(vdiSnapshots)} userData={vdisToVmIds} columns={COLUMNS} filters={FILTERS} />
: <h4 className='text-xs-center'>{_('srNoVdis')}</h4>
}
</Col>