Skip to content
This repository has been archived by the owner on Jan 20, 2021. It is now read-only.

Support for specifying VR IP in shared networks #872

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,8 @@
"label.root.disk.size": "Root disk size (GB)",
"label.rootdiskcontrollertype": "Root disk controller",
"label.rootdiskcontrollertypekvm": "Root disk controller",
"label.routerip": "IPv4 address for Router in Shared Network",
"label.routeripv6": "IPv6 address for Router in Shared Network",
"label.router.health.check.last.updated": "Last updated",
"label.router.health.check.name": "Check name",
"label.router.health.check.success": "Success",
Expand Down
54 changes: 53 additions & 1 deletion src/views/network/CreateSharedNetworkForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,17 @@
v-decorator="['endipv4', {}]"
:placeholder="this.$t('label.endipv4')"/>
</a-form-item>
<a-form-item v-if="isVirtualRouterForAtLeastOneService">
<span slot="label">
{{ $t('label.routerip') }}
<a-tooltip :title="apiParams.routerip.description" v-if="'routerip' in apiParams">
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
</a-tooltip>
</span>
<a-input
v-decorator="['routerip', {}]"
:placeholder="this.$t('label.routerip')"/>
</a-form-item>
<a-form-item>
<span slot="label">
{{ $t('label.ip6gateway') }}
Expand Down Expand Up @@ -376,6 +387,17 @@
v-decorator="['endipv6', {}]"
:placeholder="this.$t('label.endipv6')"/>
</a-form-item>
<a-form-item v-if="isVirtualRouterForAtLeastOneService">
<span slot="label">
{{ $t('label.routeripv6') }}
<a-tooltip :title="apiParams.routeripv6.description" v-if="'routeripv6' in apiParams">
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
</a-tooltip>
</span>
<a-input
v-decorator="['routeripv6', {}]"
:placeholder="this.$t('label.routeripv6')"/>
</a-form-item>
<a-form-item>
<span slot="label">
{{ $t('label.networkdomain') }}
Expand Down Expand Up @@ -457,7 +479,9 @@ export default {
selectedNetworkOffering: {},
projects: [],
projectLoading: false,
selectedProject: {}
selectedProject: {},
isVirtualRouterForAtLeastOneService: false,
selectedServiceProviderMap: {}
}
},
watch: {
Expand Down Expand Up @@ -664,6 +688,25 @@ export default {
},
handleNetworkOfferingChange (networkOffering) {
this.selectedNetworkOffering = networkOffering
this.networkServiceProviderMap(this.selectedNetworkOffering.id)
},
networkServiceProviderMap (id) {
api('listNetworkOfferings', { id: id }).then(json => {
var networkOffering = json.listnetworkofferingsresponse.networkoffering[0]
const services = networkOffering.service
this.selectedServiceProviderMap = {}
for (const svc of services) {
this.selectedServiceProviderMap[svc.name] = svc.provider[0].name
}
var providers = Object.values(this.selectedServiceProviderMap)
this.isVirtualRouterForAtLeastOneService = false
var self = this
providers.forEach(function (prvdr, idx) {
if (prvdr === 'VirtualRouter') {
self.isVirtualRouterForAtLeastOneService = true
}
})
})
},
fetchDomainData () {
const params = {}
Expand Down Expand Up @@ -783,6 +826,11 @@ export default {
if (this.isValidTextValueForKey(values, 'ip4gateway')) {
params.ip6gateway = values.ip6gateway
}

if (this.isValidTextValueForKey(values, 'routerip')) {
params.routerip = values.routerip
}

if (this.isValidTextValueForKey(values, 'ip6cidr')) {
params.ip6cidr = values.ip6cidr
}
Expand All @@ -792,6 +840,10 @@ export default {
if (this.isValidTextValueForKey(values, 'endipv6')) {
params.endipv6 = values.endipv6
}

if (this.isValidTextValueForKey(values, 'routeripv6')) {
params.routeripv6 = values.routeripv6
}
// IPv6 (end)

if (this.isValidTextValueForKey(values, 'networkdomain')) {
Expand Down