Signed-off-by: Alexandre Derumier <[email protected]>
---
 www/manager/qemu/Config.js |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/www/manager/qemu/Config.js b/www/manager/qemu/Config.js
index c557687..585406d 100644
--- a/www/manager/qemu/Config.js
+++ b/www/manager/qemu/Config.js
@@ -173,19 +173,26 @@ Ext.define('PVE.qemu.Config', {
 
         me.statusStore.on('load', function(s, records, success) {
            var status;
+           var template;
            if (!success) {
                me.workspace.checkVmMigration(me.pveSelNode);
                status = 'unknown';
            } else {
                var rec = s.data.get('status');
                status = rec ? rec.data.value : 'unknown';
+
+               var rec2 = s.data.get('template');
+               if(rec2.data.value){
+                   template = rec2.data.value;
+               }
+
            }
 
-           startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 
'running');
+           startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 
'running' || template === 1);
            resetBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 
'running');
            shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 
'running');
            stopBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 
'stopped');
-           removeBtn.setDisabled(!caps.vms['VM.Allocate'] || status !== 
'stopped');
+           removeBtn.setDisabled(!caps.vms['VM.Allocate'] || status !== 
'stopped' || template);
        });
 
        me.on('afterrender', function() {
-- 
1.7.10.4

_______________________________________________
pve-devel mailing list
[email protected]
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to