[pve-devel] [PATCH manager] LXC: Disable resize button when volume is unusued

Fabian Ebner f.ebner at proxmox.com
Wed Nov 27 13:01:48 CET 2019


The size of an unused volume is not visible to the user and trying to resize
an unused volume runs into a 'parameter verification failed' anyways.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 www/manager6/lxc/Resources.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js
index dde920bf..bd85c716 100644
--- a/www/manager6/lxc/Resources.js
+++ b/www/manager6/lxc/Resources.js
@@ -233,6 +233,7 @@ Ext.define('PVE.lxc.RessourceView', {
 
 	    var pending = rec.data['delete'] || me.hasPendingChanges(key);
 	    var isDisk = (rowdef.tdCls == 'pve-itype-icon-storage');
+	    var isUnusedDisk = key.match(/^unused\d+/);
 
 	    var noedit = rec.data['delete'] || !rowdef.editor;
 	    if (!noedit && Proxmox.UserName !== 'root at pam' && key.match(/^mp\d+$/)) {
@@ -244,7 +245,7 @@ Ext.define('PVE.lxc.RessourceView', {
 	    edit_btn.setDisabled(noedit);
 
 	    remove_btn.setDisabled(!isDisk || rec.data.key === 'rootfs' || !diskCap || pending);
-	    resize_btn.setDisabled(!isDisk || !diskCap);
+	    resize_btn.setDisabled(!isDisk || !diskCap || isUnusedDisk);
 	    move_btn.setDisabled(!isDisk || !diskCap);
 	    revert_btn.setDisabled(!pending);
 
-- 
2.20.1





More information about the pve-devel mailing list