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

bandwidth_schedule_editor(schedule)

Build the schedule editor.

find_overlaps(windows)

Return pairs of indices whose Days and time ranges overlap.

schedule_props(schedule)

Compute renderable props for a BandwidthSchedule.

validate_window(window)

Return an error string if window is invalid, else None.

Classes

BandwidthSchedule([mode, ...])

The full editor state.

ScheduleWindow([days, from_time, to_time, ...])

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: object

The full editor state.

Parameters:
default_upload_mbps: int | None = None#
mode: str = 'unlimited'#
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: object

One row in the schedule table.

Parameters:
days: list[str]#
from_time: str = '08:00'#
to_time: str = '18:00'#
upload_mbps: int | None = None#
exlab_wizard.ui.components.bandwidth_schedule_editor.bandwidth_schedule_editor(schedule)[source]#

Build the schedule editor.

Parameters:

schedule (BandwidthSchedule)

Return type:

Any

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) with i < j.

Parameters:

windows (list[ScheduleWindow])

Return type:

list[tuple[int, int]]

exlab_wizard.ui.components.bandwidth_schedule_editor.schedule_props(schedule)[source]#

Compute renderable props for a BandwidthSchedule.

Parameters:

schedule (BandwidthSchedule)

Return type:

dict[str, Any]

exlab_wizard.ui.components.bandwidth_schedule_editor.validate_window(window)[source]#

Return an error string if window is invalid, else None.

Time strings are compared lexicographically because we use 24-hour HH:MM strings (sortable by character order).

Parameters:

window (ScheduleWindow)

Return type:

str | None