ui: Moves fetchdata() to the created() (#4811)

This PR to move fetchData() to created() insteadof mount()
This commit is contained in:
Hoang Nguyen 2021-04-05 15:58:00 +07:00 committed by GitHub
parent 43257f8300
commit 4dcd9a2329
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
113 changed files with 161 additions and 214 deletions

View File

@ -58,7 +58,7 @@ export default {
loading: false loading: false
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -57,7 +57,7 @@ export default {
loading: false loading: false
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -64,7 +64,7 @@ export default {
this.domainError = this.error this.domainError = this.error
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -150,7 +150,7 @@ export default {
this.updateResource(newItem) this.updateResource(newItem)
} }
}, },
mounted () { created () {
this.updateResource(this.resource) this.updateResource(this.resource)
}, },
methods: { methods: {

View File

@ -143,7 +143,7 @@ export default {
} }
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -73,7 +73,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -120,7 +120,7 @@ export default {
this.scopeKey = '' this.scopeKey = ''
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -424,8 +424,7 @@ export default {
eventBus.$on('exec-action', (action, isGroupAction) => { eventBus.$on('exec-action', (action, isGroupAction) => {
this.execAction(action, isGroupAction) this.execAction(action, isGroupAction)
}) })
},
mounted () {
if (this.device === 'desktop') { if (this.device === 'desktop') {
this.pageSize = 20 this.pageSize = 20
} }

View File

@ -134,8 +134,6 @@ export default {
} }
}, },
created () { created () {
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -119,7 +119,7 @@ export default {
loading: false loading: false
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -64,7 +64,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -63,7 +63,7 @@ export default {
closeSchedule: this.closeAction closeSchedule: this.closeAction
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -99,7 +99,7 @@ export default {
loading: false loading: false
} }
}, },
mounted () { created () {
for (const group of this.resource.affinitygroup) { for (const group of this.resource.affinitygroup) {
this.selectedRowKeys.push(group.id) this.selectedRowKeys.push(group.id)
} }

View File

@ -361,8 +361,6 @@ export default {
name: '' name: ''
} }
] ]
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -113,8 +113,6 @@ export default {
name: '' name: ''
} }
] ]
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -109,7 +109,7 @@ export default {
this.apiParams[param.name] = param this.apiParams[param.name] = param
}) })
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -1109,8 +1109,7 @@ export default {
this.form.getFieldDecorator('cpunumber', { initialValue: undefined, preserve: true }) this.form.getFieldDecorator('cpunumber', { initialValue: undefined, preserve: true })
this.form.getFieldDecorator('cpuSpeed', { initialValue: undefined, preserve: true }) this.form.getFieldDecorator('cpuSpeed', { initialValue: undefined, preserve: true })
this.form.getFieldDecorator('memory', { 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.dataPreFill = this.preFillContent && Object.keys(this.preFillContent).length > 0 ? this.preFillContent : {}
this.fetchData() this.fetchData()
}, },

View File

@ -88,7 +88,7 @@ export default {
this.apiParams[param.name] = param this.apiParams[param.name] = param
}) })
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -203,6 +203,7 @@ export default {
if (!this.isAdmin()) { if (!this.isAdmin()) {
this.vmColumns = this.vmColumns.filter(x => x.dataIndex !== 'instancename') this.vmColumns = this.vmColumns.filter(x => x.dataIndex !== 'instancename')
} }
this.handleFetchData()
}, },
watch: { watch: {
resource (newData, oldData) { resource (newData, oldData) {
@ -220,7 +221,6 @@ export default {
} }
}, },
mounted () { mounted () {
this.handleFetchData()
this.setCurrentTab() this.setCurrentTab()
}, },
methods: { methods: {

View File

@ -132,7 +132,7 @@ export default {
] ]
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -110,8 +110,6 @@ export default {
}, },
created () { created () {
this.originalSize = !this.isObjectEmpty(this.resource) ? this.resource.size : 1 this.originalSize = !this.isObjectEmpty(this.resource) ? this.resource.size : 1
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -84,7 +84,7 @@ export default {
memoryKey: 'details[0].memory' memoryKey: 'details[0].memory'
} }
}, },
mounted () { created () {
this.fetchData({ this.fetchData({
keyword: '', keyword: '',
pageSize: 10, pageSize: 10,

View File

@ -149,7 +149,7 @@ export default {
this.apiParams[param.name] = param this.apiParams[param.name] = param
}) })
}, },
mounted () { created () {
if (this.$store.getters.userInfo.roletype === 'Admin') { if (this.$store.getters.userInfo.roletype === 'Admin') {
this.fetchPods() this.fetchPods()
this.fetchClusters() this.fetchClusters()

View File

@ -90,8 +90,6 @@ export default {
}) })
}, },
created () { created () {
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -153,7 +153,7 @@ export default {
} }
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {
@ -163,11 +163,6 @@ export default {
} }
} }
}, },
created () {
setTimeout(() => {
// to do after initial timeout
}, 1000)
},
methods: { methods: {
getStatus (value) { getStatus (value) {
if (value > 85) { if (value > 85) {

View File

@ -55,8 +55,10 @@ export default {
showOnboarding: false showOnboarding: false
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
},
mounted () {
this.showCapacityDashboard = Object.prototype.hasOwnProperty.call(store.getters.apis, 'listCapacity') this.showCapacityDashboard = Object.prototype.hasOwnProperty.call(store.getters.apis, 'listCapacity')
this.project = false this.project = false
if (store.getters.project && store.getters.project.id) { if (store.getters.project && store.getters.project.id) {

View File

@ -131,7 +131,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.project = store.getters.project this.project = store.getters.project
this.fetchData() this.fetchData()
this.$store.watch( this.$store.watch(

View File

@ -257,7 +257,7 @@ export default {
}) })
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -234,8 +234,6 @@ export default {
} }
] ]
this.selectedFilter = this.filters[0].id this.selectedFilter = this.filters[0].id
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -229,8 +229,6 @@ export default {
this.apiConfig.params.forEach(param => { this.apiConfig.params.forEach(param => {
this.apiParams[param.name] = param this.apiParams[param.name] = param
}) })
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -66,7 +66,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -132,7 +132,7 @@ export default {
loading: false loading: false
} }
}, },
mounted () { created () {
this.fetchRoles() this.fetchRoles()
}, },
beforeCreate () { beforeCreate () {

View File

@ -165,8 +165,6 @@ export default {
break break
} }
} }
},
mounted () {
if (this.action.dataView && this.action.icon === 'edit') { if (this.action.dataView && this.action.icon === 'edit') {
this.fillEditFormFieldValues() this.fillEditFormFieldValues()
} }

View File

@ -125,15 +125,15 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () {
this.fetchData()
},
beforeRouteUpdate (to, from, next) { beforeRouteUpdate (to, from, next) {
next() next()
}, },
beforeRouteLeave (to, from, next) { beforeRouteLeave (to, from, next) {
next() next()
}, },
created () {
this.fetchData()
},
watch: { watch: {
'$route' (to, from) { '$route' (to, from) {
if (to.fullPath !== from.fullPath && !to.fullPath.includes('action/')) { if (to.fullPath !== from.fullPath && !to.fullPath.includes('action/')) {

View File

@ -137,7 +137,7 @@ export default {
this.apiParams[param.name] = param this.apiParams[param.name] = param
}) })
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -144,7 +144,7 @@ export default {
apis: [] apis: []
} }
}, },
mounted () { created () {
this.apis = Object.keys(this.$store.getters.apis).sort((a, b) => a.localeCompare(b)) this.apis = Object.keys(this.$store.getters.apis).sort((a, b) => a.localeCompare(b))
this.fetchData() this.fetchData()
}, },

View File

@ -140,8 +140,6 @@ export default {
} }
] ]
this.detailColumn = ['name', 'certificate', 'certchain'] this.detailColumn = ['name', 'certificate', 'certchain']
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -190,8 +190,6 @@ export default {
name: this.$t('label.all.zone') name: this.$t('label.all.zone')
} }
] ]
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -191,8 +191,6 @@ export default {
(userInfo.account !== this.resource.account || userInfo.domain !== this.resource.domain)) { (userInfo.account !== this.resource.account || userInfo.domain !== this.resource.domain)) {
this.columns = this.columns.filter(col => { return col.dataIndex !== 'status' }) this.columns = this.columns.filter(col => { return col.dataIndex !== 'status' })
} }
},
mounted () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -411,8 +411,6 @@ export default {
this.$set(this.format, 'opts', []) this.$set(this.format, 'opts', [])
this.$set(this.osTypes, 'loading', false) this.$set(this.osTypes, 'loading', false)
this.$set(this.osTypes, 'opts', []) this.$set(this.osTypes, 'opts', [])
},
mounted () {
this.fetchData() this.fetchData()
}, },
computed: { computed: {

View File

@ -204,8 +204,6 @@ export default {
(userInfo.account !== this.resource.account || userInfo.domain !== this.resource.domain)) { (userInfo.account !== this.resource.account || userInfo.domain !== this.resource.domain)) {
this.columns = this.columns.filter(col => { return col.dataIndex !== 'status' }) this.columns = this.columns.filter(col => { return col.dataIndex !== 'status' })
} }
},
mounted () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -88,8 +88,6 @@ export default {
name: this.$t('state.disabled') name: this.$t('state.disabled')
} }
] ]
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -145,7 +145,7 @@ export default {
) : this.projects ) : this.projects
} }
}, },
mounted () { created () {
this.isImageTypeIso = this.$route.meta.name === 'iso' this.isImageTypeIso = this.$route.meta.name === 'iso'
this.fetchData() this.fetchData()
}, },

