From f5862043703b42bfc37aa42bdd2b586feec4ec52 Mon Sep 17 00:00:00 2001 From: Ritchie Vincent Date: Tue, 21 Jan 2020 11:04:25 +0000 Subject: [PATCH] network: Static NAT enable form (#119) Add static NAT form for public IP Signed-off-by: Rohit Yadav --- ui/src/components/view/ResourceView.vue | 1 + ui/src/config/section/network.js | 8 +- ui/src/views/network/EnableStaticNat.vue | 277 +++++++++++++++++++++++ 3 files changed, 280 insertions(+), 6 deletions(-) create mode 100644 ui/src/views/network/EnableStaticNat.vue diff --git a/ui/src/components/view/ResourceView.vue b/ui/src/components/view/ResourceView.vue index a1c4bf71f0f..2dc572e625a 100644 --- a/ui/src/components/view/ResourceView.vue +++ b/ui/src/components/view/ResourceView.vue @@ -110,6 +110,7 @@ export default { }, showHideTab (tab) { if ('networkServiceFilter' in tab) { + if (this.resource.virtualmachineid && tab.name !== 'Firewall') return false return this.networkService && this.networkService.service && tab.networkServiceFilter(this.networkService.service) } else if ('show' in tab) { diff --git a/ui/src/config/section/network.js b/ui/src/config/section/network.js index a2a429a937f..e1f57cc94c3 100644 --- a/ui/src/config/section/network.js +++ b/ui/src/config/section/network.js @@ -260,12 +260,8 @@ export default { label: 'Enable Static NAT', dataView: true, show: (record) => { return !record.virtualmachineid && !record.issourcenat }, - args: ['ipaddressid', 'virtualmachineid', 'vmguestip'], - mapping: { - ipaddressid: { - value: (record) => { return record.id } - } - } + popup: true, + component: () => import('@/views/network/EnableStaticNat.vue') }, { api: 'disableStaticNat', diff --git a/ui/src/views/network/EnableStaticNat.vue b/ui/src/views/network/EnableStaticNat.vue new file mode 100644 index 00000000000..30cbb62689f --- /dev/null +++ b/ui/src/views/network/EnableStaticNat.vue @@ -0,0 +1,277 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + +