[pve-devel] applied: [PATCH manager 2/2] ui: dc/options: add bandwidth limit editor
Thomas Lamprecht
t.lamprecht at proxmox.com
Wed Nov 27 11:32:10 CET 2019
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
www/manager6/dc/OptionView.js | 43 +++++++++++++++++++++++++++++++++--
1 file changed, 42 insertions(+), 1 deletions(-)
diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
index dd585b7b..79494b6d 100644
--- a/www/manager6/dc/OptionView.js
+++ b/www/manager6/dc/OptionView.js
@@ -27,8 +27,12 @@ Ext.define('PVE.dc.OptionView', {
labelWidth: opts.labelWidth || 100
},
setValues: function(values) {
- // FIXME: run through parsePropertyString if not an object?
var edit_value = values[name];
+
+ if (opts.parseBeforeSet) {
+ edit_value = PVE.Parser.parsePropertyString(edit_value);
+ }
+
Ext.Array.each(this.query('inputpanel'), function(panel) {
panel.setValues(edit_value);
});
@@ -156,6 +160,43 @@ Ext.define('PVE.dc.OptionView', {
value: gettext('NOTE: Changing an AppID breaks existing U2F registrations!'),
}]
});
+ me.add_inputpanel_row('bwlimit', gettext('Bandwidth Limits'), {
+ renderer: (v) => !v ? gettext('None') : v,
+ caps: caps.vms['Sys.Modify'],
+ width: 450,
+ url: "/api2/extjs/cluster/options",
+ parseBeforeSet: true,
+ items: [{
+ xtype: 'pveBandwidthField',
+ name: 'default',
+ fieldLabel: gettext('Default'),
+ emptyText: gettext('none')
+ },
+ {
+ xtype: 'pveBandwidthField',
+ name: 'restore',
+ fieldLabel: gettext('Backup Restore'),
+ emptyText: gettext('default')
+ },
+ {
+ xtype: 'pveBandwidthField',
+ name: 'migration',
+ fieldLabel: gettext('Migration'),
+ emptyText: gettext('default')
+ },
+ {
+ xtype: 'pveBandwidthField',
+ name: 'clone',
+ fieldLabel: gettext('Clone'),
+ emptyText: gettext('default')
+ },
+ {
+ xtype: 'pveBandwidthField',
+ name: 'move',
+ fieldLabel: gettext('Disk Move'),
+ emptyText: gettext('default')
+ }]
+ });
// TODO: bwlimits
--
2.20.1
More information about the pve-devel
mailing list