-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from dejan/pretty_print_params
Pretty print params
- Loading branch information
Showing
6 changed files
with
36 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,37 @@ | ||
<template> | ||
<DetailsTable :value="store.selectedParams"> | ||
<Column field="name" header="Name" /> | ||
<Column field="value" header="Value" /> | ||
</DetailsTable> | ||
<DetailsTable :value="store.selectedParams"> | ||
<Column field="name" header="Name" class="font-bold"/> | ||
<Column field="value" header="Value"> | ||
<template #body="slotProps"> | ||
<pre v-html="pretty(slotProps.data.value)" class="whitespace-pre-wrap"></pre> | ||
</template> | ||
</Column> | ||
</DetailsTable> | ||
</template> | ||
|
||
<script setup> | ||
import { useEventsStore } from '../stores/events'; | ||
import Column from 'primevue/column'; | ||
import DetailsTable from './wrappers/DetailsTable.vue'; | ||
import { prettyPrintJson } from 'pretty-print-json'; | ||
const store = useEventsStore() | ||
const prettyOptions = { | ||
indent: 2, | ||
quoteKeys: true, | ||
quoteStyle: 'double', | ||
trailingCommas: false, | ||
linkUrls: false, | ||
}; | ||
function pretty(obj) { | ||
try { | ||
return prettyPrintJson.toHtml(obj, prettyOptions); | ||
} catch (e) { | ||
console.log(e); | ||
return obj; | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,3 @@ | |
--primary-950: 69 10 10; | ||
|
||
} | ||
|
||
/* custom scrollbar */ | ||
/* ::-webkit-scrollbar { | ||
width: 0px; | ||
} */ |