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

@@ -36,6 +36,7 @@ import {
stringifyDuration,
timeAgo,
uuidPrefix,
prettifyPayload
} from "../utils";
import { usePolling } from "../hooks";
import { TaskInfoExtended } from "../reducers/tasksReducer";
@@ -326,7 +327,7 @@ function Row(props: RowProps) {
language="json"
customStyle={{ margin: 0, maxWidth: 400 }}
>
{task.payload}
{prettifyPayload(task.payload)}
</SyntaxHighlighter>
</TableCell>
<TableCell>{timeAgo(task.completed_at)}</TableCell>
@@ -335,7 +336,7 @@ function Row(props: RowProps) {
language="json"
customStyle={{ margin: 0, maxWidth: 400 }}
>
{task.result}
{prettifyPayload(task.result)}
</SyntaxHighlighter>
</TableCell>
<TableCell>