add steps to zone wizard for adding netris controller and public traffic

This commit is contained in:
Pearl Dsilva 2024-09-23 15:29:40 -04:00
parent 7239568afc
commit d347a6afb0
5 changed files with 91 additions and 12 deletions

View File

@ -1770,6 +1770,7 @@
"label.public.ips": "Public IP addresses",
"label.public.lb": "Public LB",
"label.public.traffic": "Public traffic",
"label.public.traffic.netris": "Netris Public traffic",
"label.public.traffic.nsx": "NSX Public traffic",
"label.publicinterface": "Public interface",
"label.publicip": "IP address",
@ -2233,6 +2234,7 @@
"label.systemvm": "System VM",
"label.systemvmtype": "System VM type",
"label.tag": "Tag",
"label.tag.netris": "netris",
"label.tag.nsx": "nsx",
"label.tag.key": "Tag key",
"label.tag.systemvm": "systemvm",

View File

@ -34,12 +34,13 @@
<template v-if="column.key === 'gateway'">
<div> {{ record.gateway }}</div>
<div v-if="record.fornsx"> <a-tag color="processing"> {{ $t('label.tag.nsx') }} </a-tag> </div>
<div v-else-if="isNsxZone"> <a-tag color="processing"> {{ $t('label.tag.systemvm') }} </a-tag> </div>
<div v-else-if="record.fornetris"> <a-tag color="processing"> {{ $t('label.tag.netris') }} </a-tag> </div>
<div v-else-if="isNsxZone || isNetrisZone"> <a-tag color="processing"> {{ $t('label.tag.systemvm') }} </a-tag> </div>
</template>
<template v-if="column.key === 'actions'">
<tooltip-button
:tooltip="$t('label.delete')"
:disabled="(record.fornsx && !forNsx) || (!record.fornsx && forNsx)"
:disabled="((record.fornsx && !forNsx) || (!record.fornsx && forNsx)) || ((record.fornetris && !forNetris) || (!record.fornetris && forNetris)) "
type="primary"
:danger="true"
icon="delete-outlined"
@ -76,7 +77,7 @@
<a-form-item name="vlan" ref="vlan">
<a-input
v-model:value="form.vlan"
:disabled="forNsx"
:disabled="forNsx || forNetris"
:placeholder="$t('label.vlan')"
/>
</a-form-item>
@ -175,6 +176,14 @@ export default {
isNsxZone: {
type: Boolean,
default: false
},
forNetris: {
type: Boolean,
default: false
},
isNetrisZone: {
type: Boolean,
default: false
}
},
data () {
@ -271,7 +280,8 @@ export default {
startIp: values.startIp,
endIp: values.endIp,
fornsx: this.forNsx,
forsystemvms: this.isNsxZone && !this.forNsx
fornetris: this.forNetris,
forsystemvms: (this.isNsxZone && !this.forNsx) || (this.isNetrisZone && !this.forNetris)
})
this.formRef.value.resetFields()
}).catch(error => {

View File

@ -139,7 +139,7 @@ export default {
{
name: 'network',
title: 'label.network',
step: ['physicalNetwork', 'nsx', 'tungsten', 'netscaler', 'pod', 'guestTraffic', 'storageTraffic', 'publicTraffic', 'nsxPublicTraffic'],
step: ['physicalNetwork', 'nsx', 'netris', 'tungsten', 'netscaler', 'pod', 'guestTraffic', 'storageTraffic', 'publicTraffic', 'nsxPublicTraffic', 'netrisPublixTraffic'],
description: this.$t('message.network.description'),
hint: this.$t('message.network.hint')
},

View File

@ -125,6 +125,7 @@ export default {
launching: 'message.please.wait.while.zone.is.being.created'
},
nsx: false,
netris: false,
isLaunchZone: false,
processStatus: null,
messageError: '',
@ -218,6 +219,7 @@ export default {
const index = this.steps.findIndex(step => step.index === this.currentStep)
this.steps[index].status = status
this.nsx = false
this.netris = false
},
handleBack (e) {
this.$emit('backPressed')
@ -487,7 +489,10 @@ export default {
if (physicalNetwork.isolationMethod === 'NSX' &&
physicalNetwork.traffics.findIndex(traffic => traffic.type === 'public' || traffic.type === 'guest') > -1) {
this.stepData.isNsxZone = true
this.stepData.tungstenPhysicalNetworkId = physicalNetworkReturned.id
}
if (physicalNetwork.isolationMethod === 'NETRIS' &&
physicalNetwork.traffics.findIndex(traffic => traffic.type === 'public' || traffic.type === 'guest') > -1) {
this.stepData.isNetrisZone = true
}
} else {
this.stepData.physicalNetworkReturned = this.stepData.physicalNetworkItem['createPhysicalNetwork' + index]
@ -909,6 +914,8 @@ export default {
this.addStep(message, trafficType)
if (trafficType === 'nsxPublicTraffic') {
this.nsx = false
} else if (trafficType === 'netrisPublicTraffic') {
this.netris = false
}
let stopNow = false
@ -937,7 +944,7 @@ export default {
params.zoneId = this.stepData.zoneReturned.id
if (publicVlanIpRange.vlan && publicVlanIpRange.vlan.length > 0) {
params.vlan = publicVlanIpRange.vlan
} else if (publicVlanIpRange.fornsx) {
} else if (publicVlanIpRange.fornsx) { // TODO: should this be the same for Netris?
params.vlan = null
} else {
params.vlan = 'untagged'
@ -987,6 +994,8 @@ export default {
await this.stepCreateTungstenFabricPublicNetwork()
} else if (this.stepData.isNsxZone) {
await this.stepAddNsxController()
} else if (this.stepData.isNetrisZone) {
await this.stepAddNetrisController()
} else {
await this.stepConfigureStorageTraffic()
}
@ -1090,6 +1099,35 @@ export default {
this.setStepStatus(STATUS_FAILED)
}
},
async stepAddNetrisController () {
this.setStepStatus(STATUS_FINISH)
this.currentStep++
this.addStep('message.add.netris.controller', 'netris')
if (this.stepData.stepMove.includes('netris')) {
await this.stepConfigureStorageTraffic()
return
}
try {
if (!this.stepData.stepMove.includes('addNetrisProvider')) {
const providerParams = {}
providerParams.name = this.prefillContent?.netrisName || ''
providerParams.netrisproviderhostname = this.prefillContent?.netrisHostname || ''
providerParams.netrisproviderport = this.prefillContent?.netrisPort || ''
providerParams.username = this.prefillContent?.username || ''
providerParams.password = this.prefillContent?.password || ''
providerParams.zoneid = this.stepData.zoneReturned.id
await this.addNetrisProvider(providerParams)
this.stepData.stepMove.push('addNetrisController')
}
this.stepData.stepMove.push('netris')
await this.stepConfigureStorageTraffic()
} catch (e) {
this.messageError = e
this.processStatus = STATUS_FAILED
this.setStepStatus(STATUS_FAILED)
}
},
async stepConfigureStorageTraffic () {
let targetNetwork = false
this.prefillContent.physicalNetworks.forEach(physicalNetwork => {
@ -2247,6 +2285,16 @@ export default {
})
})
},
addNetrisPovider (args) {
return new Promise((resolve, reject) => {
api('addNetrisProvider', {}, 'POST', args).then(json => {
resolve()
}).catch(error => {
const message = error.response.headers['x-description']
reject(message)
})
})
},
configTungstenFabricService (args) {
return new Promise((resolve, reject) => {
api('configTungstenFabricService', {}, 'POST', args).then(json => {

View File

@ -51,7 +51,7 @@
:isFixError="isFixError"
/>
<ip-address-range-form
v-if="steps && ['publicTraffic', 'nsxPublicTraffic'].includes(steps[currentStep].formKey)"
v-if="steps && ['publicTraffic', 'nsxPublicTraffic', 'netrisPublicTraffic'].includes(steps[currentStep].formKey)"
@nextPressed="nextPressed"
@backPressed="handleBack"
@fieldsChanged="fieldsChanged"
@ -62,6 +62,9 @@
:isFixError="isFixError"
:forNsx="steps[currentStep].formKey === 'nsxPublicTraffic'"
:isNsxZone="isNsxZone"
:forNetris="steps[currentStep].formKey === 'netrisPublicTraffic'"
:isNetrisZone="isNetrisZone"
:provider="providersDetails"
/>
<static-inputs-form
@ -127,7 +130,7 @@
</div>
<div v-else>
<advanced-guest-traffic-form
v-if="steps && steps[currentStep].formKey === 'guestTraffic' && !isNsxZone"
v-if="steps && steps[currentStep].formKey === 'guestTraffic' && !isNsxZone && !isNetrisZone"
@nextPressed="nextPressed"
@backPressed="handleBack"
@fieldsChanged="fieldsChanged"
@ -230,7 +233,7 @@ export default {
if (!this.prefillContent.physicalNetworks) {
isNetris = false
} else {
const netrisIdx = this.prefillContent.physicalNetworks.findIndex(network => network.isolationMethod === 'NETRIS')
const netrisIdx = this.prefillContent.physicalNetworks.findIndex(network => network.isolationMethod === 'Netris')
isNetris = netrisIdx > -1
}
return isNetris
@ -277,11 +280,18 @@ export default {
trafficType: 'public'
})
}
if (this.isNetrisZone) {
steps.push({
title: 'label.public.traffic.netris',
formKey: 'netrisPublicTraffic',
trafficType: 'public'
})
}
steps.push({
title: 'label.pod',
formKey: 'pod'
})
if (!this.isTungstenZone && !this.isNsxZone) {
if (!this.isTungstenZone && !this.isNsxZone && !this.isNetrisZone) {
steps.push({
title: 'label.guest.traffic',
formKey: 'guestTraffic',
@ -296,6 +306,15 @@ export default {
return steps
},
providersDetails () {
console.log(this.currentStep)
return {
forNsx: this.steps[this.currentStep].formKey === 'nsxPublicTraffic',
isNsxZone: this.isNsxZone,
forNetris: this.steps[this.currentStep].formKey === 'netrisPublicTraffic',
isNetrisZone: this.isNetrisZone
}
},
stepScales () {
if (!this.isMobile() && this.steps.length > 4) {
return { width: 'calc(100% / ' + this.steps.length + ')' }
@ -622,7 +641,7 @@ export default {
}
this.scrollToStepActive()
if (this.zoneType === 'Basic' ||
(this.zoneType === 'Advanced' && (this.sgEnabled || this.isNsxZone))) {
(this.zoneType === 'Advanced' && (this.sgEnabled || this.isNsxZone || this.isNetrisZone))) {
this.skipGuestTrafficStep = false
} else {
this.fetchConfiguration()