Operational reporting
Operational reporting components — operational dashboard, energy consumption, and hashrate views
@tetherto/mdk-react-devkit/foundation
Operational reporting components cover a consolidated operations dashboard (OperationalDashboard), energy consumption (EnergyReport), and hashrate (Hashrate) views. Each is a self-contained reporting surface — supply your API data; the component handles layout, charts, and tab navigation.
For financial reporting see Financial. For operational efficiency see Operational efficiency.
Prerequisites
- Complete the @tetherto/mdk-react-devkit installation and add the dependency
<MdkProvider>from@tetherto/mdk-react-adapter
Components
| Component | Description |
|---|---|
EnergyReport | Operational energy consumption reporting view |
Hashrate | Operational hashrate reporting view |
OperationalDashboard | 2×2 grid of site-operations charts (hashrate, power, efficiency, miners status) |
OperationalDashboard
Composite operational dashboard showing a 2×2 grid of line-trend and stacked-bar charts. Each card can expand to full width; expand state persists across remounts. Pair with useOperationsDashboard to shape raw metric logs into chart-ready payloads.
Import
import { OperationalDashboard } from '@tetherto/mdk-react-devkit/foundation'
import type { OperationalDashboardProps, UseOperationsDashboardInput } from '@tetherto/mdk-react-devkit/foundation'Props
All props are optional.
| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
hashrate | Optional | { data, isLoading } | none | Pre-shaped hashrate trend data from useOperationsDashboard |
consumption | Optional | { data, isLoading } | none | Pre-shaped power-consumption trend data |
efficiency | Optional | { data, isLoading } | none | Pre-shaped site-efficiency trend data |
miners | Optional | { data, isLoading } | none | Pre-shaped miners-status stacked-bar data |
controls | Optional | ReactElement | none | Optional slot rendered above the grid (for example a date-range picker) |
Basic usage
import { OperationalDashboard, useOperationsDashboard } from '@tetherto/mdk-react-devkit/foundation'
function OperationsDashboardPage({ hashrateLog, consumptionLog, efficiencyLog, minersLog }) {
const vm = useOperationsDashboard({
hashrate: { log: hashrateLog, isLoading },
consumption: { log: consumptionLog, isLoading },
efficiency: { log: efficiencyLog, isLoading },
miners: { log: minersLog, isLoading },
})
return (
<OperationalDashboard
hashrate={vm.hashrate}
consumption={vm.consumption}
efficiency={vm.efficiency}
miners={vm.miners}
/>
)
}Behaviour
Renders a 2×2 grid of four LineChartCard-based chart cards: hashrate trend, power consumption trend, site efficiency trend, and miners status (stacked bar). Each card has an expand toggle that widens it to full grid width; expand state persists across remounts. Assumes a single OperationalDashboard instance is mounted at a time.
Styling
.mdk-operational-dashboard: Root element.mdk-operational-dashboard__controls: Controls slot wrapper (only rendered whencontrolsis supplied).mdk-operational-dashboard__grid: 2×2 chart grid.mdk-operational-dashboard__cell: Individual chart cell.mdk-operational-dashboard__cell--expanded: Modifier applied when a card is expanded to full width
EnergyReport
Multi-tab reporting surface for operational energy data: site view and miner-type breakdown charts.
Import
import { EnergyReport } from '@tetherto/mdk-react-devkit/foundation'
import type { EnergyReportProps, EnergyReportTabValue } from '@tetherto/mdk-react-devkit/foundation'Props
| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
defaultTab | Optional | EnergyReportTabValue | 'site-view' | Tab shown on first render — defaults to 'site-view' |
siteView | Optional | HashrateSiteViewProps | none | Props for the Site View tab |
minerTypeView | Optional | HashrateMinerTypeViewProps | none | Props for the Miner Type View tab |
minerUnitView | Optional | EnergyReportMinerUnitViewProps | none | Props for the Mining Unit View tab |
className | Optional | string | none | Optional root class override |
EnergyReportTabValue type
type EnergyReportTabValue = 'site-view' | 'miner-type-view' | 'miner-unit-view'EnergyReportSiteViewProps key fields
type EnergyReportSiteViewProps = {
consumptionLog?: MetricsConsumptionLogEntry[] // power/consumption time-series
nominalPowerAvailabilityMw?: number | null // site nominal capacity
containers?: EnergyReportContainer[] // container inventory
tailLog?: EnergyReportTailLogItem[][] // snapshot tail-log for power-mode table
dateRange?: EnergyReportDateRange // controlled date range
onDateRangeChange?: (range: EnergyReportDateRange) => void
}Basic usage
import { EnergyReport } from '@tetherto/mdk-react-devkit/foundation'
export const EnergyReportPage = () => (
<EnergyReport
siteView={{
consumptionLog: consumptionData,
nominalPowerAvailabilityMw: 500,
containers,
tailLog,
}}
minerTypeView={{ groupedConsumption, containers }}
minerUnitView={{ groupedConsumption: unitGroupedData, containers }}
/>
)More examples
Behaviour
Renders a three-tab layout:
- Site View — power consumption trend chart against nominal capacity, power-mode breakdown table per container. A
DateRangePickerand Reset button appear above this tab only. Date range is managed internally unlesssiteView.dateRangeis provided. - Miner Type View — consumption grouped by miner type as a bar chart with per-miner-type breakdown.
- Mining Unit View — consumption grouped by mining unit as a bar chart.
Each tab fetches independently via its own prop bag.
Styling
.mdk-energy-report: Root element.mdk-energy-report__date-controls: Date picker + Reset row (site view only)
Hashrate
Multi-tab reporting surface for fleet hashrate: site view and mining-unit breakdown charts.
Import
import { Hashrate } from '@tetherto/mdk-react-devkit/foundation'
import type { HashrateProps, HashrateTabValue, HashrateSiteViewProps } from '@tetherto/mdk-react-devkit/foundation'Props
| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
defaultTab | Optional | HashrateTabValue | 'site-view' | Tab shown on first render |
siteView | Optional | HashrateSiteViewProps | none | Props for the Site View tab |
minerTypeView | Optional | HashrateMinerTypeViewProps | none | Props for the Miner Type View tab |
miningUnitView | Optional | HashrateMiningUnitViewProps | none | Props for the Mining Unit View tab |
HashrateTabValue type
type HashrateTabValue = 'site-view' | 'miner-type-view' | 'mining-unit-view'Site view tab props
HashrateSiteView renders an aggregate hashrate trend line across the whole site, with an optional miner-type filter that scopes the sum to a subset. A date-range picker and optional reset button appear in the control row.
| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
log | Optional | HashrateGroupedLog | [] | Hashrate log grouped by miner type |
isLoading | Optional | boolean | false | Show a loading state on the chart |
dateRange | Optional | HashrateDateRange | none | Controlled date range { start, end } in ms epoch; drives the upstream query |
onDateRangeChange | Optional | function | none | Fires when the user selects a new range from the date picker |
onReset | Optional | function | none | When provided, renders a Reset button next to the date picker |
Miner type and mining unit tab props
Both minerTypeView and miningUnitView render bar charts. Charts share axis scaling when both tabs are visible so relative comparisons remain accurate.
| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
chartInput | Optional | ToBarChartDataInput | none | Declarative bar data ({ labels, series }) |
isEmpty | Optional | boolean | false | When true, shows the chart empty state |
isLoading | Optional | boolean | false | Show a loading state on the bar chart |
Basic usage
import { Hashrate } from '@tetherto/mdk-react-devkit/foundation'
<Hashrate
siteView={{
log: groupedHashrateLog,
isLoading,
dateRange,
onDateRangeChange: setDateRange,
}}
minerTypeView={{ chartInput: minerTypeInput, isLoading }}
miningUnitView={{ chartInput: miningUnitInput, isLoading }}
/>More examples
Behaviour
Renders a three-tab layout using a shared Tabs shell. Each tab fetches independently via its own prop bag:
- Site View — aggregate hashrate trend line for the whole site with optional miner-type filter; date-range picker and Reset button in the control row
- Miner Type View — hashrate broken down by miner model/type as a bar chart with a toggle legend
- Mining Unit View — hashrate broken down per mining unit (container) as a bar chart with a toggle legend
Miner type and mining unit bar charts share Y-axis scaling so relative comparisons across tabs remain accurate. Active tab is managed internally.
Styling
.mdk-hashrate: Root element
Related hooks
| Hook | Supplies |
|---|---|
useOperationsDashboard | Shapes raw operational metric logs into chart-ready payloads for the four OperationalDashboard cards |
useHashrate | Normalises a grouped-hashrate query result into the shape consumed by <Hashrate /> |
useEnergyReportSite | Merges consumption metrics with tail-log and container data for <EnergyReport /> |
useReportTimeFrameSelectorState | Active time-frame window and setters for the time-frame selector |
useTimeframeControls | Year/month/week state machine for TimeframeControls |