duck.etc.blueprints.dashboard.ui.pages.dashboard

DashboardPage — the root page for the Duck Framework server dashboard.

Wires all dashboard components together and drives live data refresh via Lively WebSocket event bindings. Requires a valid JWT session — unauthenticated requests are routed to LoginPage by the view layer.

Module Contents

Classes

DashboardPage

Full-page server dashboard driven by Lively reactive updates.

API

class duck.etc.blueprints.dashboard.ui.pages.dashboard.DashboardPage(request, disable_lively: bool = False, lazy: bool = True, *args, **kwargs)[source]

Bases: duck.html.components.page.Page

Full-page server dashboard driven by Lively reactive updates.

Fetches a complete data snapshot on initial load and on every refresh triggered by the topbar button. All panels re-render in-place without a full page reload. Requires JWT authentication — handled by the view layer before this page is instantiated.

Initialization

Initialize the Page component.

Parameters:
  • request – The target HTTP request.

  • disable_lively – This disables Lively components for the page. Defaults to False.

  • lazy – This makes the page not aggressively load the page tree on initialization but let the system decide the right time to load the page. Defaults to True.

build_layout(snapshot: dict, sys_snapshot: dict) None[source]

Constructs the full page layout from the provided data snapshots.

Parameters:
  • snapshot – Dict returned by services.get_full_snapshot().

  • sys_snapshot – Dict returned by system_metrics.get_system_metrics().

build_main_content() duck.html.components.container.Container[source]

Returns the scrollable main content area with all panel rows.

Returns:

A Container holding all panel rows inside db-main.

format_ts() str[source]

Returns the current UTC time formatted as a display string.

Returns:

32:07 UTC”.

Return type:

A string like “Updated 14

async handle_refresh(btn, event: str, value, ws) None[source]

Re-fetches all dashboard data and updates every panel in-place.

Parameters:
  • btn – The Button component that fired the event.

  • event – The event name string.

  • value – Event payload (unused).

  • ws – The active LivelyWebSocketView instance.

on_create() None[source]

Sets up SEO, injects styles, fetches initial data, and builds layout.

async on_dom_ready(_, __, ___, ws)[source]

Event called on when DOM is ready.