You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2020/04/22 08:05:47 UTC

[cloudstack-primate] branch master updated: compute: fix actions for instances (#208)

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git


The following commit(s) were added to refs/heads/master by this push:
     new a1815dd  compute: fix actions for instances (#208)
a1815dd is described below

commit a1815dd230d55f0b7169e00db2fb0a2fbb8124d2
Author: Abhishek Kumar <ab...@gmail.com>
AuthorDate: Wed Apr 22 13:35:35 2020 +0530

    compute: fix actions for instances (#208)
    
    Fixes #173
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
    Co-authored-by: Rohit Yadav <ro...@shapeblue.com>
---
 src/config/section/compute.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/config/section/compute.js b/src/config/section/compute.js
index cbc57d5..4d30841 100644
--- a/src/config/section/compute.js
+++ b/src/config/section/compute.js
@@ -124,7 +124,10 @@ export default {
           label: 'Create VM Snapshot',
           dataView: true,
           args: ['virtualmachineid', 'name', 'description', 'snapshotmemory', 'quiescevm'],
-          show: (record) => { return ['Running'].includes(record.state) },
+          show: (record) => {
+            return ((['Running'].includes(record.state) && record.hypervisor !== 'LXC') ||
+              (['Stopped'].includes(record.state) && record.hypervisor !== 'KVM' && record.hypervisor !== 'LXC'))
+          },
           mapping: {
             virtualmachineid: {
               value: (record, params) => { return record.id }
@@ -230,7 +233,7 @@ export default {
           label: 'Scale VM',
           dataView: true,
           args: ['serviceofferingid', 'details'],
-          show: (record) => { return record.hypervisor !== 'KVM' }
+          show: (record) => { return ['Running'].includes(record.state) && record.hypervisor !== 'KVM' && record.hypervisor !== 'LXC' }
         },
         {
           api: 'changeServiceForVirtualMachine',
@@ -238,7 +241,7 @@ export default {
           label: 'Change Service Offering',
           dataView: true,
           args: ['serviceofferingid'],
-          show: (record) => { return ['Stopped'].includes(record.state) }
+          show: (record) => { return ['Stopped'].includes(record.state) || (['Running'].includes(record.state) && record.hypervisor !== 'KVM' && record.hypervisor !== 'LXC') }
         },
         {
           api: 'migrateVirtualMachine',