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 <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-11-20 22:04:57 +01:00
parent 3490d9460c
commit ff344655e2
1 changed files with 9 additions and 35 deletions

View File

@ -193,7 +193,7 @@ Ext.define('PBS.window.TrafficControlEdit', {
let me = this; let me = this;
let isCreate = me.up('window').isCreate; let isCreate = me.up('window').isCreate;
if (values['network-select'] === 'all') { if (!values['network-select']) {
values.network = '0.0.0.0/0'; values.network = '0.0.0.0/0';
} else if (values.network) { } else if (values.network) {
values.network = values.network.split(/\s*,\s*/); values.network = values.network.split(/\s*,\s*/);
@ -275,41 +275,15 @@ Ext.define('PBS.window.TrafficControlEdit', {
columnB: [ columnB: [
{ {
xtype: 'fieldcontainer',
fieldLabel: gettext('Network'),
layout: {
type: 'hbox',
align: 'stretch',
},
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', xtype: 'proxmoxtextfield',
fieldLabel: gettext('Network(s)'),
name: 'network', name: 'network',
reference: 'network', emptyText: gettext('0.0.0.0/0 (Apply on all Networks)'),
disabled: true, autoEl: {
tag: 'div',
'data-qtip': gettext('A comma-separated list of networks to apply the (shared) limit.'),
}, },
],
}, },
{ {
xtype: 'displayfield', xtype: 'displayfield',