duck.etc.blueprints.dashboard.ui.components.topbar

DashboardTopbar component — sticky top navigation bar for the dashboard.

Displays the Duck Framework brand, a live server status pill, a last-updated timestamp, a refresh button, and a logout link. The refresh button triggers a Lively data reload over WebSocket.

Module Contents

Classes

DashboardTopbar

Renders the dashboard sticky topbar.

API

class duck.etc.blueprints.dashboard.ui.components.topbar.DashboardTopbar(element: Optional[str] = None, properties: Optional[Dict[str, str]] = None, props: Optional[Dict[str, str]] = None, style: Optional[Dict[str, str]] = None, inner_html: Optional[Union[str, str, float]] = None, children: Optional[List[duck.html.components.HtmlComponent]] = None, **kwargs)[source]

Bases: duck.html.components.InnerComponent

Renders the dashboard sticky topbar.

The refresh button fires a “click” event handled by DashboardPage which re-fetches all panel data over the Lively WebSocket connection.

Props: last_updated (str): Formatted timestamp string shown in the bar.

Initialization

Initialize an HTML component.

Parameters:
  • element – The HTML element tag name (e.g., textarea, input, button). Can be None, but make sure element is returned by get_element method.

  • accept_inner_html – Whether the HTML component accepts an inner body (e.g., inner-body-here).

  • inner_html – Inner html to add to the HTML component. Defaults to None.

  • properties – Dictionary for properties to initialize the component with.

  • props – Just same as properties argument (added for simplicity).

  • style – Dictionary for style to initialize the component with.

  • **kwargs – Extra keyword arguments

Raises:

HtmlComponentError – If ‘element’ is not a string or ‘inner_html’ is set but ‘accept_inner_html’ is False.

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

Returns the right-side action area with status pill, timestamp, refresh button, and logout link.

Returns:

A Container holding the action widgets.

build_brand() duck.html.components.container.Container[source]
get_element() str[source]
Returns:

The HTML element tag for this component.

on_create() None[source]

Builds the topbar with brand, status pill, timestamp, refresh, and logout.

refresh_icon() str[source]

Returns the SVG markup for the refresh icon.

Returns:

An inline SVG string.