From 385ff21f4aa89a749e9c5ec690f9e1f116cbce93 Mon Sep 17 00:00:00 2001
From: MlssFrncJrg <119158464+Pizzosaure@users.noreply.github.com>
Date: Mon, 16 Sep 2024 09:44:17 +0200
Subject: [PATCH] feat(xo-web/disks): add icon for empty metadata VDI snapshots
(#7970)
---
CHANGELOG.unreleased.md | 3 ++-
packages/xo-web/src/common/intl/messages.js | 1 +
packages/xo-web/src/xo-app/sr/tab-disks.js | 9 +++++++++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md
index 070c117c7e3..2c71f8712cf 100644
--- a/CHANGELOG.unreleased.md
+++ b/CHANGELOG.unreleased.md
@@ -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))
@@ -39,6 +40,6 @@
- @xen-orchestra/lite minor
- @xen-orchestra/web minor
- @xen-orchestra/web-core minor
-- xo-web patch
+- xo-web minor
diff --git a/packages/xo-web/src/common/intl/messages.js b/packages/xo-web/src/common/intl/messages.js
index 1964b9a654e..da4d5756fbe 100644
--- a/packages/xo-web/src/common/intl/messages.js
+++ b/packages/xo-web/src/common/intl/messages.js
@@ -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',
diff --git a/packages/xo-web/src/xo-app/sr/tab-disks.js b/packages/xo-web/src/xo-app/sr/tab-disks.js
index 9c2e3f46468..ce27a7a4e00 100644
--- a/packages/xo-web/src/xo-app/sr/tab-disks.js
+++ b/packages/xo-web/src/xo-app/sr/tab-disks.js
@@ -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'
@@ -46,6 +47,7 @@ const COLUMNS = [
name: _('vdiNameLabel'),
itemRenderer: (vdi, { vdisByBaseCopy }) => {
const activeVdis = vdisByBaseCopy[vdi.id]
+ const isMetadataVdi = vdi.VDI_type === 'cbt_metadata'
return (
editVdi(vdi, { name_label: value })} />{' '}
@@ -54,6 +56,13 @@ const COLUMNS = [
)}
+ {isMetadataVdi && (
+
+
+
+
+
+ )}
{vdi.type === 'VDI-unmanaged' &&
(activeVdis !== undefined ? (