[pve-devel] [PATCH v10 manager 05/19] ui: file selector: add getCurrentSize function

Fabian Ebner f.ebner at proxmox.com
Wed Apr 6 10:04:02 CEST 2022


In preparation for disk import from an existing volume.

Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
[FE: split into its own patch]
Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 www/manager6/form/FileSelector.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/www/manager6/form/FileSelector.js b/www/manager6/form/FileSelector.js
index ef2bedf9..d426e7f4 100644
--- a/www/manager6/form/FileSelector.js
+++ b/www/manager6/form/FileSelector.js
@@ -51,6 +51,12 @@ Ext.define('PVE.form.FileSelector', {
 	this.setStorage(undefined, nodename);
     },
 
+    getCurrentSize: function() {
+	const me = this;
+	const id = me.getValue();
+	return id ? me.store.getById(id).get('size') : 0;
+    },
+
     store: {
 	model: 'pve-storage-content',
     },
-- 
2.30.2






More information about the pve-devel mailing list