From ae50e118888bc5d211cb0758cc50881d316aea0a Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Wed, 12 Feb 2020 15:15:07 +0530 Subject: [PATCH] network: IP Address and Router Tabs (#152) Guest network - IP Address and Router Tabs Signed-off-by: Rohit Yadav Co-authored-by: Rohit Yadav --- ui/src/config/section/network.js | 20 +- ui/src/locales/en.json | 1 + ui/src/views/network/IpAddressesTab.vue | 232 +++++++++++++++++++ ui/src/views/network/RoutersTab.vue | 151 +++++++++++++ ui/src/views/network/VpcTab.vue | 284 +++++------------------- 5 files changed, 451 insertions(+), 237 deletions(-) create mode 100644 ui/src/views/network/IpAddressesTab.vue create mode 100644 ui/src/views/network/RoutersTab.vue diff --git a/ui/src/config/section/network.js b/ui/src/config/section/network.js index bd125086c37..be81e0bb39a 100644 --- a/ui/src/config/section/network.js +++ b/ui/src/config/section/network.js @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +import store from '@/store' + export default { name: 'network', title: 'Network', @@ -29,14 +31,6 @@ export default { columns: ['name', 'state', 'type', 'cidr', 'ip6cidr', 'broadcasturi', 'account', 'zonename'], details: ['name', 'id', 'description', 'type', 'traffictype', 'vpcid', 'vlan', 'broadcasturi', 'cidr', 'ip6cidr', 'netmask', 'gateway', 'ispersistent', 'restartrequired', 'reservediprange', 'redundantrouter', 'networkdomain', 'zonename', 'account', 'domain'], related: [{ - name: 'publicip', - title: 'IP Addresses', - param: 'associatednetworkid' - }, { - name: 'router', - title: 'Routers', - param: 'networkid' - }, { name: 'vm', title: 'Instances', param: 'networkid' @@ -47,7 +41,15 @@ export default { }, { name: 'Egress Rules', component: () => import('@/views/network/EgressConfigure.vue'), - show: () => true + show: (record) => { return record.type === 'Isolated' && 'listEgressFirewallRules' in store.getters.apis } + }, { + name: 'Public IP Addresses', + component: () => import('@/views/network/IpAddressesTab.vue'), + show: (record) => { return record.type === 'Isolated' && 'listPublicIpAddresses' in store.getters.apis } + }, { + name: 'Virtual Routers', + component: () => import('@/views/network/RoutersTab.vue'), + show: (record) => { return (record.type === 'Isolated' || record.type === 'Shared') && 'listRouters' in store.getters.apis } }], actions: [ { diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json index d66908940a9..82988b6e474 100644 --- a/ui/src/locales/en.json +++ b/ui/src/locales/en.json @@ -2,6 +2,7 @@ "Accounts": "Accounts", "Affinity Groups": "Affinity Groups", "Alerts": "Alerts", +"allocated": "Allocated", "cancel": "Cancel", "CPU Sockets": "CPU Sockets", "Cloudian Storage": "Cloudian Storage", diff --git a/ui/src/views/network/IpAddressesTab.vue b/ui/src/views/network/IpAddressesTab.vue new file mode 100644 index 00000000000..c5ba910850f --- /dev/null +++ b/ui/src/views/network/IpAddressesTab.vue @@ -0,0 +1,232 @@ +// 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. + + + + + diff --git a/ui/src/views/network/RoutersTab.vue b/ui/src/views/network/RoutersTab.vue new file mode 100644 index 00000000000..831ff70526a --- /dev/null +++ b/ui/src/views/network/RoutersTab.vue @@ -0,0 +1,151 @@ +// 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. + + + + + diff --git a/ui/src/views/network/VpcTab.vue b/ui/src/views/network/VpcTab.vue index 02da039b100..2b4d325b1b9 100644 --- a/ui/src/views/network/VpcTab.vue +++ b/ui/src/views/network/VpcTab.vue @@ -28,6 +28,56 @@ + + + + + + Add Network ACL List + + + + + + + + + + + + + + + + - - Acquire New IP - - - - - - - - - - - Add Network ACL List - - - - - - - - - - - - - - - - - - -
-
-
-
{{ $t('name') }}
-
- - {{ item.name }} - -
-
-
-
{{ $t('state') }}
-
-
-
-
{{ $t('publicip') }}
-
{{ item.publicip }}
-
-
-
{{ $t('redundantrouter') }}
-
{{ item.isredundantrouter }}
-
-
-
{{ $t('redundantstate') }}
-
{{ item.redundantstate }}
-
-
-
{{ $t('hostname') }}
-
- - {{ item.hostname }} - -
-
-
-
-
-
+
@@ -324,16 +245,20 @@