Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions ui/src/views/infra/zone/ZoneWizardAddResources.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ export default {
},
computed: {
zoneType () {
return this.prefillContent.zoneType ? this.prefillContent.zoneType.value : null
return this.prefillContent.zoneType?.value || null
},
hypervisor () {
return this.prefillContent.hypervisor ? this.prefillContent.hypervisor.value : null
return this.prefillContent.hypervisor?.value || null
},
localstorageenabled () {
return this.prefillContent?.localstorageenabled?.value || false
Expand All @@ -143,7 +143,7 @@ export default {
},
steps () {
const steps = []
const hypervisor = this.prefillContent.hypervisor ? this.prefillContent.hypervisor.value : null
const hypervisor = this.prefillContent.hypervisor?.value || null
steps.push({
title: 'label.cluster',
fromKey: 'clusterResource',
Expand Down Expand Up @@ -713,7 +713,7 @@ export default {
}
},
created () {
this.currentStep = this.prefillContent.resourceStep ? this.prefillContent.resourceStep : 0
this.currentStep = this.prefillContent.resourceStep?.resourceStep || 0
if (this.stepChild && this.stepChild !== '') {
this.currentStep = this.steps.findIndex(item => item.fromKey === this.stepChild)
}
Expand Down Expand Up @@ -791,7 +791,7 @@ export default {
}
},
fetchScope () {
const hypervisor = this.prefillContent.hypervisor ? this.prefillContent.hypervisor.value : null
const hypervisor = this.prefillContent.hypervisor?.value || null
const scope = []
if (['KVM', 'VMware', 'Hyperv'].includes(hypervisor)) {
scope.push({
Expand All @@ -812,7 +812,7 @@ export default {
this.$forceUpdate()
},
fetchProtocol () {
const hypervisor = this.prefillContent.hypervisor ? this.prefillContent.hypervisor.value : null
const hypervisor = this.prefillContent.hypervisor?.value || null
const protocols = []
if (hypervisor === 'KVM') {
protocols.push({
Expand Down Expand Up @@ -903,7 +903,7 @@ export default {
this.$forceUpdate()
},
async fetchConfigurationSwitch () {
const hypervisor = this.prefillContent.hypervisor ? this.prefillContent.hypervisor.value : null
const hypervisor = this.prefillContent.hypervisor?.value || null
this.$emit('fieldsChanged', { dvSwitchEnabled: { value: false } })
this.$emit('fieldsChanged', { vSwitchEnabled: { value: false } })
if (hypervisor && hypervisor === 'VMware') {
Expand Down
8 changes: 4 additions & 4 deletions ui/src/views/infra/zone/ZoneWizardNetworkSetupStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ export default {
},
computed: {
zoneType () {
return this.prefillContent.zoneType ? this.prefillContent.zoneType.value : null
return this.prefillContent.zoneType?.value || null
},
sgEnabled () {
return this.prefillContent.securityGroupsEnabled ? this.prefillContent.securityGroupsEnabled.value : false
return this.prefillContent.securityGroupsEnabled?.value || false
},
havingNetscaler () {
return this.prefillContent.networkOfferingSelected ? this.prefillContent.networkOfferingSelected.havingNetscaler : false
return this.prefillContent.networkOfferingSelected?.havingNetscaler || false
},
guestTrafficRangeMode () {
return this.zoneType === 'Basic' ||
Expand Down Expand Up @@ -372,7 +372,7 @@ export default {
created () {
this.physicalNetworks = this.prefillContent.physicalNetworks
this.steps = this.filteredSteps()
this.currentStep = this.prefillContent.networkStep ? this.prefillContent.networkStep : 0
this.currentStep = this.prefillContent?.networkStep || 0
if (this.stepChild && this.stepChild !== '') {
this.currentStep = this.steps.findIndex(item => item.formKey === this.stepChild)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ export default {
return this.zoneType === 'Advanced'
},
zoneType () {
return this.prefillContent.zoneType ? this.prefillContent.zoneType.value : null
return this.prefillContent.zoneType?.value || null
},
securityGroupsEnabled () {
return this.isAdvancedZone && (this.prefillContent.securityGroupsEnabled ? this.prefillContent.securityGroupsEnabled.value : false)
return this.isAdvancedZone && (this.prefillContent.securityGroupsEnabled?.value || false)
},
networkOfferingSelected () {
return this.prefillContent.networkOfferingSelected
Expand Down
42 changes: 21 additions & 21 deletions ui/src/views/infra/zone/ZoneWizardZoneDetailsStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ export default {
ipV6Regex: /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i
}),
created () {
this.hypervisors = this.prefillContent.hypervisors ? this.prefillContent.hypervisors : null
this.networkOfferings = this.prefillContent.networkOfferings ? this.prefillContent.networkOfferings : null
this.hypervisors = this.prefillContent.hypervisors?.hypervisors || null
this.networkOfferings = this.prefillContent?.networkOfferings || null
this.form = this.$form.createForm(this, {
onFieldsChange: (_, changedFields) => {
if (changedFields.networkOfferingId && this.prefillContent.networkOfferingSelected) {
Expand Down Expand Up @@ -433,37 +433,37 @@ export default {
return this.zoneType === 'Advanced'
},
zoneType () {
return this.prefillContent.zoneType ? this.prefillContent.zoneType.value : null
return this.prefillContent.zoneType?.value || null
},
securityGroupsEnabled () {
return this.isAdvancedZone && (this.prefillContent.securityGroupsEnabled ? this.prefillContent.securityGroupsEnabled.value : false)
return this.isAdvancedZone && (this.prefillContent.securityGroupsEnabled?.value || false)
},
name () {
return this.prefillContent.name ? this.prefillContent.name.value : null
return this.prefillContent.name?.value || null
},
ipv4Dns1 () {
return this.prefillContent.ipv4Dns1 ? this.prefillContent.ipv4Dns1.value : null
return this.prefillContent.ipv4Dns1?.value || null
},
ipv4Dns2 () {
return this.prefillContent.ipv4Dns2 ? this.prefillContent.ipv4Dns2.value : null
return this.prefillContent.ipv4Dns2?.value || null
},
ipv6Dns1 () {
return this.prefillContent.ipv6Dns1 ? this.prefillContent.ipv6Dns1.value : null
return this.prefillContent.ipv6Dns1?.value || null
},
ipv6Dns2 () {
return this.prefillContent.ipv6Dns2 ? this.prefillContent.ipv6Dns2.value : null
return this.prefillContent.ipv6Dns2?.value || null
},
internalDns1 () {
return this.prefillContent.internalDns1 ? this.prefillContent.internalDns1.value : null
return this.prefillContent.internalDns1?.value || null
},
internalDns2 () {
return this.prefillContent.internalDns2 ? this.prefillContent.internalDns2.value : null
return this.prefillContent.internalDns2?.value || null
},
ipv6Cidr () {
return this.prefillContent.ipv6Cidr ? this.prefillContent.ipv6Cidr.value : null
return this.prefillContent.ipv6Cidr?.value || null
},
ip6gateway () {
return this.prefillContent.ip6gateway ? this.prefillContent.ip6gateway.value : null
return this.prefillContent.ip6gateway?.value || null
},
currentHypervisor () {
if (this.prefillContent.hypervisor) {
Expand All @@ -474,7 +474,7 @@ export default {
return null
},
currentNetworkOfferingId () {
const lastNetworkOfferingId = this.prefillContent.networkOfferingSelected ? this.prefillContent.networkOfferingSelected.id : null
const lastNetworkOfferingId = this.prefillContent.networkOfferingSelected?.id || null
if (this.networkOfferings) {
if (lastNetworkOfferingId !== null && this.networkOfferings[lastNetworkOfferingId]) {
return lastNetworkOfferingId
Expand All @@ -484,29 +484,29 @@ export default {
return null
},
networkDomain () {
return this.prefillContent.networkDomain ? this.prefillContent.networkDomain.value : null
return this.prefillContent.networkDomain?.value || null
},
guestcidraddress () {
return this.prefillContent.guestcidraddress ? this.prefillContent.guestcidraddress.value : '10.1.1.0/24'
return this.prefillContent.guestcidraddress?.value || '10.1.1.0/24'
},
isDedicated () {
return this.prefillContent.isDedicated ? this.prefillContent.isDedicated.value : false
return this.prefillContent.isDedicated?.value || false
},
domain () {
const lastDomainId = this.prefillContent.domainId ? this.prefillContent.domainId.value : null
const lastDomainId = this.prefillContent.domainId?.value || null
if (this.domains !== null && lastDomainId !== null && this.domains[lastDomainId]) {
return lastDomainId
}
return null
},
account () {
return this.prefillContent.account ? this.prefillContent.account.value : null
return this.prefillContent.account?.value || null
},
localstorageenabled () {
return this.prefillContent.localstorageenabled ? this.prefillContent.localstorageenabled.value : false
return this.prefillContent.localstorageenabled?.value || false
},
localstorageenabledforsystemvm () {
return this.prefillContent.localstorageenabledforsystemvm ? this.prefillContent.localstorageenabledforsystemvm.value : false
return this.prefillContent.localstorageenabledforsystemvm?.value || false
}
},
methods: {
Expand Down