From 14879e9e2a2f639ea5d115bede9f0e131b0d8c6f Mon Sep 17 00:00:00 2001 From: utchoang Date: Fri, 12 Mar 2021 13:11:15 +0700 Subject: [PATCH 1/3] move fetchdata to created method --- ui/src/components/header/ProjectMenu.vue | 2 +- .../components/header/SamlDomainSwitcher.vue | 2 +- ui/src/components/view/DedicateDomain.vue | 2 +- ui/src/components/view/DetailSettings.vue | 2 +- ui/src/components/view/ListResourceTable.vue | 2 +- ui/src/components/view/ResourceLimitTab.vue | 2 +- ui/src/components/view/SettingsTab.vue | 2 +- ui/src/views/auth/Login.vue | 2 - ui/src/views/compute/AssignInstance.vue | 2 +- ui/src/views/compute/AttachIso.vue | 2 +- ui/src/views/compute/BackupScheduleWizard.vue | 2 +- ui/src/views/compute/ChangeAffinity.vue | 2 +- .../views/compute/CreateKubernetesCluster.vue | 2 - ui/src/views/compute/CreateSSHKeyPair.vue | 2 - ui/src/views/compute/CreateSnapshotWizard.vue | 2 +- ui/src/views/compute/DeployVM.vue | 3 +- ui/src/views/compute/DestroyVM.vue | 2 +- ui/src/views/compute/KubernetesServiceTab.vue | 2 +- ui/src/views/compute/MigrateWizard.vue | 2 +- .../views/compute/ScaleKubernetesCluster.vue | 2 - ui/src/views/compute/ScaleVM.vue | 2 +- ui/src/views/compute/StartVirtualMachine.vue | 2 +- .../compute/UpgradeKubernetesCluster.vue | 2 - ui/src/views/dashboard/CapacityDashboard.vue | 7 +- ui/src/views/dashboard/Dashboard.vue | 4 +- ui/src/views/dashboard/UsageDashboard.vue | 2 +- ui/src/views/iam/AddAccount.vue | 2 +- ui/src/views/iam/AddLdapAccount.vue | 2 - ui/src/views/iam/AddUser.vue | 2 - ui/src/views/iam/ConfigureSamlSsoAuth.vue | 2 +- ui/src/views/iam/CreateRole.vue | 2 +- ui/src/views/iam/DomainActionForm.vue | 2 +- ui/src/views/iam/DomainView.vue | 6 +- ui/src/views/iam/EditUser.vue | 2 +- ui/src/views/iam/RolePermissionTab.vue | 2 +- ui/src/views/iam/SSLCertificateTab.vue | 2 - .../image/AddKubernetesSupportedVersion.vue | 2 - ui/src/views/image/IsoZones.vue | 2 - .../views/image/RegisterOrUploadTemplate.vue | 2 - ui/src/views/image/TemplateZones.vue | 2 - .../UpdateKubernetesSupportedVersion.vue | 2 - .../image/UpdateTemplateIsoPermissions.vue | 2 +- ui/src/views/infra/AddPrimaryStorage.vue | 2 +- ui/src/views/infra/AddSecondaryStorage.vue | 2 +- ui/src/views/infra/ClusterAdd.vue | 2 +- ui/src/views/infra/CpuSockets.vue | 2 +- ui/src/views/infra/HostAdd.vue | 2 +- ui/src/views/infra/HostInfo.vue | 2 +- ui/src/views/infra/InfraSummary.vue | 2 +- ui/src/views/infra/MigrateData.vue | 2 +- ui/src/views/infra/PodAdd.vue | 2 +- ui/src/views/infra/Resources.vue | 2 +- .../views/infra/network/DedicatedVLANTab.vue | 2 +- .../views/infra/network/EditTrafficLabel.vue | 3 +- ui/src/views/infra/network/IpRangesTab.vue | 2 +- .../views/infra/network/IpRangesTabGuest.vue | 2 +- .../infra/network/IpRangesTabManagement.vue | 2 +- .../views/infra/network/IpRangesTabPublic.vue | 2 +- .../infra/network/IpRangesTabStorage.vue | 2 +- .../infra/network/ServiceProvidersTab.vue | 8 +- .../views/infra/network/TrafficTypesTab.vue | 2 +- .../infra/network/providers/ProviderItem.vue | 57 +++++++-------- .../views/infra/routers/RouterHealthCheck.vue | 2 +- .../views/infra/zone/PhysicalNetworksTab.vue | 2 +- ui/src/views/infra/zone/SystemVmsTab.vue | 2 +- .../infra/zone/ZoneWizardAddResources.vue | 2 +- .../infra/zone/ZoneWizardNetworkSetupStep.vue | 2 +- .../infra/zone/ZoneWizardZoneDetailsStep.vue | 73 ++++++++++--------- ui/src/views/network/AclListRulesTab.vue | 2 +- .../network/CreateIsolatedNetworkForm.vue | 2 - ui/src/views/network/CreateL2NetworkForm.vue | 2 - .../views/network/CreateSharedNetworkForm.vue | 2 - ui/src/views/network/CreateVpc.vue | 2 +- ui/src/views/network/EgressRulesTab.vue | 2 +- ui/src/views/network/EnableStaticNat.vue | 2 +- ui/src/views/network/FirewallRules.vue | 2 +- ui/src/views/network/GuestIpRanges.vue | 2 +- .../network/IngressEgressRuleConfigure.vue | 2 +- .../views/network/InternalLBAssignVmForm.vue | 2 +- .../views/network/InternalLBAssignedVmTab.vue | 2 +- ui/src/views/network/IpAddressesTab.vue | 2 +- ui/src/views/network/LoadBalancing.vue | 2 +- ui/src/views/network/PortForwarding.vue | 2 +- ui/src/views/network/PublicIpResource.vue | 2 +- ui/src/views/network/RoutersTab.vue | 2 +- ui/src/views/network/StaticRoutesTab.vue | 2 +- ui/src/views/network/VpcTab.vue | 2 +- ui/src/views/network/VpcTiersTab.vue | 2 +- ui/src/views/network/VpnDetails.vue | 2 +- 89 files changed, 143 insertions(+), 180 deletions(-) diff --git a/ui/src/components/header/ProjectMenu.vue b/ui/src/components/header/ProjectMenu.vue index 01ff1385ed78..dd5e614b4d93 100644 --- a/ui/src/components/header/ProjectMenu.vue +++ b/ui/src/components/header/ProjectMenu.vue @@ -58,7 +58,7 @@ export default { loading: false } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/components/header/SamlDomainSwitcher.vue b/ui/src/components/header/SamlDomainSwitcher.vue index edce64a873bf..c19319438351 100644 --- a/ui/src/components/header/SamlDomainSwitcher.vue +++ b/ui/src/components/header/SamlDomainSwitcher.vue @@ -57,7 +57,7 @@ export default { loading: false } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/components/view/DedicateDomain.vue b/ui/src/components/view/DedicateDomain.vue index 555a55e14b84..8214922f8231 100644 --- a/ui/src/components/view/DedicateDomain.vue +++ b/ui/src/components/view/DedicateDomain.vue @@ -64,7 +64,7 @@ export default { this.domainError = this.error } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/components/view/DetailSettings.vue b/ui/src/components/view/DetailSettings.vue index 2817e1c2b5bd..a657dd06890e 100644 --- a/ui/src/components/view/DetailSettings.vue +++ b/ui/src/components/view/DetailSettings.vue @@ -150,7 +150,7 @@ export default { this.updateResource(newItem) } }, - mounted () { + created () { this.updateResource(this.resource) }, methods: { diff --git a/ui/src/components/view/ListResourceTable.vue b/ui/src/components/view/ListResourceTable.vue index c498d16e583f..9728fa90b44d 100644 --- a/ui/src/components/view/ListResourceTable.vue +++ b/ui/src/components/view/ListResourceTable.vue @@ -142,7 +142,7 @@ export default { } } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/components/view/ResourceLimitTab.vue b/ui/src/components/view/ResourceLimitTab.vue index 3a9b41a36785..4f66c7d5dd9e 100644 --- a/ui/src/components/view/ResourceLimitTab.vue +++ b/ui/src/components/view/ResourceLimitTab.vue @@ -72,7 +72,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/components/view/SettingsTab.vue b/ui/src/components/view/SettingsTab.vue index 5ee019974458..ec49d88b34ab 100644 --- a/ui/src/components/view/SettingsTab.vue +++ b/ui/src/components/view/SettingsTab.vue @@ -120,7 +120,7 @@ export default { this.scopeKey = '' } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/auth/Login.vue b/ui/src/views/auth/Login.vue index a43b61191e28..711f287d66a3 100644 --- a/ui/src/views/auth/Login.vue +++ b/ui/src/views/auth/Login.vue @@ -134,8 +134,6 @@ export default { } }, created () { - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/compute/AssignInstance.vue b/ui/src/views/compute/AssignInstance.vue index 543a43bb261b..7bd3f91db703 100644 --- a/ui/src/views/compute/AssignInstance.vue +++ b/ui/src/views/compute/AssignInstance.vue @@ -112,7 +112,7 @@ export default { loading: false } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/compute/AttachIso.vue b/ui/src/views/compute/AttachIso.vue index 947201171df3..03c1476c026e 100644 --- a/ui/src/views/compute/AttachIso.vue +++ b/ui/src/views/compute/AttachIso.vue @@ -63,7 +63,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/compute/BackupScheduleWizard.vue b/ui/src/views/compute/BackupScheduleWizard.vue index eac8995c74d7..76095b902f73 100644 --- a/ui/src/views/compute/BackupScheduleWizard.vue +++ b/ui/src/views/compute/BackupScheduleWizard.vue @@ -63,7 +63,7 @@ export default { closeSchedule: this.closeAction } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/compute/ChangeAffinity.vue b/ui/src/views/compute/ChangeAffinity.vue index 9482ccf15a72..79abcdf8b875 100644 --- a/ui/src/views/compute/ChangeAffinity.vue +++ b/ui/src/views/compute/ChangeAffinity.vue @@ -98,7 +98,7 @@ export default { loading: false } }, - mounted () { + created () { for (const group of this.resource.affinitygroup) { this.selectedRowKeys.push(group.id) } diff --git a/ui/src/views/compute/CreateKubernetesCluster.vue b/ui/src/views/compute/CreateKubernetesCluster.vue index 9759a5d90554..4d5ad01c458a 100644 --- a/ui/src/views/compute/CreateKubernetesCluster.vue +++ b/ui/src/views/compute/CreateKubernetesCluster.vue @@ -360,8 +360,6 @@ export default { name: '' } ] - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/compute/CreateSSHKeyPair.vue b/ui/src/views/compute/CreateSSHKeyPair.vue index ba58a0ee79d3..f584f98e22e1 100644 --- a/ui/src/views/compute/CreateSSHKeyPair.vue +++ b/ui/src/views/compute/CreateSSHKeyPair.vue @@ -112,8 +112,6 @@ export default { name: '' } ] - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/compute/CreateSnapshotWizard.vue b/ui/src/views/compute/CreateSnapshotWizard.vue index bf9d9ddd25b5..76eb6573efd7 100644 --- a/ui/src/views/compute/CreateSnapshotWizard.vue +++ b/ui/src/views/compute/CreateSnapshotWizard.vue @@ -108,7 +108,7 @@ export default { this.apiParams[param.name] = param }) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/compute/DeployVM.vue b/ui/src/views/compute/DeployVM.vue index b2a5fee8bcb9..5852e5365548 100644 --- a/ui/src/views/compute/DeployVM.vue +++ b/ui/src/views/compute/DeployVM.vue @@ -1101,8 +1101,7 @@ export default { this.form.getFieldDecorator('cpunumber', { initialValue: undefined, preserve: true }) this.form.getFieldDecorator('cpuSpeed', { initialValue: undefined, preserve: true }) this.form.getFieldDecorator('memory', { initialValue: undefined, preserve: true }) - }, - mounted () { + this.dataPreFill = this.preFillContent && Object.keys(this.preFillContent).length > 0 ? this.preFillContent : {} this.fetchData() }, diff --git a/ui/src/views/compute/DestroyVM.vue b/ui/src/views/compute/DestroyVM.vue index 638097d2947d..70c68113a51c 100644 --- a/ui/src/views/compute/DestroyVM.vue +++ b/ui/src/views/compute/DestroyVM.vue @@ -87,7 +87,7 @@ export default { this.apiParams[param.name] = param }) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/compute/KubernetesServiceTab.vue b/ui/src/views/compute/KubernetesServiceTab.vue index 91c8973d4ffb..6e838cf56356 100644 --- a/ui/src/views/compute/KubernetesServiceTab.vue +++ b/ui/src/views/compute/KubernetesServiceTab.vue @@ -203,6 +203,7 @@ export default { if (!this.isAdmin()) { this.vmColumns = this.vmColumns.filter(x => x.dataIndex !== 'instancename') } + this.handleFetchData() }, watch: { resource (newData, oldData) { @@ -220,7 +221,6 @@ export default { } }, mounted () { - this.handleFetchData() this.setCurrentTab() }, methods: { diff --git a/ui/src/views/compute/MigrateWizard.vue b/ui/src/views/compute/MigrateWizard.vue index 9f050cda20fd..9c01f47e79c9 100644 --- a/ui/src/views/compute/MigrateWizard.vue +++ b/ui/src/views/compute/MigrateWizard.vue @@ -131,7 +131,7 @@ export default { ] } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/compute/ScaleKubernetesCluster.vue b/ui/src/views/compute/ScaleKubernetesCluster.vue index 8ebc1fb29e89..2aee4bc23e2e 100644 --- a/ui/src/views/compute/ScaleKubernetesCluster.vue +++ b/ui/src/views/compute/ScaleKubernetesCluster.vue @@ -109,8 +109,6 @@ export default { }, created () { this.originalSize = !this.isObjectEmpty(this.resource) ? this.resource.size : 1 - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/compute/ScaleVM.vue b/ui/src/views/compute/ScaleVM.vue index 125e753b23ae..f26534051517 100644 --- a/ui/src/views/compute/ScaleVM.vue +++ b/ui/src/views/compute/ScaleVM.vue @@ -84,7 +84,7 @@ export default { memoryKey: 'details[0].memory' } }, - mounted () { + created () { this.fetchData({ keyword: '', pageSize: 10, diff --git a/ui/src/views/compute/StartVirtualMachine.vue b/ui/src/views/compute/StartVirtualMachine.vue index 5bca86084196..0a24aa15f2ad 100644 --- a/ui/src/views/compute/StartVirtualMachine.vue +++ b/ui/src/views/compute/StartVirtualMachine.vue @@ -148,7 +148,7 @@ export default { this.apiParams[param.name] = param }) }, - mounted () { + created () { if (this.$store.getters.userInfo.roletype === 'Admin') { this.fetchPods() this.fetchClusters() diff --git a/ui/src/views/compute/UpgradeKubernetesCluster.vue b/ui/src/views/compute/UpgradeKubernetesCluster.vue index 18b51b21ca1a..75d2216f9dc9 100644 --- a/ui/src/views/compute/UpgradeKubernetesCluster.vue +++ b/ui/src/views/compute/UpgradeKubernetesCluster.vue @@ -89,8 +89,6 @@ export default { }) }, created () { - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/dashboard/CapacityDashboard.vue b/ui/src/views/dashboard/CapacityDashboard.vue index 9f382992b97f..334e4ee6cc76 100644 --- a/ui/src/views/dashboard/CapacityDashboard.vue +++ b/ui/src/views/dashboard/CapacityDashboard.vue @@ -153,7 +153,7 @@ export default { } } }, - mounted () { + created () { this.fetchData() }, watch: { @@ -163,11 +163,6 @@ export default { } } }, - created () { - setTimeout(() => { - // to do after initial timeout - }, 1000) - }, methods: { getStatus (value) { if (value > 85) { diff --git a/ui/src/views/dashboard/Dashboard.vue b/ui/src/views/dashboard/Dashboard.vue index 946a1cc926f9..4cfc4de6fb77 100644 --- a/ui/src/views/dashboard/Dashboard.vue +++ b/ui/src/views/dashboard/Dashboard.vue @@ -55,8 +55,10 @@ export default { showOnboarding: false } }, - mounted () { + created () { this.fetchData() + }, + mounted () { this.showCapacityDashboard = Object.prototype.hasOwnProperty.call(store.getters.apis, 'listCapacity') this.project = false if (store.getters.project && store.getters.project.id) { diff --git a/ui/src/views/dashboard/UsageDashboard.vue b/ui/src/views/dashboard/UsageDashboard.vue index ef4d96416d0f..e1b3c828cf92 100644 --- a/ui/src/views/dashboard/UsageDashboard.vue +++ b/ui/src/views/dashboard/UsageDashboard.vue @@ -131,7 +131,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.project = store.getters.project this.fetchData() this.$store.watch( diff --git a/ui/src/views/iam/AddAccount.vue b/ui/src/views/iam/AddAccount.vue index eca86a75fe85..08925a84a35e 100644 --- a/ui/src/views/iam/AddAccount.vue +++ b/ui/src/views/iam/AddAccount.vue @@ -256,7 +256,7 @@ export default { }) } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/iam/AddLdapAccount.vue b/ui/src/views/iam/AddLdapAccount.vue index 50806d18f10f..20cb0a417639 100644 --- a/ui/src/views/iam/AddLdapAccount.vue +++ b/ui/src/views/iam/AddLdapAccount.vue @@ -234,8 +234,6 @@ export default { } ] this.selectedFilter = this.filters[0].id - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/iam/AddUser.vue b/ui/src/views/iam/AddUser.vue index d7121ea9cbbe..6257100130df 100644 --- a/ui/src/views/iam/AddUser.vue +++ b/ui/src/views/iam/AddUser.vue @@ -228,8 +228,6 @@ export default { this.apiConfig.params.forEach(param => { this.apiParams[param.name] = param }) - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/iam/ConfigureSamlSsoAuth.vue b/ui/src/views/iam/ConfigureSamlSsoAuth.vue index 1e21a0d17a95..ddbf9f58cb65 100644 --- a/ui/src/views/iam/ConfigureSamlSsoAuth.vue +++ b/ui/src/views/iam/ConfigureSamlSsoAuth.vue @@ -65,7 +65,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/iam/CreateRole.vue b/ui/src/views/iam/CreateRole.vue index 38156f84d48a..64391cbce842 100644 --- a/ui/src/views/iam/CreateRole.vue +++ b/ui/src/views/iam/CreateRole.vue @@ -101,7 +101,7 @@ export default { loading: false } }, - mounted () { + created () { this.fetchRoles() }, beforeCreate () { diff --git a/ui/src/views/iam/DomainActionForm.vue b/ui/src/views/iam/DomainActionForm.vue index 900a5908fd34..06475312b5e6 100644 --- a/ui/src/views/iam/DomainActionForm.vue +++ b/ui/src/views/iam/DomainActionForm.vue @@ -148,7 +148,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { if (this.action.dataView && this.action.icon === 'edit') { this.fillEditFormFieldValues() } diff --git a/ui/src/views/iam/DomainView.vue b/ui/src/views/iam/DomainView.vue index 12ba40b61d80..c9f1311eddc7 100644 --- a/ui/src/views/iam/DomainView.vue +++ b/ui/src/views/iam/DomainView.vue @@ -125,15 +125,15 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { - this.fetchData() - }, beforeRouteUpdate (to, from, next) { next() }, beforeRouteLeave (to, from, next) { next() }, + created () { + this.fetchData() + }, watch: { '$route' (to, from) { if (to.fullPath !== from.fullPath && !to.fullPath.includes('action/')) { diff --git a/ui/src/views/iam/EditUser.vue b/ui/src/views/iam/EditUser.vue index e1ae0b58580a..ff163c4dba50 100644 --- a/ui/src/views/iam/EditUser.vue +++ b/ui/src/views/iam/EditUser.vue @@ -136,7 +136,7 @@ export default { this.apiParams[param.name] = param }) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/iam/RolePermissionTab.vue b/ui/src/views/iam/RolePermissionTab.vue index 3e63daf30dea..a10488cd0d9b 100644 --- a/ui/src/views/iam/RolePermissionTab.vue +++ b/ui/src/views/iam/RolePermissionTab.vue @@ -144,7 +144,7 @@ export default { apis: [] } }, - mounted () { + created () { this.apis = Object.keys(this.$store.getters.apis).sort((a, b) => a.localeCompare(b)) this.fetchData() }, diff --git a/ui/src/views/iam/SSLCertificateTab.vue b/ui/src/views/iam/SSLCertificateTab.vue index 1524f743e51e..a53c152ec6b5 100644 --- a/ui/src/views/iam/SSLCertificateTab.vue +++ b/ui/src/views/iam/SSLCertificateTab.vue @@ -140,8 +140,6 @@ export default { } ] this.detailColumn = ['name', 'certificate', 'certchain'] - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/image/AddKubernetesSupportedVersion.vue b/ui/src/views/image/AddKubernetesSupportedVersion.vue index 30fb4804876d..cd0eeebddbf3 100644 --- a/ui/src/views/image/AddKubernetesSupportedVersion.vue +++ b/ui/src/views/image/AddKubernetesSupportedVersion.vue @@ -189,8 +189,6 @@ export default { name: this.$t('label.all.zone') } ] - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/image/IsoZones.vue b/ui/src/views/image/IsoZones.vue index 6808724bd8fb..4b59e3898647 100644 --- a/ui/src/views/image/IsoZones.vue +++ b/ui/src/views/image/IsoZones.vue @@ -190,8 +190,6 @@ export default { (userInfo.account !== this.resource.account || userInfo.domain !== this.resource.domain)) { this.columns = this.columns.filter(col => { return col.dataIndex !== 'status' }) } - }, - mounted () { this.fetchData() }, watch: { diff --git a/ui/src/views/image/RegisterOrUploadTemplate.vue b/ui/src/views/image/RegisterOrUploadTemplate.vue index c55410ff0bcd..7c5745b199e0 100644 --- a/ui/src/views/image/RegisterOrUploadTemplate.vue +++ b/ui/src/views/image/RegisterOrUploadTemplate.vue @@ -410,8 +410,6 @@ export default { this.$set(this.format, 'opts', []) this.$set(this.osTypes, 'loading', false) this.$set(this.osTypes, 'opts', []) - }, - mounted () { this.fetchData() }, computed: { diff --git a/ui/src/views/image/TemplateZones.vue b/ui/src/views/image/TemplateZones.vue index 047d39f23b1e..9156d417b415 100644 --- a/ui/src/views/image/TemplateZones.vue +++ b/ui/src/views/image/TemplateZones.vue @@ -203,8 +203,6 @@ export default { (userInfo.account !== this.resource.account || userInfo.domain !== this.resource.domain)) { this.columns = this.columns.filter(col => { return col.dataIndex !== 'status' }) } - }, - mounted () { this.fetchData() }, watch: { diff --git a/ui/src/views/image/UpdateKubernetesSupportedVersion.vue b/ui/src/views/image/UpdateKubernetesSupportedVersion.vue index 6d8475f07fd2..5696725276c2 100644 --- a/ui/src/views/image/UpdateKubernetesSupportedVersion.vue +++ b/ui/src/views/image/UpdateKubernetesSupportedVersion.vue @@ -87,8 +87,6 @@ export default { name: this.$t('state.disabled') } ] - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/image/UpdateTemplateIsoPermissions.vue b/ui/src/views/image/UpdateTemplateIsoPermissions.vue index 6bafcc631204..32066cc73d17 100644 --- a/ui/src/views/image/UpdateTemplateIsoPermissions.vue +++ b/ui/src/views/image/UpdateTemplateIsoPermissions.vue @@ -141,7 +141,7 @@ export default { ) : this.projects } }, - mounted () { + created () { this.isImageTypeIso = this.$route.meta.name === 'iso' this.fetchData() }, diff --git a/ui/src/views/infra/AddPrimaryStorage.vue b/ui/src/views/infra/AddPrimaryStorage.vue index 8229abedddb5..9179f5e03d45 100644 --- a/ui/src/views/infra/AddPrimaryStorage.vue +++ b/ui/src/views/infra/AddPrimaryStorage.vue @@ -340,7 +340,7 @@ export default { this.apiParams[param.name] = param }) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/infra/AddSecondaryStorage.vue b/ui/src/views/infra/AddSecondaryStorage.vue index 4016c4174541..af9af6a5ccb0 100644 --- a/ui/src/views/infra/AddSecondaryStorage.vue +++ b/ui/src/views/infra/AddSecondaryStorage.vue @@ -181,7 +181,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/infra/ClusterAdd.vue b/ui/src/views/infra/ClusterAdd.vue index f4c03fe96a04..51049bf5a847 100644 --- a/ui/src/views/infra/ClusterAdd.vue +++ b/ui/src/views/infra/ClusterAdd.vue @@ -150,7 +150,7 @@ export default { } } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/infra/CpuSockets.vue b/ui/src/views/infra/CpuSockets.vue index e04f8b013f79..798071ea541e 100644 --- a/ui/src/views/infra/CpuSockets.vue +++ b/ui/src/views/infra/CpuSockets.vue @@ -73,7 +73,7 @@ export default { columns: [] } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/infra/HostAdd.vue b/ui/src/views/infra/HostAdd.vue index 73b11f2e9c93..d0ac509d0a14 100644 --- a/ui/src/views/infra/HostAdd.vue +++ b/ui/src/views/infra/HostAdd.vue @@ -171,7 +171,7 @@ export default { } } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/infra/HostInfo.vue b/ui/src/views/infra/HostInfo.vue index a28a808b9925..2c9814307d71 100644 --- a/ui/src/views/infra/HostInfo.vue +++ b/ui/src/views/infra/HostInfo.vue @@ -125,7 +125,7 @@ export default { fetchLoading: false } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/infra/InfraSummary.vue b/ui/src/views/infra/InfraSummary.vue index bf47aa2f2dc0..46707a400212 100644 --- a/ui/src/views/infra/InfraSummary.vue +++ b/ui/src/views/infra/InfraSummary.vue @@ -221,7 +221,7 @@ export default { this.apiParams[param.name] = param }) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/infra/MigrateData.vue b/ui/src/views/infra/MigrateData.vue index 56449d497b97..571dc20101c2 100644 --- a/ui/src/views/infra/MigrateData.vue +++ b/ui/src/views/infra/MigrateData.vue @@ -98,7 +98,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchImageStores() }, methods: { diff --git a/ui/src/views/infra/PodAdd.vue b/ui/src/views/infra/PodAdd.vue index b06373f6ae1d..87887a596492 100644 --- a/ui/src/views/infra/PodAdd.vue +++ b/ui/src/views/infra/PodAdd.vue @@ -146,7 +146,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/infra/Resources.vue b/ui/src/views/infra/Resources.vue index aba42ef2a0fd..0eff0b3c57fb 100644 --- a/ui/src/views/infra/Resources.vue +++ b/ui/src/views/infra/Resources.vue @@ -61,7 +61,7 @@ export default { resourcesList: [] } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/infra/network/DedicatedVLANTab.vue b/ui/src/views/infra/network/DedicatedVLANTab.vue index f82c2249deae..b8262da656cc 100644 --- a/ui/src/views/infra/network/DedicatedVLANTab.vue +++ b/ui/src/views/infra/network/DedicatedVLANTab.vue @@ -183,7 +183,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/infra/network/EditTrafficLabel.vue b/ui/src/views/infra/network/EditTrafficLabel.vue index e36b70b8ba33..d9e76119e38c 100644 --- a/ui/src/views/infra/network/EditTrafficLabel.vue +++ b/ui/src/views/infra/network/EditTrafficLabel.vue @@ -143,8 +143,7 @@ export default { }) } }, - inject: ['parentFetchData'], - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/infra/network/IpRangesTab.vue b/ui/src/views/infra/network/IpRangesTab.vue index 41257f128331..b64ddc4f8332 100644 --- a/ui/src/views/infra/network/IpRangesTab.vue +++ b/ui/src/views/infra/network/IpRangesTab.vue @@ -40,7 +40,7 @@ export default { fetchLoading: false } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/infra/network/IpRangesTabGuest.vue b/ui/src/views/infra/network/IpRangesTabGuest.vue index 49d63f7cbf10..2cf51d3ce413 100644 --- a/ui/src/views/infra/network/IpRangesTabGuest.vue +++ b/ui/src/views/infra/network/IpRangesTabGuest.vue @@ -129,7 +129,7 @@ export default { ] } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/infra/network/IpRangesTabManagement.vue b/ui/src/views/infra/network/IpRangesTabManagement.vue index 27a1b0c79057..c8c6d0c93e37 100644 --- a/ui/src/views/infra/network/IpRangesTabManagement.vue +++ b/ui/src/views/infra/network/IpRangesTabManagement.vue @@ -191,7 +191,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/infra/network/IpRangesTabPublic.vue b/ui/src/views/infra/network/IpRangesTabPublic.vue index 4e87885987fa..aa648fb21b78 100644 --- a/ui/src/views/infra/network/IpRangesTabPublic.vue +++ b/ui/src/views/infra/network/IpRangesTabPublic.vue @@ -270,7 +270,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/infra/network/IpRangesTabStorage.vue b/ui/src/views/infra/network/IpRangesTabStorage.vue index 8b381349ade3..4ac8567c3d3e 100644 --- a/ui/src/views/infra/network/IpRangesTabStorage.vue +++ b/ui/src/views/infra/network/IpRangesTabStorage.vue @@ -179,7 +179,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/infra/network/ServiceProvidersTab.vue b/ui/src/views/infra/network/ServiceProvidersTab.vue index 89c92d418190..71b14b5124e4 100644 --- a/ui/src/views/infra/network/ServiceProvidersTab.vue +++ b/ui/src/views/infra/network/ServiceProvidersTab.vue @@ -35,7 +35,8 @@ :itemNsp="item" :nsp="nsps[item.title]" :resourceId="resource.id" - :zoneId="resource.zoneid"/> + :zoneId="resource.zoneid" + :tabKey="tabKey"/> @@ -1103,7 +1104,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, watch: { @@ -1124,6 +1125,9 @@ export default { }, methods: { fetchData () { + if (!this.resource || !('id' in this.resource)) { + return + } this.fetchServiceProvider() }, fetchServiceProvider (name) { diff --git a/ui/src/views/infra/network/TrafficTypesTab.vue b/ui/src/views/infra/network/TrafficTypesTab.vue index 3b14f9cf2ee3..24858abe068f 100644 --- a/ui/src/views/infra/network/TrafficTypesTab.vue +++ b/ui/src/views/infra/network/TrafficTypesTab.vue @@ -89,7 +89,7 @@ export default { fetchLoading: false } }, - mounted () { + created () { if (this.resource.id) { this.fetchData() } diff --git a/ui/src/views/infra/network/providers/ProviderItem.vue b/ui/src/views/infra/network/providers/ProviderItem.vue index 458fa892544a..73931bd071c5 100644 --- a/ui/src/views/infra/network/providers/ProviderItem.vue +++ b/ui/src/views/infra/network/providers/ProviderItem.vue @@ -103,45 +103,38 @@ export default { }, inject: ['provideSetNsp', 'provideExecuteAction'], watch: { - loading (newValue, oldValue) { - if (newValue !== oldValue && !newValue) { - this.fetchData() - } - }, - nsp (newData, oldData) { - if (newData && Object.keys(newData).length > 0) { - this.nsp = newData - this.resource = this.nsp - this.$set(this.resource, 'zoneid', this.zoneId) - this.provideSetNsp(this.resource) - this.fetchData() - } + nsp () { + this.fetchData() } }, - mounted () { - if (!this.nsp || Object.keys(this.nsp).length === 0) { - this.resource = { - name: this.itemNsp.title, - state: 'Disabled', - physicalnetworkid: this.resourceId, - zoneid: this.zoneId - } - } else { - this.resource = this.nsp - this.$set(this.resource, 'zoneid', this.zoneId) - } - if (this.itemNsp && Object.keys(this.itemNsp).length > 0) { - this.provider = this.itemNsp - this.provideSetNsp(this.resource) - this.fetchData() + created () { + if (!this.resourceId || !this.zoneId) { + return } + this.fetchData() }, methods: { async fetchData () { - if (!this.provider.lists || this.provider.lists.length === 0) { - return + if (!this.nsp || Object.keys(this.nsp).length === 0) { + this.resource = { + name: this.itemNsp.title, + state: 'Disabled', + physicalnetworkid: this.resourceId, + zoneid: this.zoneId + } + } else { + this.resource = this.nsp + this.$set(this.resource, 'zoneid', this.zoneId) + } + if (this.itemNsp && Object.keys(this.itemNsp).length > 0) { + this.provider = this.itemNsp + this.provideSetNsp(this.resource) + + if (!this.provider.lists || this.provider.lists.length === 0) { + return + } + this.provider.lists.map(this.fetchOptions) } - this.provider.lists.map(this.fetchOptions) }, async fetchOptions (args) { if (!args || Object.keys(args).length === 0) { diff --git a/ui/src/views/infra/routers/RouterHealthCheck.vue b/ui/src/views/infra/routers/RouterHealthCheck.vue index fdc8737bbce5..e75b35f8460b 100644 --- a/ui/src/views/infra/routers/RouterHealthCheck.vue +++ b/ui/src/views/infra/routers/RouterHealthCheck.vue @@ -130,7 +130,7 @@ export default { this.updateResource(newItem) } }, - mounted () { + created () { this.updateResource(this.resource) }, methods: { diff --git a/ui/src/views/infra/zone/PhysicalNetworksTab.vue b/ui/src/views/infra/zone/PhysicalNetworksTab.vue index 66e8e5c123f6..8312b6954cfd 100644 --- a/ui/src/views/infra/zone/PhysicalNetworksTab.vue +++ b/ui/src/views/infra/zone/PhysicalNetworksTab.vue @@ -85,7 +85,7 @@ export default { fetchLoading: false } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/infra/zone/SystemVmsTab.vue b/ui/src/views/infra/zone/SystemVmsTab.vue index c453042ec78c..c6b48b1e5f4b 100644 --- a/ui/src/views/infra/zone/SystemVmsTab.vue +++ b/ui/src/views/infra/zone/SystemVmsTab.vue @@ -93,7 +93,7 @@ export default { fetchLoading: false } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/infra/zone/ZoneWizardAddResources.vue b/ui/src/views/infra/zone/ZoneWizardAddResources.vue index ba8cf207f095..ce75b857e76b 100644 --- a/ui/src/views/infra/zone/ZoneWizardAddResources.vue +++ b/ui/src/views/infra/zone/ZoneWizardAddResources.vue @@ -691,7 +691,7 @@ export default { options: ['primaryStorageScope', 'primaryStorageProtocol', 'provider'] } }, - mounted () { + created () { if (this.stepChild && this.stepChild !== '') { this.currentStep = this.steps.findIndex(item => item.fromKey === this.stepChild) } diff --git a/ui/src/views/infra/zone/ZoneWizardNetworkSetupStep.vue b/ui/src/views/infra/zone/ZoneWizardNetworkSetupStep.vue index c7175600df4a..abfb77ceaf29 100644 --- a/ui/src/views/infra/zone/ZoneWizardNetworkSetupStep.vue +++ b/ui/src/views/infra/zone/ZoneWizardNetworkSetupStep.vue @@ -361,7 +361,7 @@ export default { ] } }, - mounted () { + created () { this.physicalNetworks = this.prefillContent.physicalNetworks this.steps = this.filteredSteps() this.currentStep = this.prefillContent.networkStep ? this.prefillContent.networkStep : 0 diff --git a/ui/src/views/infra/zone/ZoneWizardZoneDetailsStep.vue b/ui/src/views/infra/zone/ZoneWizardZoneDetailsStep.vue index e44d3347a365..9ce126a11d5b 100644 --- a/ui/src/views/infra/zone/ZoneWizardZoneDetailsStep.vue +++ b/ui/src/views/infra/zone/ZoneWizardZoneDetailsStep.vue @@ -393,6 +393,8 @@ export default { this.$emit('fieldsChanged', changedFields) } }) + + this.fetchData() }, mounted () { this.form.setFieldsValue({ @@ -413,41 +415,6 @@ export default { localstorageenabled: this.localstorageenabled, localstorageenabledforsystemvm: this.localstorageenabledforsystemvm }) - - const cForm = this.form - api('listHypervisors', { listAll: true }).then(json => { - this.hypervisors = json.listhypervisorsresponse.hypervisor - if ('listSimulatorHAStateTransitions' in this.$store.getters.apis) { - this.hypervisors.push({ name: 'Simulator' }) - } - cForm.setFieldsValue({ - hypervisor: this.currentHypervisor - }) - }) - - if (!this.isAdvancedZone || this.securityGroupsEnabled) { - api('listNetworkOfferings', { state: 'Enabled', guestiptype: 'Shared' }).then(json => { - this.networkOfferings = {} - json.listnetworkofferingsresponse.networkoffering.forEach(offering => { - this.setupNetworkOfferingAdditionalFlags(offering) - this.networkOfferings[offering.id] = offering - }) - this.availableNetworkOfferings = this.getAvailableNetworkOfferings(this.currentHypervisor) - cForm.setFieldsValue({ - networkOfferingId: this.currentNetworkOfferingId - }) - }) - } - - api('listDomains', { listAll: true }).then(json => { - this.domains = {} - json.listdomainsresponse.domain.forEach(dom => { - this.domains[dom.id] = dom - }) - cForm.setFieldsValue({ - domain: this.domain - }) - }) }, computed: { isAdvancedZone () { @@ -531,6 +498,42 @@ export default { } }, methods: { + fetchData () { + const cForm = this.form + api('listHypervisors', { listAll: true }).then(json => { + this.hypervisors = json.listhypervisorsresponse.hypervisor + if ('listSimulatorHAStateTransitions' in this.$store.getters.apis) { + this.hypervisors.push({ name: 'Simulator' }) + } + cForm.setFieldsValue({ + hypervisor: this.currentHypervisor + }) + }) + + if (!this.isAdvancedZone || this.securityGroupsEnabled) { + api('listNetworkOfferings', { state: 'Enabled', guestiptype: 'Shared' }).then(json => { + this.networkOfferings = {} + json.listnetworkofferingsresponse.networkoffering.forEach(offering => { + this.setupNetworkOfferingAdditionalFlags(offering) + this.networkOfferings[offering.id] = offering + }) + this.availableNetworkOfferings = this.getAvailableNetworkOfferings(this.currentHypervisor) + cForm.setFieldsValue({ + networkOfferingId: this.currentNetworkOfferingId + }) + }) + } + + api('listDomains', { listAll: true }).then(json => { + this.domains = {} + json.listdomainsresponse.domain.forEach(dom => { + this.domains[dom.id] = dom + }) + cForm.setFieldsValue({ + domain: this.domain + }) + }) + }, handleSubmit (e) { e.preventDefault() this.form.validateFields((err, values) => { diff --git a/ui/src/views/network/AclListRulesTab.vue b/ui/src/views/network/AclListRulesTab.vue index 62448d769048..49df0de9ae59 100644 --- a/ui/src/views/network/AclListRulesTab.vue +++ b/ui/src/views/network/AclListRulesTab.vue @@ -227,7 +227,7 @@ export default { ruleFormMode: 'edit' } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/network/CreateIsolatedNetworkForm.vue b/ui/src/views/network/CreateIsolatedNetworkForm.vue index b40c241b5c1a..7035cb2641fc 100644 --- a/ui/src/views/network/CreateIsolatedNetworkForm.vue +++ b/ui/src/views/network/CreateIsolatedNetworkForm.vue @@ -302,8 +302,6 @@ export default { name: ' ' } ] - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/network/CreateL2NetworkForm.vue b/ui/src/views/network/CreateL2NetworkForm.vue index b21bce0b1f8d..a55eaaeba303 100644 --- a/ui/src/views/network/CreateL2NetworkForm.vue +++ b/ui/src/views/network/CreateL2NetworkForm.vue @@ -274,8 +274,6 @@ export default { name: ' ' } ] - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/network/CreateSharedNetworkForm.vue b/ui/src/views/network/CreateSharedNetworkForm.vue index e91a5631c4af..8f5d47c59d03 100644 --- a/ui/src/views/network/CreateSharedNetworkForm.vue +++ b/ui/src/views/network/CreateSharedNetworkForm.vue @@ -474,8 +474,6 @@ export default { }) }, created () { - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/network/CreateVpc.vue b/ui/src/views/network/CreateVpc.vue index d3697f350bb2..f17ac2f85da4 100644 --- a/ui/src/views/network/CreateVpc.vue +++ b/ui/src/views/network/CreateVpc.vue @@ -146,7 +146,7 @@ export default { this.apiParams[param.name] = param }) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/network/EgressRulesTab.vue b/ui/src/views/network/EgressRulesTab.vue index b77d7c940a75..f1f130365ec1 100644 --- a/ui/src/views/network/EgressRulesTab.vue +++ b/ui/src/views/network/EgressRulesTab.vue @@ -156,7 +156,7 @@ export default { ] } }, - mounted () { + created () { this.fetchData() }, filters: { diff --git a/ui/src/views/network/EnableStaticNat.vue b/ui/src/views/network/EnableStaticNat.vue index d03e67bc8774..a4e70dda28e4 100644 --- a/ui/src/views/network/EnableStaticNat.vue +++ b/ui/src/views/network/EnableStaticNat.vue @@ -151,7 +151,7 @@ export default { pageSize: 10 } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/network/FirewallRules.vue b/ui/src/views/network/FirewallRules.vue index 48e30a6b3a0f..74b7fc1bce94 100644 --- a/ui/src/views/network/FirewallRules.vue +++ b/ui/src/views/network/FirewallRules.vue @@ -198,7 +198,7 @@ export default { ] } }, - mounted () { + created () { this.fetchData() }, filters: { diff --git a/ui/src/views/network/GuestIpRanges.vue b/ui/src/views/network/GuestIpRanges.vue index a2e364af7a64..87a62e01a787 100644 --- a/ui/src/views/network/GuestIpRanges.vue +++ b/ui/src/views/network/GuestIpRanges.vue @@ -147,7 +147,7 @@ export default { ] } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/network/IngressEgressRuleConfigure.vue b/ui/src/views/network/IngressEgressRuleConfigure.vue index 7b9965ad60aa..71aaa15e3413 100644 --- a/ui/src/views/network/IngressEgressRuleConfigure.vue +++ b/ui/src/views/network/IngressEgressRuleConfigure.vue @@ -250,7 +250,7 @@ export default { return val.toUpperCase() } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/network/InternalLBAssignVmForm.vue b/ui/src/views/network/InternalLBAssignVmForm.vue index b1e1fa26a510..2471dd5971a3 100644 --- a/ui/src/views/network/InternalLBAssignVmForm.vue +++ b/ui/src/views/network/InternalLBAssignVmForm.vue @@ -115,7 +115,7 @@ export default { fetchLoading: false } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/network/InternalLBAssignedVmTab.vue b/ui/src/views/network/InternalLBAssignedVmTab.vue index 9971a40ae99c..22e6b58ffbfd 100644 --- a/ui/src/views/network/InternalLBAssignedVmTab.vue +++ b/ui/src/views/network/InternalLBAssignedVmTab.vue @@ -97,7 +97,7 @@ export default { ] } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/network/IpAddressesTab.vue b/ui/src/views/network/IpAddressesTab.vue index 2d4c0147fa94..8e889042f490 100644 --- a/ui/src/views/network/IpAddressesTab.vue +++ b/ui/src/views/network/IpAddressesTab.vue @@ -185,7 +185,7 @@ export default { listPublicIpAddress: [] } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/network/LoadBalancing.vue b/ui/src/views/network/LoadBalancing.vue index 7bf183bc814d..e8bcc3e554d2 100644 --- a/ui/src/views/network/LoadBalancing.vue +++ b/ui/src/views/network/LoadBalancing.vue @@ -517,7 +517,7 @@ export default { searchQuery: null } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/network/PortForwarding.vue b/ui/src/views/network/PortForwarding.vue index ef5c66f852b5..d4dbffbb87e6 100644 --- a/ui/src/views/network/PortForwarding.vue +++ b/ui/src/views/network/PortForwarding.vue @@ -364,7 +364,7 @@ export default { searchQuery: null } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/network/PublicIpResource.vue b/ui/src/views/network/PublicIpResource.vue index 84c62eb4c453..2c97f93bde09 100644 --- a/ui/src/views/network/PublicIpResource.vue +++ b/ui/src/views/network/PublicIpResource.vue @@ -85,7 +85,7 @@ export default { } } }, - mounted () { + created () { if ('id' in this.resource) { this.fetchData() } diff --git a/ui/src/views/network/RoutersTab.vue b/ui/src/views/network/RoutersTab.vue index 876a77af8bb6..24dac4ea215b 100644 --- a/ui/src/views/network/RoutersTab.vue +++ b/ui/src/views/network/RoutersTab.vue @@ -103,7 +103,7 @@ export default { ] } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/network/StaticRoutesTab.vue b/ui/src/views/network/StaticRoutesTab.vue index 814dd07ca650..805d57ecb354 100644 --- a/ui/src/views/network/StaticRoutesTab.vue +++ b/ui/src/views/network/StaticRoutesTab.vue @@ -99,7 +99,7 @@ export default { newRoute: null } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/network/VpcTab.vue b/ui/src/views/network/VpcTab.vue index d75dae8dbc92..14b5d96dc77b 100644 --- a/ui/src/views/network/VpcTab.vue +++ b/ui/src/views/network/VpcTab.vue @@ -406,7 +406,7 @@ export default { this.setCurrentTab() } }, - mounted () { + created () { this.handleFetchData() this.setCurrentTab() }, diff --git a/ui/src/views/network/VpcTiersTab.vue b/ui/src/views/network/VpcTiersTab.vue index ae67a8f87a2e..8baf8afcd5dc 100644 --- a/ui/src/views/network/VpcTiersTab.vue +++ b/ui/src/views/network/VpcTiersTab.vue @@ -371,7 +371,7 @@ export default { } } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/network/VpnDetails.vue b/ui/src/views/network/VpnDetails.vue index 0159f6ec4bb6..a200aa66b5a8 100644 --- a/ui/src/views/network/VpnDetails.vue +++ b/ui/src/views/network/VpnDetails.vue @@ -86,7 +86,7 @@ export default { } }, inject: ['parentFetchData', 'parentToggleLoading'], - mounted () { + created () { this.fetchData() }, watch: { From 6cf7e4e3ca19fe06a4f06d292bd6d5faa96d3b3f Mon Sep 17 00:00:00 2001 From: utchoang Date: Mon, 15 Mar 2021 08:56:02 +0700 Subject: [PATCH 2/3] moves fetch data to the created method is missing --- ui/src/views/AutogenView.vue | 3 +-- ui/src/views/offering/AddComputeOffering.vue | 2 -- ui/src/views/offering/AddDiskOffering.vue | 2 -- ui/src/views/offering/AddNetworkOffering.vue | 2 -- ui/src/views/offering/AddVpcOffering.vue | 2 -- ui/src/views/offering/ImportBackupOffering.vue | 3 +-- ui/src/views/offering/UpdateOfferingAccess.vue | 2 -- ui/src/views/plugins/CloudianPlugin.vue | 2 +- ui/src/views/plugins/quota/EmailTemplateDetails.vue | 2 +- ui/src/views/plugins/quota/QuotaBalance.vue | 2 +- ui/src/views/plugins/quota/QuotaSummaryResource.vue | 2 +- ui/src/views/plugins/quota/QuotaUsage.vue | 2 +- ui/src/views/project/AccountsTab.vue | 4 +--- ui/src/views/project/AddAccountOrUserToProject.vue | 2 +- ui/src/views/project/InvitationsTemplate.vue | 2 -- ui/src/views/storage/AttachVolume.vue | 2 +- ui/src/views/storage/CreateSnapshotFromVMSnapshot.vue | 2 +- ui/src/views/storage/CreateVolume.vue | 2 +- ui/src/views/storage/FormSchedule.vue | 2 +- ui/src/views/storage/MigrateVolume.vue | 2 +- ui/src/views/storage/RecurringSnapshotVolume.vue | 2 +- ui/src/views/storage/ResizeVolume.vue | 2 +- ui/src/views/storage/RestoreAttachBackupVolume.vue | 2 +- ui/src/views/storage/UploadLocalVolume.vue | 2 +- 24 files changed, 18 insertions(+), 34 deletions(-) diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index a41b17d47bfc..29d7f6777ae5 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -417,8 +417,7 @@ export default { eventBus.$on('exec-action', (action, isGroupAction) => { this.execAction(action, isGroupAction) }) - }, - mounted () { + if (this.device === 'desktop') { this.pageSize = 20 } diff --git a/ui/src/views/offering/AddComputeOffering.vue b/ui/src/views/offering/AddComputeOffering.vue index eafa87527420..87dc4c9dee5c 100644 --- a/ui/src/views/offering/AddComputeOffering.vue +++ b/ui/src/views/offering/AddComputeOffering.vue @@ -818,8 +818,6 @@ export default { name: this.$t('label.all.zone') } ] - }, - mounted () { if (this.$route.meta.name === 'systemoffering') { this.isSystem = true } diff --git a/ui/src/views/offering/AddDiskOffering.vue b/ui/src/views/offering/AddDiskOffering.vue index 267c5eff87f8..2272853d1fa2 100644 --- a/ui/src/views/offering/AddDiskOffering.vue +++ b/ui/src/views/offering/AddDiskOffering.vue @@ -483,8 +483,6 @@ export default { name: this.$t('label.all.zone') } ] - }, - mounted () { this.fetchData() this.isPublic = this.isAdmin() }, diff --git a/ui/src/views/offering/AddNetworkOffering.vue b/ui/src/views/offering/AddNetworkOffering.vue index 6e56f5b6ff5d..4c99e7f540f4 100644 --- a/ui/src/views/offering/AddNetworkOffering.vue +++ b/ui/src/views/offering/AddNetworkOffering.vue @@ -524,8 +524,6 @@ export default { name: this.$t('label.all.zone') } ] - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/offering/AddVpcOffering.vue b/ui/src/views/offering/AddVpcOffering.vue index 99fafa85dca1..e96f3edfaf61 100644 --- a/ui/src/views/offering/AddVpcOffering.vue +++ b/ui/src/views/offering/AddVpcOffering.vue @@ -204,8 +204,6 @@ export default { name: this.$t('label.all.zone') } ] - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/offering/ImportBackupOffering.vue b/ui/src/views/offering/ImportBackupOffering.vue index 782df3a2e4a8..b729cd7e38a0 100644 --- a/ui/src/views/offering/ImportBackupOffering.vue +++ b/ui/src/views/offering/ImportBackupOffering.vue @@ -128,10 +128,9 @@ export default { this.apiParams[param.name] = param }) }, - mounted () { + created () { this.fetchData() }, - inject: ['parentFetchData'], methods: { fetchData () { this.fetchZone() diff --git a/ui/src/views/offering/UpdateOfferingAccess.vue b/ui/src/views/offering/UpdateOfferingAccess.vue index e5fc8c32c1f6..e9e1c6032b16 100644 --- a/ui/src/views/offering/UpdateOfferingAccess.vue +++ b/ui/src/views/offering/UpdateOfferingAccess.vue @@ -146,8 +146,6 @@ export default { name: this.$t('label.all.zone') } ] - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/plugins/CloudianPlugin.vue b/ui/src/views/plugins/CloudianPlugin.vue index f5a37cea284c..29a51264a761 100644 --- a/ui/src/views/plugins/CloudianPlugin.vue +++ b/ui/src/views/plugins/CloudianPlugin.vue @@ -34,7 +34,7 @@ import { api } from '@/api' export default { name: 'CloudianPlugin', - mounted () { + created () { this.doSso() }, data () { diff --git a/ui/src/views/plugins/quota/EmailTemplateDetails.vue b/ui/src/views/plugins/quota/EmailTemplateDetails.vue index 1d05ccd336c4..dad536e8d51c 100644 --- a/ui/src/views/plugins/quota/EmailTemplateDetails.vue +++ b/ui/src/views/plugins/quota/EmailTemplateDetails.vue @@ -75,7 +75,7 @@ export default { loading: false } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/plugins/quota/QuotaBalance.vue b/ui/src/views/plugins/quota/QuotaBalance.vue index 10a4621a0aa9..e8c5eb366d4b 100644 --- a/ui/src/views/plugins/quota/QuotaBalance.vue +++ b/ui/src/views/plugins/quota/QuotaBalance.vue @@ -93,7 +93,7 @@ export default { } } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/plugins/quota/QuotaSummaryResource.vue b/ui/src/views/plugins/quota/QuotaSummaryResource.vue index 1a41780f0075..381f94e09285 100644 --- a/ui/src/views/plugins/quota/QuotaSummaryResource.vue +++ b/ui/src/views/plugins/quota/QuotaSummaryResource.vue @@ -51,7 +51,7 @@ export default { pattern: 'YYYY-MM-DD' } }, - mounted () { + created () { this.fetchData() }, watch: { diff --git a/ui/src/views/plugins/quota/QuotaUsage.vue b/ui/src/views/plugins/quota/QuotaUsage.vue index a42bc8cdfc76..3136a897428b 100644 --- a/ui/src/views/plugins/quota/QuotaUsage.vue +++ b/ui/src/views/plugins/quota/QuotaUsage.vue @@ -91,7 +91,7 @@ export default { } } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/project/AccountsTab.vue b/ui/src/views/project/AccountsTab.vue index 8c986c5f393b..ed757354b3a3 100644 --- a/ui/src/views/project/AccountsTab.vue +++ b/ui/src/views/project/AccountsTab.vue @@ -156,11 +156,9 @@ export default { this.page = 1 this.pageSize = 10 this.itemCount = 0 - }, - inject: ['parentFetchData'], - mounted () { this.fetchData() }, + inject: ['parentFetchData'], watch: { resource (newItem, oldItem) { if (!newItem || !newItem.id) { diff --git a/ui/src/views/project/AddAccountOrUserToProject.vue b/ui/src/views/project/AddAccountOrUserToProject.vue index dcd0ba91dec5..0a20e8d43cfa 100644 --- a/ui/src/views/project/AddAccountOrUserToProject.vue +++ b/ui/src/views/project/AddAccountOrUserToProject.vue @@ -178,7 +178,7 @@ export default { } } }, - mounted () { + created () { this.fetchData() }, beforeCreate () { diff --git a/ui/src/views/project/InvitationsTemplate.vue b/ui/src/views/project/InvitationsTemplate.vue index b640457e80d0..a935ddba58ae 100644 --- a/ui/src/views/project/InvitationsTemplate.vue +++ b/ui/src/views/project/InvitationsTemplate.vue @@ -173,8 +173,6 @@ export default { scopedSlots: { customRender: 'user' } }) } - }, - mounted () { this.fetchData() }, methods: { diff --git a/ui/src/views/storage/AttachVolume.vue b/ui/src/views/storage/AttachVolume.vue index 43ca3cd85230..d97863792229 100644 --- a/ui/src/views/storage/AttachVolume.vue +++ b/ui/src/views/storage/AttachVolume.vue @@ -67,7 +67,7 @@ export default { this.apiParams[param.name] = param }) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/storage/CreateSnapshotFromVMSnapshot.vue b/ui/src/views/storage/CreateSnapshotFromVMSnapshot.vue index 93d2e2979051..5d969a5358a1 100644 --- a/ui/src/views/storage/CreateSnapshotFromVMSnapshot.vue +++ b/ui/src/views/storage/CreateSnapshotFromVMSnapshot.vue @@ -70,7 +70,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/storage/CreateVolume.vue b/ui/src/views/storage/CreateVolume.vue index ef22b07ef761..ea0a125b1598 100644 --- a/ui/src/views/storage/CreateVolume.vue +++ b/ui/src/views/storage/CreateVolume.vue @@ -119,7 +119,7 @@ export default { this.apiParams[param.name] = param }) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/storage/FormSchedule.vue b/ui/src/views/storage/FormSchedule.vue index 603ec61539d9..a054f0dc89bb 100644 --- a/ui/src/views/storage/FormSchedule.vue +++ b/ui/src/views/storage/FormSchedule.vue @@ -237,7 +237,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.volumeId = this.resource.id this.fetchTimeZone() }, diff --git a/ui/src/views/storage/MigrateVolume.vue b/ui/src/views/storage/MigrateVolume.vue index 88a8266dd501..dc1493f1aa63 100644 --- a/ui/src/views/storage/MigrateVolume.vue +++ b/ui/src/views/storage/MigrateVolume.vue @@ -82,7 +82,7 @@ export default { selectedDiskOffering: null } }, - mounted () { + created () { this.fetchStoragePools() this.resource.virtualmachineid && this.fetchDiskOfferings() }, diff --git a/ui/src/views/storage/RecurringSnapshotVolume.vue b/ui/src/views/storage/RecurringSnapshotVolume.vue index 113cc3518495..7f4bd5de0293 100644 --- a/ui/src/views/storage/RecurringSnapshotVolume.vue +++ b/ui/src/views/storage/RecurringSnapshotVolume.vue @@ -61,7 +61,7 @@ export default { dataSource: [] } }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/storage/ResizeVolume.vue b/ui/src/views/storage/ResizeVolume.vue index b30514a0fcb9..000ae1dffd98 100644 --- a/ui/src/views/storage/ResizeVolume.vue +++ b/ui/src/views/storage/ResizeVolume.vue @@ -74,7 +74,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, methods: { diff --git a/ui/src/views/storage/RestoreAttachBackupVolume.vue b/ui/src/views/storage/RestoreAttachBackupVolume.vue index d56b75db8e67..47effed85023 100644 --- a/ui/src/views/storage/RestoreAttachBackupVolume.vue +++ b/ui/src/views/storage/RestoreAttachBackupVolume.vue @@ -86,7 +86,7 @@ export default { beforeCreate () { this.form = this.$form.createForm(this) }, - mounted () { + created () { this.fetchData() }, inject: ['parentFetchData'], diff --git a/ui/src/views/storage/UploadLocalVolume.vue b/ui/src/views/storage/UploadLocalVolume.vue index 66633db6816b..f95156202ee5 100644 --- a/ui/src/views/storage/UploadLocalVolume.vue +++ b/ui/src/views/storage/UploadLocalVolume.vue @@ -147,7 +147,7 @@ export default { this.apiParams[param.name] = param }) }, - mounted () { + created () { this.listZones() }, methods: { From d475f60c8444e3d8835c9d4cfc013161166b0ffa Mon Sep 17 00:00:00 2001 From: utchoang Date: Wed, 24 Mar 2021 16:11:17 +0700 Subject: [PATCH 3/3] revert the deleted function --- ui/src/views/infra/network/EditTrafficLabel.vue | 1 + ui/src/views/offering/ImportBackupOffering.vue | 1 + 2 files changed, 2 insertions(+) diff --git a/ui/src/views/infra/network/EditTrafficLabel.vue b/ui/src/views/infra/network/EditTrafficLabel.vue index d9e76119e38c..99b59e495131 100644 --- a/ui/src/views/infra/network/EditTrafficLabel.vue +++ b/ui/src/views/infra/network/EditTrafficLabel.vue @@ -143,6 +143,7 @@ export default { }) } }, + inject: ['parentFetchData'], created () { this.fetchData() }, diff --git a/ui/src/views/offering/ImportBackupOffering.vue b/ui/src/views/offering/ImportBackupOffering.vue index b729cd7e38a0..9de4b01ad244 100644 --- a/ui/src/views/offering/ImportBackupOffering.vue +++ b/ui/src/views/offering/ImportBackupOffering.vue @@ -131,6 +131,7 @@ export default { created () { this.fetchData() }, + inject: ['parentFetchData'], methods: { fetchData () { this.fetchZone()