ui: traffic-control edit: very simple duplicate timeframe detection

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-11-20 22:03:58 +01:00
parent fdf9373f9e
commit 3490d9460c

View File

@ -203,7 +203,14 @@ Ext.define('PBS.window.TrafficControlEdit', {
delete values.timeframe;
}
if (values.timeframe && !Ext.isArray(values.timeframe)) {
values.timeframe = values.timeframe.split(';');
let timeframe = [], seen = {};
values.timeframe.split(';').forEach(tf => {
if (!seen[tf]) {
timeframe.push(tf);
seen[tf] = true;
}
});
values.timeframe = timeframe;
}
delete values['network-select'];