View File

@ -343,7 +343,7 @@ export default {
this.apiParams[param.name] = param this.apiParams[param.name] = param
}) })
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -181,7 +181,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -150,7 +150,7 @@ export default {
} }
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -73,7 +73,7 @@ export default {
columns: [] columns: []
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -171,7 +171,7 @@ export default {
} }
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -125,7 +125,7 @@ export default {
fetchLoading: false fetchLoading: false
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -221,7 +221,7 @@ export default {
this.apiParams[param.name] = param this.apiParams[param.name] = param
}) })
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -99,7 +99,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.fetchImageStores() this.fetchImageStores()
}, },
methods: { methods: {

View File

@ -147,7 +147,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -61,7 +61,7 @@ export default {
resourcesList: [] resourcesList: []
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -184,7 +184,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -145,7 +145,7 @@ export default {
} }
}, },
inject: ['parentFetchData'], inject: ['parentFetchData'],
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -40,7 +40,7 @@ export default {
fetchLoading: false fetchLoading: false
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -129,7 +129,7 @@ export default {
] ]
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -192,7 +192,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -271,7 +271,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -180,7 +180,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -35,7 +35,8 @@
:itemNsp="item" :itemNsp="item"
:nsp="nsps[item.title]" :nsp="nsps[item.title]"
:resourceId="resource.id" :resourceId="resource.id"
:zoneId="resource.zoneid"/> :zoneId="resource.zoneid"
:tabKey="tabKey"/>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-spin> </a-spin>
@ -1107,7 +1108,7 @@ export default {
beforeCreate () { beforeCreate () {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {
@ -1128,6 +1129,9 @@ export default {
}, },
methods: { methods: {
fetchData () { fetchData () {
if (!this.resource || !('id' in this.resource)) {
return
}
this.fetchServiceProvider() this.fetchServiceProvider()
}, },
fetchServiceProvider (name) { fetchServiceProvider (name) {

View File

@ -89,7 +89,7 @@ export default {
fetchLoading: false fetchLoading: false
} }
}, },
mounted () { created () {
if (this.resource.id) { if (this.resource.id) {
this.fetchData() this.fetchData()
} }

View File

@ -103,45 +103,38 @@ export default {
}, },
inject: ['provideSetNsp', 'provideExecuteAction'], inject: ['provideSetNsp', 'provideExecuteAction'],
watch: { watch: {
loading (newValue, oldValue) { nsp () {
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()
}
}
},
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() this.fetchData()
} }
}, },
created () {
if (!this.resourceId || !this.zoneId) {
return
}
this.fetchData()
},
methods: { methods: {
async fetchData () { async fetchData () {
if (!this.provider.lists || this.provider.lists.length === 0) { if (!this.nsp || Object.keys(this.nsp).length === 0) {
return 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) { async fetchOptions (args) {
if (!args || Object.keys(args).length === 0) { if (!args || Object.keys(args).length === 0) {

View File

@ -131,7 +131,7 @@ export default {
this.updateResource(newItem) this.updateResource(newItem)
} }
}, },
mounted () { created () {
this.updateResource(this.resource) this.updateResource(this.resource)
}, },
methods: { methods: {

View File

@ -85,7 +85,7 @@ export default {
fetchLoading: false fetchLoading: false
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -93,7 +93,7 @@ export default {
fetchLoading: false fetchLoading: false
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -699,7 +699,7 @@ export default {
options: ['primaryStorageScope', 'primaryStorageProtocol', 'provider'] options: ['primaryStorageScope', 'primaryStorageProtocol', 'provider']
} }
}, },
mounted () { created () {
this.currentStep = this.prefillContent.resourceStep ? this.prefillContent.resourceStep : 0 this.currentStep = this.prefillContent.resourceStep ? this.prefillContent.resourceStep : 0
if (this.stepChild && this.stepChild !== '') { if (this.stepChild && this.stepChild !== '') {
this.currentStep = this.steps.findIndex(item => item.fromKey === this.stepChild) this.currentStep = this.steps.findIndex(item => item.fromKey === this.stepChild)

View File

@ -369,7 +369,7 @@ export default {
] ]
} }
}, },
mounted () { created () {
this.physicalNetworks = this.prefillContent.physicalNetworks this.physicalNetworks = this.prefillContent.physicalNetworks
this.steps = this.filteredSteps() this.steps = this.filteredSteps()
this.currentStep = this.prefillContent.networkStep ? this.prefillContent.networkStep : 0 this.currentStep = this.prefillContent.networkStep ? this.prefillContent.networkStep : 0

View File

@ -394,6 +394,8 @@ export default {
this.$emit('fieldsChanged', changedFields) this.$emit('fieldsChanged', changedFields)
} }
}) })
this.fetchData()
}, },
mounted () { mounted () {
this.form.setFieldsValue({ this.form.setFieldsValue({
@ -414,41 +416,6 @@ export default {
localstorageenabled: this.localstorageenabled, localstorageenabled: this.localstorageenabled,
localstorageenabledforsystemvm: this.localstorageenabledforsystemvm 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: { computed: {
isAdvancedZone () { isAdvancedZone () {
@ -532,6 +499,42 @@ export default {
} }
}, },
methods: { 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) { handleSubmit (e) {
e.preventDefault() e.preventDefault()
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {

View File

@ -229,7 +229,7 @@ export default {
ruleFormMode: 'edit' ruleFormMode: 'edit'
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -303,8 +303,6 @@ export default {
name: ' ' name: ' '
} }
] ]
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -275,8 +275,6 @@ export default {
name: ' ' name: ' '
} }
] ]
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -475,8 +475,6 @@ export default {
}) })
}, },
created () { created () {
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -147,7 +147,7 @@ export default {
this.apiParams[param.name] = param this.apiParams[param.name] = param
}) })
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -156,7 +156,7 @@ export default {
] ]
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
filters: { filters: {

View File

@ -155,7 +155,7 @@ export default {
pageSize: 10 pageSize: 10
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -198,7 +198,7 @@ export default {
] ]
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
filters: { filters: {

View File

@ -147,7 +147,7 @@ export default {
] ]
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -256,7 +256,7 @@ export default {
return val.toUpperCase() return val.toUpperCase()
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -119,7 +119,7 @@ export default {
fetchLoading: false fetchLoading: false
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -97,7 +97,7 @@ export default {
] ]
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -189,7 +189,7 @@ export default {
listPublicIpAddress: [] listPublicIpAddress: []
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -521,7 +521,7 @@ export default {
searchQuery: null searchQuery: null
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -367,7 +367,7 @@ export default {
searchQuery: null searchQuery: null
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -85,7 +85,7 @@ export default {
} }
} }
}, },
mounted () { created () {
if ('id' in this.resource) { if ('id' in this.resource) {
this.fetchData() this.fetchData()
} }

View File

@ -103,7 +103,7 @@ export default {
] ]
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -101,7 +101,7 @@ export default {
newRoute: null newRoute: null
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -408,7 +408,7 @@ export default {
this.setCurrentTab() this.setCurrentTab()
} }
}, },
mounted () { created () {
this.handleFetchData() this.handleFetchData()
this.setCurrentTab() this.setCurrentTab()
}, },

View File

@ -373,7 +373,7 @@ export default {
} }
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -86,7 +86,7 @@ export default {
} }
}, },
inject: ['parentFetchData', 'parentToggleLoading'], inject: ['parentFetchData', 'parentToggleLoading'],
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

