Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(xo-web/disks): add icon for empty metadata VDI snapshots #7970

Merged
merged 4 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [REST API] Add `pifs` and `vm-controllers` collections
- [REST API/Dashboard] Add name and type of the backup in the backup job issues (PR [#7958](https://github.com/vatesfr/xen-orchestra/pull/7958))
- [Perf-alert] Display warning if no guest tools are detected while monitoring VM memory (PR [#7886](https://github.com/vatesfr/xen-orchestra/pull/7886))
- [SR/Disks] Display information if VDI is empty metadata VDI snapshot (PR [7970](https://github.com/vatesfr/xen-orchestra/pull/7970))

### Bug fixes

Expand Down
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
Loading