ui: traffic-control edit: handle empty time-frame correctly
delete on update and avoid sending an empty string in any case, the backend does not likes that much. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
ba80611324
commit
fdf9373f9e
|
@ -199,13 +199,17 @@ Ext.define('PBS.window.TrafficControlEdit', {
|
||||||
values.network = values.network.split(/\s*,\s*/);
|
values.network = values.network.split(/\s*,\s*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Ext.isArray(values.timeframe)) {
|
if ('timeframe' in values && !values.timeframe) {
|
||||||
|
delete values.timeframe;
|
||||||
|
}
|
||||||
|
if (values.timeframe && !Ext.isArray(values.timeframe)) {
|
||||||
values.timeframe = values.timeframe.split(';');
|
values.timeframe = values.timeframe.split(';');
|
||||||
}
|
}
|
||||||
|
|
||||||
delete values['network-select'];
|
delete values['network-select'];
|
||||||
|
|
||||||
if (!isCreate) {
|
if (!isCreate) {
|
||||||
|
PBS.Utils.delete_if_default(values, 'timeframe');
|
||||||
PBS.Utils.delete_if_default(values, 'rate-in');
|
PBS.Utils.delete_if_default(values, 'rate-in');
|
||||||
PBS.Utils.delete_if_default(values, 'rate-out');
|
PBS.Utils.delete_if_default(values, 'rate-out');
|
||||||
PBS.Utils.delete_if_default(values, 'burst-in');
|
PBS.Utils.delete_if_default(values, 'burst-in');
|
||||||
|
|
Loading…
Reference in New Issue