View File

@ -819,8 +819,6 @@ export default {
name: this.$t('label.all.zone') name: this.$t('label.all.zone')
} }
] ]
},
mounted () {
if (this.$route.meta.name === 'systemoffering') { if (this.$route.meta.name === 'systemoffering') {
this.isSystem = true this.isSystem = true
} }

View File

@ -484,8 +484,6 @@ export default {
name: this.$t('label.all.zone') name: this.$t('label.all.zone')
} }
] ]
},
mounted () {
this.fetchData() this.fetchData()
this.isPublic = this.isAdmin() this.isPublic = this.isAdmin()
}, },

View File

@ -525,8 +525,6 @@ export default {
name: this.$t('label.all.zone') name: this.$t('label.all.zone')
} }
] ]
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -205,8 +205,6 @@ export default {
name: this.$t('label.all.zone') name: this.$t('label.all.zone')
} }
] ]
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -129,7 +129,7 @@ export default {
this.apiParams[param.name] = param this.apiParams[param.name] = param
}) })
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
inject: ['parentFetchData'], inject: ['parentFetchData'],

View File

@ -148,8 +148,6 @@ export default {
name: this.$t('label.all.zone') name: this.$t('label.all.zone')
} }
] ]
},
mounted () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -34,7 +34,7 @@ import { api } from '@/api'
export default { export default {
name: 'CloudianPlugin', name: 'CloudianPlugin',
mounted () { created () {
this.doSso() this.doSso()
}, },
data () { data () {

View File

@ -75,7 +75,7 @@ export default {
loading: false loading: false
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -93,7 +93,7 @@ export default {
} }
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
methods: { methods: {

View File

@ -51,7 +51,7 @@ export default {
pattern: 'YYYY-MM-DD' pattern: 'YYYY-MM-DD'
} }
}, },
mounted () { created () {
this.fetchData() this.fetchData()
}, },
watch: { watch: {

Some files were not shown because too many files have changed in this diff Show More