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 { TaskDetailsRouteParams } from "../paths";
import { usePolling } from "../hooks";
import { listQueuesAsync } from "../actions/queuesActions";
import SyntaxHighlighter from "../components/SyntaxHighlighter";
import { durationFromSeconds, stringifyDuration, timeAgo } from "../utils";
import { durationFromSeconds, stringifyDuration, timeAgo, prettifyPayload } from "../utils";
function mapStateToProps(state: AppState) {
return {
@@ -228,7 +228,7 @@ function TaskDetailsView(props: Props) {
language="json"
customStyle={{ margin: 0, maxWidth: 400 }}
>
{taskInfo.payload}
{prettifyPayload(taskInfo.payload)}
</SyntaxHighlighter>
)}
</div>
@@ -262,7 +262,7 @@ function TaskDetailsView(props: Props) {
language="json"
customStyle={{ margin: 0, maxWidth: 400 }}
>
{taskInfo.result}
{prettifyPayload(taskInfo.result)}
</SyntaxHighlighter>
</div>
</div>