[pve-devel] [PATCH v2 manager 1/2] Don't show empty parentheses when size is not known

Fabian Ebner f.ebner at proxmox.com
Mon May 4 10:50:39 CEST 2020


The size of VM state files and the size of unused disks not
referenced by any snapshot is not saved in the VM configuration,
so it's not available here either.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

Changes from v1:
    * use variable for size text and use format string
    * drop patch exposing target storage for offline migration
    * and adapt comment

 www/manager6/window/Migrate.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/www/manager6/window/Migrate.js b/www/manager6/window/Migrate.js
index 61bc6a49..42a54246 100644
--- a/www/manager6/window/Migrate.js
+++ b/www/manager6/window/Migrate.js
@@ -266,10 +266,11 @@ Ext.define('PVE.window.Migrate', {
 				    });
 				}
 			    } else {
+				var size_string = disk.size ? '(' + PVE.Utils.render_size(disk.size) + ')' : '';
 				migration['with-local-disks'] = 1;
 				migration.preconditions.push({
-				    text:'Migration with local disk might take long: ' + disk.volid
-					+' (' + PVE.Utils.render_size(disk.size) + ')',
+				    text: Ext.String.format('Migration with local disk might take long: {0} {1}',
+				          disk.volid, size_string),
 				    severity: 'warning'
 				});
 			    }
-- 
2.20.1





More information about the pve-devel mailing list