[pve-devel] [PATCH manager] ui: dc/Backup: disable pveCompressionSelector for pbs storages

Dominik Csapak d.csapak at proxmox.com
Thu Sep 3 14:08:14 CEST 2020


like in window/Backup

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
i'd really like to incorporate that info into our storage plugin api
so that we do not have to hardcode 'pbs', but for it's okay i guess

 www/manager6/dc/Backup.js | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index e9f20596..d868dcfc 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -61,7 +61,21 @@ Ext.define('PVE.dc.BackupEdit', {
 	    nodename: 'localhost',
 	    storageContent: 'backup',
 	    allowBlank: false,
-	    name: 'storage'
+	    name: 'storage',
+	    listeners: {
+		change: function(f, v) {
+		    let store = f.getStore();
+		    let rec = store.findRecord('storage', v);
+		    let compressionSelector = me.down('pveCompressionSelector');
+
+		    if (rec && rec.data && rec.data.type === 'pbs') {
+			compressionSelector.setValue('zstd');
+			compressionSelector.setDisabled(true);
+		    } else if (!compressionSelector.getEditable()) {
+			compressionSelector.setDisabled(false);
+		    }
+		}
+	    }
 	});
 
 	var store = new Ext.data.Store({
-- 
2.20.1





More information about the pve-devel mailing list