From b611a9de9eeaa34b8c8bf8903bd481ad354058ad Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 24 Feb 2025 17:13:46 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20setup=20inverter=20detail=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/(defaults)/chint/inverters/[id]/page.tsx | 239 +++++++++++++++++++ app/(defaults)/chint/inverters/page.tsx | 3 +- components/panel-code-highlight.tsx | 1 - 3 files changed, 241 insertions(+), 2 deletions(-) create mode 100644 app/(defaults)/chint/inverters/[id]/page.tsx diff --git a/app/(defaults)/chint/inverters/[id]/page.tsx b/app/(defaults)/chint/inverters/[id]/page.tsx new file mode 100644 index 0000000..ef8b0a8 --- /dev/null +++ b/app/(defaults)/chint/inverters/[id]/page.tsx @@ -0,0 +1,239 @@ +'use client'; + +import PanelCodeHighlight from '@/components/panel-code-highlight' +import React, { Fragment, useEffect, useState } from 'react'; +import { Tab } from '@headlessui/react'; +import IconHome from '@/components/icon/icon-home'; +import IconUser from '@/components/icon/icon-user'; +import IconPhone from '@/components/icon/icon-phone'; +import { useRouter } from 'next/router'; +import { useParams } from 'next/navigation'; + +type Props = {} + +const InverterViewPage = (props: Props) => { + const [isMounted, setIsMounted] = useState(false) + const params = useParams() + console.log() + useEffect(() => { + setIsMounted(true) + }, []) + + // https://api-a.fomware.com.cn/asset/v1/list?key=1105160823180001&type=2 + + return ( + <> + +
+ {isMounted && ( + + + + {({ selected }) => ( + + )} + + + {({ selected }) => ( + + )} + + + {({ selected }) => ( + + )} + + + {({ selected }) => ( + + )} + + + {({ selected }) => ( + + )} + + + {({ selected }) => ( + + )} + + + + +
+

Last Updated ( 2025-02-24 16:03:10 +0800 )

+ +
+
+

Basic Information

+
+
+ +
+

Model: CPS SCA10KTL-T

+

SN: 1105160823180001

+

Total Energy: 9.24 MWh

+

Today Energy: 35.65 kWh

+

Reactive Power: -226.9 var

+

Active Power: 5.552 kW

+

Inverter Mode: OnGrid

+

Inner Temperature: 53°C

+

Create Time: 2024-06-05 12:05:41 +0800

+

Modules: Master: 011330, Deputy: BR0208

+
+ +
+ + +
+ +
+
+
+ img +
+
+
Media heading
+

+ Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra + turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. +

+
+
+
+
+ +
+

+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis + nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +

+
+
+ Disabled +
+
+ )} +
+
+ + +
+ {isMounted && ( + + + + {({ selected }) => ( + + )} + + + {({ selected }) => ( + + )} + + + {({ selected }) => ( + + )} + + + {({ selected }) => ( + + )} + + + + +
+ + + + + + + + + + + {[ + { pv: "PV1/PV1", voltage: 362.1, current: 7.5, power: 2717.5 }, + { pv: "PV2/PV2", voltage: 347.0, current: 9.16, power: 3181.9 }, + { pv: "PV3/PV3", voltage: 0.0, current: 0.0, power: 0.0 }, + { pv: "PV4/PV4", voltage: 0.0, current: 0.0, power: 0.0 }, + ].map((row, index) => ( + + + + + + + ))} + +
Voltage(V)Current(A)Power(W)
{row.pv}{row.voltage}{row.current}{row.power}
+
+
+ +
+ + + + + + + + + + + + {[ + { pv: "A", voltage: 362.1, current: 7.5, power: 2717.5, frequency: 1 }, + { pv: "B", voltage: 347.0, current: 9.16, power: 3181.9, frequency: 1 }, + { pv: "C", voltage: 0.0, current: 0.0, power: 0.0, frequency: 1 }, + ].map((row, index) => ( + + + + + + + + ))} + +
Voltage(V)Current(A)Power(W)Frequency(Hz)
{row.pv}{row.voltage}{row.current}{row.power}{row.frequency}
+
+
+ Disabled + Disabled +
+
+ )} +
+ + + ) +} + +export default InverterViewPage diff --git a/app/(defaults)/chint/inverters/page.tsx b/app/(defaults)/chint/inverters/page.tsx index 11f92e8..0744130 100644 --- a/app/(defaults)/chint/inverters/page.tsx +++ b/app/(defaults)/chint/inverters/page.tsx @@ -9,6 +9,7 @@ import React, { useEffect, useState } from 'react' // import ReactApexChart from 'react-apexcharts'; import dynamic from 'next/dynamic'; +import Link from 'next/link'; const ReactApexChart = dynamic(() => import('react-apexcharts'), { ssr: false }); type Props = {} @@ -111,7 +112,7 @@ const SungrowInverters = (props: Props) => { {inverters.map((data) => ( -
{data.name}
+
{data.name}
{data.siteName}
diff --git a/components/panel-code-highlight.tsx b/components/panel-code-highlight.tsx index 96b96bf..5bb4c77 100644 --- a/components/panel-code-highlight.tsx +++ b/components/panel-code-highlight.tsx @@ -15,7 +15,6 @@ const PanelCodeHighlight = ({ children, title, id, className = '' }: PanelCodeHi
{title}
-
{children}