mirror of https://github.com/apache/cloudstack.git
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
This commit is contained in:
parent
46a3032178
commit
3a51540c24
|
|
@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -871,6 +871,9 @@ export default {
|
|||
})
|
||||
}
|
||||
}
|
||||
if ('successMethod' in action) {
|
||||
action.successMethod(this, result)
|
||||
}
|
||||
},
|
||||
errorMethod: () => this.fetchData(),
|
||||
loadingMessage: `${this.$t(action.label)} - ${resourceName}`,
|
||||
|
|
|
|||
Loading…
Reference in New Issue