From e9ef3ba893344a803c14ee7ab47c2a03ced82328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Jandre?= <48719461+JoaoJandre@users.noreply.github.com> Date: Fri, 11 Jul 2025 10:08:25 -0300 Subject: [PATCH 1/2] fix message --- ui/public/locales/en.json | 1 + ui/public/locales/pt_BR.json | 3 ++- ui/src/config/section/compute.js | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index b649f6914bb..69af52a7f66 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -2836,6 +2836,7 @@ "message.action.unmanage.volume": "Please confirm that you want to unmanage the Volume.", "message.action.unmanage.volumes": "Please confirm that you want to unmanage the Volumes.", "message.action.vmsnapshot.delete": "Please confirm that you want to delete this Instance Snapshot.
Please notice that the Instance will be paused before the Snapshot deletion, and resumed after deletion, if it runs on KVM.", +"message.action.vmsnapshot.disk-only.delete": "Please confirm that you want to delete this Instance Snapshot.", "message.activate.project": "Are you sure you want to activate this project?", "message.add.egress.rule.failed": "Adding new egress rule failed.", "message.add.egress.rule.processing": "Adding new egress rule...", diff --git a/ui/public/locales/pt_BR.json b/ui/public/locales/pt_BR.json index 8aba6fe2c78..5f58446c23a 100644 --- a/ui/public/locales/pt_BR.json +++ b/ui/public/locales/pt_BR.json @@ -1905,7 +1905,8 @@ "message.action.unmanage.instance": "Por favor, confirme que voc\u00ea deseja parar de gerenciar a inst\u00e2ncia.", "message.action.unmanage.instances": "Por favor, confirme que voc\u00ea deseja parar de gerenciar as inst\u00e2ncias.", "message.action.unmanage.virtualmachine": "Por favor, confirme que voc\u00ea deseja parar de gerenciar a VM.", -"message.action.vmsnapshot.delete": "Por favor, confirme que voc\u00ea deseja excluir esta snapshot de VM.", +"message.action.vmsnapshot.delete": "Por favor, confirme que voc\u00ea deseja excluir esta snapshot de VM.
Saiba que caso a instância execute em um hypervisor KVM, ela será pausada antes da deleç\u00e3o, e continuada após a deleç\u00e3o.", +"message.action.vmsnapshot.disk-only.delete": "Por favor, confirme que voc\u00ea deseja excluir esta snapshot de VM.", "message.activate.project": "Voc\u00ea tem certeza que deseja ativar este projeto?", "message.add.egress.rule.failed": "Falha ao adicionar uma nova regra de sa\u00edda", "message.add.egress.rule.processing": "Adicionando uma nova regra de sa\u00edda...", diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index c5647fd2804..a278340cbc5 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -528,7 +528,12 @@ export default { api: 'deleteVMSnapshot', icon: 'delete-outlined', label: 'label.action.vmsnapshot.delete', - message: 'message.action.vmsnapshot.delete', + message: (record) => { + if (record.type === 'Disk') { + return 'message.action.vmsnapshot.disk-only.delete' + } + return 'message.action.vmsnapshot.delete' + }, dataView: true, show: (record) => { return ['Ready', 'Expunging', 'Error'].includes(record.state) }, args: ['vmsnapshotid'], From e933434c1dbb2e20187ab6abda33666854c6edbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Jandre?= <48719461+JoaoJandre@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:01:38 -0300 Subject: [PATCH 2/2] check for hypervisor --- ui/src/config/section/compute.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index a278340cbc5..cbd0bf4f073 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -529,7 +529,7 @@ export default { icon: 'delete-outlined', label: 'label.action.vmsnapshot.delete', message: (record) => { - if (record.type === 'Disk') { + if (record.hypervisor !== 'KVM' || record.type === 'Disk') { return 'message.action.vmsnapshot.disk-only.delete' } return 'message.action.vmsnapshot.delete'