Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dashboard] Add start/end time for job #18901

Merged
merged 2 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions dashboard/client/src/pages/job/JobDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
TableRow,
Tabs,
} from "@material-ui/core";
import dayjs from "dayjs";
import React from "react";
import { Link, RouteComponentProps } from "react-router-dom";
import ActorTable from "../../components/ActorTable";
Expand Down Expand Up @@ -140,6 +141,16 @@ const JobDetailPage = (props: RouteComponentProps<{ id: string }>) => {
<span className={classes.label}>Driver Pid</span>:{" "}
{jobInfo.driverPid}
</Grid>
<Grid item xs={4}>
<span className={classes.label}>StartTime</span>:{" "}
{dayjs(Number(jobInfo.startTime)).format("YYYY/MM/DD HH:mm:ss")}
</Grid>
<Grid item xs={4}>
<span className={classes.label}>EndTime</span>:{" "}
{jobInfo.endTime > 0
? dayjs(Number(jobInfo.endTime)).format("YYYY/MM/DD HH:mm:ss")
: "-"}
</Grid>
{jobInfo.eventUrl && (
<Grid item xs={4}>
<span className={classes.label}>Event Link</span>:{" "}
Expand Down
19 changes: 16 additions & 3 deletions dashboard/client/src/pages/job/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ const useStyles = makeStyles((theme) => ({
},
}));

const columns = ["ID", "DriverIpAddress", "DriverPid", "IsDead", "Timestamp"];
const columns = [
"ID",
"DriverIpAddress",
"DriverPid",
"IsDead",
"StartTime",
"EndTime",
];

const JobList = () => {
const classes = useStyles();
Expand Down Expand Up @@ -98,7 +105,8 @@ const JobList = () => {
driverIpAddress,
isDead,
driverPid,
timestamp,
startTime,
endTime,
}) => (
<TableRow key={jobId}>
<TableCell align="center">
Expand All @@ -110,7 +118,12 @@ const JobList = () => {
{isDead ? "true" : "false"}
</TableCell>
<TableCell align="center">
{dayjs(Number(timestamp)).format("YYYY/MM/DD HH:mm:ss")}
{dayjs(Number(startTime)).format("YYYY/MM/DD HH:mm:ss")}
</TableCell>
<TableCell align="center">
{endTime > 0
? dayjs(Number(endTime)).format("YYYY/MM/DD HH:mm:ss")
: "-"}
</TableCell>
</TableRow>
),
Expand Down
2 changes: 2 additions & 0 deletions dashboard/client/src/type/job.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export type Job = {
driverEntry: string;
state: string;
timestamp: number;
startTime: number;
endTime: number;
namespaceId: string;
driverPid: number;
driverIpAddress: string;
Expand Down