From 9d39bc8de545f5233049150c7fa444c6642bdb99 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Sat, 8 Feb 2020 19:36:16 +0530 Subject: [PATCH] src: ilbvms support Signed-off-by: Rohit Yadav --- ui/src/config/section/infra.js | 2 ++ ui/src/config/section/infra/ilbvms.js | 42 +++++++++++++++++++++++++++ ui/src/config/section/network.js | 16 ++++++++++ ui/src/views/infra/InfraSummary.vue | 2 +- 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 ui/src/config/section/infra/ilbvms.js diff --git a/ui/src/config/section/infra.js b/ui/src/config/section/infra.js index c42cdf6dfbd..dc09f6898d8 100644 --- a/ui/src/config/section/infra.js +++ b/ui/src/config/section/infra.js @@ -25,6 +25,7 @@ import primaryStorages from '@/config/section/infra/primaryStorages' import secondaryStorages from '@/config/section/infra/secondaryStorages' import systemVms from '@/config/section/infra/systemVms' import routers from '@/config/section/infra/routers' +import ilbvms from '@/config/section/infra/ilbvms' export default { name: 'infra', @@ -49,6 +50,7 @@ export default { secondaryStorages, systemVms, routers, + ilbvms, { name: 'cpusocket', title: 'CPU Sockets', diff --git a/ui/src/config/section/infra/ilbvms.js b/ui/src/config/section/infra/ilbvms.js new file mode 100644 index 00000000000..c412ac610be --- /dev/null +++ b/ui/src/config/section/infra/ilbvms.js @@ -0,0 +1,42 @@ +// 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. + +export default { + name: 'ilbvm', + title: 'Internal LB VMs', + icon: 'share-alt', + permission: ['listInternalLoadBalancerVMs'], + columns: ['name', 'state', 'publicip', 'guestnetworkname', 'vpcname', 'version', 'hostname', 'account', 'zonename', 'requiresupgrade'], + details: ['name', 'id', 'version', 'requiresupgrade', 'guestnetworkname', 'vpcname', 'publicip', 'guestipaddress', 'linklocalip', 'serviceofferingname', 'networkdomain', 'isredundantrouter', 'redundantstate', 'hostname', 'account', 'zonename', 'created'], + actions: [ + { + api: 'startInternalLoadBalancerVM', + icon: 'caret-right', + label: 'label.action.start.router', + dataView: true, + show: (record) => { return record.state === 'Stopped' } + }, + { + api: 'stopInternalLoadBalancerVM', + icon: 'stop', + label: 'label.action.stop.router', + dataView: true, + args: ['forced'], + show: (record) => { return record.state === 'Running' } + } + ] +} diff --git a/ui/src/config/section/network.js b/ui/src/config/section/network.js index c3f7ab8af4f..bd125086c37 100644 --- a/ui/src/config/section/network.js +++ b/ui/src/config/section/network.js @@ -122,6 +122,14 @@ export default { name: 'vm', title: 'Instances', param: 'vpcid' + }, { + name: 'router', + title: 'Virtual Routers', + param: 'vpcid' + }, { + name: 'ilbvm', + title: 'Internal LB VMs', + param: 'vpcid' }], tabs: [{ name: 'VPC', @@ -433,6 +441,14 @@ export default { }, scheme: { value: (record) => { return 'Internal' } + }, + networkid: { + api: 'listNetworks', + params: (record) => { return { forvpc: true } } + }, + sourceipaddressnetworkid: { + api: 'listNetworks', + params: (record) => { return { forvpc: true } } } } }, diff --git a/ui/src/views/infra/InfraSummary.vue b/ui/src/views/infra/InfraSummary.vue index b7baf9dc005..d406b325a67 100644 --- a/ui/src/views/infra/InfraSummary.vue +++ b/ui/src/views/infra/InfraSummary.vue @@ -174,7 +174,7 @@ export default { return { loading: true, routes: {}, - sections: ['zones', 'pods', 'clusters', 'hosts', 'storagepools', 'imagestores', 'systemvms', 'routers', 'cpusockets', 'managementservers', 'alerts'], + sections: ['zones', 'pods', 'clusters', 'hosts', 'storagepools', 'imagestores', 'systemvms', 'routers', 'cpusockets', 'managementservers', 'alerts', 'ilbvms'], sslFormVisible: false, stats: {}, intermediateCertificates: [],