mirror of https://github.com/apache/cloudstack.git
add button on compute and volume views and logic to show/hide in data/list views
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
9fc863043a
commit
cc649cc477
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<a-row>
|
||||
<a-col :span="16">
|
||||
<a-tooltip placement="bottom" v-for="(action, actionIndex) in actions" :key="actionIndex">
|
||||
<a-tooltip placement="bottom" v-for="(action, actionIndex) in actions" :key="actionIndex" v-if="(!dataView && action.listView) || (dataView && action.dataView)">
|
||||
<template slot="title">
|
||||
{{ action.label }}
|
||||
</template>
|
||||
|
|
@ -152,7 +152,7 @@
|
|||
</a-spin>
|
||||
</a-drawer>
|
||||
|
||||
<div v-if="showDetails">
|
||||
<div v-if="dataView">
|
||||
<a-row :gutter="12">
|
||||
<a-col :xl="12">
|
||||
<chart-card class="info-card" v-if="resource.name">
|
||||
|
|
@ -258,7 +258,7 @@ export default {
|
|||
selectedRowKeys: [],
|
||||
currentAction: {},
|
||||
showAction: false,
|
||||
showDetails: false,
|
||||
dataView: false,
|
||||
actions: [],
|
||||
breadList: []
|
||||
}
|
||||
|
|
@ -309,9 +309,9 @@ export default {
|
|||
params['keyword'] = search
|
||||
}
|
||||
if (this.$route && this.$route.params && this.$route.params.id) {
|
||||
this.showDetails = true
|
||||
this.dataView = true
|
||||
} else {
|
||||
this.showDetails = false
|
||||
this.dataView = false
|
||||
}
|
||||
if (this.$route && this.$route.meta && this.$route.meta.permission) {
|
||||
this.apiName = this.$route.meta.permission[0]
|
||||
|
|
|
|||
|
|
@ -20,19 +20,57 @@ export default {
|
|||
api: 'deployVirtualMachine',
|
||||
icon: 'plus',
|
||||
label: 'Deploy VM',
|
||||
params: ['name', 'zoneid', 'diskofferingid']
|
||||
params: ['name', 'zoneid', 'diskofferingid'],
|
||||
listView: true
|
||||
},
|
||||
{
|
||||
api: 'startVirtualMachine',
|
||||
icon: 'right-square',
|
||||
label: 'View Console',
|
||||
dataView: true
|
||||
},
|
||||
|
||||
{
|
||||
api: 'startVirtualMachine',
|
||||
icon: 'caret-right',
|
||||
label: 'Start VM',
|
||||
params: ['name', 'zoneid', 'diskofferingid']
|
||||
params: ['name', 'zoneid', 'diskofferingid'],
|
||||
listView: true,
|
||||
dataView: true
|
||||
},
|
||||
{
|
||||
api: 'stopVirtualMachine',
|
||||
icon: 'stop',
|
||||
label: 'Stop VM',
|
||||
params: ['name', 'zoneid', 'diskofferingid']
|
||||
params: ['name', 'zoneid', 'diskofferingid'],
|
||||
listView: true,
|
||||
dataView: true
|
||||
},
|
||||
{
|
||||
api: 'rebootVirtualMachine',
|
||||
icon: 'sync',
|
||||
label: 'Reboot VM',
|
||||
dataView: true
|
||||
},
|
||||
{
|
||||
api: 'migrateVirtualMachine',
|
||||
icon: 'drag',
|
||||
label: 'Migrate VM',
|
||||
dataView: true
|
||||
},
|
||||
{
|
||||
api: 'resetSSHKeyForVirtualMachine',
|
||||
icon: 'lock',
|
||||
label: 'Reset SSH Key',
|
||||
dataView: true
|
||||
},
|
||||
{
|
||||
api: 'destroyVirtualMachine',
|
||||
icon: 'delete',
|
||||
label: 'Destroy VM',
|
||||
params: ['id'],
|
||||
listView: true,
|
||||
dataView: true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -17,34 +17,48 @@ export default {
|
|||
icon: 'plus',
|
||||
label: 'Create Volume',
|
||||
type: 'main',
|
||||
params: ['name', 'zoneid', 'diskofferingid']
|
||||
params: ['name', 'zoneid', 'diskofferingid'],
|
||||
listView: true
|
||||
}, {
|
||||
api: 'uploadVolume',
|
||||
icon: 'cloud-upload',
|
||||
label: 'Upload Volume From URL',
|
||||
type: 'main',
|
||||
params: ['url', 'name', 'zoneid', 'format', 'diskofferingid', 'checksum']
|
||||
params: ['url', 'name', 'zoneid', 'format', 'diskofferingid', 'checksum'],
|
||||
listView: true
|
||||
}, {
|
||||
api: 'getUploadParamsForVolume',
|
||||
icon: 'upload',
|
||||
label: 'Upload Local Volume',
|
||||
params: ['@file', 'name', 'zoneid', 'format', 'checksum']
|
||||
}, {
|
||||
params: ['@file', 'name', 'zoneid', 'format', 'checksum'],
|
||||
listView: true
|
||||
},
|
||||
{
|
||||
api: 'migrateVolume',
|
||||
icon: 'drag',
|
||||
label: 'Migrate Volume',
|
||||
params: ['volumeid', 'storageid', 'livemigrate'],
|
||||
dataView: true
|
||||
},
|
||||
{
|
||||
api: 'resizeVolume',
|
||||
icon: 'fullscreen',
|
||||
label: 'Resize Volume',
|
||||
type: 'main',
|
||||
params: ['id', 'virtualmachineid']
|
||||
params: ['id', 'virtualmachineid'],
|
||||
dataView: true
|
||||
}, {
|
||||
api: 'attachVolume',
|
||||
icon: 'paper-clip',
|
||||
label: 'Attach Volume',
|
||||
params: ['id', 'virtualmachineid']
|
||||
params: ['id', 'virtualmachineid'],
|
||||
dataView: true
|
||||
}, {
|
||||
api: 'detachVolume',
|
||||
icon: 'link',
|
||||
label: 'Detach Volume',
|
||||
params: ['id', 'virtualmachineid']
|
||||
params: ['id', 'virtualmachineid'],
|
||||
dataView: true
|
||||
}, {
|
||||
api: 'extractVolume',
|
||||
icon: 'cloud-download',
|
||||
|
|
@ -54,17 +68,16 @@ export default {
|
|||
'mode': {
|
||||
'value': 'HTTP_DOWNLOAD'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
api: 'migrateVolume',
|
||||
icon: 'drag',
|
||||
label: 'Migrate Volume',
|
||||
params: ['volumeid', 'storageid', 'livemigrate']
|
||||
}, {
|
||||
},
|
||||
dataView: true
|
||||
},
|
||||
{
|
||||
api: 'deleteVolume',
|
||||
icon: 'delete',
|
||||
label: 'Delete Volume',
|
||||
params: ['id']
|
||||
params: ['id'],
|
||||
listView: true,
|
||||
dataView: true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue