bundle.website.builtin.components ================================= .. py:module:: bundle.website.builtin.components .. autoapi-nested-parse:: Built-in website components and UI helpers. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/bundle/website/builtin/components/graphic/index /autoapi/bundle/website/builtin/components/websocket/index Classes ------- .. autoapisummary:: bundle.website.builtin.components.Component bundle.website.builtin.components.ComponentAsset bundle.website.builtin.components.ComponentAssets bundle.website.builtin.components.GPXComponentParams bundle.website.builtin.components.GPXWebSocketBaseComponent bundle.website.builtin.components.WebSocketBaseComponent bundle.website.builtin.components.WebSocketComponentParams bundle.website.builtin.components.WebSocketECCComponent bundle.website.builtin.components.WebSocketHeartbeatComponent bundle.website.builtin.components.WebSocketHeartBeatCardioComponent bundle.website.builtin.components.WebSocketHeartBeatMonitorEarthComponent bundle.website.builtin.components.WebSocketHeartBeatMonitorEarthMoonComponent bundle.website.builtin.components.WebSocketToastComponent Functions --------- .. autoapisummary:: bundle.website.builtin.components.attach_routes bundle.website.builtin.components.context Package Contents ---------------- .. py:class:: Component(/, **data: Any) Bases: :py:obj:`bundle.core.data.Data` Base data model class, providing utilities for serialization and deserialization from/to JSON, along with JSON Schema generation. .. attribute:: model_config Default model configuration settings. .. py:attribute:: slug :type: str .. py:attribute:: template :type: str | None :value: None .. py:attribute:: assets :type: list[ComponentAsset] :value: None .. py:attribute:: routers :type: list[fastapi.APIRouter] :value: None .. py:attribute:: params :type: bundle.core.data.Data | None :value: None .. py:attribute:: name :type: str | None :value: None .. py:attribute:: description :type: str | None :value: None .. py:attribute:: asset_filenames :type: ClassVar[tuple[str, Ellipsis]] :value: ('component.css', 'component.js', 'component.mjs') .. py:attribute:: component_file :type: str | pathlib.Path | None :value: None .. py:method:: build_routers() -> list[fastapi.APIRouter] .. py:method:: component_assets(*paths: str, route_name: str = 'components_static') -> list[ComponentAsset] :staticmethod: .. py:method:: component_asset_paths_for(component_file: str | pathlib.Path, *, asset_filenames: collections.abc.Iterable[str] | None = None) -> list[str] :classmethod: .. py:method:: component_assets_for(component_file: str | pathlib.Path, *, route_name: str = 'components_static') -> list[ComponentAsset] :classmethod: .. py:method:: component_template_for(component_file: str | pathlib.Path) -> str | None :classmethod: .. py:class:: ComponentAsset(/, **data: Any) Bases: :py:obj:`bundle.core.data.Data` Base data model class, providing utilities for serialization and deserialization from/to JSON, along with JSON Schema generation. .. attribute:: model_config Default model configuration settings. .. py:attribute:: kind :type: AssetKind | None :value: None .. py:attribute:: path :type: str .. py:attribute:: route_name :type: str :value: 'static' .. py:attribute:: module :type: bool :value: False .. py:class:: ComponentAssets(/, **data: Any) Bases: :py:obj:`bundle.core.data.Data` Base data model class, providing utilities for serialization and deserialization from/to JSON, along with JSON Schema generation. .. attribute:: model_config Default model configuration settings. .. py:attribute:: styles :type: list[ComponentAsset] :value: None .. py:attribute:: scripts :type: list[ComponentAsset] :value: None .. py:method:: from_components(items: tuple[Component, Ellipsis]) -> ComponentAssets :classmethod: .. py:function:: attach_routes(router: fastapi.APIRouter, *items: Component) -> None .. py:function:: context(*items: Component) -> dict[str, Any] .. py:class:: GPXComponentParams(/, **data: Any) Bases: :py:obj:`bundle.website.builtin.components.graphic.threeD.GraphicThreeDComponentParams`, :py:obj:`bundle.website.builtin.components.websocket.base.component.WebSocketComponentParams` Shared params for GPX websocket components. .. py:attribute:: graph_id :type: str :value: 'gpx' .. py:class:: GPXWebSocketBaseComponent(/, **data: Any) Bases: :py:obj:`bundle.website.builtin.components.websocket.base.component.WebSocketBaseComponent`, :py:obj:`bundle.website.builtin.components.graphic.threeD.GraphicThreeDComponent` Base class for graph-oriented websocket components. .. py:attribute:: params :type: GPXComponentParams :value: None .. py:class:: WebSocketBaseComponent(/, **data: Any) Bases: :py:obj:`bundle.website.core.component.Component` Base websocket component with default params and shared assets. .. py:attribute:: shared_assets :type: ClassVar[tuple[str, Ellipsis]] :value: ('websocket/base/component.css',) .. py:attribute:: params :type: WebSocketComponentParams :value: None .. py:method:: shared_asset_paths() -> list[str] :classmethod: .. py:method:: component_asset_paths_for(component_file: str | pathlib.Path, *, asset_filenames: collections.abc.Iterable[str] | None = None) -> list[str] :classmethod: .. py:method:: handle_websocket(websocket: fastapi.WebSocket) -> None :async: Default websocket handler (keepalive protocol). .. py:method:: build_routers() Attach the component websocket route using the configured endpoint. .. py:class:: WebSocketComponentParams(/, **data: Any) Bases: :py:obj:`bundle.core.data.Data` Shared websocket parameters for component instances. .. py:attribute:: endpoint :type: str :value: '/ws/default' .. py:class:: WebSocketECCComponent(/, **data: Any) Bases: :py:obj:`bundle.website.builtin.components.websocket.base.WebSocketBaseComponent` Base websocket component with default params and shared assets. .. py:attribute:: component_file :type: str :value: '/home/runner/work/TheBundle/TheBundle/src/bundle/website/builtin/components/websocket/ecc/component.py' .. py:attribute:: slug :type: str :value: 'ws-ecc' .. py:attribute:: name :type: str :value: 'WebSocket ECC monitor' .. py:attribute:: description :type: str :value: 'Monitor TX/RX keepalive pulses and timing.' .. py:attribute:: params :type: bundle.website.builtin.components.websocket.base.WebSocketComponentParams .. py:class:: WebSocketHeartbeatComponent(/, **data: Any) Bases: :py:obj:`bundle.website.builtin.components.websocket.base.WebSocketBaseComponent` Base websocket component with default params and shared assets. .. py:attribute:: component_file :type: str :value: '/home/runner/work/TheBundle/TheBundle/src/bundle/website/builtin/components/websocket/heartbeat/... .. py:attribute:: slug :type: str :value: 'ws-heartbeat' .. py:attribute:: name :type: str :value: 'WebSocket Heartbeat' .. py:attribute:: description :type: str :value: 'Periodic keepalive loop with a minimal UI.' .. py:attribute:: params :type: bundle.website.builtin.components.websocket.base.WebSocketComponentParams .. py:class:: WebSocketHeartBeatCardioComponent(/, **data: Any) Bases: :py:obj:`bundle.website.builtin.components.websocket.base.GPXWebSocketBaseComponent` Base class for graph-oriented websocket components. .. py:attribute:: component_file :type: str :value: '/home/runner/work/TheBundle/TheBundle/src/bundle/website/builtin/components/websocket/heartbeat_... .. py:attribute:: slug :type: str :value: 'ws-heartbeat-cardio' .. py:attribute:: name :type: str :value: 'HeartBeatCardio' .. py:attribute:: description :type: str :value: '3D cardiogram monitor for websocket heartbeat pulses.' .. py:attribute:: params :type: bundle.website.builtin.components.websocket.base.GPXComponentParams .. py:class:: WebSocketHeartBeatMonitorEarthComponent(/, **data: Any) Bases: :py:obj:`bundle.website.builtin.components.websocket.base.GPXWebSocketBaseComponent` Base class for graph-oriented websocket components. .. py:attribute:: component_file :type: str :value: '/home/runner/work/TheBundle/TheBundle/src/bundle/website/builtin/components/websocket/heartbeat_... .. py:attribute:: slug :type: str :value: 'ws-heartbeat-earth' .. py:attribute:: name :type: str :value: 'HeartBeatMonitorEarth' .. py:attribute:: description :type: str :value: 'Futuristic Earth monitor for websocket heartbeat pulses.' .. py:attribute:: params :type: bundle.website.builtin.components.websocket.base.GPXComponentParams .. py:class:: WebSocketHeartBeatMonitorEarthMoonComponent(/, **data: Any) Bases: :py:obj:`bundle.website.builtin.components.websocket.base.GPXWebSocketBaseComponent` Base class for graph-oriented websocket components. .. py:attribute:: component_file :type: str :value: '/home/runner/work/TheBundle/TheBundle/src/bundle/website/builtin/components/websocket/heartbeat_... .. py:attribute:: slug :type: str :value: 'ws-heartbeat-earth-moon' .. py:attribute:: name :type: str :value: 'HeartBeatMonitorEarthMoon' .. py:attribute:: description :type: str :value: 'Heartbeat monitor with Earth moon scene (server moon, client heart).' .. py:attribute:: params :type: bundle.website.builtin.components.websocket.base.GPXComponentParams .. py:class:: WebSocketToastComponent(/, **data: Any) Bases: :py:obj:`bundle.website.builtin.components.websocket.base.WebSocketBaseComponent` Websocket component that pushes periodic toast messages to the client. .. py:attribute:: component_file :type: str :value: '/home/runner/work/TheBundle/TheBundle/src/bundle/website/builtin/components/websocket/toast/comp... .. py:attribute:: slug :type: str :value: 'ws-toast' .. py:attribute:: name :type: str :value: 'WebSocket Toast Feed' .. py:attribute:: description :type: str :value: 'Toast notifications for incoming messages.' .. py:attribute:: params :type: bundle.website.builtin.components.websocket.base.WebSocketComponentParams .. py:method:: handle_websocket(websocket: fastapi.WebSocket) -> None :async: Run periodic server push while draining client messages.