Skip to content

Commit d347a6a

Browse files
committed
add steps to zone wizard for adding netris controller and public traffic
1 parent 7239568 commit d347a6a

File tree

5 files changed

+91
-12
lines changed

5 files changed

+91
-12
lines changed

ui/public/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,7 @@
17701770
"label.public.ips": "Public IP addresses",
17711771
"label.public.lb": "Public LB",
17721772
"label.public.traffic": "Public traffic",
1773+
"label.public.traffic.netris": "Netris Public traffic",
17731774
"label.public.traffic.nsx": "NSX Public traffic",
17741775
"label.publicinterface": "Public interface",
17751776
"label.publicip": "IP address",
@@ -2233,6 +2234,7 @@
22332234
"label.systemvm": "System VM",
22342235
"label.systemvmtype": "System VM type",
22352236
"label.tag": "Tag",
2237+
"label.tag.netris": "netris",
22362238
"label.tag.nsx": "nsx",
22372239
"label.tag.key": "Tag key",
22382240
"label.tag.systemvm": "systemvm",

ui/src/views/infra/zone/IpAddressRangeForm.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@
3434
<template v-if="column.key === 'gateway'">
3535
<div> {{ record.gateway }}</div>
3636
<div v-if="record.fornsx"> <a-tag color="processing"> {{ $t('label.tag.nsx') }} </a-tag> </div>
37-
<div v-else-if="isNsxZone"> <a-tag color="processing"> {{ $t('label.tag.systemvm') }} </a-tag> </div>
37+
<div v-else-if="record.fornetris"> <a-tag color="processing"> {{ $t('label.tag.netris') }} </a-tag> </div>
38+
<div v-else-if="isNsxZone || isNetrisZone"> <a-tag color="processing"> {{ $t('label.tag.systemvm') }} </a-tag> </div>
3839
</template>
3940
<template v-if="column.key === 'actions'">
4041
<tooltip-button
4142
:tooltip="$t('label.delete')"
42-
:disabled="(record.fornsx && !forNsx) || (!record.fornsx && forNsx)"
43+
:disabled="((record.fornsx && !forNsx) || (!record.fornsx && forNsx)) || ((record.fornetris && !forNetris) || (!record.fornetris && forNetris)) "
4344
type="primary"
4445
:danger="true"
4546
icon="delete-outlined"
@@ -76,7 +77,7 @@
7677
<a-form-item name="vlan" ref="vlan">
7778
<a-input
7879
v-model:value="form.vlan"
79-
:disabled="forNsx"
80+
:disabled="forNsx || forNetris"
8081
:placeholder="$t('label.vlan')"
8182
/>
8283
</a-form-item>
@@ -175,6 +176,14 @@ export default {
175176
isNsxZone: {
176177
type: Boolean,
177178
default: false
179+
},
180+
forNetris: {
181+
type: Boolean,
182+
default: false
183+
},
184+
isNetrisZone: {
185+
type: Boolean,
186+
default: false
178187
}
179188
},
180189
data () {
@@ -271,7 +280,8 @@ export default {
271280
startIp: values.startIp,
272281
endIp: values.endIp,
273282
fornsx: this.forNsx,
274-
forsystemvms: this.isNsxZone && !this.forNsx
283+
fornetris: this.forNetris,
284+
forsystemvms: (this.isNsxZone && !this.forNsx) || (this.isNetrisZone && !this.forNetris)
275285
})
276286
this.formRef.value.resetFields()
277287
}).catch(error => {

ui/src/views/infra/zone/ZoneWizard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export default {
139139
{
140140
name: 'network',
141141
title: 'label.network',
142-
step: ['physicalNetwork', 'nsx', 'tungsten', 'netscaler', 'pod', 'guestTraffic', 'storageTraffic', 'publicTraffic', 'nsxPublicTraffic'],
142+
step: ['physicalNetwork', 'nsx', 'netris', 'tungsten', 'netscaler', 'pod', 'guestTraffic', 'storageTraffic', 'publicTraffic', 'nsxPublicTraffic', 'netrisPublixTraffic'],
143143
description: this.$t('message.network.description'),
144144
hint: this.$t('message.network.hint')
145145
},

ui/src/views/infra/zone/ZoneWizardLaunchZone.vue

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export default {
125125
launching: 'message.please.wait.while.zone.is.being.created'
126126
},
127127
nsx: false,
128+
netris: false,
128129
isLaunchZone: false,
129130
processStatus: null,
130131
messageError: '',
@@ -218,6 +219,7 @@ export default {
218219
const index = this.steps.findIndex(step => step.index === this.currentStep)
219220
this.steps[index].status = status
220221
this.nsx = false
222+
this.netris = false
221223
},
222224
handleBack (e) {
223225
this.$emit('backPressed')
@@ -487,7 +489,10 @@ export default {
487489
if (physicalNetwork.isolationMethod === 'NSX' &&
488490
physicalNetwork.traffics.findIndex(traffic => traffic.type === 'public' || traffic.type === 'guest') > -1) {
489491
this.stepData.isNsxZone = true
490-
this.stepData.tungstenPhysicalNetworkId = physicalNetworkReturned.id
492+
}
493+
if (physicalNetwork.isolationMethod === 'NETRIS' &&
494+
physicalNetwork.traffics.findIndex(traffic => traffic.type === 'public' || traffic.type === 'guest') > -1) {
495+
this.stepData.isNetrisZone = true
491496
}
492497
} else {
493498
this.stepData.physicalNetworkReturned = this.stepData.physicalNetworkItem['createPhysicalNetwork' + index]
@@ -909,6 +914,8 @@ export default {
909914
this.addStep(message, trafficType)
910915
if (trafficType === 'nsxPublicTraffic') {
911916
this.nsx = false
917+
} else if (trafficType === 'netrisPublicTraffic') {
918+
this.netris = false
912919
}
913920
914921
let stopNow = false
@@ -937,7 +944,7 @@ export default {
937944
params.zoneId = this.stepData.zoneReturned.id
938945
if (publicVlanIpRange.vlan && publicVlanIpRange.vlan.length > 0) {
939946
params.vlan = publicVlanIpRange.vlan
940-
} else if (publicVlanIpRange.fornsx) {
947+
} else if (publicVlanIpRange.fornsx) { // TODO: should this be the same for Netris?
941948
params.vlan = null
942949
} else {
943950
params.vlan = 'untagged'
@@ -987,6 +994,8 @@ export default {
987994
await this.stepCreateTungstenFabricPublicNetwork()
988995
} else if (this.stepData.isNsxZone) {
989996
await this.stepAddNsxController()
997+
} else if (this.stepData.isNetrisZone) {
998+
await this.stepAddNetrisController()
990999
} else {
9911000
await this.stepConfigureStorageTraffic()
9921001
}
@@ -1090,6 +1099,35 @@ export default {
10901099
this.setStepStatus(STATUS_FAILED)
10911100
}
10921101
},
1102+
async stepAddNetrisController () {
1103+
this.setStepStatus(STATUS_FINISH)
1104+
this.currentStep++
1105+
this.addStep('message.add.netris.controller', 'netris')
1106+
if (this.stepData.stepMove.includes('netris')) {
1107+
await this.stepConfigureStorageTraffic()
1108+
return
1109+
}
1110+
try {
1111+
if (!this.stepData.stepMove.includes('addNetrisProvider')) {
1112+
const providerParams = {}
1113+
providerParams.name = this.prefillContent?.netrisName || ''
1114+
providerParams.netrisproviderhostname = this.prefillContent?.netrisHostname || ''
1115+
providerParams.netrisproviderport = this.prefillContent?.netrisPort || ''
1116+
providerParams.username = this.prefillContent?.username || ''
1117+
providerParams.password = this.prefillContent?.password || ''
1118+
providerParams.zoneid = this.stepData.zoneReturned.id
1119+
1120+
await this.addNetrisProvider(providerParams)
1121+
this.stepData.stepMove.push('addNetrisController')
1122+
}
1123+
this.stepData.stepMove.push('netris')
1124+
await this.stepConfigureStorageTraffic()
1125+
} catch (e) {
1126+
this.messageError = e
1127+
this.processStatus = STATUS_FAILED
1128+
this.setStepStatus(STATUS_FAILED)
1129+
}
1130+
},
10931131
async stepConfigureStorageTraffic () {
10941132
let targetNetwork = false
10951133
this.prefillContent.physicalNetworks.forEach(physicalNetwork => {
@@ -2247,6 +2285,16 @@ export default {
22472285
})
22482286
})
22492287
},
2288+
addNetrisPovider (args) {
2289+
return new Promise((resolve, reject) => {
2290+
api('addNetrisProvider', {}, 'POST', args).then(json => {
2291+
resolve()
2292+
}).catch(error => {
2293+
const message = error.response.headers['x-description']
2294+
reject(message)
2295+
})
2296+
})
2297+
},
22502298
configTungstenFabricService (args) {
22512299
return new Promise((resolve, reject) => {
22522300
api('configTungstenFabricService', {}, 'POST', args).then(json => {

ui/src/views/infra/zone/ZoneWizardNetworkSetupStep.vue

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
:isFixError="isFixError"
5252
/>
5353
<ip-address-range-form
54-
v-if="steps && ['publicTraffic', 'nsxPublicTraffic'].includes(steps[currentStep].formKey)"
54+
v-if="steps && ['publicTraffic', 'nsxPublicTraffic', 'netrisPublicTraffic'].includes(steps[currentStep].formKey)"
5555
@nextPressed="nextPressed"
5656
@backPressed="handleBack"
5757
@fieldsChanged="fieldsChanged"
@@ -62,6 +62,9 @@
6262
:isFixError="isFixError"
6363
:forNsx="steps[currentStep].formKey === 'nsxPublicTraffic'"
6464
:isNsxZone="isNsxZone"
65+
:forNetris="steps[currentStep].formKey === 'netrisPublicTraffic'"
66+
:isNetrisZone="isNetrisZone"
67+
:provider="providersDetails"
6568
/>
6669

6770
<static-inputs-form
@@ -127,7 +130,7 @@
127130
</div>
128131
<div v-else>
129132
<advanced-guest-traffic-form
130-
v-if="steps && steps[currentStep].formKey === 'guestTraffic' && !isNsxZone"
133+
v-if="steps && steps[currentStep].formKey === 'guestTraffic' && !isNsxZone && !isNetrisZone"
131134
@nextPressed="nextPressed"
132135
@backPressed="handleBack"
133136
@fieldsChanged="fieldsChanged"
@@ -230,7 +233,7 @@ export default {
230233
if (!this.prefillContent.physicalNetworks) {
231234
isNetris = false
232235
} else {
233-
const netrisIdx = this.prefillContent.physicalNetworks.findIndex(network => network.isolationMethod === 'NETRIS')
236+
const netrisIdx = this.prefillContent.physicalNetworks.findIndex(network => network.isolationMethod === 'Netris')
234237
isNetris = netrisIdx > -1
235238
}
236239
return isNetris
@@ -277,11 +280,18 @@ export default {
277280
trafficType: 'public'
278281
})
279282
}
283+
if (this.isNetrisZone) {
284+
steps.push({
285+
title: 'label.public.traffic.netris',
286+
formKey: 'netrisPublicTraffic',
287+
trafficType: 'public'
288+
})
289+
}
280290
steps.push({
281291
title: 'label.pod',
282292
formKey: 'pod'
283293
})
284-
if (!this.isTungstenZone && !this.isNsxZone) {
294+
if (!this.isTungstenZone && !this.isNsxZone && !this.isNetrisZone) {
285295
steps.push({
286296
title: 'label.guest.traffic',
287297
formKey: 'guestTraffic',
@@ -296,6 +306,15 @@ export default {
296306
297307
return steps
298308
},
309+
providersDetails () {
310+
console.log(this.currentStep)
311+
return {
312+
forNsx: this.steps[this.currentStep].formKey === 'nsxPublicTraffic',
313+
isNsxZone: this.isNsxZone,
314+
forNetris: this.steps[this.currentStep].formKey === 'netrisPublicTraffic',
315+
isNetrisZone: this.isNetrisZone
316+
}
317+
},
299318
stepScales () {
300319
if (!this.isMobile() && this.steps.length > 4) {
301320
return { width: 'calc(100% / ' + this.steps.length + ')' }
@@ -622,7 +641,7 @@ export default {
622641
}
623642
this.scrollToStepActive()
624643
if (this.zoneType === 'Basic' ||
625-
(this.zoneType === 'Advanced' && (this.sgEnabled || this.isNsxZone))) {
644+
(this.zoneType === 'Advanced' && (this.sgEnabled || this.isNsxZone || this.isNetrisZone))) {
626645
this.skipGuestTrafficStep = false
627646
} else {
628647
this.fetchConfiguration()

0 commit comments

Comments
 (0)