Skip to content

Commit d154fa8

Browse files
committed
hide js static files in ProfilingFeature
1 parent 8d74756 commit d154fa8

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

ServiceStack/src/ServiceStack.AI.Chat/modules/admin-ui/components/AdminChat.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { leftPart } from '@servicestack/client'
44
import { Chart, registerables } from "chart.js"
55
import { QueryDb, QueryResponse } from "dtos"
66
import { Marked } from "marked"
7+
import hljs from "highlight.js"
78

89
Chart.register(...registerables)
910

@@ -318,7 +319,7 @@ const LogDetailDialog = {
318319
<!-- Code view (default) -->
319320
<div v-if="!preview" class="bg-gray-50 dark:bg-gray-900 rounded-md p-3 text-sm text-gray-900 dark:text-gray-100 whitespace-pre-wrap">{{ log.answer?.trim() }}</div>
320321
<!-- Preview view (rendered markdown) -->
321-
<div v-else class="bg-gray-50 dark:bg-gray-900 rounded-md p-3 text-sm text-gray-900 dark:text-gray-100 prose dark:prose-invert max-w-none" v-html="renderMarkdown(log.answer?.trim())"></div>
322+
<div v-else class="bg-gray-50 dark:bg-gray-900 rounded-md p-3 text-sm text-gray-900 dark:text-gray-100 prose prose-sm dark:prose-invert max-w-none" v-html="renderMarkdown(log.answer?.trim())"></div>
322323
</div>
323324
324325
<!-- Error -->
@@ -333,13 +334,13 @@ const LogDetailDialog = {
333334
<!-- Request Body -->
334335
<div v-if="log.requestBody">
335336
<h3 class="text-sm font-medium text-gray-900 dark:text-gray-100 mb-2">Request Body</h3>
336-
<pre class="bg-gray-50 dark:bg-gray-900 rounded-md p-3 text-xs text-gray-900 dark:text-gray-100 overflow-x-auto">{{ formatJson(log.requestBody) }}</pre>
337+
<pre class="whitespace-pre-wrap"><code :key="log.id" lang="json" class="language-json text-sm" v-highlightjs="formatJson(log.requestBody)"></code></pre>
337338
</div>
338339
339340
<!-- Response Body -->
340341
<div v-if="log.responseBody">
341342
<h3 class="text-sm font-medium text-gray-900 dark:text-gray-100 mb-2">Response Body</h3>
342-
<pre class="bg-gray-50 dark:bg-gray-900 rounded-md p-3 text-xs text-gray-900 dark:text-gray-100 overflow-x-auto">{{ formatJson(log.responseBody) }}</pre>
343+
<pre class="whitespace-pre-wrap"><code :key="log.id" lang="json" class="language-json text-sm" v-highlightjs="formatJson(log.responseBody)"></code></pre>
343344
</div>
344345
</div>
345346
</div>
@@ -389,6 +390,7 @@ const LogDetailDialog = {
389390
if (nextLog) {
390391
props.routes.to({ show: nextLog.id })
391392
}
393+
hljs.highlightAll()
392394
}
393395

394396
// Handle keyboard navigation
@@ -1673,7 +1675,6 @@ export const AdminChat = {
16731675
}
16741676
}
16751677

1676-
const hljs = globalThis.hljs
16771678
export const marked = (() => {
16781679
const aliases = {
16791680
vue: 'html',

ServiceStack/src/ServiceStack/ProfilingFeature.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,24 @@ public class ProfilingFeature : IPlugin, IConfigureServices, Model.IHasStringId,
111111
public ProfilingFeature()
112112
{
113113
ExcludeRequestPathInfoStartingWith = [
114+
"/js/components/",
115+
"/js/chart.js",
116+
"/js/color.js",
117+
"/js/core.mjs",
118+
"/js/highlight.js",
119+
"/js/hot-fileloader.js",
120+
"/js/hot-loader.js",
121+
"/js/idb.mjs",
122+
"/js/marked.mjs",
114123
"/js/petite-vue.js",
115-
"/js/servicestack-client.js",
116124
"/js/require.js",
125+
"/js/servicestack-blazor.js",
126+
"/js/servicestack-client.js",
127+
"/js/servicestack-client.mjs",
128+
"/js/servicestack-vue.mjs",
129+
"/js/ss-utils.js",
130+
"/js/vue-router.mjs",
131+
"/js/vue.mjs",
117132
"/js/highlight.js",
118133
"/admin-ui",
119134
];

0 commit comments

Comments
 (0)