-
Notifications
You must be signed in to change notification settings - Fork 26
Refactor message tabs views into separate components #2274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ import { computed, watch } from "vue"; | |
import { useRouter } from "vue-router"; | ||
import "bootstrap"; | ||
import { monitoringUrl, serviceControlUrl, useIsMonitoringDisabled } from "@/composables/serviceServiceControlUrls"; | ||
import "highlight.js/styles/github-dark.css"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not needed |
||
import { monitoringConnectionState, connectionState, environment } from "@/composables/serviceServiceControl"; | ||
import routeLinks from "@/router/routeLinks"; | ||
import { useShowToast } from "@/composables/toast"; | ||
|
@@ -53,5 +52,5 @@ watch( | |
); | ||
</script> | ||
<template> | ||
<div></div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed empty divs |
||
<template></template> | ||
</template> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,5 +61,5 @@ onMounted(async () => { | |
}); | ||
</script> | ||
<template> | ||
<div></div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed empty divs |
||
<template></template> | ||
</template> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script setup lang="ts"> | ||
import { ExtendedFailedMessage } from "@/resources/FailedMessage"; | ||
|
||
const props = defineProps<{ | ||
message: ExtendedFailedMessage; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<div v-if="props.message.messageBodyNotFound" class="alert alert-info">Could not find message body. This could be because the message URL is invalid or the corresponding message was processed and is no longer tracked by ServiceControl.</div> | ||
<div v-else-if="props.message.bodyUnavailable" class="alert alert-info">Message body unavailable.</div> | ||
<pre v-else>{{ props.message.messageBody }}</pre> | ||
</template> | ||
|
||
<style scoped></style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script setup lang="ts"> | ||
import { ExtendedFailedMessage } from "@/resources/FailedMessage"; | ||
|
||
const props = defineProps<{ | ||
message: ExtendedFailedMessage; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<table class="table" v-if="!props.message.headersNotFound"> | ||
<tbody> | ||
<tr class="interactiveList" v-for="(header, index) in props.message.headers" :key="index"> | ||
<td nowrap="nowrap">{{ header.key }}</td> | ||
<td> | ||
<pre>{{ header.value }}</pre> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<div v-if="props.message.headersNotFound" class="alert alert-info">Could not find message headers. This could be because the message URL is invalid or the corresponding message was processed and is no longer tracked by ServiceControl.</div> | ||
</template> | ||
|
||
<style scoped></style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ import { NServiceBusHeaders } from "@/resources/Header"; | |
import { useConfiguration } from "@/composables/configuration"; | ||
import { useIsMassTransitConnected } from "@/composables/useIsMassTransitConnected"; | ||
import { parse, stringify } from "lossless-json"; | ||
import BodyView from "@/components/messages/BodyView.vue"; | ||
import HeadersView from "@/components/messages/HeadersView.vue"; | ||
import StackTraceView from "@/components/messages/StacktraceView.vue"; | ||
|
||
let refreshInterval: number | undefined; | ||
let pollingFaster = false; | ||
|
@@ -438,31 +441,15 @@ onUnmounted(() => { | |
<div class="row"> | ||
<div class="col-sm-12 no-side-padding"> | ||
<div class="nav tabs msg-tabs"> | ||
<h5 :class="{ active: panel === 1 }" class="nav-item" @click="togglePanel(1)"><a href="javascript:void(0)">Stacktrace</a></h5> | ||
<h5 :class="{ active: panel === 2 }" class="nav-item" @click="togglePanel(2)"><a href="javascript:void(0)">Headers</a></h5> | ||
<h5 :class="{ active: panel === 3 }" class="nav-item" @click="togglePanel(3)"><a href="javascript:void(0)">Message body</a></h5> | ||
<h5 v-if="!isMassTransitConnected" :class="{ active: panel === 4 }" class="nav-item" @click="togglePanel(4)"><a href="javascript:void(0)">Flow Diagram</a></h5> | ||
<h5 :class="{ active: panel === 1 }" class="nav-item" @click.prevent="togglePanel(1)"><a href="#">Stacktrace</a></h5> | ||
<h5 :class="{ active: panel === 2 }" class="nav-item" @click.prevent="togglePanel(2)"><a href="#">Message body</a></h5> | ||
<h5 :class="{ active: panel === 3 }" class="nav-item" @click.prevent="togglePanel(3)"><a href="#">Headers</a></h5> | ||
<h5 v-if="!isMassTransitConnected" :class="{ active: panel === 4 }" class="nav-item" @click.prevent="togglePanel(4)"><a href="#">Flow Diagram</a></h5> | ||
</div> | ||
<pre v-if="panel === 1">{{ failedMessage.exception?.stack_trace }}</pre> | ||
<table class="table" v-if="panel === 2 && !failedMessage.headersNotFound"> | ||
<tbody> | ||
<tr class="interactiveList" v-for="(header, index) in failedMessage.headers" :key="index"> | ||
<td nowrap="nowrap">{{ header.key }}</td> | ||
<td> | ||
<pre>{{ header.value }}</pre> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<div v-if="panel === 2 && failedMessage.headersNotFound" class="alert alert-info"> | ||
Could not find message headers. This could be because the message URL is invalid or the corresponding message was processed and is no longer tracked by ServiceControl. | ||
</div> | ||
<pre v-if="panel === 3 && !failedMessage.messageBodyNotFound && !failedMessage.bodyUnavailable">{{ failedMessage.messageBody }}</pre> | ||
<div v-if="panel === 3 && failedMessage.messageBodyNotFound" class="alert alert-info"> | ||
Could not find message body. This could be because the message URL is invalid or the corresponding message was processed and is no longer tracked by ServiceControl. | ||
</div> | ||
<div v-if="panel === 3 && failedMessage.bodyUnavailable" class="alert alert-info">Message body unavailable.</div> | ||
<FlowDiagram v-if="panel === 4" :conversation-id="failedMessage.conversationId" :message-id="id"></FlowDiagram> | ||
<StackTraceView v-if="panel === 1" :message="failedMessage" /> | ||
<BodyView v-if="panel === 2" :message="failedMessage" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved "message body" to be 2nd tab |
||
<HeadersView v-if="panel === 3" :message="failedMessage" /> | ||
<FlowDiagram v-if="panel === 4" :message="failedMessage" /> | ||
</div> | ||
</div> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script setup lang="ts"> | ||
import { ExtendedFailedMessage } from "@/resources/FailedMessage"; | ||
import VCodeBlock from "@wdns/vue-code-block"; | ||
const props = defineProps<{ | ||
message: ExtendedFailedMessage; | ||
}>(); | ||
</script> | ||
|
||
<template> | ||
<VCodeBlock :code="props.message.exception.stack_trace" lang="csharp"></VCodeBlock> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be csharp highlighted, given that it's a stack trace? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no highlighter mode for stack traces, and c# did not look bad, so I went with that one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would plain text be better then? |
||
</template> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import VueTippy from "vue-tippy"; | |
import { createPinia } from "pinia"; | ||
import SimpleTypeahead from "vue3-simple-typeahead"; | ||
import { createVCodeBlock } from "@wdns/vue-code-block"; | ||
import "highlight.js/styles/github-dark.css"; | ||
|
||
const toastOptions: PluginOptions = { | ||
position: POSITION.BOTTOM_RIGHT, | ||
|
@@ -25,6 +26,7 @@ export function mount({ router }: { router: Router }) { | |
|
||
const VCodeBlock = createVCodeBlock({ | ||
theme: "github-dark", | ||
cssPath: "highlight.js/styles/github-dark.css", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is needed, otherwise the highligh.js lib attempts to contact a CDN |
||
highlightjs: true, | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is moved to the mount.ts