From 74b63325724958f9dae80cb78f72a693cf938cf1 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Tue, 24 Aug 2021 14:14:05 +0700 Subject: [PATCH] ui: VM - hide button take vm volume snapshot for Destroyed state (#5345) Fixes #5340 --- ui/src/config/section/compute.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index a9ffbe0b785..f821ec58002 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -181,6 +181,10 @@ export default { docHelp: 'adminguide/virtual_machines.html#virtual-machine-snapshots', dataView: true, popup: true, + show: (record) => { + return ((['Running'].includes(record.state) && record.hypervisor !== 'LXC') || + (['Stopped'].includes(record.state) && !['KVM', 'LXC'].includes(record.hypervisor))) + }, component: () => import('@/views/compute/CreateSnapshotWizard.vue') }, {