Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Commit

Permalink
Improve stack trace redability (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmeapples authored May 25, 2021
1 parent dc5e218 commit 44073a7
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions client/routes/workflow/stack-trace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
<a href="#" class="refresh" @click="getStackTrace">Refresh</a>
</header>

<pre v-if="stackTrace && stackTrace.payloads" class="stack-trace-view">{{
stackTrace.payloads
}}</pre>
<prism
v-for="(payload, index) in stackTrace.payloads"
:key="index"
language="json"
class="stack-trace-view"
>
{{ payload }}
</prism>

<span class="error" v-if="stackTrace && stackTrace.error">
{{ stackTrace.error }}
Expand All @@ -29,13 +34,19 @@

<script>
import moment from 'moment';
import { getQueryResult } from './helpers/get-query-result';
import 'prismjs';
import 'prismjs/components/prism-json';
import Prism from 'vue-prism-component';
export default {
components: {
prism: Prism,
},
data() {
return {
loading: undefined,
stackTrace: undefined,
stackTrace: { payloads: [] },
stackTraceTimestamp: undefined,
};
},
Expand All @@ -54,7 +65,10 @@ export default {
return this.$http
.post(`${this.baseAPIURL}/query/__stack_trace`)
.then(({ queryResult }) => {
this.stackTrace = getQueryResult(queryResult);
queryResult.payloads = queryResult.payloads.map(p =>
p.replaceAll('\n', ' \n ')
);
this.stackTrace = queryResult;
this.stackTraceTimestamp = moment();
})
.catch(e => {
Expand Down Expand Up @@ -96,7 +110,7 @@ section.stack-trace
icon-refresh()
section .stack-trace-view
white-space pre-wrap
white-space pre-line
span.no-queries {
display: block;
Expand Down

0 comments on commit 44073a7

Please sign in to comment.