X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fpybind%2Fmgr%2Fdashboard%2Ffrontend%2Fsrc%2Fapp%2Fceph%2Fblock%2Frbd-snapshot-list%2Frbd-snapshot-actions.model.ts;h=9b3b7d1d6cdd0d1ce849876c58076c57da9e03f3;hb=aee94f6923ba628a85d855d0c5316d0da78bfa2a;hp=8b40111b8c8cb655586b4ea90c863ada4af02ea0;hpb=27f45121cc74e31203777ad565f78d8aad9b92a2;p=ceph.git diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-actions.model.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-actions.model.ts index 8b40111b8..9b3b7d1d6 100644 --- a/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-actions.model.ts +++ b/ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-actions.model.ts @@ -44,7 +44,9 @@ export class RbdSnapshotActionsModel { visible: (selection: CdTableSelection) => selection.hasSingleSelection && !selection.first().is_protected, name: actionLabels.PROTECT, - disable: (selection: CdTableSelection) => this.disableForMirrorSnapshot(selection) + disable: (selection: CdTableSelection) => + this.disableForMirrorSnapshot(selection) || + this.getProtectDisableDesc(selection, this.featuresName) }; this.unprotect = { permission: 'update', @@ -58,8 +60,7 @@ export class RbdSnapshotActionsModel { permission: 'create', canBePrimary: (selection: CdTableSelection) => selection.hasSingleSelection, disable: (selection: CdTableSelection) => - this.getCloneDisableDesc(selection, this.featuresName) || - this.disableForMirrorSnapshot(selection), + this.getCloneDisableDesc(selection) || this.disableForMirrorSnapshot(selection), icon: Icons.clone, name: actionLabels.CLONE }; @@ -107,19 +108,23 @@ export class RbdSnapshotActionsModel { ]; } - getCloneDisableDesc(selection: CdTableSelection, featuresName: string[]): boolean | string { + getProtectDisableDesc(selection: CdTableSelection, featuresName: string[]): boolean | string { if (selection.hasSingleSelection && !selection.first().cdExecuting) { if (!featuresName?.includes('layering')) { - return $localize`Parent image must support Layering`; + return $localize`The layering feature needs to be enabled on parent image`; } + return false; + } + return true; + } + getCloneDisableDesc(selection: CdTableSelection): boolean | string { + if (selection.hasSingleSelection && !selection.first().cdExecuting) { if (this.cloneFormatVersion === 1 && !selection.first().is_protected) { return $localize`Snapshot must be protected in order to clone.`; } - return false; } - return true; }