This is an automated email from the ASF dual-hosted git repository.

sureshanaparti pushed a commit to branch 4.22
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.22 by this push:
     new 470e95964bc Change disk-only VM snapshot removal message (#11182)
470e95964bc is described below

commit 470e95964bc74f14787b0b9459a267977c104ef0
Author: João Jandre <[email protected]>
AuthorDate: Mon May 11 06:47:23 2026 -0300

    Change disk-only VM snapshot removal message (#11182)
    
    * fix message
    
    * check for hypervisor
    
    * fix function being executed once
---
 ui/public/locales/en.json        |  1 +
 ui/public/locales/pt_BR.json     |  3 ++-
 ui/src/config/section/compute.js |  7 ++++++-
 ui/src/views/AutogenView.vue     | 14 ++++++++------
 4 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json
index f5b7cc647dc..4bc005c0be1 100644
--- a/ui/public/locales/en.json
+++ b/ui/public/locales/en.json
@@ -3037,6 +3037,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. <br>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.custom.action.parameters": "Parameters to be made available while 
running the custom action.",
 "message.add.egress.rule.failed": "Adding new egress rule failed.",
diff --git a/ui/public/locales/pt_BR.json b/ui/public/locales/pt_BR.json
index c82a9e3c952..e827b1f05fe 100644
--- a/ui/public/locales/pt_BR.json
+++ b/ui/public/locales/pt_BR.json
@@ -1914,7 +1914,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. <br>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 63d0e365db9..d8605471d19 100644
--- a/ui/src/config/section/compute.js
+++ b/ui/src/config/section/compute.js
@@ -533,7 +533,12 @@ export default {
           api: 'deleteVMSnapshot',
           icon: 'delete-outlined',
           label: 'label.action.vmsnapshot.delete',
-          message: 'message.action.vmsnapshot.delete',
+          message: (record) => {
+            if (record.hypervisor !== 'KVM' || 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'],
diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue
index a5c0be3d488..c3807724b5e 100644
--- a/ui/src/views/AutogenView.vue
+++ b/ui/src/views/AutogenView.vue
@@ -216,7 +216,7 @@
           :spinning="actionLoading"
           v-ctrl-enter="handleSubmit"
         >
-          <span v-if="currentAction.message">
+          <span v-if="currentAction.messageString">
             <div v-if="selectedRowKeys.length > 0">
               <a-alert
                 v-if="['delete-outlined', 'DeleteOutlined', 
'poweroff-outlined', 'PoweroffOutlined'].includes(currentAction.icon)"
@@ -228,7 +228,7 @@
                     style="padding-left: 5px"
                     v-html="`<b>${selectedRowKeys.length} ` + 
$t('label.items.selected') + `. </b>`"
                   />
-                  <span v-html="currentAction.message" />
+                  <span v-html="currentAction.messageString" />
                 </template>
               </a-alert>
               <a-alert
@@ -240,14 +240,14 @@
                     v-if="selectedRowKeys.length > 0"
                     v-html="`<b>${selectedRowKeys.length} ` + 
$t('label.items.selected') + `. </b>`"
                   />
-                  <span v-html="currentAction.message" />
+                  <span v-html="currentAction.messageString" />
                 </template>
               </a-alert>
             </div>
             <div v-else>
               <a-alert type="warning">
                 <template #message>
-                  <span v-html="currentAction.message" />
+                  <span v-html="currentAction.messageString" />
                 </template>
               </a-alert>
             </div>
@@ -1369,9 +1369,11 @@ export default {
       this.currentAction.paramFilters = []
       if ('message' in action) {
         if (typeof action.message === 'function') {
-          action.message = action.message(action.resource)
+          action.messageString = action.message(action.resource)
+        } else {
+          action.messageString = action.message
         }
-        action.message = Array.isArray(action.message) ? 
this.$t(...action.message) : this.$t(action.message)
+        action.messageString = Array.isArray(action.messageString) ? 
this.$t(...action.messageString) : this.$t(action.messageString)
       }
       this.getArgs(action, isGroupAction, paramFields)
       this.getFilters(action, isGroupAction, paramFields)

Reply via email to