diff --git a/central_frontend/src/routes/DevicesRoute.tsx b/central_frontend/src/routes/DevicesRoute.tsx index e0ab75f..9545bf9 100644 --- a/central_frontend/src/routes/DevicesRoute.tsx +++ b/central_frontend/src/routes/DevicesRoute.tsx @@ -19,7 +19,7 @@ import { BoolText } from "../widgets/BoolText"; import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer"; import { TimeWidget } from "../widgets/TimeWidget"; -export function DevicesRoute(): React.ReactElement { +export function DevicesRoute(p: { homeWidget?: boolean }): React.ReactElement { const loadKey = React.useRef(1); const [list, setList] = React.useState(); @@ -38,6 +38,7 @@ export function DevicesRoute(): React.ReactElement { return ( @@ -81,12 +82,12 @@ function ValidatedDevicesList(p: { # - Model - Version - Max number of relays - Created - Updated - Status + Model + Version + Max relays + Created + Updated + Status @@ -100,13 +101,13 @@ function ValidatedDevicesList(p: { {dev.id} - {dev.info.reference} - {dev.info.version} - {dev.info.max_relays} - + {dev.info.reference} + {dev.info.version} + {dev.info.max_relays} + - + diff --git a/central_frontend/src/routes/HomeRoute.tsx b/central_frontend/src/routes/HomeRoute.tsx index 40b97f0..6ec346e 100644 --- a/central_frontend/src/routes/HomeRoute.tsx +++ b/central_frontend/src/routes/HomeRoute.tsx @@ -3,6 +3,8 @@ import { CurrConsumptionWidget } from "./HomeRoute/CurrConsumptionWidget"; import Grid from "@mui/material/Grid2"; import { CachedConsumptionWidget } from "./HomeRoute/CachedConsumptionWidget"; import { RelayConsumptionWidget } from "./HomeRoute/RelayConsumptionWidget"; +import { RelaysListRoute } from "./RelaysListRoute"; +import { DevicesRoute } from "./DevicesRoute"; export function HomeRoute(): React.ReactElement { return ( @@ -25,6 +27,14 @@ export function HomeRoute(): React.ReactElement { + + + + + + + + ); diff --git a/central_frontend/src/routes/RelaysListRoute.tsx b/central_frontend/src/routes/RelaysListRoute.tsx index 70317bd..bb69731 100644 --- a/central_frontend/src/routes/RelaysListRoute.tsx +++ b/central_frontend/src/routes/RelaysListRoute.tsx @@ -18,7 +18,9 @@ import { BoolText } from "../widgets/BoolText"; import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer"; import { TimeWidget } from "../widgets/TimeWidget"; -export function RelaysListRoute(): React.ReactElement { +export function RelaysListRoute(p: { + homeWidget?: boolean; +}): React.ReactElement { const loadKey = React.useRef(1); const [list, setList] = React.useState(); @@ -39,6 +41,7 @@ export function RelaysListRoute(): React.ReactElement { return ( diff --git a/central_frontend/src/widgets/SolarEnergyRouteContainer.tsx b/central_frontend/src/widgets/SolarEnergyRouteContainer.tsx index 9c7a706..5b87fee 100644 --- a/central_frontend/src/widgets/SolarEnergyRouteContainer.tsx +++ b/central_frontend/src/widgets/SolarEnergyRouteContainer.tsx @@ -4,11 +4,12 @@ import React, { PropsWithChildren } from "react"; export function SolarEnergyRouteContainer( p: { label: string; + homeWidget?: boolean; actions?: React.ReactElement; } & PropsWithChildren ): React.ReactElement { return ( -
+
- {p.label} + {p.label} {p.actions ?? <>}