Prettify json bytes in Web UI

This commit is contained in:
Hugo Fonseca
2021-12-14 00:39:55 +00:00
committed by GitHub
parent 980cdedcc4
commit 711ca8b5c8
19 changed files with 53 additions and 33 deletions

View File

@@ -18,7 +18,7 @@ import { SortDirection, SortableTableColumn } from "../types/table";
import TableSortLabel from "@material-ui/core/TableSortLabel";
import SyntaxHighlighter from "./SyntaxHighlighter";
import { SchedulerEntry } from "../api";
import { timeAgo, durationBefore } from "../utils";
import { timeAgo, durationBefore, prettifyPayload } from "../utils";
import SchedulerEnqueueEventsTable from "./SchedulerEnqueueEventsTable";
const useStyles = makeStyles((theme) => ({
@@ -288,7 +288,7 @@ function Row(props: RowProps) {
</TableCell>
<TableCell className={clsx(isLastRow && classes.noBorder)}>
<SyntaxHighlighter language="json">
{entry.task_payload}
{prettifyPayload(entry.task_payload)}
</SyntaxHighlighter>
</TableCell>
<TableCell className={clsx(isLastRow && classes.noBorder)}>