diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index 312c0903e39..48e9a10742b 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 c51487c3b7a..ebeca6e4ab0 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}`,