ui: Fix async poll job (#5221)

This commit is contained in:
davidjumani 2021-07-21 14:00:32 +05:30 committed by GitHub
parent 61de48904c
commit 84e52c9263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 41 deletions

View File

@ -173,13 +173,9 @@ export default {
} else {
jobId = response.migratevirtualmachine.jobid
}
this.$store.dispatch('AddAsyncJob', {
title: `${this.$t('label.migrating')} ${this.resource.name}`,
jobid: jobId,
description: this.resource.name,
status: 'progress'
})
this.$pollJob({
title: `${this.$t('label.migrating')} ${this.resource.name}`,
description: this.resource.name,
jobId: jobId,
successMessage: `${this.$t('message.success.migrating')} ${this.resource.name}`,
successMethod: () => {

View File

@ -288,15 +288,10 @@ export default {
this.loading = true
api('deleteEgressFirewallRule', { id: rule.id }).then(response => {
const jobId = response.deleteegressfirewallruleresponse.jobid
this.$store.dispatch('AddAsyncJob', {
title: this.$t('label.action.delete.egress.firewall'),
jobid: jobId,
description: rule.id,
status: 'progress',
bulkAction: this.selectedItems.length > 0 && this.showGroupActionModal
})
eventBus.$emit('update-job-details', jobId, null)
this.$pollJob({
title: this.$t('label.action.delete.egress.firewall'),
description: rule.id,
jobId: jobId,
successMessage: this.$t('message.success.remove.egress.rule'),
successMethod: () => {

View File

@ -331,15 +331,10 @@ export default {
this.loading = true
api('deleteFirewallRule', { id: rule.id }).then(response => {
const jobId = response.deletefirewallruleresponse.jobid
this.$store.dispatch('AddAsyncJob', {
title: this.$t('label.action.delete.firewall'),
jobid: jobId,
description: rule.id,
status: 'progress',
bulkAction: this.selectedItems.length > 0 && this.showGroupActionModal
})
eventBus.$emit('update-job-details', jobId, null)
this.$pollJob({
title: this.$t('label.action.delete.firewall'),
description: rule.id,
jobId: jobId,
successMessage: this.$t('message.success.remove.firewall.rule'),
successMethod: () => {

View File

@ -389,15 +389,10 @@ export default {
id: ip.id
}).then(response => {
const jobId = response.disassociateipaddressresponse.jobid
this.$store.dispatch('AddAsyncJob', {
title: this.$t('label.action.release.ip'),
jobid: jobId,
description: ip.id,
status: 'progress',
bulkAction: this.selectedItems.length > 0 && this.showGroupActionModal
})
eventBus.$emit('update-job-details', jobId, null)
this.$pollJob({
title: this.$t('label.action.release.ip'),
description: ip.id,
jobId: jobId,
successMessage: this.$t('message.success.release.ip'),
successMethod: () => {

View File

@ -1023,15 +1023,10 @@ export default {
id: rule.id
}).then(response => {
const jobId = response.deleteloadbalancerruleresponse.jobid
this.$store.dispatch('AddAsyncJob', {
title: this.$t('label.action.delete.load.balancer'),
jobid: jobId,
description: rule.id,
status: 'progress',
bulkAction: this.selectedItems.length > 0 && this.showGroupActionModal
})
eventBus.$emit('update-job-details', jobId, null)
this.$pollJob({
title: this.$t('label.action.delete.load.balancer'),
description: rule.id,
jobId: jobId,
successMessage: this.$t('message.success.remove.rule'),
successMethod: () => {

View File

@ -523,15 +523,10 @@ export default {
this.loading = true
api('deletePortForwardingRule', { id: rule.id }).then(response => {
const jobId = response.deleteportforwardingruleresponse.jobid
this.$store.dispatch('AddAsyncJob', {
title: this.$t('label.portforwarding.rule'),
jobid: jobId,
description: rule.id,
status: 'progress',
bulkAction: this.selectedItems.length > 0 && this.showGroupActionModal
})
eventBus.$emit('update-job-details', jobId, null)
this.$pollJob({
title: this.$t('label.portforwarding.rule'),
description: rule.id,
jobId: jobId,
successMessage: this.$t('message.success.remove.port.forward'),
successMethod: () => {