Skip to content
Open
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
19 changes: 17 additions & 2 deletions ui/src/views/offering/AddNetworkOffering.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="12">
<a-col :md="12" :lg="12">
<a-form-item name="specifyipranges" ref="specifyipranges" v-if="guestType === 'isolated'">
<template #label>
<tooltip-label :title="$t('label.specifyipranges')" :tooltip="apiParams.specifyipranges.description"/>
</template>
<a-switch v-model:checked="form.specifyipranges" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="12">
<a-col :md="12" :lg="12">
<a-form-item name="forvpc" ref="forvpc" v-if="guestType === 'isolated'">
Expand Down Expand Up @@ -681,7 +691,8 @@ export default {
isolation: 'dedicated',
conservemode: true,
availability: 'optional',
egressdefaultpolicy: 'deny',
specifyipranges: false,
egressdefaultpolicy: 'allow',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tonitzpp , i have my doubts about this part of the change. Someone decided that it is better to deny outgoing traffic be default (for UI users) and that seems reasonable to me. No reason to allign UI and API on this I think as API users are usually better versed at hardening their VMs/networks. If allignment is strictly necessary (not to me) I think we should change the API on this point, in another PR. What do you think?

ispublic: this.isPublic,
nsxsupportlb: true,
routingmode: 'static'
Expand Down Expand Up @@ -1043,7 +1054,7 @@ export default {

var keys = Object.keys(values)
const detailsKey = ['promiscuousmode', 'macaddresschanges', 'forgedtransmits', 'maclearning']
const ignoredKeys = [...detailsKey, 'state', 'status', 'allocationstate', 'forvpc', 'lbType', 'specifyvlan', 'ispublic', 'domainid', 'zoneid', 'egressdefaultpolicy', 'isolation', 'supportspublicaccess']
const ignoredKeys = [...detailsKey, 'state', 'status', 'allocationstate', 'forvpc', 'lbType', 'specifyvlan', 'ispublic', 'domainid', 'zoneid', 'egressdefaultpolicy', 'isolation', 'supportspublicaccess', 'specifyipranges']
keys.forEach(function (key, keyIndex) {
if (!ignoredKeys.includes(key) &&
values[key] != null && values[key] !== undefined &&
Expand All @@ -1062,6 +1073,9 @@ export default {
if (values.specifyvlan === true) {
params.specifyvlan = true
}

params.specifyipranges = values.specifyipranges

if (values.ispersistent) {
params.ispersistent = true
} else { // Isolated Network with Non-persistent network
Expand All @@ -1078,6 +1092,7 @@ export default {
}
// Conserve mode is irrelevant on L2 network offerings as there are no resources to conserve, do not pass it, true by default on server side
delete params.conservemode
delete params.specifyipranges
}

if (values.forvpc === true) {
Expand Down