Skip to content

Commit 432d0c1

Browse files
Hoang Nguyenyadvr
authored andcommitted
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>
1 parent 28b0477 commit 432d0c1

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

ui/src/utils/plugins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const pollJobPlugin = {
6666
key: jobId,
6767
duration: 2
6868
})
69-
eventBus.$emit('async-job-complete')
69+
eventBus.$emit('async-job-complete', action)
7070
successMethod(result)
7171
} else if (result.jobstatus === 2) {
7272
message.error({
@@ -88,7 +88,7 @@ export const pollJobPlugin = {
8888
key: jobId,
8989
duration: 0
9090
})
91-
eventBus.$emit('async-job-complete')
91+
eventBus.$emit('async-job-complete', action)
9292
errorMethod(result)
9393
} else if (result.jobstatus === 0) {
9494
if (showLoading) {

ui/src/views/AutogenView.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,12 @@ export default {
402402
this.fetchData()
403403
}
404404
})
405-
eventBus.$on('async-job-complete', () => {
405+
eventBus.$on('async-job-complete', (action) => {
406+
if (this.$route.path.includes('/vm/')) {
407+
if (action && 'api' in action && ['destroyVirtualMachine'].includes(action.api)) {
408+
return
409+
}
410+
}
406411
this.fetchData()
407412
})
408413
eventBus.$on('exec-action', (action, isGroupAction) => {

ui/src/views/compute/DestroyVM.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ export default {
141141
} else {
142142
this.parentFetchData()
143143
}
144+
},
145+
action: {
146+
api: 'destroyVirtualMachine'
144147
}
145148
})
146149
this.closeAction()

0 commit comments

Comments
 (0)