From ff344655e20eed82cb51ccbd3de49be04a9ce46d Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sat, 20 Nov 2021 22:04:57 +0100 Subject: [PATCH] ui: traffic-control edit: make network edit a single text field here's to note that the radio-group was my idea, Dominik just executed it, nicely that is. But, the panel looks a bit glitchy layout wise as with that and the bandwidth fields (maybe we should render their unit inline) the vertical alignments were all over the place. So for now make it a simple text field and throw in a tooltip for good measurement Signed-off-by: Thomas Lamprecht --- www/window/TrafficControlEdit.js | 44 +++++++------------------------- 1 file changed, 9 insertions(+), 35 deletions(-) diff --git a/www/window/TrafficControlEdit.js b/www/window/TrafficControlEdit.js index ced947a4..caf79b57 100644 --- a/www/window/TrafficControlEdit.js +++ b/www/window/TrafficControlEdit.js @@ -193,7 +193,7 @@ Ext.define('PBS.window.TrafficControlEdit', { let me = this; let isCreate = me.up('window').isCreate; - if (values['network-select'] === 'all') { + if (!values['network-select']) { values.network = '0.0.0.0/0'; } else if (values.network) { values.network = values.network.split(/\s*,\s*/); @@ -275,41 +275,15 @@ Ext.define('PBS.window.TrafficControlEdit', { columnB: [ { - xtype: 'fieldcontainer', - fieldLabel: gettext('Network'), - layout: { - type: 'hbox', - align: 'stretch', + xtype: 'proxmoxtextfield', + fieldLabel: gettext('Network(s)'), + name: 'network', + emptyText: gettext('0.0.0.0/0 (Apply on all Networks)'), + autoEl: { + tag: 'div', + 'data-qtip': gettext('A comma-separated list of networks to apply the (shared) limit.'), + }, - items: [ - { - flex: 1, - xtype: 'radiofield', - boxLabel: gettext('All Networks'), - name: 'network-select', - value: true, - inputValue: 'all', - }, - { - xtype: 'radiofield', - boxLabel: gettext('Limit to'), - name: 'network-select', - inputValue: 'limit', - listeners: { - change: function(field, value) { - this.up('window').lookup('network').setDisabled(!value); - }, - }, - }, - { - flex: 1, - margin: '0 0 0 10', - xtype: 'proxmoxtextfield', - name: 'network', - reference: 'network', - disabled: true, - }, - ], }, { xtype: 'displayfield',