Fix reload data after delete vm (#761)

* fix reload data after delete vm

* fix call fetchData after pollJob success response

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Hoang Nguyen 2020-10-05 18:46:57 +07:00 committed by Rohit Yadav
parent 28b0477425
commit 432d0c19ad
3 changed files with 11 additions and 3 deletions

View File

@ -66,7 +66,7 @@ export const pollJobPlugin = {
key: jobId,
duration: 2
})
eventBus.$emit('async-job-complete')
eventBus.$emit('async-job-complete', action)
successMethod(result)
} else if (result.jobstatus === 2) {
message.error({
@ -88,7 +88,7 @@ export const pollJobPlugin = {
key: jobId,
duration: 0
})
eventBus.$emit('async-job-complete')
eventBus.$emit('async-job-complete', action)
errorMethod(result)
} else if (result.jobstatus === 0) {
if (showLoading) {

View File

@ -402,7 +402,12 @@ export default {
this.fetchData()
}
})
eventBus.$on('async-job-complete', () => {
eventBus.$on('async-job-complete', (action) => {
if (this.$route.path.includes('/vm/')) {
if (action && 'api' in action && ['destroyVirtualMachine'].includes(action.api)) {
return
}
}
this.fetchData()
})
eventBus.$on('exec-action', (action, isGroupAction) => {

View File

@ -141,6 +141,9 @@ export default {
} else {
this.parentFetchData()
}
},
action: {
api: 'destroyVirtualMachine'
}
})
this.closeAction()