mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-27 11:46:44 +00:00
config.js : disable start button if vm is a template on current (raw, qcow2)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
8091a76574
commit
a7aa073353
@ -189,6 +189,7 @@ Ext.define('PVE.qemu.Config', {
|
|||||||
me.statusStore.on('load', function(s, records, success) {
|
me.statusStore.on('load', function(s, records, success) {
|
||||||
var status;
|
var status;
|
||||||
var qmpstatus;
|
var qmpstatus;
|
||||||
|
var template;
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
me.workspace.checkVmMigration(me.pveSelNode);
|
me.workspace.checkVmMigration(me.pveSelNode);
|
||||||
@ -198,6 +199,10 @@ Ext.define('PVE.qemu.Config', {
|
|||||||
status = rec ? rec.data.value : 'unknown';
|
status = rec ? rec.data.value : 'unknown';
|
||||||
rec = s.data.get('qmpstatus');
|
rec = s.data.get('qmpstatus');
|
||||||
qmpstatus = rec ? rec.data.value : 'unknown';
|
qmpstatus = rec ? rec.data.value : 'unknown';
|
||||||
|
rec = s.data.get('template');
|
||||||
|
if(rec.data.value){
|
||||||
|
template = rec.data.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qmpstatus === 'prelaunch' || qmpstatus === 'paused') {
|
if (qmpstatus === 'prelaunch' || qmpstatus === 'paused') {
|
||||||
@ -208,8 +213,8 @@ Ext.define('PVE.qemu.Config', {
|
|||||||
resumeBtn.setVisible(false);
|
resumeBtn.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'running');
|
startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'running' || template);
|
||||||
resetBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
|
resetBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running' || template);
|
||||||
shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
|
shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
|
||||||
stopBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'stopped');
|
stopBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'stopped');
|
||||||
removeBtn.setDisabled(!caps.vms['VM.Allocate'] || status !== 'stopped');
|
removeBtn.setDisabled(!caps.vms['VM.Allocate'] || status !== 'stopped');
|
||||||
|
Loading…
Reference in New Issue
Block a user