Add battery health to host details (#6472)

This commit is contained in:
Luke Heath 2022-07-05 12:17:51 -07:00 committed by GitHub
parent 1c6c379f4d
commit 943a1188f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1 @@
* Added battery health to host details UI

View File

@ -178,6 +178,7 @@ const DeviceUserPage = ({
"hardware_serial",
"primary_ip",
"public_ip",
"batteries",
])
);

View File

@ -342,6 +342,7 @@ const HostDetailsPage = ({
"primary_ip",
"public_ip",
"geolocation",
"batteries",
])
);

View File

@ -137,6 +137,20 @@ const About = ({
);
};
const renderBattery = () => {
if (typeof aboutData.batteries !== "object") {
return null;
}
return (
<div className="info-grid__block">
<span className="info-grid__header">Battery</span>
<span className="info-grid__data">
{aboutData.batteries[0]?.health}
</span>
</div>
);
};
if (deviceUser) {
return (
<div className="section about">
@ -160,6 +174,7 @@ const About = ({
</div>
{renderSerialAndIPs()}
{renderDeviceUser()}
{renderBattery()}
</div>
</div>
);
@ -190,6 +205,7 @@ const About = ({
{renderMdmData()}
{renderDeviceUser()}
{renderGeolocation()}
{renderBattery()}
</div>
</div>
);