exlab_wizard.ui.components.bandwidth_schedule_editor#
Bandwidth schedule editor (Frontend Spec §7.7.3).
Lives inside the Equipment Add/Edit sub-dialog. Two modes:
Unlimited – no cap, no schedule.
Limit upload bandwidth – a default cap (Mbps) plus zero-or-more schedule windows (Days, From, To, Upload Mbps).
Validation:
Each row requires
From < To.Rows whose Days overlap each other render a non-blocking warning.
Functions
|
Build the schedule editor. |
|
Return pairs of indices whose Days and time ranges overlap. |
|
Compute renderable props for a |
|
Return an error string if |
Classes
|
The full editor state. |
|
One row in the schedule table. |
- class exlab_wizard.ui.components.bandwidth_schedule_editor.BandwidthSchedule(mode='unlimited', default_upload_mbps=None, windows=<factory>)[source]#
Bases:
objectThe full editor state.
- Parameters:
mode (
str)windows (
list[ScheduleWindow])
- windows: list[ScheduleWindow]#
- class exlab_wizard.ui.components.bandwidth_schedule_editor.ScheduleWindow(days=<factory>, from_time='08:00', to_time='18:00', upload_mbps=None)[source]#
Bases:
objectOne row in the schedule table.
- exlab_wizard.ui.components.bandwidth_schedule_editor.bandwidth_schedule_editor(schedule)[source]#
Build the schedule editor.
- Parameters:
schedule (
BandwidthSchedule)- Return type:
- exlab_wizard.ui.components.bandwidth_schedule_editor.find_overlaps(windows)[source]#
Return pairs of indices whose Days and time ranges overlap.
Pairs are returned in canonical order
(i, j)withi < j.
- exlab_wizard.ui.components.bandwidth_schedule_editor.schedule_props(schedule)[source]#
Compute renderable props for a
BandwidthSchedule.- Parameters:
schedule (
BandwidthSchedule)- Return type:
- exlab_wizard.ui.components.bandwidth_schedule_editor.validate_window(window)[source]#
Return an error string if
windowis invalid, elseNone.Time strings are compared lexicographically because we use 24-hour HH:MM strings (sortable by character order).
- Parameters:
window (
ScheduleWindow)- Return type: