MDK Logo
ReferenceUIHooks

Operations Centre Hooks

Operations centre and monitoring hooks

Hooks for operations centre functionality and monitoring.

From @tetherto/mdk-react-adapter

useCabinetDevices

Fetches one LV cabinet's family of devices — the powermeters and temperature sensors whose info.pos sits under the cabinet root (buildCabinetDetailParams) — polled at the Op-Centre realtime cadence and flattened across the per-…

(root: string, options: UseCabinetDevicesOptions = {}) => UseCabinetDevicesResult

useCabinetGroups

Fetches the Explorer cabinet-tab devices (powermeters + temperature sensors) and groups them by their owning container (info.container); devices without a container assignment (site-level meters) collect under the site group, sorted la…

(options: UseCabinetGroupsOptions = {}) => UseCabinetGroupsResult

useContainerSettings

Fetches per-model container thresholds/parameters from GET /auth/global/data?type=containerSettings. Feeds the threshold status indicators (tank pressure, oil/water temperature) on the container widgets and detail tabs.

(options: UseContainerSettingsOptions = {}) => UseContainerSettingsResult

useContainerSnapshots

Fetches the detail snapshots for the selected containers — the richer projection (buildContainerDetailParams) that carries container_specific.pdu_data plus the tank / cooling / power-mode config the detail panel controls read. `c…

(containerKeys: string[], options: UseContainerSnapshotsOptions = {}) => UseContainerSnapshotsResult

useContainerWidgets

Data source for the Site Overview Container Widgets grid: the container inventory (one card per container) plus the latest per-miner realtime aggregate sample the cards derive their summaries from. Card-shaped payload derivation lives with…

(options: UseContainerWidgetsOptions = {}) => UseContainerWidgetsResult

useExplorerList

Fetches the thing list behind one Explorer tab (container / miner / cabinet) from GET /auth/list-things, tag-filtered and projected by the foundation's Explorer params builder. Rows are flattened across the per-Kernel envelope so r…

(tab: ExplorerTabValue, options: UseExplorerListOptions = {}) => UseExplorerListResult

useFeatureFlags

Fetches the deployment feature flags from GET /auth/featureConfig (camelCase route — there is no /auth/feature-config). Static deployment config — fetched once per session, no polling. Gates optional tabs/sub-routes (containerCharts,…

(options: UseFeatureFlagsOptions = {}) => UseFeatureFlagsResult

usePduLayout

Fetches a container type's static PDU socket grid from GET /auth/pdu-layout. The grid is provisioned in the container worker's pduGridLayout config keyed by the exact type string — an unprovisioned type is a backend 400 (`ERR_PDU_LAYOU…

(params: UsePduLayoutParams, options: UsePduLayoutOptions = {}) => UsePduLayoutResult

useRackLayout

Fetches the rack structure for a worker type from GET /auth/list-racks (type is required — the backend 400s with ERR_TYPE_INVALID without it). Feeds the Explorer rack grouping.

(params: UseRackLayoutParams, options: UseRackLayoutOptions = {}) => UseRackLayoutResult

useSite

Fetches the configured site label from GET /auth/site. Static deployment config — fetched once per session, no polling.

(options: UseSiteOptions = {}) => UseSiteResult

useThingComment

Device-comment writes for the Explorer detail panel — add, edit, and delete against /auth/thing/comment (the author is stamped server-side from the session token). Comments ride on the thing rows themselves (comments in the list-things…

() => UseThingCommentResult

useThingDetail

Fetches a single thing by id from GET /auth/list-things with the full Op Centre field projection — the data source for the Explorer detail panel and the container Thing-detail view.

(id: string | undefined, options: UseThingDetailOptions = {}) => UseThingDetailResult

From @tetherto/mdk-react-devkit

useExplorerSelection

Bridges the Explorer table selection into the shared devicesStore that the write-control cards read. Given the active tab and the table's row-selection, it dispatches the matching setters — contain…

({ deviceType, rows, selected, }: UseExplorerSelectionParams) => UseExplorerSelectionResult

useMinerDetail

Reads the miner selection the [**useExplorerSelection**](/reference/ui/hooks/op-centre/#useexplorerselection) bridge writes into devicesStore and shapes the head miner for the read-only cards of the miner detail panel — the info rows ({@link MinerInfoCar…

() => UseMinerDetailResult

On this page