[pve-devel] [PATCH manager v2] ui: restore: add bandwidth limit field

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Mar 22 10:46:22 CET 2018


Let user input MiB/s as values in the KiB/s range are not that handy
and would make even smaller backups need several hours to restore,
days for bigger ones.

Try to give the user imformation about per-storage bandwidth limits
and how he can disable all of them.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 www/manager6/window/Restore.js | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/www/manager6/window/Restore.js b/www/manager6/window/Restore.js
index 14969f09..8927e096 100644
--- a/www/manager6/window/Restore.js
+++ b/www/manager6/window/Restore.js
@@ -50,7 +50,18 @@ Ext.define('PVE.window.Restore', {
 		fieldLabel: gettext('Source')
 	    },
 	    storagesel,
-	    IDfield
+	    IDfield,
+	    {
+		xtype: 'proxmoxintegerfield',
+		name: 'bwlimit',
+		fieldLabel: gettext('Read Limit (MiB/s)'),
+		minValue: 0,
+		emptyText: gettext('Defaults to target storage restore limit'),
+		autoEl: {
+		    tag: 'div',
+		    'data-qtip': gettext("Use '0' to disable all bandwidth limits.")
+		}
+	    }
 	];
 
 	if (me.vmtype === 'lxc') {
@@ -107,6 +118,10 @@ Ext.define('PVE.window.Restore', {
 		    force: me.vmid ? 1 : 0
 		};
 
+		if (values.bwlimit !== undefined) {
+		    params.bwlimit = values.bwlimit * 1024;
+		}
+
 		var url;
 		var msg;
 		if (me.vmtype === 'lxc') {
-- 
2.14.2





More information about the pve-devel mailing list