You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2021/06/18 13:57:49 UTC

[cloudstack] branch 4.15 updated: ui: Notify vm password on reinstall of VM (for password enabled templates) (#5129)

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

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


The following commit(s) were added to refs/heads/4.15 by this push:
     new 3a51540  ui: Notify vm password on reinstall of VM (for password enabled templates) (#5129)
3a51540 is described below

commit 3a51540c24932d573564c56124231e3d527e2909
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Fri Jun 18 19:27:22 2021 +0530

    ui: Notify vm password on reinstall of VM (for password enabled templates) (#5129)
    
    * ui: Notify vm password on reinstall of VM (for password enabled templates)
    
    * refactor
---
 ui/src/config/section/compute.js | 12 ++++++++++++
 ui/src/views/AutogenView.vue     |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js
index 312c090..48e9a10 100644
--- a/ui/src/config/section/compute.js
+++ b/ui/src/config/section/compute.js
@@ -144,6 +144,18 @@ export default {
             virtualmachineid: {
               value: (record) => { return record.id }
             }
+          },
+          successMethod: (obj, result) => {
+            console.log('here')
+            const vm = result.jobresult.virtualmachine || {}
+            if (result.jobstatus === 1 && vm.password) {
+              const name = vm.displayname || vm.name || vm.id
+              obj.$notification.success({
+                message: `${obj.$t('label.reinstall.vm')}: ` + name,
+                description: `${obj.$t('label.password.reset.confirm')}: ` + vm.password,
+                duration: 0
+              })
+            }
           }
         },
         {
diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue
index c51487c..ebeca6e 100644
--- a/ui/src/views/AutogenView.vue
+++ b/ui/src/views/AutogenView.vue
@@ -871,6 +871,9 @@ export default {
               })
             }
           }
+          if ('successMethod' in action) {
+            action.successMethod(this, result)
+          }
         },
         errorMethod: () => this.fetchData(),
         loadingMessage: `${this.$t(action.label)} - ${resourceName}`,