This is an automated email from the ASF dual-hosted git repository.
JoaoJandre pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push:
new 974c27b04a3 Addition of a button to download backup's validation
screenshot in UI (#14234)
974c27b04a3 is described below
commit 974c27b04a3eedaeb21adf3d863f638e196e6bf5
Author: Gean Jair Silva <[email protected]>
AuthorDate: Wed Dec 2 10:30:23 2026 -0300
Addition of a button to download backup's validation screenshot in UI
(#14234)
* Addition of a button to download backup's validation screenshot in UI
* ui: show validation screenshot download only when available
* ui: avoid duplicate notifications when screenshot is unavailable
* ui: escape validation screenshot download URL
* ui: clarify unavailable validation screenshot message
---------
Co-authored-by: Gean Jair Silva <[email protected]>
Co-authored-by: Fabricio Duarte <[email protected]>
---
ui/public/locales/en.json | 4 ++++
ui/public/locales/pt_BR.json | 4 ++++
ui/src/config/section/storage.js | 28 ++++++++++++++++++++++++++++
ui/src/views/AutogenView.vue | 1 +
4 files changed, 37 insertions(+)
diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json
index f5d7b9a9b7d..15cab79eb55 100644
--- a/ui/public/locales/en.json
+++ b/ui/public/locales/en.json
@@ -147,6 +147,7 @@
"label.action.download.iso": "Download ISO",
"label.action.download.snapshot": "Download Snapshot",
"label.action.download.template": "Download Template",
+"label.action.download.screenshot": "Download Validation Screenshot",
"label.action.download.volume": "Download Volume",
"label.action.edit.account": "Edit Account",
"label.action.edit.domain": "Edit Domain",
@@ -3292,6 +3293,7 @@
"message.action.discover.gpu.devices": "Please confirm that you want to
discover GPU devices.",
"message.action.download.iso": "Please confirm that you want to download this
ISO.",
"message.action.download.snapshot": "Please confirm that you want to download
this Snapshot.",
+"message.action.download.screenshot": "Please confirm that you want to
download this screenshot",
"message.action.download.template": "Please confirm that you want to download
this Template.",
"message.action.edit.backup.repository": "Please confirm that you want to
update the backup repository.",
"message.action.edit.nfs.mount.options": "Changes to NFS mount options will
only take affect on cancelling maintenance mode which will cause the storage
pool to be remounted on all KVM hosts with the new mount options.",
@@ -3716,6 +3718,8 @@
"message.success.clone.network.offering": "Successfully cloned network
offering:",
"message.disk.usage.info.data.points": "Each data point represents the
difference in read/write data since the last data point.",
"message.disk.usage.info.sum.of.disks": "The disk usage shown is made up of
the sum of read/write data from all the disks in the Instance.",
+"message.download.screenshot": "Please click on the link to download the
validation screenshot:<br><br>{url}",
+"message.download.screenshot.failed": "No validation screenshot is available
for this backup.",
"message.download.volume": "Please click the link to download the volume:<p><a
href=\"#\">00000</a>",
"message.download.volume.confirm": "Please confirm that you want to download
this volume.",
"message.edit.acl.failed": "Failed to edit ACL rule",
diff --git a/ui/public/locales/pt_BR.json b/ui/public/locales/pt_BR.json
index 09259496da5..af4df0b33e1 100644
--- a/ui/public/locales/pt_BR.json
+++ b/ui/public/locales/pt_BR.json
@@ -131,6 +131,7 @@
"label.action.disable.zone": "Desativar zona",
"label.action.download.iso": "Baixar ISO",
"label.action.download.snapshot": "Baixar snapshot",
+"label.action.download.screenshot": "Baixar captura de tela de
valida\u00e7\u00e3o",
"label.action.download.template": "Baixar template",
"label.action.download.volume": "Baixar disco",
"label.action.edit.account": "Editar conta",
@@ -2762,6 +2763,7 @@
"message.action.disable.zone": "Confirma a desativa\u00e7\u00e3o da zona.",
"message.action.download.iso": "Por favor confirme que voc\u00ea deseja baixar
esta ISO.",
"message.action.download.snapshot": "Por favor confirme que voc\u00ea deseja
baixar esta snapshot.",
+"message.action.download.screenshot": "Por favor, confirme que voc\u00ea
deseja baixar esta captura de tela.",
"message.action.download.template": "Por favor confirme que voc\u00ea deseja
baixar este template.",
"message.action.edit.nfs.mount.options": "Altera\u00e7\u00f5es nas
op\u00e7\u00f5es de montagem NFS s\u00f3 ter\u00e3o efeito ao cancelar o modo
de manuten\u00e7\u00e3o, o que far\u00e1 com que o pool de armazenamento seja
remontado em todos os hosts KVM com as novas op\u00e7\u00f5es de montagem.",
"message.action.enable.cluster": "Confirma a ativa\u00e7\u00e3o do cluster.",
@@ -3106,6 +3108,8 @@
"message.disk.offering.created": "Oferta de disco criada:",
"message.disk.usage.info.data.points": "Cada ponto no gr\u00e1fico representa
a diferen\u00e7a de dados lidos/escritos desde a \u00faltima coleta de
estat\u00edstica realizada (o ponto anterior)",
"message.disk.usage.info.sum.of.disks": "O uso de disco apresentado \u00e9
composto pela soma de dados lidos/escritos por todos os discos da VM",
+"message.download.screenshot": "A captura de tela de valida\u00e7\u00e3o
encontra-se disponível em:<br><br>{url}",
+"message.download.screenshot.failed": "Nenhuma captura de tela de validação
está disponível para este backup.",
"message.download.volume": "Clique <a href=\"#\">00000</a> para baixar o
disco",
"message.download.volume.confirm": "Por favor confirme que voc\u00ea quer
baixar este volume",
"message.drs.plan.description": "O n\u00famero m\u00e1ximo de
migra\u00e7\u00f5es ao vivo permitidas para DRS. Configure DRS na aba de
configura\u00e7\u00f5es antes de gerar um plano ou para ativar o DRS
autom\u00e1tico para o cluster.",
diff --git a/ui/src/config/section/storage.js b/ui/src/config/section/storage.js
index d0ea953569e..8eb753d6623 100644
--- a/ui/src/config/section/storage.js
+++ b/ui/src/config/section/storage.js
@@ -19,6 +19,8 @@ import { shallowRef, defineAsyncComponent } from 'vue'
import store from '@/store'
import { isZoneCreated } from '@/utils/zone'
import { isAdmin } from '@/role'
+import { i18n } from '@/locales'
+import { escapeHtml } from '@/utils/util'
export default {
name: 'storage',
@@ -513,6 +515,32 @@ export default {
}
],
actions: [
+ {
+ api: 'downloadValidationScreenshot',
+ icon: 'picture-outlined',
+ label: 'label.action.download.screenshot',
+ message: 'message.action.download.screenshot',
+ dataView: true,
+ showSuccessMessage: false,
+ show: (record) => {
+ return record.status === 'BackedUp' && ['Valid',
'NotValid'].includes(record.validationstatus)
+ },
+ args: ['backupid'],
+ mapping: {
+ backupid: {
+ value: (record) => { return record.id }
+ }
+ },
+ response: (result) => {
+ const state = result?.downloadvalidationscreenshotresponse?.state
+ const url = result?.downloadvalidationscreenshotresponse?.url
+ if (state !== 'DOWNLOAD_URL_CREATED' || !url) {
+ return i18n.global.t('message.download.screenshot.failed')
+ }
+ const escapedUrl = escapeHtml(url)
+ return i18n.global.t('message.download.screenshot', { url: `<a
href="${escapedUrl}" target="_blank">${escapedUrl}</a>` })
+ }
+ },
{
api: 'restoreBackup',
icon: 'sync-outlined',
diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue
index c2ceabe8e49..109ee2584b7 100644
--- a/ui/src/views/AutogenView.vue
+++ b/ui/src/views/AutogenView.vue
@@ -1623,6 +1623,7 @@ export default {
title: this.$t(action.label),
description: resourceName,
name: resourceName,
+ showSuccessMessage: action.showSuccessMessage !== false,
successMethod: result => {
if (this.selectedItems.length > 0) {
eventBus.emit('update-resource-state', { selectedItems:
this.selectedItems, resource, state: 'success' })