diff --git a/ui/src/components/view/InfoCard.vue b/ui/src/components/view/InfoCard.vue index 6d7438a8312..a739c9ba57e 100644 --- a/ui/src/components/view/InfoCard.vue +++ b/ui/src/components/view/InfoCard.vue @@ -308,7 +308,7 @@
- + View {{ $t(item.title) }} diff --git a/ui/src/config/router.js b/ui/src/config/router.js index 77f11efba3b..c580de3582a 100644 --- a/ui/src/config/router.js +++ b/ui/src/config/router.js @@ -55,6 +55,7 @@ export function generateRouterMap (section) { keepAlive: true, icon: child.icon, docHelp: child.docHelp, + hidden: child.hidden, permission: child.permission, resourceType: child.resourceType, params: child.params ? child.params : {}, @@ -73,6 +74,7 @@ export function generateRouterMap (section) { name: child.name, keepAlive: true, icon: child.icon, + hidden: child.hidden, permission: child.permission, resourceType: child.resourceType, params: child.params ? child.params : {}, @@ -119,6 +121,7 @@ export function generateRouterMap (section) { keepAlive: true, icon: section.icon, docHelp: section.docHelp, + hidden: section.hidden, permission: section.permission, resourceType: section.resourceType, params: section.params ? section.params : {}, diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index b51840056cb..627500be28d 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -154,27 +154,6 @@ export default { } } }, - { - api: 'migrateVirtualMachine', - icon: 'drag', - label: 'label.migrate.instance.to.host', - dataView: true, - show: (record) => { return ['Running'].includes(record.state) } - }, - { - api: 'migrateVirtualMachineWithVolume', - icon: 'export', - label: 'Migrate VM with Volume(s)', - dataView: true, - show: (record) => { return ['Running'].includes(record.state) } - }, - { - api: 'migrateVirtualMachine', - icon: 'drag', - label: 'label.migrate.instance.to.ps', - dataView: true, - show: (record) => { return ['Stopped'].includes(record.state) } - }, { api: 'updateVMAffinityGroup', icon: 'swap', @@ -199,6 +178,42 @@ export default { args: ['serviceofferingid'], show: (record) => { return ['Stopped'].includes(record.state) } }, + { + api: 'migrateVirtualMachine', + icon: 'drag', + label: 'label.migrate.instance.to.host', + dataView: true, + show: (record) => { return ['Running'].includes(record.state) }, + args: ['hostid', 'virtualmachineid'], + mapping: { + virtualmachineid: { + value: (record) => { return record.id } + } + } + }, + { + api: 'migrateVirtualMachineWithVolume', + icon: 'export', + label: 'Migrate VM with Volume(s)', + dataView: true, + show: (record) => { return ['Running'].includes(record.state) } + }, + { + api: 'migrateVirtualMachine', + icon: 'drag', + label: 'label.migrate.instance.to.ps', + dataView: true, + show: (record) => { return ['Stopped'].includes(record.state) }, + args: ['storageid', 'virtualmachineid'], + mapping: { + storageid: { + api: 'listStoragePools' + }, + virtualmachineid: { + value: (record) => { return record.id } + } + } + }, { api: 'resetPasswordForVirtualMachine', icon: 'key', diff --git a/ui/src/config/section/event.js b/ui/src/config/section/event.js index 0e15e2b3ddb..0a501a18333 100644 --- a/ui/src/config/section/event.js +++ b/ui/src/config/section/event.js @@ -22,25 +22,32 @@ export default { permission: ['listEvents'], columns: ['username', 'description', 'state', 'level', 'type', 'account', 'domain', 'created'], details: ['username', 'id', 'description', 'state', 'level', 'type', 'account', 'domain', 'created'], - related: [{ - name: 'event', - title: 'Event Timeline', - param: 'startid' - }], actions: [ { api: 'archiveEvents', icon: 'book', label: 'Archive Event', + listView: true, dataView: true, - args: ['ids'] + args: ['ids'], + mapping: { + ids: { + value: (record) => { return record.id } + } + } }, { api: 'deleteEvents', icon: 'delete', label: 'Delete Event', + listView: true, dataView: true, - args: ['ids'] + args: ['ids'], + mapping: { + ids: { + value: (record) => { return record.id } + } + } } ] } diff --git a/ui/src/config/section/iam.js b/ui/src/config/section/iam.js index aaca2bb027f..d910392056a 100644 --- a/ui/src/config/section/iam.js +++ b/ui/src/config/section/iam.js @@ -85,6 +85,11 @@ export default { permission: ['listAccounts'], columns: ['name', 'state', 'firstname', 'lastname', 'rolename', 'roletype', 'domain'], details: ['name', 'id', 'rolename', 'roletype', 'domain', 'networkdomain', 'iptotal', 'vmtotal', 'volumetotal', 'receivedbytes', 'sentbytes', 'vmlimit', 'iplimit', 'volumelimit', 'snapshotlimit', 'templatelimit', 'vpclimit', 'cpulimit', 'memorylimit', 'networklimit', 'primarystoragelimit', 'secondarystoragelimit'], + related: [{ + name: 'accountuser', + title: 'Users', + param: 'account' + }], actions: [ { api: 'createAccount', @@ -105,7 +110,15 @@ export default { icon: 'sync', label: 'Update Resource Count', dataView: true, - args: ['account', 'domainid'] + args: ['account', 'domainid'], + mapping: { + account: { + value: (record) => { return record.account } + }, + domainid: { + value: (record) => { return record.domainid } + } + } }, { api: 'enableAccount', @@ -121,7 +134,12 @@ export default { label: 'Disable Account', dataView: true, show: (record) => { return record.state === 'enabled' }, - params: { lock: 'false' } + args: ['lock'], + mapping: { + lock: { + value: (record) => { return false } + } + } }, { api: 'disableAccount', @@ -129,17 +147,19 @@ export default { label: 'Lock account', dataView: true, show: (record) => { return record.state === 'enabled' }, - args: ['lock'] + args: ['lock'], + mapping: { + lock: { + value: (record) => { return true } + } + } }, { api: 'deleteAccount', icon: 'delete', label: 'Delete account', dataView: true, - hidden: (record) => { return record.name === 'admin' }, - args: [ - 'id' - ] + hidden: (record) => { return record.name === 'admin' } } ] }, @@ -206,14 +226,24 @@ export default { icon: 'plus', label: 'Create Role', listView: true, - args: ['name', 'description', 'type'] + args: ['name', 'description', 'type'], + mapping: { + type: { + options: ['Admin', 'DomainAdmin', 'User'] + } + } }, { api: 'updateRole', icon: 'edit', label: 'Edit Role', dataView: true, - args: ['name', 'description', 'type'] + args: ['name', 'description', 'type'], + mapping: { + type: { + options: ['Admin', 'DomainAdmin', 'User'] + } + } }, { api: 'deleteRole', diff --git a/ui/src/config/section/infra.js b/ui/src/config/section/infra.js index 7ffbdde830b..e89e67a3ad5 100644 --- a/ui/src/config/section/infra.js +++ b/ui/src/config/section/infra.js @@ -16,6 +16,7 @@ // under the License. import zones from '@/config/section/infra/zones' +import phynetworks from '@/config/section/infra/phynetworks' import pods from '@/config/section/infra/pods' import clusters from '@/config/section/infra/clusters' import hosts from '@/config/section/infra/hosts' @@ -38,6 +39,7 @@ export default { component: () => import('@/views/infra/InfraSummary.vue') }, zones, + phynetworks, pods, clusters, hosts, @@ -48,7 +50,7 @@ export default { { name: 'cpusocket', title: 'CPU Sockets', - icon: 'api', + icon: 'inbox', permission: ['listHosts'], params: { type: 'routing' }, columns: ['hypervisor', 'hosts', 'cpusockets'] @@ -73,14 +75,24 @@ export default { icon: 'book', label: 'Archive Alert', dataView: true, - args: ['ids'] + args: ['ids'], + mapping: { + ids: { + value: (record) => { return record.id } + } + } }, { api: 'deleteAlerts', icon: 'delete', label: 'Delete Alert', dataView: true, - args: ['ids'] + args: ['ids'], + mapping: { + ids: { + value: (record) => { return record.id } + } + } } ] } diff --git a/ui/src/config/section/infra/clusters.js b/ui/src/config/section/infra/clusters.js index ae9e8d74d6d..c9eeaae4378 100644 --- a/ui/src/config/section/infra/clusters.js +++ b/ui/src/config/section/infra/clusters.js @@ -35,37 +35,47 @@ export default { listView: true, args: ['zoneid', 'hypervisor', 'podid', 'clustername'] }, - { - api: 'updateCluster', - icon: 'pause-circle', - label: 'label.action.enable.cluster', - dataView: true, - defaultArgs: { allocationstate: 'Disabled' }, - show: (record) => { return record.allocationstate === 'Enabled' } - }, { api: 'updateCluster', icon: 'play-circle', - label: 'label.action.disable.cluster', + label: 'label.action.enable.cluster', dataView: true, defaultArgs: { allocationstate: 'Enabled' }, show: (record) => { return record.allocationstate === 'Disabled' } }, + { + api: 'updateCluster', + icon: 'pause-circle', + label: 'label.action.disable.cluster', + dataView: true, + defaultArgs: { allocationstate: 'Disabled' }, + show: (record) => { return record.allocationstate === 'Enabled' } + }, { api: 'dedicateCluster', icon: 'user-add', label: 'label.dedicate.cluster', dataView: true, + show: (record) => { return !record.domainid }, args: ['clusterid', 'domainid', 'account'], - show: (record) => { return !record.domainid } + mapping: { + clusterid: { + value: (record) => { return record.id } + } + } }, { api: 'releaseDedicatedCluster', icon: 'user-delete', label: 'label.release.dedicated.cluster', dataView: true, + show: (record) => { return record.domainid }, args: ['clusterid'], - show: (record) => { return record.domainid } + mapping: { + clusterid: { + value: (record) => { return record.id } + } + } }, { api: 'updateCluster', @@ -88,10 +98,15 @@ export default { icon: 'plus-circle', label: 'label.outofbandmanagement.enable', dataView: true, - args: ['clusterid'], show: (record) => { return !record.resourcedetails || !record.resourcedetails.outOfBandManagementEnabled || record.resourcedetails.outOfBandManagementEnabled === 'false' + }, + args: ['clusterid'], + mapping: { + clusterid: { + value: (record) => { return record.id } + } } }, { @@ -99,10 +114,15 @@ export default { icon: 'minus-circle', label: 'label.outofbandmanagement.disable', dataView: true, - args: ['clusterid'], show: (record) => { return record.resourcedetails && record.resourcedetails.outOfBandManagementEnabled && record.resourcedetails.outOfBandManagementEnabled === 'true' + }, + args: ['clusterid'], + mapping: { + clusterid: { + value: (record) => { return record.id } + } } }, { @@ -110,10 +130,15 @@ export default { icon: 'eye', label: 'label.ha.enable', dataView: true, - args: ['clusterid'], show: (record) => { return !record.resourcedetails || !record.resourcedetails.resourceHAEnabled || record.resourcedetails.resourceHAEnabled === 'false' + }, + args: ['clusterid'], + mapping: { + clusterid: { + value: (record) => { return record.id } + } } }, { @@ -121,10 +146,15 @@ export default { icon: 'eye-invisible', label: 'label.ha.disable', dataView: true, - args: ['clusterid'], show: (record) => { return record.resourcedetails && record.resourcedetails.resourceHAEnabled && record.resourcedetails.resourceHAEnabled === 'true' + }, + args: ['clusterid'], + mapping: { + clusterid: { + value: (record) => { return record.id } + } } }, { diff --git a/ui/src/config/section/infra/hosts.js b/ui/src/config/section/infra/hosts.js index 64c1cbc1308..d19577b073c 100644 --- a/ui/src/config/section/infra/hosts.js +++ b/ui/src/config/section/infra/hosts.js @@ -49,8 +49,13 @@ export default { icon: 'safety-certificate', label: 'label.action.secure.host', dataView: true, + show: (record) => { return record.hypervisor === 'KVM' }, args: ['hostid'], - show: (record) => { return record.hypervisor === 'KVM' } + mapping: { + hostid: { + value: (record) => { return record.id } + } + } }, { api: 'reconnectHost', @@ -80,16 +85,26 @@ export default { icon: 'user-add', label: 'label.dedicate.host', dataView: true, + show: (record) => { return !record.domainid }, args: ['hostid', 'domainid', 'account'], - show: (record) => { return !record.domainid } + mapping: { + hostid: { + value: (record) => { return record.id } + } + } }, { api: 'releaseDedicatedHost', icon: 'user-delete', label: 'label.release.dedicated.host', dataView: true, + show: (record) => { return record.domainid }, args: ['hostid'], - show: (record) => { return record.domainid } + mapping: { + hostid: { + value: (record) => { return record.id } + } + } }, { api: 'prepareHostForMaintenance', @@ -110,17 +125,30 @@ export default { icon: 'setting', label: 'label.outofbandmanagement.configure', dataView: true, - args: ['hostid', 'address', 'port', 'username', 'password', 'driver'] + args: ['hostid', 'address', 'port', 'username', 'password', 'driver'], + mapping: { + hostid: { + value: (record) => { return record.id } + }, + driver: { + options: ['ipmitool', 'nestedcloudstack'] + } + } }, { api: 'enableOutOfBandManagementForHost', icon: 'plus-circle', label: 'label.outofbandmanagement.enable', dataView: true, - args: ['hostid'], show: (record) => { return !record.resourcedetails || !record.resourcedetails.outOfBandManagementEnabled || record.resourcedetails.outOfBandManagementEnabled === 'false' + }, + args: ['hostid'], + mapping: { + hostid: { + value: (record) => { return record.id } + } } }, { @@ -128,10 +156,15 @@ export default { icon: 'minus-circle', label: 'label.outofbandmanagement.disable', dataView: true, - args: ['hostid'], show: (record) => { return record.resourcedetails && record.resourcedetails.outOfBandManagementEnabled && record.resourcedetails.outOfBandManagementEnabled === 'true' + }, + args: ['hostid'], + mapping: { + hostid: { + value: (record) => { return record.id } + } } }, { @@ -139,10 +172,15 @@ export default { icon: 'login', label: 'label.outofbandmanagement.action.issue', dataView: true, - args: ['hostid', 'action'], show: (record) => { return record.resourcedetails && record.resourcedetails.outOfBandManagementEnabled && record.resourcedetails.outOfBandManagementEnabled === 'true' + }, + args: ['hostid', 'action'], + mapping: { + hostid: { + value: (record) => { return record.id } + } } }, { @@ -150,10 +188,15 @@ export default { icon: 'key', label: 'label.outofbandmanagement.changepassword', dataView: true, - args: ['hostid', 'password'], show: (record) => { return record.resourcedetails && record.resourcedetails.outOfBandManagementEnabled && record.resourcedetails.outOfBandManagementEnabled === 'true' + }, + args: ['hostid', 'password'], + mapping: { + hostid: { + value: (record) => { return record.id } + } } }, { @@ -161,17 +204,27 @@ export default { icon: 'tool', label: 'label.ha.configure', dataView: true, - args: ['hostid', 'provider'] + args: ['hostid', 'provider'], + mapping: { + hostid: { + value: (record) => { return record.id } + } + } }, { api: 'enableHAForHost', icon: 'eye', label: 'label.ha.enable', dataView: true, - args: ['hostid'], show: (record) => { return !record.resourcedetails || !record.resourcedetails.resourceHAEnabled || record.resourcedetails.resourceHAEnabled === 'false' + }, + args: ['hostid'], + mapping: { + hostid: { + value: (record) => { return record.id } + } } }, { @@ -179,10 +232,15 @@ export default { icon: 'eye-invisible', label: 'label.ha.disable', dataView: true, - args: ['hostid'], show: (record) => { return record.resourcedetails && record.resourcedetails.resourceHAEnabled && record.resourcedetails.resourceHAEnabled === 'true' + }, + args: ['hostid'], + mapping: { + hostid: { + value: (record) => { return record.id } + } } }, { diff --git a/ui/src/config/section/infra/phynetworks.js b/ui/src/config/section/infra/phynetworks.js new file mode 100644 index 00000000000..aa59adddc49 --- /dev/null +++ b/ui/src/config/section/infra/phynetworks.js @@ -0,0 +1,27 @@ +// 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: 'physicalnetwork', + title: 'Physical Networks', + icon: 'api', + hidden: true, + permission: ['listPhysicalNetworks'], + columns: ['name', 'state', 'isolationmethods', 'vlan', 'broadcastdomainrange', 'zoneid'], + details: ['name', 'state', 'isolationmethods', 'vlan', 'broadcastdomainrange', 'zoneid'], + actions: [] +} diff --git a/ui/src/config/section/infra/pods.js b/ui/src/config/section/infra/pods.js index 23b80e4d2f2..19ef0303233 100644 --- a/ui/src/config/section/infra/pods.js +++ b/ui/src/config/section/infra/pods.js @@ -51,16 +51,26 @@ export default { icon: 'user-add', label: 'label.dedicate.pod', dataView: true, + show: (record) => { return !record.domainid }, args: ['podid', 'domainid', 'account'], - show: (record) => { return !record.domainid } + mapping: { + podid: { + value: (record) => { return record.id } + } + } }, { api: 'releaseDedicatedPod', icon: 'user-delete', label: 'label.release.dedicated.pod', dataView: true, + show: (record) => { return record.domainid }, args: ['podid'], - show: (record) => { return record.domainid } + mapping: { + podid: { + value: (record) => { return record.id } + } + } }, { api: 'updatePod', diff --git a/ui/src/config/section/infra/routers.js b/ui/src/config/section/infra/routers.js index f3631bb1319..4491693c0a6 100644 --- a/ui/src/config/section/infra/routers.js +++ b/ui/src/config/section/infra/routers.js @@ -66,16 +66,29 @@ export default { icon: 'drag', label: 'label.action.migrate.router', dataView: true, + show: (record) => { return record.state === 'Running' }, args: ['virtualmachineid', 'hostid'], - show: (record) => { return record.state === 'Running' } + mapping: { + virtualmachineid: { + value: (record) => { return record.id } + } + } }, { api: 'runDiagnostics', icon: 'reconciliation', label: 'label.action.run.diagnostics', dataView: true, + show: (record) => { return record.state === 'Running' }, args: ['targetid', 'type', 'ipaddress', 'params'], - show: (record) => { return record.state === 'Running' } + mapping: { + targetid: { + value: (record) => { return record.id } + }, + type: { + options: ['ping', 'traceroute', 'arping'] + } + } }, { api: 'destroyRouter', diff --git a/ui/src/config/section/infra/systemVms.js b/ui/src/config/section/infra/systemVms.js index 3c87da07383..8c0e93f82b4 100644 --- a/ui/src/config/section/infra/systemVms.js +++ b/ui/src/config/section/infra/systemVms.js @@ -35,7 +35,8 @@ export default { icon: 'stop', label: 'label.action.stop.systemvm', dataView: true, - show: (record) => { return record.state === 'Running' } + show: (record) => { return record.state === 'Running' }, + args: ['forced'] }, { api: 'rebootSystemVm', @@ -49,24 +50,37 @@ export default { icon: 'arrows-alt', label: 'label.change.service.offering', dataView: true, - args: ['serviceofferingid'], - show: (record) => { return record.hypervisor !== 'KVM' } + show: (record) => { return record.hypervisor !== 'KVM' }, + args: ['serviceofferingid'] }, { api: 'migrateSystemVm', icon: 'drag', label: 'label.action.migrate.systemvm', dataView: true, + show: (record) => { return record.state === 'Running' }, args: ['virtualmachineid', 'hostid'], - show: (record) => { return record.state === 'Running' } + mapping: { + virtualmachineid: { + value: (record) => { return record.id } + } + } }, { api: 'runDiagnostics', icon: 'reconciliation', label: 'label.action.run.diagnostics', dataView: true, + show: (record) => { return record.state === 'Running' }, args: ['targetid', 'type', 'ipaddress', 'params'], - show: (record) => { return record.state === 'Running' } + mapping: { + targetid: { + value: (record) => { return record.id } + }, + type: { + options: ['ping', 'traceroute', 'arping'] + } + } }, { api: 'destroySystemVm', diff --git a/ui/src/config/section/infra/zones.js b/ui/src/config/section/infra/zones.js index 4d8edb01fae..ee8d3fdd940 100644 --- a/ui/src/config/section/infra/zones.js +++ b/ui/src/config/section/infra/zones.js @@ -23,6 +23,10 @@ export default { columns: ['name', 'state', 'networktype', 'clusters', 'cpuused', 'cpumaxdeviation', 'cpuallocated', 'cputotal', 'memoryused', 'memorymaxdeviation', 'memoryallocated', 'memorytotal'], details: ['name', 'id', 'allocationstate', 'networktype', 'guestcidraddress', 'localstorageenabled', 'securitygroupsenabled', 'dns1', 'dns2', 'internaldns1', 'internaldns2'], related: [{ + name: 'physicalnetwork', + title: 'Physical Networks', + param: 'zoneid' + }, { name: 'pod', title: 'Pods', param: 'zoneid' @@ -34,6 +38,10 @@ export default { name: 'host', title: 'Hosts', param: 'zoneid' + }, { + name: 'systemvm', + title: 'SystemVMs', + param: 'zoneid' }, { name: 'storagepool', title: 'Primate Storage', @@ -89,26 +97,41 @@ export default { icon: 'user-add', label: 'label.dedicate.zone', dataView: true, + show: (record) => { return !record.domainid }, args: ['zoneid', 'domainid', 'account'], - show: (record) => { return !record.domainid } + mapping: { + zoneid: { + value: (record) => { return record.id } + } + } }, { api: 'releaseDedicatedZone', icon: 'user-delete', label: 'label.release.dedicated.zone', dataView: true, + show: (record) => { return record.domainid }, args: ['zoneid'], - show: (record) => { return record.domainid } + mapping: { + zoneid: { + value: (record) => { return record.id } + } + } }, { api: 'enableOutOfBandManagementForZone', icon: 'plus-circle', label: 'label.outofbandmanagement.enable', dataView: true, - args: ['zoneid'], show: (record) => { return !record.resourcedetails || !record.resourcedetails.outOfBandManagementEnabled || record.resourcedetails.outOfBandManagementEnabled === 'false' + }, + args: ['zoneid'], + mapping: { + zoneid: { + value: (record) => { return record.id } + } } }, { @@ -116,10 +139,15 @@ export default { icon: 'minus-circle', label: 'label.outofbandmanagement.disable', dataView: true, - args: ['zoneid'], show: (record) => { return record.resourcedetails && record.resourcedetails.outOfBandManagementEnabled && record.resourcedetails.outOfBandManagementEnabled === 'true' + }, + args: ['zoneid'], + mapping: { + zoneid: { + value: (record) => { return record.id } + } } }, { @@ -127,10 +155,15 @@ export default { icon: 'eye', label: 'label.ha.enable', dataView: true, - args: ['zoneid'], show: (record) => { return !record.resourcedetails || !record.resourcedetails.resourceHAEnabled || record.resourcedetails.resourceHAEnabled === 'false' + }, + args: ['zoneid'], + mapping: { + zoneid: { + value: (record) => { return record.id } + } } }, { @@ -138,10 +171,15 @@ export default { icon: 'eye-invisible', label: 'label.ha.disable', dataView: true, - args: ['zoneid'], show: (record) => { return record.resourcedetails && record.resourcedetails.resourceHAEnabled && record.resourcedetails.resourceHAEnabled === 'true' + }, + args: ['zoneid'], + mapping: { + zoneid: { + value: (record) => { return record.id } + } } }, { @@ -149,24 +187,39 @@ export default { icon: 'block', label: 'label.add.vmware.datacenter', dataView: true, + show: (record) => { return !record.vmwaredcid }, args: ['zoneid', 'name', 'vcenter', 'username', 'password'], - show: (record) => { return !record.vmwaredcid } + mapping: { + zoneid: { + value: (record) => { return record.id } + } + } }, { api: 'updateVmwareDc', icon: 'block', label: 'label.update.vmware.datacenter', dataView: true, + show: (record) => { return record.vmwaredcid }, args: ['zoneid', 'name', 'vcenter', 'username', 'password', 'isrecursive'], - show: (record) => { return record.vmwaredcid } + mapping: { + zoneid: { + value: (record) => { return record.id } + } + } }, { api: 'removeVmwareDc', icon: 'minus-square', label: 'label.remove.vmware.datacenter', dataView: true, + show: (record) => { return record.vmwaredcid }, args: ['zoneid'], - show: (record) => { return record.vmwaredcid } + mapping: { + zoneid: { + value: (record) => { return record.id } + } + } }, { api: 'deleteZone', diff --git a/ui/src/config/section/network.js b/ui/src/config/section/network.js index 874f3944002..92e5e405734 100644 --- a/ui/src/config/section/network.js +++ b/ui/src/config/section/network.js @@ -191,30 +191,59 @@ export default { icon: 'link', label: 'Enable Remote Access VPN', dataView: true, - args: ['publicipid', 'domainid', 'account'] + args: ['publicipid', 'domainid', 'account'], + mapping: { + publicipid: { + value: (record) => { return record.id } + }, + domainid: { + value: (record) => { return record.domainid } + }, + account: { + value: (record) => { return record.account } + } + } }, { api: 'deleteRemoteAccessVpn', icon: 'disconnect', label: 'Disable Remove Access VPN', dataView: true, - args: ['publicipid', 'domainid'] + args: ['publicipid', 'domainid'], + mapping: { + publicipid: { + value: (record) => { return record.id } + }, + domainid: { + value: (record) => { return record.domainid } + } + } }, { api: 'enableStaticNat', icon: 'plus-circle', label: 'Enable Static NAT', dataView: true, + show: (record) => { return !record.virtualmachineid && !record.issourcenat }, args: ['ipaddressid', 'virtualmachineid', 'vmguestip'], - show: (record) => { return !record.virtualmachineid && !record.issourcenat } + mapping: { + ipaddressid: { + value: (record) => { return record.id } + } + } }, { api: 'disableStaticNat', icon: 'minus-circle', label: 'Disable Static NAT', dataView: true, + show: (record) => { return record.virtualmachineid }, args: ['ipaddressid'], - show: (record) => { return record.virtualmachineid } + mapping: { + ipaddressid: { + value: (record) => { return record.id } + } + } }, { api: 'disassociateIpAddress', @@ -245,7 +274,18 @@ export default { icon: 'delete', label: 'Delete VPN User', dataView: true, - args: ['username', 'domainid', 'account'] + args: ['username', 'domainid', 'account'], + mapping: { + username: { + value: (record) => { return record.username } + }, + domainid: { + value: (record) => { return record.domainid } + }, + account: { + value: (record) => { return record.account } + } + } } ] }, @@ -264,6 +304,12 @@ export default { label: 'Add VPN Customer Gateway', listView: true, args: ['name', 'gateway', 'cidrlist', 'ipsecpsk', 'ikelifetime', 'esplifetime', 'dpd', 'forceencap', 'ikepolicy', 'esppolicy'] + }, + { + api: 'deleteVpnCustomerGateway', + icon: 'delete', + label: 'Delete VPN Customer Gateway', + dataView: true } ] } diff --git a/ui/src/config/section/offering.js b/ui/src/config/section/offering.js index b629530db5a..2483d9c787d 100644 --- a/ui/src/config/section/offering.js +++ b/ui/src/config/section/offering.js @@ -136,6 +136,30 @@ export default { label: 'Edit Offering', dataView: true, args: ['name', 'displaytext', 'availability'] + }, { + api: 'updateNetworkOffering', + icon: 'play-circle', + label: 'Enable Offering', + dataView: true, + show: (record) => { return record.state === 'Disabled' }, + args: ['state'], + mapping: { + state: { + value: (record) => { return 'Enabled' } + } + } + }, { + api: 'updateNetworkOffering', + icon: 'pause-circle', + label: 'Disable Offering', + dataView: true, + show: (record) => { return record.state === 'Enabled' }, + args: ['state'], + mapping: { + state: { + value: (record) => { return 'Disabled' } + } + } }, { api: 'deleteNetworkOffering', icon: 'delete', @@ -169,6 +193,30 @@ export default { label: 'Edit Offering', dataView: true, args: ['name', 'displaytext'] + }, { + api: 'updateVPCOffering', + icon: 'play-circle', + label: 'Enable Offering', + dataView: true, + show: (record) => { return record.state === 'Disabled' }, + args: ['state'], + mapping: { + state: { + value: (record) => { return 'Enabled' } + } + } + }, { + api: 'updateVPCOffering', + icon: 'pause-circle', + label: 'Disable Offering', + dataView: true, + show: (record) => { return record.state === 'Enabled' }, + args: ['state'], + mapping: { + state: { + value: (record) => { return 'Disabled' } + } + } }, { api: 'deleteVPCOffering', icon: 'delete', diff --git a/ui/src/config/section/project.js b/ui/src/config/section/project.js index 1f2b033d28e..fd482927116 100644 --- a/ui/src/config/section/project.js +++ b/ui/src/config/section/project.js @@ -57,7 +57,12 @@ export default { icon: 'user-add', label: 'Add Account to Project', dataView: true, - args: ['projectid', 'account', 'email'] + args: ['projectid', 'account', 'email'], + mapping: { + projectid: { + value: (record) => { return record.id } + } + } }, { api: 'deleteProject', diff --git a/ui/src/config/section/storage.js b/ui/src/config/section/storage.js index 48e229899b0..649e7bedcdb 100644 --- a/ui/src/config/section/storage.js +++ b/ui/src/config/section/storage.js @@ -38,16 +38,19 @@ export default { api: 'createVolume', icon: 'plus', label: 'Create Volume', - type: 'main', - args: ['name', 'zoneid', 'diskofferingid'], - listView: true + listView: true, + args: ['name', 'zoneid', 'diskofferingid'] }, { api: 'uploadVolume', icon: 'link', label: 'Upload Volume From URL', - type: 'main', + listView: true, args: ['url', 'name', 'zoneid', 'format', 'diskofferingid', 'checksum'], - listView: true + mapping: { + format: { + options: ['RAW', 'VHD', 'VHDX', 'OVA', 'QCOW2'] + } + } }, { api: 'getUploadParamsForVolume', icon: 'cloud-upload', @@ -142,9 +145,14 @@ export default { api: 'createTemplate', icon: 'picture', label: 'Create Template from Volume', - args: ['volumeid', 'name', 'displaytext', 'ostypeid', 'ispublic', 'isfeatured', 'isdynamicallyscalable', 'requireshvm', 'passwordenabled', 'sshkeyenabled'], dataView: true, - show: (record) => { return record.type === 'ROOT' } + show: (record) => { return record.type === 'ROOT' }, + args: ['volumeid', 'name', 'displaytext', 'ostypeid', 'ispublic', 'isfeatured', 'isdynamicallyscalable', 'requireshvm', 'passwordenabled', 'sshkeyenabled'], + mapping: { + volumeid: { + value: (record) => { return record.id } + } + } }, { api: 'deleteVolume', @@ -169,6 +177,7 @@ export default { icon: 'plus', label: 'Create volume', dataView: true, + show: (record) => { return record.state === 'BackedUp' }, args: ['snapshotid', 'name'], mapping: { snapshotid: { @@ -181,6 +190,7 @@ export default { icon: 'picture', label: 'Create volume', dataView: true, + show: (record) => { return record.state === 'BackedUp' }, args: ['snapshotid', 'name', 'displaytext', 'ostypeid', 'ispublic', 'isfeatured', 'isdynamicallyscalable', 'requireshvm', 'passwordenabled', 'sshkeyenabled'], mapping: { snapshotid: { @@ -216,6 +226,7 @@ export default { icon: 'sync', label: 'Revert VM snapshot', dataView: true, + show: (record) => { return record.state === 'Ready' }, args: ['vmsnapshotid'], mapping: { vmsnapshotid: { diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index 8fd7a3fdd67..977a70c337f 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -496,6 +496,8 @@ export default { params.templatefilter = 'executable' } else if (possibleApi === 'listIsos') { params.isofilter = 'executable' + } else if (possibleApi === 'listHosts') { + params.type = 'routing' } api(possibleApi, params).then(json => { param.loading = false