diff --git a/public/_redirects b/public/_redirects new file mode 100644 index 0000000..78f7f20 --- /dev/null +++ b/public/_redirects @@ -0,0 +1 @@ +/* /index.html 200 \ No newline at end of file diff --git a/src/components/Link/index.jsx b/src/components/Link/index.jsx index ead7bc9..ea15242 100644 --- a/src/components/Link/index.jsx +++ b/src/components/Link/index.jsx @@ -2,7 +2,11 @@ import MuiLink from "@mui/material/Link"; export default function Link(props) { return ( - + {props.children} ); diff --git a/src/lib/paddles.ts b/src/lib/paddles.ts index f7e70bc..1d34a06 100644 --- a/src/lib/paddles.ts +++ b/src/lib/paddles.ts @@ -4,8 +4,7 @@ import type { UseQueryResult } from "@tanstack/react-query"; import type { GetURLParams, Run, Job } from "./paddles.d"; const PADDLES_SERVER = - import.meta.env.REACT_APP_PADDLES_SERVER || - "https://paddles.front.sepia.ceph.com"; + import.meta.env.VITE_PADDLES_SERVER || "https://paddles.front.sepia.ceph.com"; function getURL(endpoint: string, params?: GetURLParams) { // Because paddles' API is clunky, we have to do extra work. If it were diff --git a/src/pages/Job/index.jsx b/src/pages/Job/index.jsx index 8da20fb..0a7b5e9 100644 --- a/src/pages/Job/index.jsx +++ b/src/pages/Job/index.jsx @@ -11,6 +11,7 @@ import PlayCircleOutlineIcon from "@mui/icons-material/PlayCircleOutline"; import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline"; import HighlightOffIcon from "@mui/icons-material/HighlightOff"; import formatDuration from "date-fns/formatDuration"; +import { isValid, parse } from "date-fns"; import Editor from "react-simple-code-editor"; import { highlight, languages } from "prismjs/components/prism-core"; import "prismjs/components/prism-yaml"; @@ -43,6 +44,11 @@ function StatusIcon({ status }) { } function timeSince(date) { + const parsedDate = parse(date, "yyyy-MM-dd HH:mm:ss", new Date()); + if (!isValid(parsedDate)) { + return 'N/A'; + } + let minute = 60; let hour = minute * 60; let day = hour * 24; @@ -93,9 +99,16 @@ function JobHeader({ query }) { Nodes:  - {Object.keys(query.data.targets || []).map((item) => { - return {item.split(".")[0]}; - })} + {Object.keys(query.data.targets || []).map((item) => ( + + + {item.split(".")[0]} + +   + + ))} OS: {query.data.os_type} {query.data.os_version} diff --git a/src/pages/Run/index.tsx b/src/pages/Run/index.tsx index e608c1d..a472371 100644 --- a/src/pages/Run/index.tsx +++ b/src/pages/Run/index.tsx @@ -1,11 +1,11 @@ +import { PropsWithChildren } from 'react' import { useQueryParams, StringParam, NumberParam } from "use-query-params"; -import { styled, useTheme } from "@mui/material/styles"; +import { styled } from "@mui/material/styles"; import { useParams } from "react-router-dom"; import Typography from "@mui/material/Typography"; import Button from "@mui/material/Button"; import ButtonGroup from "@mui/material/ButtonGroup"; import { format } from "date-fns"; -import SourceBranch from "mdi-material-ui/SourceBranch"; import { Helmet } from "react-helmet"; import type { Run, RunParams } from "../../lib/paddles.d"; @@ -28,8 +28,17 @@ const Root = styled("div")(() => ({ }, })); +type FilterLinkProps = { + to: string +} + +const FilterLink = (props: PropsWithChildren) => ( + + {props.children} + +); + export default function Run() { - const theme = useTheme(); const [params, setParams] = useQueryParams({ status: StringParam, page: NumberParam, @@ -55,20 +64,16 @@ export default function Run() { {name}
- See similar runs: - - - suite {suite} and branch {branch} - - - - - - - - - scheduled on {date} - + See runs with the same: + + branch + + + suite and branch + + + date +