MDK Logo

Controls

Power mode, reboot, LED, frequency, maintenance, and container-level controls for the details view

Operator controls for the currently selected miner or container. These components dispatch into actionsSlice and surface confirmation through the standard notification hooks.

For miner identity, see the details view overview. For aggregated stats, see Stats. For fleet activity, see Charts.

Prerequisites

Components

ComponentDescription
ContainerControlsBoxContainer operations panel
MinerControlsCardMiner power mode and restart controls
MinerPowerModeSelectionButtonsPower mode selector grouped by miner model
BatchContainerControlsCardContainer controls card for selected devices

MinerControlsCard

Miner power mode and control panel with reboot, LED controls, frequency settings, and maintenance operations.

Import

import { MinerControlsCard } from '@mdk/foundation'

Props

PropTypeDefaultDescription
buttonsStatesRecord<string, boolean | undefined>requiredPer-action disable flags. Currently consumed: isSetUpFrequencyButtonDisabled
isLoadingbooleanrequiredRenders the loading spinner and disables every action
showPowerModeSelectorbooleantrueShow the embedded MinerPowerModeSelectionButtons row

Available controls

The component renders a different control set depending on the selection and maintenance state:

Standard mode (any non-maintenance selection):

  • Power mode selector: embedded MinerPowerModeSelectionButtons (toggle via showPowerModeSelector)
  • Reboot: dispatches ACTION_TYPES.REBOOT for every selected miner
  • Setup Freq. Settings: opens the frequency dropdown and dispatches ACTION_TYPES.SETUP_FREQUENCY_SPEED with the chosen value
  • LEDs on / LEDs off: dispatches ACTION_TYPES.SET_LED for miners whose LED is not already in the requested state
  • Move to Maintenance, Change miner info, Change position: single-device actions that open the matching dialog flow

Single-miner-in-maintenance mode:

  • Change Miner Info: opens the change-info dialog
  • Back from Maintenance: opens the container-selection dialog (disabled until the device has a MAC address)
  • Remove Miner: opens the remove-miner dialog

The card returns null when more than one miner is selected and every selected miner is already in maintenance.

Basic usage

<MinerControlsCard
  buttonsStates={{ isSetUpFrequencyButtonDisabled: false }}
  isLoading={false}
/>

Hide the power mode selector

<MinerControlsCard
  buttonsStates={buttonsStates}
  isLoading={isLoading}
  showPowerModeSelector={false}
/>

Composition

MinerControlsCard composes MinerPowerModeSelectionButtons, MinerSetupFrequencyDropdown, and four dialogs (ContainerSelectionDialog, RemoveMinerDialog, AddReplaceMinerDialog, PositionChangeDialog). The dialogs are mounted unconditionally and toggle visibility through internal state; no wiring required from the caller.

Styling

  • .mdk-miner-controls: root element
  • .mdk-miner-controls__label: Miner Controls header
  • .mdk-miner-controls__content: controls container
  • .mdk-miner-controls__loader: loading spinner
  • .mdk-miner-controls__grid: standard mode button grid
  • .mdk-miner-controls__full-width: full-width button slot
  • .mdk-miner-controls__maintenance-stack: maintenance mode action stack
  • .mdk-miner-controls__single-device-stack: single-device action stack

MinerPowerModeSelectionButtons

Dropdown selector for setting miner power modes, groups miners by type.

MinerPowerModeSelectionButtons is rendered inside MinerControlsCard by default but is exported as a peer for layouts that want the power-mode dropdown without the rest of the control card (for example, an Alarm rail or a custom toolbar).

Import

import { MinerPowerModeSelectionButtons } from '@mdk/foundation'

Props

PropTypeDefaultDescription
selectedDevicesDevice[][]Miners targeted by the dropdown; used to derive the model groups
setPowerMode(devices: Device[], mode: string) => voidnoneCallback fired with the matching device subset when a mode is chosen
connectedMinersDevice[]noneUsed to compute the current power mode summary when powerModesLog is not provided
powerModesLogUnknownRecordnonePre-computed per-model current power modes (overrides the derived value)
disabledbooleannoneDisable every dropdown
hasMarginbooleanfalseAdd the --with-margin modifier on the root

The component groups selectedDevices by miner model (via getDeviceModel) and renders one dropdown per group. When the selection contains a single model, the button reads Set Power Mode; with multiple models, the model name is appended (Set Power Mode (S19 Pro)).

