Skip to content

Commit

Permalink
fixes #1096 (#1362)
Browse files Browse the repository at this point in the history
* fixes #1096

* reviewed-changes

* reviewed-changes2

* reviewed-changes
  • Loading branch information
abheektripathy committed Dec 27, 2022
1 parent 2330d6c commit 841f6ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion frontend/src/components/jobs/result/utils/sections.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable camelcase */
import React from "react";
import PropTypes from "prop-types";
import { Button, ListGroup, ListGroupItem, Badge, Fade } from "reactstrap";
Expand Down Expand Up @@ -111,6 +112,10 @@ export function JobActionsBar({ job }) {
}

export function JobInfoCard({ job }) {
const process_time_mmss = new Date(job.process_time * 1000)
.toISOString()
.substring(14, 19);

return (
<>
<ContentSection className="mb-0 bg-darker d-flex-center">
Expand Down Expand Up @@ -140,7 +145,7 @@ export function JobInfoCard({ job }) {
["TLP", <TLPTag value={job.tlp} />],
["User", job.user?.username],
["MD5", job.md5],
["Process Time (s)", job.process_time],
["Process Time (mm:ss)", process_time_mmss],
[
"Start Time",
<DateHoverable
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/components/jobs/table/data.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable camelcase */
/* eslint-disable react/prop-types */
import React from "react";

Expand All @@ -16,6 +17,9 @@ import {
ALL_CLASSIFICATIONS,
} from "../../../constants";

const process_time_mmss = (value) =>
new Date(value * 1000).toISOString().substring(14, 19);

const jobTableColumns = [
{
Header: () => null, // No header
Expand Down Expand Up @@ -162,9 +166,11 @@ const jobTableColumns = [
maxWidth: 175,
},
{
Header: "Process Time (s)",
Header: "Process Time (mm:ss)",
id: "process_time",
accessor: "process_time",
Cell: ({ value }) => <span>{process_time_mmss(value)}</span>,

disableSortBy: true,
maxWidth: 125,
},
Expand Down

0 comments on commit 841f6ae

Please sign in to comment.