diff --git a/.env.development b/.env.development index 0b2aaf0..1466a87 100644 --- a/.env.development +++ b/.env.development @@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false NEXT_PUBLIC_EXPORT_STATIC=false NEXT_PUBLIC_USE_CGI=false # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.535 +NEXT_PUBLIC_APP_VERSION=1.6.537 NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter) diff --git a/.env.production b/.env.production index 93713ec..3c70af8 100644 --- a/.env.production +++ b/.env.production @@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL NEXT_PUBLIC_EXPORT_STATIC=true NEXT_PUBLIC_USE_CGI=true # App-Versionsnummer -NEXT_PUBLIC_APP_VERSION=1.6.535 +NEXT_PUBLIC_APP_VERSION=1.6.537 NEXT_PUBLIC_CPL_MODE=production \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d371e99..d73ab01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [1.6.537] – 2025-07-03 + +- feat: APIs erstellt für Systemspannungen + +--- +## [1.6.536] – 2025-07-03 + +- feat: APIs erstellt für Systemspannungen + +--- ## [1.6.535] – 2025-07-03 - feat: in System 5 Volt DIA0, DIA1 und DIA2 in dropdown anzeigen diff --git a/components/main/system/DetailModal.tsx b/components/main/system/DetailModal.tsx index 1895534..004b7e4 100644 --- a/components/main/system/DetailModal.tsx +++ b/components/main/system/DetailModal.tsx @@ -13,6 +13,8 @@ type Props = { setZeitraum: (typ: "DIA0" | "DIA1" | "DIA2") => void; }; +type ReduxDataEntry = { t: string; i: number }; + export const DetailModal = ({ isOpen, selectedKey, @@ -20,22 +22,27 @@ export const DetailModal = ({ zeitraum, setZeitraum, }: Props) => { - const typMap: Record = { - "+5V": zeitraum, - "+15V": zeitraum, - "-15V": zeitraum, - "-98V": zeitraum, - }; + const reduxData: ReduxDataEntry[] = useSelector((state: RootState) => { + switch (selectedKey) { + case "+5V": + return state.systemspannung5Vplus[zeitraum] as ReduxDataEntry[]; + case "+15V": + return state.systemspannung15Vplus[zeitraum] as ReduxDataEntry[]; + case "-15V": + return state.systemspannung15Vminus[zeitraum] as ReduxDataEntry[]; + case "-98V": + return state.systemspannung98Vminus[zeitraum] as ReduxDataEntry[]; + case "ADC Temp": + return state.temperaturAdWandler[zeitraum] as ReduxDataEntry[]; + case "CPU Temp": + return state.temperaturProzessor[zeitraum] as ReduxDataEntry[]; + default: + return [] as ReduxDataEntry[]; + } + }); - const typ = selectedKey ? typMap[selectedKey] : null; - type ReduxDataItem = { t: string; i: number }; - - const reduxData = useSelector((state: RootState) => - typ ? (state.systemspannung5Vplus[typ] as ReduxDataItem[]) : [] - ); - - const labels = reduxData.map((e: ReduxDataItem) => e.t); - const values = reduxData.map((e: ReduxDataItem) => e.i); + const labels = reduxData.map((e: ReduxDataEntry) => e.t); + const values = reduxData.map((e: ReduxDataEntry) => e.i); const baseOptions = { responsive: true, @@ -61,7 +68,7 @@ export const DetailModal = ({ return (
-
+

Detailansicht: {selectedKey} @@ -86,7 +93,7 @@ export const DetailModal = ({

-
+
{ const dispatch = useDispatch(); @@ -35,6 +40,11 @@ const SystemPage = () => { useEffect(() => { dispatch(getSystemspannung5VplusThunk(zeitraum)); + dispatch(getSystemspannung15VplusThunk(zeitraum)); + dispatch(getSystemspannung15VminusThunk(zeitraum)); + dispatch(getSystemspannung98VminusThunk(zeitraum)); + dispatch(getTemperaturAdWandlerThunk(zeitraum)); + dispatch(getTemperaturProzessorThunk(zeitraum)); }, [dispatch, zeitraum]); const handleOpenDetail = (key: string) => {