Basic usage

<MinerPowerModeSelectionButtons
  selectedDevices={selectedMiners}
  setPowerMode={(devices, mode) => {
    console.log('Set power mode:', mode, 'for', devices.length, 'miners')
  }}
/>

With pre-computed power modes

<MinerPowerModeSelectionButtons
  selectedDevices={selectedMiners}
  powerModesLog={powerModesByModel}
  setPowerMode={handlePowerModeChange}
  disabled={isLoading}
/>

Styling

  • .mdk-miner-power-mode-selection-buttons: root element
  • .mdk-miner-power-mode-selection-buttons--with-margin: margin modifier

BatchContainerControlsCard

Renders container controls for the currently selected device(s) from explorer state, switching between batch and single-device modes based on selection count.

BatchContainerControlsCard is the container-level counterpart to MinerControlsCard. It renders inside the details view when one or more containers are selected and switches between batch and single-container layouts based on selection size.

Import

import { BatchContainerControlsCard } from '@mdk/foundation'

Props

PropTypeDefaultDescription
isBatchbooleantrueToggle the title between Batch Container Controls and Container Controls
isCompactbooleannoneForwarded to ContainerControlsBox for the compact layout
connectedMinersunknownnoneForwarded to ContainerControlsBox when exactly one container is selected
alarmsDataItemsTimelineItemData[]noneForwarded alarm timeline data
onNavigate(path: string) => voidno-opForwarded navigation handler

The card reads selectSelectedContainers from Redux and uses the selection to derive the device record passed into ContainerControlsBox. With a single container selected, the full record (plus connectedMiners) is forwarded; with multiple containers, only type is forwarded, and only when every selected container shares the same model (otherwise type is undefined, which forces the batch layout).

Basic usage

<BatchContainerControlsCard
  alarmsDataItems={alarmTimelineItems}
  onNavigate={(path) => router.push(path)}
/>

Single-container compact layout

<BatchContainerControlsCard
  isBatch={false}
  isCompact
  connectedMiners={connectedMinerCount}
  alarmsDataItems={alarmTimelineItems}
  onNavigate={(path) => router.push(path)}
/>

Composition

BatchContainerControlsCard is a thin shell that renders ContentBox (with the batch or single title) wrapping ContainerControlsBox. Use ContainerControlsBox directly if you need to drive the controls from a non-Redux source.

Styling

  • .mdk-batch-container-controls-card: root element
  • .mdk-batch-container-controls-card__controls: controls wrapper inside the content box

ContainerControlsBox

Container operations panel with start/stop, cooling controls, power management, and alarm reset functionality. Adapts UI based on container type (Bitdeer, Bitmain, MicroBT) and supports batch operations across multiple selected containers.

Import

import { ContainerControlsBox } from '@mdk/foundation'

Props

PropTypeDefaultDescription
dataDevicenoneContainer device data
isBatchbooleanfalseEnable batch operations mode
selectedDevicesDevice[][]Selected devices for batch operations
pendingSubmissionsPendingSubmission[][]Pending action submissions
alarmsDataItemsTimelineItemData[][]Active alarms to display
tailLogDataUnknownRecord[]noneTail log data for power modes
onNavigate(path: string) => voidrequiredNavigation handler

Basic usage

<ContainerControlsBox
  data={container}
  onNavigate={(path) => router.push(path)}
/>

Batch operations

<ContainerControlsBox
  isBatch
  selectedDevices={selectedContainers}
  pendingSubmissions={pending}
  alarmsDataItems={alarms}
  onNavigate={handleNavigate}
/>

Container type features

The component automatically adapts based on container type:

  • Bitdeer: Start/Stop, Reset Alarm, Tank 1/2 toggles, Air Exhaust toggle, Socket controls
  • Bitmain Hydro: Start/Stop Cooling, PID Mode display
  • Bitmain Immersion: Start/Stop Cooling, PID Mode, Running Mode, System Status
  • MicroBT: Start/Stop Cooling, Socket controls

Styling

  • .mdk-container-controls-box: Root element
  • .mdk-container-controls-box__buttons-row: Action buttons row
  • .mdk-container-controls-box__toggles-row: Toggle switches row
  • .mdk-container-controls-box__toggle: Individual toggle container
  • .mdk-container-controls-box__bulk-row: Bulk action buttons row

On this page