Finish UI
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
Grid,
|
||||
IconButton,
|
||||
Table,
|
||||
TableBody,
|
||||
@@ -7,7 +8,10 @@ import {
|
||||
TablePagination,
|
||||
TableRow,
|
||||
} from "@material-ui/core";
|
||||
import AddCircleIcon from "@material-ui/icons/AddCircle";
|
||||
import DeleteIcon from "@material-ui/icons/Delete";
|
||||
import clsx from "clsx";
|
||||
import { LocalDateTimeString } from "../../utils/dates";
|
||||
import { logger } from "../../services/monitoring";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useParams } from "react-router";
|
||||
@@ -17,6 +21,7 @@ import {
|
||||
} from "../Contexts/CarUpdatesContext";
|
||||
import { useStatusContext } from "../Contexts/StatusContext";
|
||||
import { useUserContext } from "../Contexts/UserContext";
|
||||
import { Link } from "react-router-dom";
|
||||
import TableHeaderSortable from "../Table/HeaderSortable";
|
||||
import { useLocalStorage } from "../useLocalStorage";
|
||||
import DeleteConfirmation from "../DeleteConfirmation";
|
||||
@@ -26,12 +31,12 @@ import { RoleWrap } from "../Controls/RoleWrap";
|
||||
|
||||
const tableColumns = [
|
||||
{
|
||||
id: "sums_version",
|
||||
label: "SUMS Version",
|
||||
id: "sums_rxswin",
|
||||
label: "RXSWIN (RX Software Identification Number)",
|
||||
},
|
||||
{
|
||||
id: "sums_rxswin",
|
||||
label: "RXSwin Version",
|
||||
id: "created_at",
|
||||
label: "Created",
|
||||
},
|
||||
];
|
||||
|
||||
@@ -59,7 +64,18 @@ const MainForm = () => {
|
||||
groups,
|
||||
providers,
|
||||
} = useUserContext();
|
||||
const { setMessage } = useStatusContext();
|
||||
const { setMessage, setTitle, setSitePath } = useStatusContext();
|
||||
|
||||
useEffect(() => {
|
||||
setTitle(`SUMS Version ${sums_version}`);
|
||||
setSitePath([
|
||||
{
|
||||
label: `SUMS Version ${sums_version}`,
|
||||
link: `/sums/${sums_version}`,
|
||||
},
|
||||
]);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
@@ -122,6 +138,13 @@ const MainForm = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Grid container className={classes.root} spacing={2}>
|
||||
<Grid item md={4} className={clsx(classes.textJustifyAlign, classes.actionsBar)}>
|
||||
<Link to={`/sums-rxswin-add/${sums_version}`} className={classes.labelInline}>
|
||||
<AddCircleIcon fontSize="large" />
|
||||
</Link>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Table>
|
||||
<TableHeaderSortable
|
||||
classes={classes}
|
||||
@@ -134,10 +157,10 @@ const MainForm = () => {
|
||||
{versionRxSwins.map((row, index) => (
|
||||
<TableRow key={index}>
|
||||
<TableCell align="center">
|
||||
{row.version}
|
||||
{row.rxswin}
|
||||
</TableCell>
|
||||
<TableCell align="center">
|
||||
{row.rxswin}
|
||||
{LocalDateTimeString(row.created)}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<RoleWrap
|
||||
|
||||
Reference in New Issue
Block a user