Commit b83c4fb8 authored by Alexandre Derumier's avatar Alexandre Derumier Committed by Dietmar Maurer

config.js : disable start button if vm is a template on current (raw, qcow2)

Signed-off-by: 's avatarAlexandre Derumier <aderumier@odiso.com>
parent ac311dc8
......@@ -189,6 +189,7 @@ Ext.define('PVE.qemu.Config', {
me.statusStore.on('load', function(s, records, success) {
var status;
var qmpstatus;
var template;
if (!success) {
me.workspace.checkVmMigration(me.pveSelNode);
......@@ -198,6 +199,10 @@ Ext.define('PVE.qemu.Config', {
status = rec ? rec.data.value : 'unknown';
rec = s.data.get('qmpstatus');
qmpstatus = rec ? rec.data.value : 'unknown';
rec = s.data.get('template');
if(rec.data.value){
template = rec.data.value;
}
}
if (qmpstatus === 'prelaunch' || qmpstatus === 'paused') {
......@@ -208,8 +213,8 @@ Ext.define('PVE.qemu.Config', {
resumeBtn.setVisible(false);
}
startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'running');
resetBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'running' || template);
resetBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running' || template);
shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
stopBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'stopped');
removeBtn.setDisabled(!caps.vms['VM.Allocate'] || status !== 'stopped');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment