config: implement API arg remappings

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2019-11-25 17:46:54 +05:30
parent 135ddf8b98
commit 13ca0859d2
18 changed files with 482 additions and 98 deletions

View File

@ -308,7 +308,7 @@
<div class="account-center-tags" v-if="$route.meta.related">
<span v-for="item in $route.meta.related" :key="item.path">
<router-link :to="{ path: '/' + item.name + '?' + item.param + '=' + resource.id }">
<router-link :to="{ path: '/' + item.name + '?' + item.param + '=' + (item.param === 'account' ? resource.name + '&domainid=' + resource.domainid : resource.id) }">
<a-button style="margin-right: 10px">
View {{ $t(item.title) }}
</a-button>

View File

@ -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 : {},

View File

@ -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',

View File

@ -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 }
}
}
}
]
}

View File

@ -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',

View File

@ -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 }
}
}
}
]
}

View File

@ -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 }
}
}
},
{

View File

@ -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 }
}
}
},
{

View File

@ -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: []
}

View File

@ -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',

View File

@ -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',

View File

@ -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',

View File

@ -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',

View File

@ -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
}
]
}

View File

@ -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',

View File

@ -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',

View File

@ -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: {

View File

@ -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