diff --git a/src/components/view/ActionButton.vue b/src/components/view/ActionButton.vue index df36a16ce..bd869b10f 100644 --- a/src/components/view/ActionButton.vue +++ b/src/components/view/ActionButton.vue @@ -135,6 +135,7 @@ export default { const dataBadge = {} const arrAsync = [] const actionBadge = this.actions.filter(action => action.showBadge === true) + if ((actionBadge.dataView ? actionBadge.dataView : false) !== this.dataView) return if (actionBadge && actionBadge.length > 0) { const dataLength = actionBadge.length diff --git a/src/components/view/DedicateData.vue b/src/components/view/DedicateData.vue index af50eac2b..5b5cda858 100644 --- a/src/components/view/DedicateData.vue +++ b/src/components/view/DedicateData.vue @@ -177,7 +177,6 @@ export default { jobId: response.releasededicatedzoneresponse.jobid, successMessage: this.$t('message.dedicated.zone.released'), successMethod: () => { - this.parentFetchData() this.dedicatedDomainId = null this.$store.dispatch('AddAsyncJob', { title: this.$t('message.dedicated.zone.released'), @@ -186,9 +185,6 @@ export default { }) }, errorMessage: this.$t('error.release.dedicate.zone'), - errorMethod: () => { - this.parentFetchData() - }, loadingMessage: this.$t('message.releasing.dedicated.zone'), catchMessage: this.$t('error.fetching.async.job.result'), catchMethod: () => { @@ -207,7 +203,6 @@ export default { jobId: response.releasededicatedpodresponse.jobid, successMessage: this.$t('message.pod.dedication.released'), successMethod: () => { - this.parentFetchData() this.dedicatedDomainId = null this.$store.dispatch('AddAsyncJob', { title: this.$t('message.pod.dedication.released'), @@ -216,9 +211,6 @@ export default { }) }, errorMessage: this.$t('error.release.dedicate.pod'), - errorMethod: () => { - this.parentFetchData() - }, loadingMessage: this.$t('message.releasing.dedicated.pod'), catchMessage: this.$t('error.fetching.async.job.result'), catchMethod: () => { @@ -237,7 +229,6 @@ export default { jobId: response.releasededicatedclusterresponse.jobid, successMessage: this.$t('message.cluster.dedication.released'), successMethod: () => { - this.parentFetchData() this.dedicatedDomainId = null this.$store.dispatch('AddAsyncJob', { title: this.$t('message.cluster.dedication.released'), @@ -246,9 +237,6 @@ export default { }) }, errorMessage: this.$t('error.release.dedicate.cluster'), - errorMethod: () => { - this.parentFetchData() - }, loadingMessage: this.$t('message.releasing.dedicated.cluster'), catchMessage: this.$t('error.fetching.async.job.result'), catchMethod: () => { @@ -267,7 +255,6 @@ export default { jobId: response.releasededicatedhostresponse.jobid, successMessage: this.$t('message.host.dedication.released'), successMethod: () => { - this.parentFetchData() this.dedicatedDomainId = null this.$store.dispatch('AddAsyncJob', { title: this.$t('message.host.dedication.released'), @@ -276,9 +263,6 @@ export default { }) }, errorMessage: this.$t('error.release.dedicate.host'), - errorMethod: () => { - this.parentFetchData() - }, loadingMessage: this.$t('message.releasing.dedicated.host'), catchMessage: this.$t('error.fetching.async.job.result'), catchMethod: () => { diff --git a/src/components/view/DedicateModal.vue b/src/components/view/DedicateModal.vue index 9443e42cb..4ec0a88b7 100644 --- a/src/components/view/DedicateModal.vue +++ b/src/components/view/DedicateModal.vue @@ -95,7 +95,6 @@ export default { jobId: response.dedicatezoneresponse.jobid, successMessage: this.$t('label.zone.dedicated'), successMethod: () => { - this.parentFetchData() this.fetchParentData() this.dedicatedDomainId = this.domainId this.dedicatedDomainModal = false @@ -108,7 +107,6 @@ export default { }, errorMessage: this.$t('error.dedicate.zone.failed'), errorMethod: () => { - this.parentFetchData() this.fetchParentData() this.dedicatedDomainModal = false }, @@ -139,7 +137,6 @@ export default { jobId: response.dedicatepodresponse.jobid, successMessage: this.$t('label.pod.dedicated'), successMethod: () => { - this.parentFetchData() this.fetchParentData() this.dedicatedDomainId = this.domainId this.dedicatedDomainModal = false @@ -152,7 +149,6 @@ export default { }, errorMessage: this.$t('error.dedicate.pod.failed'), errorMethod: () => { - this.parentFetchData() this.fetchParentData() this.dedicatedDomainModal = false }, @@ -183,7 +179,6 @@ export default { jobId: response.dedicateclusterresponse.jobid, successMessage: this.$t('message.cluster.dedicated'), successMethod: () => { - this.parentFetchData() this.fetchParentData() this.dedicatedDomainId = this.domainId this.dedicatedDomainModal = false @@ -196,7 +191,6 @@ export default { }, errorMessage: this.$t('error.dedicate.cluster.failed'), errorMethod: () => { - this.parentFetchData() this.fetchParentData() this.dedicatedDomainModal = false }, @@ -227,7 +221,6 @@ export default { jobId: response.dedicatehostresponse.jobid, successMessage: this.$t('message.host.dedicated'), successMethod: () => { - this.parentFetchData() this.fetchParentData() this.dedicatedDomainId = this.domainId this.dedicatedDomainModal = false @@ -240,7 +233,6 @@ export default { }, errorMessage: this.$t('error.dedicate.host.failed'), errorMethod: () => { - this.parentFetchData() this.fetchParentData() this.dedicatedDomainModal = false }, diff --git a/src/utils/plugins.js b/src/utils/plugins.js index d00269d3b..7c5a20137 100644 --- a/src/utils/plugins.js +++ b/src/utils/plugins.js @@ -66,7 +66,9 @@ export const pollJobPlugin = { key: jobId, duration: 2 }) - eventBus.$emit('async-job-complete', action) + if (!action || !('isFetchData' in action) || ('isFetchData' in action && action.isFetchData)) { + eventBus.$emit('async-job-complete') + } successMethod(result) } else if (result.jobstatus === 2) { message.error({ @@ -88,7 +90,9 @@ export const pollJobPlugin = { key: jobId, duration: 0 }) - eventBus.$emit('async-job-complete', action) + if (!action || !('isFetchData' in action) || ('isFetchData' in action && action.isFetchData)) { + eventBus.$emit('async-job-complete') + } errorMethod(result) } else if (result.jobstatus === 0) { if (showLoading) { diff --git a/src/views/AutogenView.vue b/src/views/AutogenView.vue index 0cdf4a62f..8c01c4ece 100644 --- a/src/views/AutogenView.vue +++ b/src/views/AutogenView.vue @@ -394,12 +394,18 @@ export default { searchParams: {}, actions: [], formModel: {}, - confirmDirty: false + confirmDirty: false, + promises: [] } }, beforeCreate () { this.form = this.$form.createForm(this) }, + beforeDestroy () { + eventBus.$off('vm-refresh-data') + eventBus.$off('async-job-complete') + eventBus.$off('exec-action') + }, created () { eventBus.$on('vm-refresh-data', () => { if (this.$route.path === '/vm' || this.$route.path.includes('/vm/')) { @@ -407,11 +413,6 @@ export default { } }) 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) => { @@ -831,27 +832,29 @@ export default { }) }, pollActionCompletion (jobId, action, resourceName, showLoading = true) { - this.$pollJob({ - jobId, - name: resourceName, - successMethod: result => { - this.fetchData() - if (action.response) { - const description = action.response(result.jobresult) - if (description) { - this.$notification.info({ - message: this.$t(action.label), - description: (), - duration: 0 - }) + return new Promise((resolve, reject) => { + this.$pollJob({ + jobId, + name: resourceName, + successMethod: result => { + if (action.response) { + const description = action.response(result.jobresult) + if (description) { + this.$notification.info({ + message: this.$t(action.label), + description: (), + duration: 0 + }) + } } - } - }, - errorMethod: () => this.fetchData(), - loadingMessage: `${this.$t(action.label)} - ${resourceName}`, - showLoading: showLoading, - catchMessage: this.$t('error.fetching.async.job.result'), - action + resolve() + }, + errorMethod: () => resolve, + loadingMessage: `${this.$t(action.label)} - ${resourceName}`, + showLoading: showLoading, + catchMessage: this.$t('error.fetching.async.job.result'), + action + }) }) }, fillEditFormFieldValues () { @@ -872,6 +875,7 @@ export default { }) }, handleSubmit (e) { + this.promises = [] if (!this.dataView && this.currentAction.groupAction && this.selectedRowKeys.length > 0) { this.form.validateFields((err, values) => { if (!err) { @@ -884,18 +888,18 @@ export default { for (const params of paramsList) { var resourceName = itemsNameMap[params.id] // Using a method for this since it's an async call and don't want wrong prarms to be passed - this.callGroupApi(params, resourceName) + this.promises.push(this.callGroupApi(params, resourceName)) } this.$message.info({ content: this.$t(this.currentAction.label), key: this.currentAction.label, duration: 3 }) - setTimeout(() => { + Promise.all(this.promises).finally(() => { this.actionLoading = false this.closeAction() this.fetchData() - }, 500) + }) } }) } else { @@ -903,24 +907,28 @@ export default { } }, callGroupApi (params, resourceName) { - const action = this.currentAction - api(action.api, params).then(json => { - this.handleResponse(json, resourceName, action, false) - }).catch(error => { - if ([401].includes(error.response.status)) { - return - } - this.$notifyError(error) + return new Promise((resolve, reject) => { + const action = this.currentAction + action.isFetchData = false + api(action.api, params).then(json => { + resolve(this.handleResponse(json, resourceName, action, false)) + }).catch(error => { + if ([401].includes(error.response.status)) { + return + } + this.$notifyError(error) + }) }) }, handleResponse (response, resourceName, action, showLoading = true) { for (const obj in response) { if (obj.includes('response')) { if (response[obj].jobid) { - const jobid = response[obj].jobid - this.$store.dispatch('AddAsyncJob', { title: this.$t(action.label), jobid: jobid, description: resourceName, status: 'progress' }) - this.pollActionCompletion(jobid, action, resourceName, showLoading) - return true + return new Promise(resolve => { + const jobid = response[obj].jobid + this.$store.dispatch('AddAsyncJob', { title: this.$t(action.label), jobid: jobid, description: resourceName, status: 'progress' }) + resolve(this.pollActionCompletion(jobid, action, resourceName, showLoading)) + }) } else { var message = action.successMessage ? this.$t(action.successMessage) : this.$t(action.label) + (resourceName ? ' - ' + resourceName : '') diff --git a/src/views/compute/AttachIso.vue b/src/views/compute/AttachIso.vue index 947201171..16d3bec64 100644 --- a/src/views/compute/AttachIso.vue +++ b/src/views/compute/AttachIso.vue @@ -128,7 +128,6 @@ export default { jobid: jobId, status: this.$t('progress') }) - this.parentFetchData() }, successMessage: `${this.$t('label.action.attach.iso')} ${this.$t('label.success')}`, loadingMessage: `${title} ${this.$t('label.in.progress')}`, diff --git a/src/views/compute/CreateKubernetesCluster.vue b/src/views/compute/CreateKubernetesCluster.vue index 9759a5d90..e0116b2e5 100644 --- a/src/views/compute/CreateKubernetesCluster.vue +++ b/src/views/compute/CreateKubernetesCluster.vue @@ -546,13 +546,9 @@ export default { jobId, loadingMessage: `${this.$t('label.kubernetes.cluster.create')} ${values.name} ${this.$t('label.in.progress')}`, catchMessage: this.$t('error.fetching.async.job.result'), - successMessage: this.$t('message.success.create.kubernetes.cluter') + ' ' + values.name, - successMethod: result => { - this.$emit('refresh-data') - } + successMessage: this.$t('message.success.create.kubernetes.cluter') + ' ' + values.name }) this.closeAction() - this.$emit('refresh-data') }).catch(error => { this.$notifyError(error) }).finally(() => { diff --git a/src/views/compute/DeployVM.vue b/src/views/compute/DeployVM.vue index bee2a3865..054d84888 100644 --- a/src/views/compute/DeployVM.vue +++ b/src/views/compute/DeployVM.vue @@ -1546,15 +1546,14 @@ export default { duration: 0 }) } - eventBus.$emit('vm-refresh-data') - }, - errorMethod: () => { - eventBus.$emit('vm-refresh-data') }, loadingMessage: `${title} ${this.$t('label.in.progress')}`, catchMessage: this.$t('error.fetching.async.job.result'), catchMethod: () => { eventBus.$emit('vm-refresh-data') + }, + action: { + isFetchData: false } }) this.$store.dispatch('AddAsyncJob', { diff --git a/src/views/compute/DestroyVM.vue b/src/views/compute/DestroyVM.vue index 638097d29..b3c5bac41 100644 --- a/src/views/compute/DestroyVM.vue +++ b/src/views/compute/DestroyVM.vue @@ -144,7 +144,7 @@ export default { } }, action: { - api: 'destroyVirtualMachine' + isFetchData: false } }) this.closeAction() diff --git a/src/views/compute/InstanceTab.vue b/src/views/compute/InstanceTab.vue index 95da48797..d8adc7139 100644 --- a/src/views/compute/InstanceTab.vue +++ b/src/views/compute/InstanceTab.vue @@ -438,13 +438,11 @@ export default { successMethod: () => { this.loadingNic = false this.closeModals() - this.parentFetchData() }, errorMessage: this.$t('message.add.network.failed'), errorMethod: () => { this.loadingNic = false this.closeModals() - this.parentFetchData() }, loadingMessage: this.$t('message.add.network.processing'), catchMessage: this.$t('error.fetching.async.job.result'), @@ -470,12 +468,10 @@ export default { successMessage: `${this.$t('label.success.set')} ${item.networkname} ${this.$t('label.as.default')}. ${this.$t('message.set.default.nic.manual')}.`, successMethod: () => { this.loadingNic = false - this.parentFetchData() }, errorMessage: `${this.$t('label.error.setting')} ${item.networkname} ${this.$t('label.as.default')}`, errorMethod: () => { this.loadingNic = false - this.parentFetchData() }, loadingMessage: `${this.$t('label.setting')} ${item.networkname} ${this.$t('label.as.default')}...`, catchMessage: this.$t('error.fetching.async.job.result'), @@ -502,13 +498,11 @@ export default { successMethod: () => { this.loadingNic = false this.closeModals() - this.parentFetchData() }, errorMessage: this.$t('label.error'), errorMethod: () => { this.loadingNic = false this.closeModals() - this.parentFetchData() }, loadingMessage: this.$t('message.update.ipaddress.processing'), catchMessage: this.$t('error.fetching.async.job.result'), @@ -536,12 +530,10 @@ export default { successMessage: this.$t('message.success.remove.nic'), successMethod: () => { this.loadingNic = false - this.parentFetchData() }, errorMessage: this.$t('message.error.remove.nic'), errorMethod: () => { this.loadingNic = false - this.parentFetchData() }, loadingMessage: this.$t('message.remove.nic.processing'), catchMessage: this.$t('error.fetching.async.job.result'), @@ -572,13 +564,11 @@ export default { successMethod: () => { this.loadingNic = false this.fetchSecondaryIPs(this.selectedNicId) - this.parentFetchData() }, errorMessage: this.$t('message.error.add.secondary.ipaddress'), errorMethod: () => { this.loadingNic = false this.fetchSecondaryIPs(this.selectedNicId) - this.parentFetchData() }, loadingMessage: this.$t('message.add.secondary.ipaddress.processing'), catchMessage: this.$t('error.fetching.async.job.result'), @@ -603,13 +593,11 @@ export default { successMethod: () => { this.loadingNic = false this.fetchSecondaryIPs(this.selectedNicId) - this.parentFetchData() }, errorMessage: this.$t('message.error.remove.secondary.ipaddress'), errorMethod: () => { this.loadingNic = false this.fetchSecondaryIPs(this.selectedNicId) - this.parentFetchData() }, loadingMessage: this.$t('message.remove.secondary.ipaddress.processing'), catchMessage: this.$t('error.fetching.async.job.result'), diff --git a/src/views/compute/ScaleKubernetesCluster.vue b/src/views/compute/ScaleKubernetesCluster.vue index 8ebc1fb29..0cf077265 100644 --- a/src/views/compute/ScaleKubernetesCluster.vue +++ b/src/views/compute/ScaleKubernetesCluster.vue @@ -197,13 +197,9 @@ export default { jobId, loadingMessage: `${this.$t('label.kubernetes.cluster.scale')} ${this.resource.name} ${this.$t('label.in.progress')}`, catchMessage: this.$t('error.fetching.async.job.result'), - successMessage: `${this.$t('message.success.scale.kubernetes')} ${this.resource.name}`, - successMethod: result => { - this.$emit('refresh-data') - } + successMessage: `${this.$t('message.success.scale.kubernetes')} ${this.resource.name}` }) this.closeAction() - this.$emit('refresh-data') }).catch(error => { this.$notifyError(error) }).finally(() => { diff --git a/src/views/compute/UpgradeKubernetesCluster.vue b/src/views/compute/UpgradeKubernetesCluster.vue index 18b51b21c..6ce6ff29f 100644 --- a/src/views/compute/UpgradeKubernetesCluster.vue +++ b/src/views/compute/UpgradeKubernetesCluster.vue @@ -169,12 +169,8 @@ export default { jobId, loadingMessage: `${this.$t('label.kubernetes.cluster.upgrade')} ${this.resource.name} ${this.$t('label.in.progress')}`, catchMessage: this.$t('error.fetching.async.job.result'), - successMessage: `${this.$t('message.success.upgrade.kubernetes')} ${this.resource.name}`, - successMethod: result => { - this.$emit('refresh-data') - } + successMessage: `${this.$t('message.success.upgrade.kubernetes')} ${this.resource.name}` }) - this.$emit('refresh-data') this.closeAction() }).catch(error => { this.$notifyError(error) diff --git a/src/views/iam/DomainActionForm.vue b/src/views/iam/DomainActionForm.vue index 900a5908f..e07c5ee83 100644 --- a/src/views/iam/DomainActionForm.vue +++ b/src/views/iam/DomainActionForm.vue @@ -163,7 +163,6 @@ export default { this.$set(this.resource, 'isDel', true) this.parentUpdActionData(this.resource) } - this.parentFetchData() if (action.response) { const description = action.response(result.jobresult) if (description) { @@ -175,7 +174,6 @@ export default { } } }, - errorMethod: () => this.parentFetchData(), loadingMessage: `${this.$t(action.label)} ${this.$t('label.in.progress')} ${this.$t('label.for')} ${this.resource.name}`, catchMessage: this.$t('error.fetching.async.job.result'), action diff --git a/src/views/network/CreateVpc.vue b/src/views/network/CreateVpc.vue index d3697f350..a3c3cc34b 100644 --- a/src/views/network/CreateVpc.vue +++ b/src/views/network/CreateVpc.vue @@ -220,7 +220,6 @@ export default { loadingMessage: `${title} ${this.$t('label.in.progress')}`, catchMessage: this.$t('error.fetching.async.job.result') }) - this.$emit('refresh-data') } this.closeAction() }).catch(error => { diff --git a/src/views/network/CreateVpnCustomerGateway.vue b/src/views/network/CreateVpnCustomerGateway.vue index ebbb7be12..80529c8d5 100644 --- a/src/views/network/CreateVpnCustomerGateway.vue +++ b/src/views/network/CreateVpnCustomerGateway.vue @@ -253,7 +253,6 @@ export default { required: true } }, - inject: ['parentFetchData', 'parentToggleLoading'], data () { return { encryptionAlgo: [ @@ -329,12 +328,10 @@ export default { successMessage: this.$t('message.success.add.vpn.customer.gateway'), successMethod: () => { this.closeModal() - this.parentFetchData() }, errorMessage: `${this.$t('message.create.vpn.customer.gateway.failed')} ` + response, errorMethod: () => { this.closeModal() - this.parentFetchData() }, loadingMessage: this.$t('message.add.vpn.customer.gateway.processing'), catchMessage: this.$t('error.fetching.async.job.result'), diff --git a/src/views/network/FirewallRules.vue b/src/views/network/FirewallRules.vue index 48e30a6b3..ec766eea0 100644 --- a/src/views/network/FirewallRules.vue +++ b/src/views/network/FirewallRules.vue @@ -323,13 +323,11 @@ export default { jobId: response.createtagsresponse.jobid, successMessage: this.$t('message.success.add.tag'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.openTagsModal(this.selectedRule) }, errorMessage: this.$t('message.add.tag.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.closeModal() }, @@ -358,13 +356,11 @@ export default { jobId: response.deletetagsresponse.jobid, successMessage: this.$t('message.success.delete.tag'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.openTagsModal(this.selectedRule) }, errorMessage: this.$t('message.delete.tag.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.closeModal() }, diff --git a/src/views/network/IngressEgressRuleConfigure.vue b/src/views/network/IngressEgressRuleConfigure.vue index 7b9965ad6..aa1e17a1d 100644 --- a/src/views/network/IngressEgressRuleConfigure.vue +++ b/src/views/network/IngressEgressRuleConfigure.vue @@ -278,12 +278,10 @@ export default { : response.authorizesecuritygroupegressresponse.jobid, successMessage: this.$t('message.success.add.rule'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() }, errorMessage: this.$t('message.add.rule.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() }, loadingMessage: this.$t('message.add.rule.processing'), @@ -310,12 +308,10 @@ export default { : response.revokesecuritygroupegressresponse.jobid, successMessage: this.$t('message.success.remove.rule'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() }, errorMessage: this.$t('message.remove.rule.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() }, loadingMessage: this.$t('message.remove.securitygroup.rule.processing'), @@ -354,14 +350,12 @@ export default { jobId: response.deletetagsresponse.jobid, successMessage: this.$t('message.success.delete.tag'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchTags(this.selectedRule) this.tagsLoading = false }, errorMessage: this.$t('message.delete.tag.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchTags(this.selectedRule) this.tagsLoading = false @@ -402,14 +396,12 @@ export default { jobId: response.createtagsresponse.jobid, successMessage: this.$t('message.success.add.tag'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchTags(this.selectedRule) this.tagsLoading = false }, errorMessage: this.$t('message.add.tag.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchTags(this.selectedRule) this.tagsLoading = false diff --git a/src/views/network/InternalLBAssignVmForm.vue b/src/views/network/InternalLBAssignVmForm.vue index b1e1fa26a..8819000e7 100644 --- a/src/views/network/InternalLBAssignVmForm.vue +++ b/src/views/network/InternalLBAssignVmForm.vue @@ -206,17 +206,10 @@ export default { this.$pollJob({ jobId: response.assigntoloadbalancerruleresponse.jobid, successMessage: `${this.$t('message.success.assigned.vms')} ${this.$t('label.to')} ${this.resource.name}`, - successMethod: () => { - this.$emit('refresh-data') - }, errorMessage: `${this.$t('message.failed.to.assign.vms')} ${this.$t('label.to')} ${this.resource.name}`, - errorMethod: () => { - this.$emit('refresh-data') - }, loadingMessage: `${this.$t('label.assigning.vms')} ${this.$t('label.to')} ${this.resource.name}`, catchMessage: this.$t('error.fetching.async.job.result') }) - this.$emit('refresh-data') this.closeModal() }).catch(error => { this.$notification.error({ diff --git a/src/views/network/LoadBalancing.vue b/src/views/network/LoadBalancing.vue index ea991329b..27be0a207 100644 --- a/src/views/network/LoadBalancing.vue +++ b/src/views/network/LoadBalancing.vue @@ -671,13 +671,11 @@ export default { jobId: response.createtagsresponse.jobid, successMessage: this.$t('message.success.add.tag'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.openTagsModal(this.selectedRule) }, errorMessage: this.$t('message.add.tag.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.closeModal() }, @@ -706,13 +704,11 @@ export default { jobId: response.deletetagsresponse.jobid, successMessage: this.$t('message.success.delete.tag'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.openTagsModal(this.selectedRule) }, errorMessage: this.$t('message.delete.tag.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.closeModal() }, @@ -763,14 +759,12 @@ export default { jobId: response.createLBStickinessPolicy.jobid, successMessage: this.$t('message.success.config.sticky.policy'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchData() this.closeModal() }, errorMessage: this.$t('message.config.sticky.policy.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchData() this.closeModal() @@ -795,14 +789,12 @@ export default { jobId: response.deleteLBstickinessrruleresponse.jobid, successMessage: this.$t('message.success.remove.sticky.policy'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchData() this.closeModal() }, errorMessage: this.$t('message.remove.sticky.policy.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchData() this.closeModal() @@ -907,14 +899,12 @@ export default { jobId: response.updateloadbalancerruleresponse.jobid, successMessage: this.$t('message.success.edit.rule'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchData() this.closeModal() }, errorMessage: this.$t('message.edit.rule.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchData() this.closeModal() @@ -942,14 +932,12 @@ export default { jobId: response.deleteloadbalancerruleresponse.jobid, successMessage: this.$t('message.success.remove.rule'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchData() this.closeModal() }, errorMessage: this.$t('message.remove.rule.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchData() this.closeModal() @@ -1074,14 +1062,12 @@ export default { jobId: response.assigntoloadbalancerruleresponse.jobid, successMessage: this.$t('message.success.asign.vm'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchData() this.closeModal() }, errorMessage: this.$t('message.assign.vm.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.fetchData() this.closeModal() diff --git a/src/views/network/PortForwarding.vue b/src/views/network/PortForwarding.vue index 9d1769512..33e77833a 100644 --- a/src/views/network/PortForwarding.vue +++ b/src/views/network/PortForwarding.vue @@ -453,13 +453,11 @@ export default { successMessage: this.$t('message.success.add.port.forward'), successMethod: () => { this.closeModal() - this.parentFetchData() this.fetchData() }, errorMessage: this.$t('message.add.port.forward.failed'), errorMethod: () => { this.closeModal() - this.parentFetchData() this.fetchData() }, loadingMessage: this.$t('message.add.port.forward.processing'), @@ -529,13 +527,11 @@ export default { jobId: response.createtagsresponse.jobid, successMessage: this.$t('message.success.add.tag'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.openTagsModal(this.selectedRule) }, errorMessage: this.$t('message.add.tag.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.closeModal() }, @@ -563,13 +559,11 @@ export default { jobId: response.deletetagsresponse.jobid, successMessage: this.$t('message.success.delete.tag'), successMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.openTagsModal(this.selectedRule) }, errorMessage: this.$t('message.delete.tag.failed'), errorMethod: () => { - this.parentFetchData() this.parentToggleLoading() this.closeModal() }, diff --git a/src/views/network/VpnDetails.vue b/src/views/network/VpnDetails.vue index 0159f6ec4..e92db9aab 100644 --- a/src/views/network/VpnDetails.vue +++ b/src/views/network/VpnDetails.vue @@ -130,13 +130,11 @@ export default { duration: 0 }) this.fetchData() - this.parentFetchData() this.parentToggleLoading() }, errorMessage: this.$t('message.enable.vpn.failed'), errorMethod: () => { this.fetchData() - this.parentFetchData() this.parentToggleLoading() }, loadingMessage: this.$t('message.enable.vpn.processing'), @@ -166,13 +164,11 @@ export default { successMessage: this.$t('message.success.disable.vpn'), successMethod: () => { this.fetchData() - this.parentFetchData() this.parentToggleLoading() }, errorMessage: this.$t('message.disable.vpn.failed'), errorMethod: () => { this.fetchData() - this.parentFetchData() this.parentToggleLoading() }, loadingMessage: this.$t('message.disable.vpn.processing'), diff --git a/src/views/offering/ImportBackupOffering.vue b/src/views/offering/ImportBackupOffering.vue index 782df3a2e..898c40ce8 100644 --- a/src/views/offering/ImportBackupOffering.vue +++ b/src/views/offering/ImportBackupOffering.vue @@ -131,7 +131,6 @@ export default { mounted () { this.fetchData() }, - inject: ['parentFetchData'], methods: { fetchData () { this.fetchZone() @@ -193,7 +192,6 @@ export default { description: successDescription, status: 'progress' }) - this.parentFetchData() this.closeAction() }, loadingMessage: `${title} ${this.$t('label.in.progress')} ${this.$t('label.for')} ${params.name}`, diff --git a/src/views/project/AddAccountOrUserToProject.vue b/src/views/project/AddAccountOrUserToProject.vue index dcd0ba91d..8662b7e60 100644 --- a/src/views/project/AddAccountOrUserToProject.vue +++ b/src/views/project/AddAccountOrUserToProject.vue @@ -267,7 +267,6 @@ export default { loadingMessage: `Adding Account: ${params.account} to project...`, catchMessage: 'Error encountered while fetching async job result' }) - this.$emit('refresh-data') this.closeAction() }).catch(error => { this.$notifyError(error) @@ -302,7 +301,6 @@ export default { loadingMessage: `Adding User ${params.username} to project...`, catchMessage: 'Error encountered while fetching async job result' }) - this.$emit('refresh-data') this.closeAction() }).catch(error => { console.log('catch') diff --git a/src/views/storage/AttachVolume.vue b/src/views/storage/AttachVolume.vue index 43ca3cd85..a081ed7db 100644 --- a/src/views/storage/AttachVolume.vue +++ b/src/views/storage/AttachVolume.vue @@ -52,7 +52,6 @@ export default { required: true } }, - inject: ['parentFetchData'], data () { return { virtualmachines: [], @@ -120,9 +119,6 @@ export default { }) this.$pollJob({ jobId: response.attachvolumeresponse.jobid, - successMethod: () => { - this.parentFetchData() - }, errorMessage: `${this.$t('message.attach.volume.failed')}: ${this.resource.name || this.resource.id}`, loadingMessage: `${this.$t('message.attach.volume.progress')}: ${this.resource.name || this.resource.id}`, catchMessage: this.$t('error.fetching.async.job.result') @@ -132,7 +128,6 @@ export default { this.$notifyError(error) }).finally(() => { this.loading = false - this.parentFetchData() }) }) } diff --git a/src/views/storage/CreateSnapshotFromVMSnapshot.vue b/src/views/storage/CreateSnapshotFromVMSnapshot.vue index 93d2e2979..2ca5ea6ee 100644 --- a/src/views/storage/CreateSnapshotFromVMSnapshot.vue +++ b/src/views/storage/CreateSnapshotFromVMSnapshot.vue @@ -107,16 +107,11 @@ export default { description: values.name, status: 'progress' }) - this.$emit('refresh-data') }, errorMessage: this.$t('message.create.snapshot.from.vmsnapshot.failed'), - errorMethod: () => { - this.$emit('refresh-data') - }, loadingMessage: this.$t('message.create.snapshot.from.vmsnapshot.progress'), catchMessage: this.$t('error.fetching.async.job.result') }) - this.$emit('refresh-data') this.closeModal() }).catch(error => { this.$notifyError(error) diff --git a/src/views/storage/CreateVolume.vue b/src/views/storage/CreateVolume.vue index ef22b07ef..47be1083f 100644 --- a/src/views/storage/CreateVolume.vue +++ b/src/views/storage/CreateVolume.vue @@ -163,16 +163,11 @@ export default { description: values.name, status: 'progress' }) - this.$emit('refresh-data') }, errorMessage: this.$t('message.create.volume.failed'), - errorMethod: () => { - this.$emit('refresh-data') - }, loadingMessage: this.$t('message.create.volume.processing'), catchMessage: this.$t('error.fetching.async.job.result') }) - this.$emit('refresh-data') this.closeModal() }).catch(error => { this.$notifyError(error) diff --git a/src/views/storage/MigrateVolume.vue b/src/views/storage/MigrateVolume.vue index 88a8266dd..9a011bb79 100644 --- a/src/views/storage/MigrateVolume.vue +++ b/src/views/storage/MigrateVolume.vue @@ -143,13 +143,7 @@ export default { this.$pollJob({ jobId: response.migratevolumeresponse.jobid, successMessage: this.$t('message.success.migrate.volume'), - successMethod: () => { - this.parentFetchData() - }, errorMessage: this.$t('message.migrate.volume.failed'), - errorMethod: () => { - this.parentFetchData() - }, loadingMessage: this.$t('message.migrate.volume.processing'), catchMessage: this.$t('error.fetching.async.job.result'), catchMethod: () => { @@ -157,7 +151,6 @@ export default { } }) this.closeModal() - this.parentFetchData() }).catch(error => { this.$notifyError(error) }) diff --git a/src/views/storage/RestoreAttachBackupVolume.vue b/src/views/storage/RestoreAttachBackupVolume.vue index d56b75db8..d90b0fd3c 100644 --- a/src/views/storage/RestoreAttachBackupVolume.vue +++ b/src/views/storage/RestoreAttachBackupVolume.vue @@ -89,7 +89,6 @@ export default { mounted () { this.fetchData() }, - inject: ['parentFetchData'], methods: { fetchData () { this.fetchVirtualMachine() @@ -151,7 +150,6 @@ export default { description: successDescription, status: 'progress' }) - this.parentFetchData() this.closeAction() }, loadingMessage: `${title} ${this.$t('label.in.progress.for')} ${this.resource.id}`,