]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: traffic-control edit: handle empty time-frame correctly
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 20 Nov 2021 20:56:12 +0000 (21:56 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 20 Nov 2021 21:02:47 +0000 (22:02 +0100)
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>
www/window/TrafficControlEdit.js

index 24e6b63f4a48fe189723729b675664c9204d1e5e..2fdb470f016f513491766dace8b427bc74c09436 100644 (file)
@@ -199,13 +199,17 @@ Ext.define('PBS.window.TrafficControlEdit', {
                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(';');
            }
 
            delete values['network-select'];
 
            if (!isCreate) {
+               PBS.Utils.delete_if_default(values, 'timeframe');
                PBS.Utils.delete_if_default(values, 'rate-in');
                PBS.Utils.delete_if_default(values, 'rate-out');
                PBS.Utils.delete_if_default(values, 'burst-in');