🚧 inverter add data

This commit is contained in:
sam 2025-02-24 14:49:35 +08:00
parent 93191ac4a0
commit 27d9986d40
2 changed files with 32 additions and 6 deletions

View File

@ -43,9 +43,15 @@ const SungrowInverters = (props: Props) => {
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Model</th> <th>Inverter Name</th>
<th>Site Name</th> <th>Site Name</th>
<th>Status</th> <th>Gateway SN</th>
<th>Inverter Status</th>
<th>Model</th>
<th>SN</th>
<th>Real Time Power</th>
<th>E-Today</th>
<th>WeekData</th>
<th>Created At</th> <th>Created At</th>
<th>Updated At</th> <th>Updated At</th>
<th className="text-center">Action</th> <th className="text-center">Action</th>
@ -55,17 +61,20 @@ const SungrowInverters = (props: Props) => {
{inverters.map((data) => ( {inverters.map((data) => (
<tr key={data.id}> <tr key={data.id}>
<td> <td>
<div className="whitespace-nowrap">{data.model}</div> <div className="whitespace-nowrap">{data.name}</div>
</td> </td>
<td> <td>
<div className="whitespace-nowrap">{data.siteName}</div> <div className="whitespace-nowrap">{data.siteName}</div>
</td> </td>
<td>
<div>{data.gatewaySn}</div>
</td>
<td> <td>
<div className={`whitespace-nowrap ${ <div className={`whitespace-nowrap ${
data.status === 0 ? "text-gray-500" // Initial data.status === 0 ? "text-gray-500" // Initial
: data.status === 1 ? "text-green-500" // Standby : data.status === 1 ? "text-blue-500" // Standby
: data.status === 2 ? "text-red-500" // Fault : data.status === 2 ? "text-red-500" // Fault
: data.status === 3 ? "text-blue-500" // Running : data.status === 3 ? "text-green-500" // Running
: data.status === 5 ? "text-yellow-500" // Offline : data.status === 5 ? "text-yellow-500" // Offline
: data.status === 9 ? "text-purple-500" // Shutdown : data.status === 9 ? "text-purple-500" // Shutdown
: "text-gray-400" // Unknown (default) : "text-gray-400" // Unknown (default)
@ -73,7 +82,21 @@ const SungrowInverters = (props: Props) => {
{data.statusLabel} {data.statusLabel}
</div> </div>
</td> </td>
<td>
<div>{data.model}</div>
</td>
<td>
<div>{data.sn}</div>
</td>
<td>
<div>{data.activePowerWithUnit}</div>
</td>
<td>
<div>{data.eTodayWithUnit}</div>
</td>
<td>
<div>{data.eTodayWithUnit}</div>
</td>
<td>{formatUnixTimestamp(data.createdAt)}</td> <td>{formatUnixTimestamp(data.createdAt)}</td>
<td>{formatUnixTimestamp(data.updatedAt)}</td> <td>{formatUnixTimestamp(data.updatedAt)}</td>
<td className="text-center"> <td className="text-center">

View File

@ -134,6 +134,9 @@ const Sidebar = () => {
<li> <li>
<Link href="/chint/sites">Sites</Link> <Link href="/chint/sites">Sites</Link>
</li> </li>
<li>
<Link href="/chint/gateway">Gateaway</Link>
</li>
<li> <li>
<Link href="/chint/inverters">Inverters</Link> <Link href="/chint/inverters">Inverters</Link>
</li> </li>