diff --git a/ui/src/pages/config/view.ts b/ui/src/pages/config/view.ts index 6aedc7b69b57..4977460ae718 100644 --- a/ui/src/pages/config/view.ts +++ b/ui/src/pages/config/view.ts @@ -2,6 +2,7 @@ import "../../styles/lobster-pet.css"; import { truncateUtf16Safe } from "@openclaw/normalization-core/utf16-slice"; import { html, nothing } from "lit"; +import { unsafeHTML } from "lit/directives/unsafe-html.js"; import type { QueueMode } from "../../../../src/auto-reply/reply/queue/types.js"; import type { ConfigUiHints } from "../../api/types.ts"; import type { NativeNotificationsPermission } from "../../app/native-notifications.ts"; @@ -39,6 +40,7 @@ import { canonicalLobsterLook, renderLobsterSvg, } from "../../components/lobster-pet.ts"; +import { highlightJsonHtml } from "../../components/markdown.ts"; import { renderSettingsRow, renderSettingsSegmented, @@ -2026,7 +2028,8 @@ export function renderConfig(props: ConfigProps) { })()} ${props.issues.length > 0 ? html`
${JSON.stringify(props.issues, null, 2)}
+
+${unsafeHTML(highlightJsonHtml(JSON.stringify(props.issues, null, 2)))}
${JSON.stringify(value ?? {}, null, 2)}`,
+ control: html`
+${unsafeHTML(highlightJsonHtml(JSON.stringify(value ?? {}, null, 2)))}`,
});
}
@@ -74,7 +77,8 @@ function renderEventRow(evt: EventLogEntry) {
title: evt.event,
description: formatTimeMs(evt.ts, undefined, ""),
stacked: true,
- control: html`${formatEventPayload(evt.payload)}`,
+ control: html`
+${unsafeHTML(highlightJsonHtml(formatEventPayload(evt.payload)))}`,
});
}
@@ -147,7 +151,7 @@ export function renderDebug(props: DebugProps) {
? html`
${props.callResult}
+ ${unsafeHTML(highlightJsonHtml(props.callResult))}
${JSON.stringify(props.models ?? [], null, 2)}
+
+${unsafeHTML(highlightJsonHtml(JSON.stringify(props.models ?? [], null, 2)))}