import VisibilityIcon from "@mui/icons-material/Visibility"; import { Button, IconButton, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, } from "@mui/material"; import React from "react"; import { useNavigate } from "react-router-dom"; import { APIToken, APITokenURL, ExpiredAPIToken, TokensApi, } from "../api/TokensApi"; import { AsyncWidget } from "../widgets/AsyncWidget"; import { RouterLink } from "../widgets/RouterLink"; import { TimeWidget, timeDiff } from "../widgets/TimeWidget"; import { VirtWebRouteContainer } from "../widgets/VirtWebRouteContainer"; export function TokensListRoute(): React.ReactElement { const [list, setList] = React.useState(); const [count] = React.useState(1); const load = async () => { setList(await TokensApi.GetList()); }; return ( } /> ); } export function TokensListRouteInner(p: { list: APIToken[]; }): React.ReactElement { const navigate = useNavigate(); return ( } > Name Description Created Updated Last used IP restriction Max inactivity Rights Actions {p.list.map((t) => { return ( navigate(APITokenURL(t))} style={{ backgroundColor: ExpiredAPIToken(t) ? "red" : "" }} > {t.name} {ExpiredAPIToken(t) && (Expired)} {t.description} {t.ip_restriction} {t.max_inactivity && timeDiff(0, t.max_inactivity)} {t.rights.map((r) => { return (
{r.verb} {r.path}
); })}
); })}
); }