Skip to content

Commit

Permalink
feat(xo-web/disks): add icon for empty metadata VDI snapshots (#7970)
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaFrncJrg authored Sep 16, 2024
1 parent 40f5f48 commit 385ff21
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [SR/Disks] Display information if the VDI is an empty metadata snapshot (PR [#7970](https://github.com/vatesfr/xen-orchestra/pull/7970))
- **XO 6**:
- [Dashboard] Display backup issues data (PR [#7974](https://github.com/vatesfr/xen-orchestra/pull/7974))

Expand Down Expand Up @@ -39,6 +40,6 @@
- @xen-orchestra/lite minor
- @xen-orchestra/web minor
- @xen-orchestra/web-core minor
- xo-web patch
- xo-web minor

<!--packages-end-->
1 change: 1 addition & 0 deletions packages/xo-web/src/common/intl/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ const messages = {
srReclaimSpaceNotSupported: 'Space reclaim not supported. Only supported on block based/LVM based SRs.',

// ----- SR disks tab -----
isMetadataVdi: 'This snapshot has been purged of its data. It only contains the metadata and changed blocks.',
multipleActiveVdis: '{firstVdi} and {nVdis} more',
noActiveVdi: 'No active VDI',

Expand Down
9 changes: 9 additions & 0 deletions packages/xo-web/src/xo-app/sr/tab-disks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import PropTypes from 'prop-types'
import React from 'react'
import SortedTable from 'sorted-table'
import TabButton from 'tab-button'
import Tooltip from 'tooltip'
import renderXoItem, { Vdi, Vm } from 'render-xo-item'
import { confirm } from 'modal'
import { injectIntl } from 'react-intl'
Expand Down Expand Up @@ -46,6 +47,7 @@ const COLUMNS = [
name: _('vdiNameLabel'),
itemRenderer: (vdi, { vdisByBaseCopy }) => {
const activeVdis = vdisByBaseCopy[vdi.id]
const isMetadataVdi = vdi.VDI_type === 'cbt_metadata'
return (
<span>
<Text value={vdi.name_label} onChange={value => editVdi(vdi, { name_label: value })} />{' '}
Expand All @@ -54,6 +56,13 @@ const COLUMNS = [
<Icon icon='vm-snapshot' />
</span>
)}
{isMetadataVdi && (
<span className='tag tag-info' style={{ marginLeft: '0.4em' }}>
<Tooltip content={_('isMetadataVdi')}>
<Icon icon='file' />
</Tooltip>
</span>
)}
{vdi.type === 'VDI-unmanaged' &&
(activeVdis !== undefined ? (
<span>
Expand Down

0 comments on commit 385ff21

Please sign in to comment.