1
1
<script setup lang="ts">
2
- import { computed , watch } from " vue" ;
3
- import { RouterLink , useRoute } from " vue-router" ;
2
+ import { computed , onMounted , ref , watch } from " vue" ;
3
+ import { RouterLink , useRoute , useRouter } from " vue-router" ;
4
4
import NoData from " ../NoData.vue" ;
5
5
import TimeSince from " ../TimeSince.vue" ;
6
6
import FlowDiagram from " ./FlowDiagram/FlowDiagram.vue" ;
@@ -29,6 +29,7 @@ const isError = computed(() => messageId.value === undefined);
29
29
const isMassTransitConnected = useIsMassTransitConnected ();
30
30
const store = useMessageStore ();
31
31
const { state } = storeToRefs (store );
32
+ const backLink = ref <string >(routeLinks .failedMessage .failedMessages .link );
32
33
const tabs = computed (() => {
33
34
const currentTabs = [
34
35
{
@@ -78,6 +79,13 @@ watch(
78
79
{ immediate: true }
79
80
);
80
81
const endpointColor = hexToCSSFilter (" #929E9E" ).filter ;
82
+
83
+ onMounted (() => {
84
+ const back = useRouter ().currentRoute .value .query .back as string ;
85
+ if (back ) {
86
+ backLink .value = back ;
87
+ }
88
+ });
81
89
</script >
82
90
83
91
<template >
@@ -89,6 +97,7 @@ const endpointColor = hexToCSSFilter("#929E9E").filter;
89
97
<LoadingOverlay v-if =" state.loading ?? false" />
90
98
<div class =" row" >
91
99
<div class =" col-sm-12 no-side-padding" >
100
+ <RouterLink :to =" backLink" ><i class =" fa fa-chevron-left" ></i > Back</RouterLink >
92
101
<div class =" active break group-title" >
93
102
<h1 class =" message-type-title" >{{ state.data.message_type }}</h1 >
94
103
</div >
@@ -112,7 +121,7 @@ const endpointColor = hexToCSSFilter("#929E9E").filter;
112
121
<template v-if =" state .data .failure_metadata .edited " >
113
122
<MetadataLabel tooltip =" Message was edited" type =" info" text =" Edited" />
114
123
<span v-if =" state.data.failure_metadata.edit_of" class =" metadata metadata-link" >
115
- <i class =" fa fa-history" ></i > <RouterLink :to =" { path: routeLinks.messages.failedMessage.link(state.data.failure_metadata.edit_of) }" >View previous version</RouterLink >
124
+ <i class =" fa fa-history" ></i > <RouterLink :to =" { path: routeLinks.messages.failedMessage.link(state.data.failure_metadata.edit_of), query: { back: backLink } }" >View previous version</RouterLink >
116
125
</span >
117
126
</template >
118
127
<span v-if =" state.data.failure_metadata.time_of_failure" class =" metadata" ><i class =" fa fa-clock-o" ></i > Failed: <time-since :date-utc =" state.data.failure_metadata.time_of_failure" ></time-since ></span >
@@ -173,10 +182,6 @@ button img {
173
182
width : 17px ;
174
183
}
175
184
176
- .msg-tabs {
177
- margin-bottom : 20px ;
178
- }
179
-
180
185
.pa-redirect-source {
181
186
background-image : url (" @/assets/redirect-source.svg" );
182
187
background-position : center ;
0 commit comments