From 291060afc3d179ee2c28b28cdc6df9a09b685cab Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 22 Jan 2020 16:03:31 +0530 Subject: [PATCH] infra: host config tab Signed-off-by: Rohit Yadav --- ui/docs/api/apis.remaining | 5 - ui/src/config/section/compute.js | 3 +- ui/src/config/section/infra/hosts.js | 16 ++- ui/src/locales/en.json | 2 +- ui/src/views/AutogenView.vue | 3 + ui/src/views/infra/HostInfoTab.vue | 152 +++++++++++++++++++++++++++ 6 files changed, 171 insertions(+), 10 deletions(-) create mode 100644 ui/src/views/infra/HostInfoTab.vue diff --git a/ui/docs/api/apis.remaining b/ui/docs/api/apis.remaining index 77a2f00df07..ebcb1747ede 100644 --- a/ui/docs/api/apis.remaining +++ b/ui/docs/api/apis.remaining @@ -36,11 +36,7 @@ deleteVpnConnection deleteVpnGateway findStoragePoolsForMigration listAffinityGroupTypes -listDedicatedClusters listDedicatedGuestVlanRanges -listDedicatedHosts -listDedicatedPods -listDedicatedZones listDeploymentPlanners listHostTags listInternalLoadBalancerElements @@ -49,7 +45,6 @@ listLBHealthCheckPolicies listLoadBalancers listNetworkACLs listNetworkServiceProviders -listOsCategories listPortableIpRanges listRegisteredServicePackages listStaticRoutes diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index 4af84c7a28d..8da60c8d244 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -30,8 +30,7 @@ export default { columns: [ 'name', 'state', 'instancename', 'ipaddress', 'cpunumber', 'cpuused', 'cputotal', { - memoryused: - (record) => { + memoryused: (record) => { return record.memorykbs && record.memoryintfreekbs ? parseFloat(100.0 * (record.memorykbs - record.memoryintfreekbs) / record.memorykbs).toFixed(2) + '%' : '0.0%' } }, diff --git a/ui/src/config/section/infra/hosts.js b/ui/src/config/section/infra/hosts.js index 83ea7f8313c..08c3cd61384 100644 --- a/ui/src/config/section/infra/hosts.js +++ b/ui/src/config/section/infra/hosts.js @@ -23,7 +23,14 @@ export default { resourceType: 'Host', params: { type: 'routing' }, columns: ['name', 'state', 'resourcestate', 'powerstate', 'ipaddress', 'hypervisor', 'instances', 'cpunumber', 'cputotalghz', 'cpuusedghz', 'cpuallocatedghz', 'memorytotalgb', 'memoryusedgb', 'memoryallocatedgb', 'networkread', 'networkwrite', 'clustername', 'zonename'], - details: ['name', 'id', 'resourcestate', 'ipaddress', 'hypervisor', 'hypervisorversion', 'version', 'type', 'oscategoryname', 'hosttags', 'clustername', 'podname', 'zonename', 'created'], + details: ['name', 'id', 'resourcestate', 'ipaddress', 'hypervisor', 'type', 'clustername', 'podname', 'zonename', 'disconnected', 'created'], + tabs: [{ + name: 'details', + component: () => import('@/components/view/DetailsTab.vue') + }, { + name: 'Config', + component: () => import('@/views/infra/HostInfoTab.vue') + }], related: [{ name: 'vm', title: 'Instances', @@ -42,7 +49,12 @@ export default { icon: 'edit', label: 'label.edit', dataView: true, - args: ['hosttags', 'oscategoryid'] + args: ['hosttags', 'oscategoryid'], + mapping: { + oscategoryid: { + api: 'listOsCategories' + } + } }, { api: 'provisionCertificate', diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json index f4abfaf4424..4fa98e9a167 100644 --- a/ui/src/locales/en.json +++ b/ui/src/locales/en.json @@ -257,7 +257,7 @@ "hypervisorSnapshotReserve": "Hypervisor Snapshot Reserve", "hypervisorsnapshotreserve": "Hypervisor Snapshot Reserve", "hypervisortype": "Hypervisor", -"hypervisorversion": "Hypervisor version", +"hypervisorversion": "Hypervisor Version", "hypervnetworklabel": "HyperV Traffic Label", "icmp": "ICMP", "icmpcode": "ICMP Code", diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index 0328cf590f5..13ddffc417e 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -525,6 +525,9 @@ export default { this.showAction = true for (const param of this.currentAction.paramFields) { + if (param.type === 'list' && param.name === 'hosttags') { + param.type = 'string' + } if (param.type === 'uuid' || param.type === 'list' || param.name === 'account' || (this.currentAction.mapping && param.name in this.currentAction.mapping)) { this.listUuidOpts(param) } diff --git a/ui/src/views/infra/HostInfoTab.vue b/ui/src/views/infra/HostInfoTab.vue new file mode 100644 index 00000000000..31e95c7622b --- /dev/null +++ b/ui/src/views/infra/HostInfoTab.vue @@ -0,0 +1,152 @@ +// 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. + + + + + +