Skip to content

Commit

Permalink
Merge pull request #353 from laradumps/do-not-show-html
Browse files Browse the repository at this point in the history
Fix logs not appearing and displaying plain text instead of HTML
  • Loading branch information
luanfreitasdev authored Dec 9, 2024
2 parents 9930931 + 6a638c8 commit 5f1d1b4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
25 changes: 16 additions & 9 deletions src/renderer/components/DumpDump.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ const props = defineProps<{

<template>
<div>
<div v-if="props.payload.hasOwnProperty('cols')">
<div v-if="payload.hasOwnProperty('cols')">
<div class="flex gap-2 w-full">
<div
class="w-full"
v-for="(content, i) in props.payload.dump?.original_content"
v-for="(content, i) in payload.dump?.original_content"
:key="i"
>
<VueJsonPretty
Expand All @@ -27,14 +27,21 @@ const props = defineProps<{
</div>
</div>
</div>

<div
v-else-if="!props.payload.hasOwnProperty('cols')"
:id="`dump-content-${props.payload.sf_dump_id}`"
v-show="props.payload.dump?.dump !== ''"
v-else-if="!payload.hasOwnProperty('cols')"
v-show="payload.dump?.dump !== ''"
class="text-base-content break-all"
v-html="props.payload.dump?.dump === null ? 'null' : props.payload.dump.dump"
></div>
>
<span
v-if="payload.dump?.variable_type === 'string'"
v-text="payload.dump.dump"
></span>
<span
v-else
:id="`dump-content-${payload.sf_dump_id}`"
v-html="payload.dump?.dump === null ? 'null' : payload.dump?.dump"
></span>
</div>
</div>
</template>

<style scoped></style>
15 changes: 8 additions & 7 deletions src/renderer/components/DumpLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ onMounted(() => {
@dblclick="toggleCompletedMessage"
title="Double click to expand"
class="prose my-3 mb-6 tracking-wide"
:class="{
'!my-2' : Object.values(payload.code_snippet || {}).length === 0
}"
>
<h2
:class="{
Expand All @@ -40,18 +43,16 @@ onMounted(() => {
'text-sm font-semibold break-all': true
}"
>
{{ props.payload.log_application?.message }}
{{ payload.log_application?.message }}
</h2>
</div>

<div
v-if="Object.values(props.payload.code_snippet).length === 0"
v-html="props.payload.log_application?.context[0]"
></div>

<div v-if="Object.values(payload.code_snippet || {}).length === 0">
<div v-html="payload.log_application?.context[0]"></div>
</div>
<CodeSnippet
v-else
:payload="payload"
:payload="payload || {}"
/>
</div>
</template>

0 comments on commit 5f1d1b4

Please sign in to comment.