CEC-377 Fix carstatus page (#72)

This commit is contained in:
John Wu
2021-08-06 09:46:42 -07:00
committed by GitHub
parent 070e4f923c
commit 5d82356991

View File

@@ -110,6 +110,14 @@ const MainForm = () => {
} }
}; };
const updateName = (row) => {
if (row.updatepackage)
return `${row.updatepackage.package_name} ${row.updatepackage.version}`;
if (row.updatemanifest)
return `${row.updatemanifest.name} ${row.updatemanifest.version}`;
return "None";
};
return ( return (
<div className={classes.paper} style={{ height: 700, width: "100%" }}> <div className={classes.paper} style={{ height: 700, width: "100%" }}>
<Table> <Table>
@@ -124,7 +132,7 @@ const MainForm = () => {
{carUpdates.map((row) => ( {carUpdates.map((row) => (
<TableRow key={row.id}> <TableRow key={row.id}>
<TableCell align="center">{row.id}</TableCell> <TableCell align="center">{row.id}</TableCell>
<TableCell align="center">{`${row.updatepackage.package_name} ${row.updatepackage.version}`}</TableCell> <TableCell align="center">{updateName(row)}</TableCell>
<TableCell align="center">{row.status}</TableCell> <TableCell align="center">{row.status}</TableCell>
<TableCell align="center"> <TableCell align="center">
{LocalDateTimeString(row.created)} {LocalDateTimeString(row.created)}