diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index c2013ee7975..c82717a4647 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -984,13 +984,13 @@ export default { if (!hasJobId) { this.fetchData() } + this.closeAction() } }).catch(error => { console.log(error) this.$notifyError(error) }).finally(f => { this.actionLoading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/compute/AssignInstance.vue b/ui/src/views/compute/AssignInstance.vue index e0aa888f10b..543a43bb261 100644 --- a/ui/src/views/compute/AssignInstance.vue +++ b/ui/src/views/compute/AssignInstance.vue @@ -212,13 +212,12 @@ export default { this.$notification.success({ message: this.$t('label.loadbalancerinstance') }) - this.loading = false this.$parent.$parent.close() this.parentFetchData() }).catch(error => { this.$notifyError(error) - this.$parent.$parent.close() - this.parentFetchData() + }).finally(() => { + this.loading = false }) } } diff --git a/ui/src/views/compute/AttachIso.vue b/ui/src/views/compute/AttachIso.vue index 23bd38c4493..947201171df 100644 --- a/ui/src/views/compute/AttachIso.vue +++ b/ui/src/views/compute/AttachIso.vue @@ -135,11 +135,11 @@ export default { catchMessage: this.$t('error.fetching.async.job.result') }) } + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.closeAction() }) }) } diff --git a/ui/src/views/compute/ChangeAffinity.vue b/ui/src/views/compute/ChangeAffinity.vue index c03a4b5df49..9482ccf15a7 100644 --- a/ui/src/views/compute/ChangeAffinity.vue +++ b/ui/src/views/compute/ChangeAffinity.vue @@ -154,8 +154,6 @@ export default { this.parentFetchData() }).catch(error => { this.$notifyError(error) - this.$parent.$parent.close() - this.parentFetchData() }).finally(() => { this.loading = false }) diff --git a/ui/src/views/compute/CreateKubernetesCluster.vue b/ui/src/views/compute/CreateKubernetesCluster.vue index 14b59f7e320..75e70d4be89 100644 --- a/ui/src/views/compute/CreateKubernetesCluster.vue +++ b/ui/src/views/compute/CreateKubernetesCluster.vue @@ -485,12 +485,12 @@ export default { this.$emit('refresh-data') } }) + this.closeAction() + this.$emit('refresh-data') }).catch(error => { this.$notifyError(error) }).finally(() => { - this.$emit('refresh-data') this.loading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/compute/DestroyVM.vue b/ui/src/views/compute/DestroyVM.vue index 754bf818241..518204b3cdb 100644 --- a/ui/src/views/compute/DestroyVM.vue +++ b/ui/src/views/compute/DestroyVM.vue @@ -136,12 +136,12 @@ export default { catchMessage: this.$t('error.fetching.async.job.result'), successMessage: `${this.$t('message.success.delete.vm')} ${this.resource.name}` }) + this.parentFetchData() + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.parentFetchData() - this.closeAction() }) }) }, diff --git a/ui/src/views/compute/ScaleKubernetesCluster.vue b/ui/src/views/compute/ScaleKubernetesCluster.vue index fdb747ab1f8..4dc11b9b2f8 100644 --- a/ui/src/views/compute/ScaleKubernetesCluster.vue +++ b/ui/src/views/compute/ScaleKubernetesCluster.vue @@ -198,12 +198,12 @@ export default { this.$emit('refresh-data') } }) + this.closeAction() + this.$emit('refresh-data') }).catch(error => { this.$notifyError(error) }).finally(() => { - this.$emit('refresh-data') this.loading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/compute/ScaleVM.vue b/ui/src/views/compute/ScaleVM.vue index d22b6f6f5fc..6171c1f3262 100644 --- a/ui/src/views/compute/ScaleVM.vue +++ b/ui/src/views/compute/ScaleVM.vue @@ -182,8 +182,6 @@ export default { this.parentFetchData() }).catch(error => { this.$notifyError(error) - this.$parent.$parent.close() - this.parentFetchData() }).finally(() => { this.loading = false }) diff --git a/ui/src/views/compute/UpgradeKubernetesCluster.vue b/ui/src/views/compute/UpgradeKubernetesCluster.vue index a2979818f37..32f96df954a 100644 --- a/ui/src/views/compute/UpgradeKubernetesCluster.vue +++ b/ui/src/views/compute/UpgradeKubernetesCluster.vue @@ -170,12 +170,12 @@ export default { this.$emit('refresh-data') } }) + this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { - this.$emit('refresh-data') this.loading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/iam/AddAccount.vue b/ui/src/views/iam/AddAccount.vue index b330d171394..fdfa44ddc35 100644 --- a/ui/src/views/iam/AddAccount.vue +++ b/ui/src/views/iam/AddAccount.vue @@ -383,12 +383,10 @@ export default { description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message, duration: 0 }) - }).finally(() => { - this.loading = false - this.closeAction() }) } } + this.closeAction() }).catch(error => { this.$notification.error({ message: this.$t('message.request.failed'), @@ -397,7 +395,6 @@ export default { }) }).finally(() => { this.loading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/iam/AddUser.vue b/ui/src/views/iam/AddUser.vue index dd7c10ed880..8d227615d9b 100644 --- a/ui/src/views/iam/AddUser.vue +++ b/ui/src/views/iam/AddUser.vue @@ -349,12 +349,10 @@ export default { description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message, duration: 0 }) - }).finally(() => { - this.loading = false - this.closeAction() }) } } + this.closeAction() }).catch(error => { this.$notification.error({ message: this.$t('message.request.failed'), @@ -363,7 +361,6 @@ export default { }) }).finally(() => { this.loading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/iam/ChangeUserPassword.vue b/ui/src/views/iam/ChangeUserPassword.vue index 48abdaf175a..698d2fb5f45 100644 --- a/ui/src/views/iam/ChangeUserPassword.vue +++ b/ui/src/views/iam/ChangeUserPassword.vue @@ -145,12 +145,12 @@ export default { message: this.$t('label.action.change.password'), description: `${this.$t('message.success.change.password')} ${this.resource.username}` }) + this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { - this.$emit('refresh-data') this.loading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/iam/ConfigureSamlSsoAuth.vue b/ui/src/views/iam/ConfigureSamlSsoAuth.vue index 57756008b60..1e21a0d17a9 100644 --- a/ui/src/views/iam/ConfigureSamlSsoAuth.vue +++ b/ui/src/views/iam/ConfigureSamlSsoAuth.vue @@ -105,6 +105,7 @@ export default { description: values.samlEnable ? `${this.$t('message.success.enable.saml.auth')} ${this.$t('label.for')} ${this.resource.username}` : `${this.$t('message.success.disable.saml.auth')} ${this.$t('label.for')} ${this.resource.username}` }) + this.handleClose() }).catch(error => { this.$notification.error({ message: this.$t('message.request.failed'), @@ -113,7 +114,6 @@ export default { }) }).finally(() => { this.loading = false - this.handleClose() }) }) } diff --git a/ui/src/views/iam/CreateRole.vue b/ui/src/views/iam/CreateRole.vue index 5721de27f46..38156f84d48 100644 --- a/ui/src/views/iam/CreateRole.vue +++ b/ui/src/views/iam/CreateRole.vue @@ -162,11 +162,11 @@ export default { description: 'Sucessfully created role ' + params.name }) } + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.closeAction() }) }, fetchRoles () { diff --git a/ui/src/views/iam/DomainActionForm.vue b/ui/src/views/iam/DomainActionForm.vue index ab65a84b476..6cfecb7d076 100644 --- a/ui/src/views/iam/DomainActionForm.vue +++ b/ui/src/views/iam/DomainActionForm.vue @@ -254,6 +254,7 @@ export default { this.$set(this.resource, 'isDel', true) this.parentUpdActionData(this.resource) } + this.parentCloseAction() }).catch(error => { this.$notification.error({ message: this.$t('message.request.failed'), @@ -261,7 +262,6 @@ export default { }) }).finally(f => { this.action.loading = false - this.parentCloseAction() }) }) }, diff --git a/ui/src/views/iam/EditUser.vue b/ui/src/views/iam/EditUser.vue index 531051ba4a9..e1ae0b58580 100644 --- a/ui/src/views/iam/EditUser.vue +++ b/ui/src/views/iam/EditUser.vue @@ -201,6 +201,7 @@ export default { message: this.$t('label.edit.user'), description: `${this.$t('message.success.update.user')} ${params.username}` }) + this.closeAction() }).catch(error => { this.$notification.error({ message: this.$t('message.request.failed'), @@ -209,7 +210,6 @@ export default { }) }).finally(() => { this.loading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/iam/ImportRole.vue b/ui/src/views/iam/ImportRole.vue index 64c6ee595b4..151efdab002 100644 --- a/ui/src/views/iam/ImportRole.vue +++ b/ui/src/views/iam/ImportRole.vue @@ -178,11 +178,11 @@ export default { description: 'Sucessfully imported role ' + params.name }) } + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.closeAction() }) }, rulesCsvToJson (rulesCsv) { diff --git a/ui/src/views/image/AddKubernetesSupportedVersion.vue b/ui/src/views/image/AddKubernetesSupportedVersion.vue index 297e89976cf..30fb4804876 100644 --- a/ui/src/views/image/AddKubernetesSupportedVersion.vue +++ b/ui/src/views/image/AddKubernetesSupportedVersion.vue @@ -247,12 +247,12 @@ export default { } api('addKubernetesSupportedVersion', params).then(json => { this.$message.success(`${this.$t('message.success.add.kuberversion')}: ${values.semanticversion}`) + this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { - this.$emit('refresh-data') this.loading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/image/RegisterOrUploadIso.vue b/ui/src/views/image/RegisterOrUploadIso.vue index 8c75a581462..d70d282fb22 100644 --- a/ui/src/views/image/RegisterOrUploadIso.vue +++ b/ui/src/views/image/RegisterOrUploadIso.vue @@ -289,15 +289,14 @@ export default { message: this.$t('message.success.upload'), description: this.$t('message.success.upload.description') }) + this.closeAction() + this.$emit('refresh-data') }).catch(e => { this.$notification.error({ message: this.$t('message.upload.failed'), description: `${this.$t('message.upload.iso.failed.description')} - ${e}`, duration: 0 }) - }).finally(() => { - this.closeAction() - this.$emit('refresh-data') }) }, handleSubmit (e) { @@ -337,12 +336,12 @@ export default { message: this.$t('label.action.register.iso'), description: `${this.$t('message.success.register.iso')} ${params.name}` }) + this.closeAction() + this.$emit('refresh-data') }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.closeAction() - this.$emit('refresh-data') }) } else { if (this.fileList.length !== 1) { diff --git a/ui/src/views/image/RegisterOrUploadTemplate.vue b/ui/src/views/image/RegisterOrUploadTemplate.vue index 7588ecdb743..e20a38437bb 100644 --- a/ui/src/views/image/RegisterOrUploadTemplate.vue +++ b/ui/src/views/image/RegisterOrUploadTemplate.vue @@ -503,15 +503,14 @@ export default { message: this.$t('message.success.upload'), description: this.$t('message.success.upload.template.description') }) + this.$emit('refresh-data') + this.closeAction() }).catch(e => { this.$notification.error({ message: this.$t('message.upload.failed'), description: `${this.$t('message.upload.template.failed.description')} - ${e}`, duration: 0 }) - }).finally(() => { - this.$emit('refresh-data') - this.closeAction() }) }, fetchZone () { @@ -881,12 +880,12 @@ export default { message: this.$t('label.register.template'), description: `${this.$t('message.success.register.template')} ${params.name}` }) + this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.$emit('refresh-data') - this.closeAction() }) } else { this.loading = true diff --git a/ui/src/views/image/TemplateZones.vue b/ui/src/views/image/TemplateZones.vue index af2fb8bd29f..a9786c79924 100644 --- a/ui/src/views/image/TemplateZones.vue +++ b/ui/src/views/image/TemplateZones.vue @@ -280,12 +280,12 @@ export default { loadingMessage: `${this.$t('label.deleting.template')} ${this.resource.name} ${this.$t('label.in.progress')}`, catchMessage: this.$t('error.fetching.async.job.result') }) + this.onCloseModal() + this.fetchData() }).catch(error => { this.$notifyError(error) }).finally(() => { this.deleteLoading = false - this.onCloseModal() - this.fetchData() }) }, fetchZoneData () { diff --git a/ui/src/views/image/UpdateKubernetesSupportedVersion.vue b/ui/src/views/image/UpdateKubernetesSupportedVersion.vue index bc6a3ae798c..6d8475f07fd 100644 --- a/ui/src/views/image/UpdateKubernetesSupportedVersion.vue +++ b/ui/src/views/image/UpdateKubernetesSupportedVersion.vue @@ -130,12 +130,12 @@ export default { } api('updateKubernetesSupportedVersion', params).then(json => { this.$message.success(`${this.$t('message.success.update.kubeversion')}: ${this.resource.name}`) + this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { - this.$emit('refresh-data') this.loading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/image/UpdateTemplateIsoPermissions.vue b/ui/src/views/image/UpdateTemplateIsoPermissions.vue index 3c272358dd8..6bafcc63120 100644 --- a/ui/src/views/image/UpdateTemplateIsoPermissions.vue +++ b/ui/src/views/image/UpdateTemplateIsoPermissions.vue @@ -249,20 +249,17 @@ export default { isextractable: this.resource.isExtractable, featured: this.resource.featured, op: this.selectedOperation.toLowerCase() + }).then(response => { + this.$notification.success({ + message: `${this.$t('label.success.updated')} ${resourceType} ${this.$t('label.permissions')}` + }) + this.closeModal() + this.parentFetchData() + }).catch(error => { + this.$notifyError(error) + }).finally(e => { + this.loading = false }) - .then(response => { - this.$notification.success({ - message: `${this.$t('label.success.updated')} ${resourceType} ${this.$t('label.permissions')}` - }) - }) - .catch(error => { - this.$notifyError(error) - }) - .finally(e => { - this.loading = false - this.closeModal() - this.parentFetchData() - }) } } } diff --git a/ui/src/views/infra/AddPrimaryStorage.vue b/ui/src/views/infra/AddPrimaryStorage.vue index 05378895f3c..07cf530a53c 100644 --- a/ui/src/views/infra/AddPrimaryStorage.vue +++ b/ui/src/views/infra/AddPrimaryStorage.vue @@ -667,12 +667,12 @@ export default { message: this.$t('label.add.primary.storage'), description: this.$t('label.add.primary.storage') }) + this.closeModal() + this.parentFetchData() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.closeModal() - this.parentFetchData() }) }) } diff --git a/ui/src/views/infra/AddSecondaryStorage.vue b/ui/src/views/infra/AddSecondaryStorage.vue index 7e78b4c961e..4016c417454 100644 --- a/ui/src/views/infra/AddSecondaryStorage.vue +++ b/ui/src/views/infra/AddSecondaryStorage.vue @@ -278,12 +278,12 @@ export default { message: this.$t('label.add.secondary.storage'), description: this.$t('label.add.secondary.storage') }) + this.closeModal() + this.parentFetchData() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.closeModal() - this.parentFetchData() }) }) } diff --git a/ui/src/views/infra/ClusterAdd.vue b/ui/src/views/infra/ClusterAdd.vue index 7c80a529481..dcb56b30e49 100644 --- a/ui/src/views/infra/ClusterAdd.vue +++ b/ui/src/views/infra/ClusterAdd.vue @@ -240,6 +240,9 @@ export default { if (cluster.id && this.showDedicated) { this.dedicateCluster(cluster.id) } + this.parentFetchData() + this.parentToggleLoading() + this.$parent.$parent.close() }).catch(error => { this.$notification.error({ message: `${this.$t('label.error')} ${error.response.status}`, @@ -248,9 +251,6 @@ export default { }) }).finally(() => { this.loading = false - this.parentFetchData() - this.parentToggleLoading() - this.$parent.$parent.close() }) }, dedicateCluster (clusterId) { diff --git a/ui/src/views/infra/HostAdd.vue b/ui/src/views/infra/HostAdd.vue index dc4bbfc61dc..41a34e632fa 100644 --- a/ui/src/views/infra/HostAdd.vue +++ b/ui/src/views/infra/HostAdd.vue @@ -294,6 +294,8 @@ export default { if (host.id && this.showDedicated) { this.dedicateHost(host.id) } + this.parentFetchData() + this.$parent.$parent.close() }).catch(error => { this.$notification.error({ message: `${this.$t('label.error')} ${error.response.status}`, @@ -302,8 +304,6 @@ export default { }) }).finally(() => { this.loading = false - this.parentFetchData() - this.$parent.$parent.close() }) }, dedicateHost (hostId) { diff --git a/ui/src/views/infra/MigrateData.vue b/ui/src/views/infra/MigrateData.vue index 4e9c1bbd680..784df0904a4 100644 --- a/ui/src/views/infra/MigrateData.vue +++ b/ui/src/views/infra/MigrateData.vue @@ -150,12 +150,12 @@ export default { duration: 0 }) } + this.parentFetchData() + this.closeAction() }).catch(error => { console.log(error) }) this.loading = false - this.parentFetchData() - this.closeAction() }) }, migrateData (args, title) { diff --git a/ui/src/views/infra/PodAdd.vue b/ui/src/views/infra/PodAdd.vue index 85d48aa4f5b..b06373f6ae1 100644 --- a/ui/src/views/infra/PodAdd.vue +++ b/ui/src/views/infra/PodAdd.vue @@ -199,8 +199,6 @@ export default { duration: 0 }) this.loading = false - this.parentFetchData() - this.$parent.$parent.close() }) }) }, diff --git a/ui/src/views/network/CreateIsolatedNetworkForm.vue b/ui/src/views/network/CreateIsolatedNetworkForm.vue index 85d6b5513d3..dd29272936d 100644 --- a/ui/src/views/network/CreateIsolatedNetworkForm.vue +++ b/ui/src/views/network/CreateIsolatedNetworkForm.vue @@ -485,11 +485,11 @@ export default { description: this.$t('message.success.create.isolated.network') }) this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.actionLoading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/network/CreateL2NetworkForm.vue b/ui/src/views/network/CreateL2NetworkForm.vue index 50707558807..e97c0d6c67d 100644 --- a/ui/src/views/network/CreateL2NetworkForm.vue +++ b/ui/src/views/network/CreateL2NetworkForm.vue @@ -426,12 +426,12 @@ export default { message: 'Network', description: this.$t('message.success.create.l2.network') }) + this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { - this.$emit('refresh-data') this.actionLoading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/network/CreateSharedNetworkForm.vue b/ui/src/views/network/CreateSharedNetworkForm.vue index 4aa28f804d4..c698f49245c 100644 --- a/ui/src/views/network/CreateSharedNetworkForm.vue +++ b/ui/src/views/network/CreateSharedNetworkForm.vue @@ -794,12 +794,12 @@ export default { description: this.$t('message.success.add.guest.network') }) this.resetForm() + this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { - this.$emit('refresh-data') this.actionLoading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/network/CreateVpc.vue b/ui/src/views/network/CreateVpc.vue index abf645d73eb..d3697f350bb 100644 --- a/ui/src/views/network/CreateVpc.vue +++ b/ui/src/views/network/CreateVpc.vue @@ -222,11 +222,11 @@ export default { }) this.$emit('refresh-data') } + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.closeAction() }) }) } diff --git a/ui/src/views/network/CreateVpnCustomerGateway.vue b/ui/src/views/network/CreateVpnCustomerGateway.vue index 87941b82fe9..ebbb7be1216 100644 --- a/ui/src/views/network/CreateVpnCustomerGateway.vue +++ b/ui/src/views/network/CreateVpnCustomerGateway.vue @@ -343,12 +343,10 @@ export default { } }) this.closeModal() + this.form.resetFields() }).catch(error => { console.error(error) this.$message.error(this.$t('message.success.add.vpn.customer.gateway')) - }).finally(() => { - this.form.resetFields() - this.closeModal() }) }) } diff --git a/ui/src/views/network/EnableStaticNat.vue b/ui/src/views/network/EnableStaticNat.vue index d445e6d4ed4..d03e67bc877 100644 --- a/ui/src/views/network/EnableStaticNat.vue +++ b/ui/src/views/network/EnableStaticNat.vue @@ -246,11 +246,11 @@ export default { networkid: this.selectedVpcTier }).then(() => { this.parentFetchData() + this.handleClose() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.handleClose() }) }, handleClose () { diff --git a/ui/src/views/network/FirewallRules.vue b/ui/src/views/network/FirewallRules.vue index 2280f571e06..48e30a6b3a0 100644 --- a/ui/src/views/network/FirewallRules.vue +++ b/ui/src/views/network/FirewallRules.vue @@ -343,7 +343,6 @@ export default { }) }).catch(error => { this.$notifyError(error) - this.closeModal() }).finally(() => { this.addTagLoading = false }) @@ -379,7 +378,6 @@ export default { }) }).catch(error => { this.$notifyError(error) - this.closeModal() }) }, handleChangePage (page, pageSize) { diff --git a/ui/src/views/network/InternalLBAssignVmForm.vue b/ui/src/views/network/InternalLBAssignVmForm.vue index 848e905ba42..b1e1fa26a51 100644 --- a/ui/src/views/network/InternalLBAssignVmForm.vue +++ b/ui/src/views/network/InternalLBAssignVmForm.vue @@ -216,6 +216,8 @@ export default { 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({ message: `${this.$t('label.error')} ${error.response.status}`, @@ -224,8 +226,6 @@ export default { }) }).finally(() => { this.fetchLoading = false - this.$emit('refresh-data') - this.closeModal() }) }, changePage (page, pageSize) { diff --git a/ui/src/views/network/IpAddressesTab.vue b/ui/src/views/network/IpAddressesTab.vue index 405558451cc..fd28060b39f 100644 --- a/ui/src/views/network/IpAddressesTab.vue +++ b/ui/src/views/network/IpAddressesTab.vue @@ -275,6 +275,7 @@ export default { loadingMessage: `${this.$t('label.acquiring.ip')} ${this.$t('label.for')} ${this.resource.name} ${this.$t('label.is.in.progress')}`, catchMessage: this.$t('error.fetching.async.job.result') }) + this.onCloseModal() }).catch(error => { this.$notification.error({ message: `${this.$t('label.error')} ${error.response.status}`, @@ -283,7 +284,6 @@ export default { }) }).finally(() => { this.acquireLoading = false - this.onCloseModal() }) }, releaseIpAddress (ip) { diff --git a/ui/src/views/network/LoadBalancing.vue b/ui/src/views/network/LoadBalancing.vue index d94908a868d..dfcfc57b6ca 100644 --- a/ui/src/views/network/LoadBalancing.vue +++ b/ui/src/views/network/LoadBalancing.vue @@ -689,7 +689,6 @@ export default { }) }).catch(error => { this.$notifyError(error) - this.closeModal() }) }) }, @@ -725,7 +724,6 @@ export default { }) }).catch(error => { this.$notifyError(error) - this.closeModal() }) }, openStickinessModal (id) { @@ -786,7 +784,6 @@ export default { }) }).catch(error => { this.$notifyError(error) - this.closeModal() }) }, handleDeleteStickinessPolicy () { @@ -819,7 +816,6 @@ export default { }) }).catch(error => { this.$notifyError(error) - this.closeModal() }) }, handleSubmitStickinessForm (e) { @@ -933,7 +929,6 @@ export default { }).catch(error => { this.$notifyError(error) this.loading = false - this.closeModal() }) }, handleDeleteRule (rule) { @@ -969,7 +964,6 @@ export default { }).catch(error => { this.$notifyError(error) this.loading = false - this.closeModal() }) }, handleOpenAddVMModal () { diff --git a/ui/src/views/network/PortForwarding.vue b/ui/src/views/network/PortForwarding.vue index 46ba8038617..49a152266a0 100644 --- a/ui/src/views/network/PortForwarding.vue +++ b/ui/src/views/network/PortForwarding.vue @@ -469,7 +469,6 @@ export default { }) }).catch(error => { this.$notifyError(error) - this.closeModal() this.fetchData() }) }, @@ -548,7 +547,6 @@ export default { }) }).catch(error => { this.$notifyError(error) - this.closeModal() }) }, handleDeleteTag (tag) { @@ -583,7 +581,6 @@ export default { }) }).catch(error => { this.$notifyError(error) - this.closeModal() }) }, openAddVMModal () { diff --git a/ui/src/views/offering/AddComputeOffering.vue b/ui/src/views/offering/AddComputeOffering.vue index 31784602d8e..f3f169d5a55 100644 --- a/ui/src/views/offering/AddComputeOffering.vue +++ b/ui/src/views/offering/AddComputeOffering.vue @@ -1061,12 +1061,12 @@ export default { ? `${this.$t('message.create.service.offering')}: ` : `${this.$t('message.create.compute.offering')}: ` this.$message.success(message + values.name) + this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.$emit('refresh-data') - this.closeAction() }) }) }, diff --git a/ui/src/views/offering/AddDiskOffering.vue b/ui/src/views/offering/AddDiskOffering.vue index a38fc57f980..c685af0e609 100644 --- a/ui/src/views/offering/AddDiskOffering.vue +++ b/ui/src/views/offering/AddDiskOffering.vue @@ -651,12 +651,12 @@ export default { } api('createDiskOffering', params).then(json => { this.$message.success(`${this.$t('message.disk.offering.created')} ${values.name}}`) + this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.$emit('refresh-data') - this.closeAction() }) }) }, diff --git a/ui/src/views/offering/AddNetworkOffering.vue b/ui/src/views/offering/AddNetworkOffering.vue index f080d377b68..79290553f5b 100644 --- a/ui/src/views/offering/AddNetworkOffering.vue +++ b/ui/src/views/offering/AddNetworkOffering.vue @@ -932,12 +932,12 @@ export default { params.traffictype = 'GUEST' // traffic type dropdown has been removed since it has only one option ('Guest'). Hardcode traffic type value here. api('createNetworkOffering', params).then(json => { this.$message.success('Network offering created: ' + values.name) + this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.$emit('refresh-data') - this.closeAction() }) }) }, diff --git a/ui/src/views/offering/AddVpcOffering.vue b/ui/src/views/offering/AddVpcOffering.vue index 7e33697b5c4..082c0e30d7f 100644 --- a/ui/src/views/offering/AddVpcOffering.vue +++ b/ui/src/views/offering/AddVpcOffering.vue @@ -402,12 +402,12 @@ export default { } api('createVPCOffering', params).then(json => { this.$message.success(`${this.$t('message.create.vpc.offering')}: ` + values.name) + this.$emit('refresh-data') + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.$emit('refresh-data') - this.closeAction() }) }) }, diff --git a/ui/src/views/offering/UpdateOfferingAccess.vue b/ui/src/views/offering/UpdateOfferingAccess.vue index 07ecc38a701..e5fc8c32c1f 100644 --- a/ui/src/views/offering/UpdateOfferingAccess.vue +++ b/ui/src/views/offering/UpdateOfferingAccess.vue @@ -284,11 +284,11 @@ export default { message: this.$t('label.action.update.offering.access'), description: this.$t('label.action.update.offering.access') }) + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/project/AddAccountOrUserToProject.vue b/ui/src/views/project/AddAccountOrUserToProject.vue index a1165a731c4..dcd0ba91dec 100644 --- a/ui/src/views/project/AddAccountOrUserToProject.vue +++ b/ui/src/views/project/AddAccountOrUserToProject.vue @@ -267,12 +267,12 @@ 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) }).finally(() => { - this.$emit('refresh-data') this.loading = false - this.closeAction() }) }) }, @@ -302,13 +302,13 @@ 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') this.$notifyError(error) }).finally(() => { - this.$emit('refresh-data') this.loading = false - this.closeAction() }) }) }, diff --git a/ui/src/views/project/iam/ProjectRoleTab.vue b/ui/src/views/project/iam/ProjectRoleTab.vue index 73b9bf9816b..e34f02ef15f 100644 --- a/ui/src/views/project/iam/ProjectRoleTab.vue +++ b/ui/src/views/project/iam/ProjectRoleTab.vue @@ -240,12 +240,12 @@ export default { message: this.$t('label.update.project.role'), description: this.$t('label.update.project.role') }) + this.fetchData() + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.fetchData() - this.closeAction() }) }) }, @@ -278,12 +278,12 @@ export default { message: this.$t('label.create.project.role'), description: this.$t('label.create.project.role') }) + this.fetchData() + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.fetchData() - this.closeAction() }) }) }, @@ -297,12 +297,12 @@ export default { message: this.$t('label.delete.project.role'), description: this.$t('label.delete.project.role') }) + this.fetchData() + this.closeAction() }).catch(error => { this.$notifyError(error) }).finally(() => { this.loading = false - this.fetchData() - this.closeAction() }) } } diff --git a/ui/src/views/storage/CreateSnapshotFromVMSnapshot.vue b/ui/src/views/storage/CreateSnapshotFromVMSnapshot.vue index 6e3be3cfd12..93d2e297905 100644 --- a/ui/src/views/storage/CreateSnapshotFromVMSnapshot.vue +++ b/ui/src/views/storage/CreateSnapshotFromVMSnapshot.vue @@ -116,12 +116,12 @@ export default { 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) }).finally(() => { this.loading = false - this.$emit('refresh-data') - this.closeModal() }) }) }, diff --git a/ui/src/views/storage/CreateVolume.vue b/ui/src/views/storage/CreateVolume.vue index 4211aec4052..ef22b07ef76 100644 --- a/ui/src/views/storage/CreateVolume.vue +++ b/ui/src/views/storage/CreateVolume.vue @@ -172,12 +172,12 @@ export default { 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) }).finally(() => { this.loading = false - this.$emit('refresh-data') - this.closeModal() }) }) }, diff --git a/ui/src/views/storage/MigrateVolume.vue b/ui/src/views/storage/MigrateVolume.vue index ad1193a063d..88a8266dd50 100644 --- a/ui/src/views/storage/MigrateVolume.vue +++ b/ui/src/views/storage/MigrateVolume.vue @@ -156,12 +156,10 @@ export default { this.parentFetchData() } }) - }).catch(error => { - this.$notifyError(error) - this.closeModal() - }).finally(() => { this.closeModal() this.parentFetchData() + }).catch(error => { + this.$notifyError(error) }) } } diff --git a/ui/src/views/storage/ResizeVolume.vue b/ui/src/views/storage/ResizeVolume.vue index cfd5349261b..b30514a0fcb 100644 --- a/ui/src/views/storage/ResizeVolume.vue +++ b/ui/src/views/storage/ResizeVolume.vue @@ -121,6 +121,7 @@ export default { this.closeModal() } }) + this.closeModal() }).catch(error => { this.$notification.error({ message: `${this.$t('label.error')} ${error.response.status}`, @@ -129,7 +130,6 @@ export default { }) }).finally(() => { this.loading = false - this.closeModal() }) }) }, diff --git a/ui/src/views/storage/UploadLocalVolume.vue b/ui/src/views/storage/UploadLocalVolume.vue index d2f60582ed2..66633db6816 100644 --- a/ui/src/views/storage/UploadLocalVolume.vue +++ b/ui/src/views/storage/UploadLocalVolume.vue @@ -229,10 +229,8 @@ export default { description: `${this.$t('message.upload.iso.failed.description')} - ${e}`, duration: 0 }) - this.closeAction() }).finally(() => { this.loading = false - this.closeAction() }) }) })