1
1
<script setup lang="ts">
2
- import routeLinks from " @/router/routeLinks" ;
3
2
import { FieldNames , useAuditStore } from " @/stores/AuditStore" ;
4
3
import { storeToRefs } from " pinia" ;
5
- import Message , { MessageStatus } from " @/resources/Message" ;
6
4
import { useRoute , useRouter } from " vue-router" ;
7
5
import ResultsCount from " @/components/ResultsCount.vue" ;
8
- import { formatDotNetTimespan } from " @/composables/formatUtils" ;
9
6
import FiltersPanel from " @/components/audit/FiltersPanel.vue" ;
10
- import MessageStatusIcon from " @/components/audit/MessageStatusIcon .vue" ;
7
+ import AuditListItem from " @/components/audit/AuditListItem .vue" ;
11
8
import { onBeforeMount , onUnmounted , ref , watch } from " vue" ;
12
9
import RefreshConfig from " ../RefreshConfig.vue" ;
13
10
import useAutoRefresh from " @/composables/autoRefresh" ;
@@ -37,15 +34,6 @@ onUnmounted(() => {
37
34
dataRetriever .updateTimeout (null );
38
35
});
39
36
40
- function navigateToMessage(message : Message ) {
41
- const query = router .currentRoute .value .query ;
42
-
43
- router .push ({
44
- path: message .status === MessageStatus .Successful || message .status === MessageStatus .ResolvedSuccessfully ? routeLinks .messages .successMessage .link (message .message_id , message .id ) : routeLinks .messages .failedMessage .link (message .id ),
45
- query: { ... query , ... { back: route .path } },
46
- });
47
- }
48
-
49
37
const firstLoad = ref (true );
50
38
51
39
onBeforeMount (() => {
@@ -125,17 +113,7 @@ watch(autoRefreshValue, (newValue) => dataRetriever.updateTimeout(newValue));
125
113
<div class =" row results-table" >
126
114
<LoadingSpinner v-if =" firstLoad" />
127
115
<template v-for =" message in messages " :key =" message .id " >
128
- <div class =" item" @click =" navigateToMessage(message)" >
129
- <div class =" status" >
130
- <MessageStatusIcon :message =" message" />
131
- </div >
132
- <div class =" message-id" >{{ message.message_id }}</div >
133
- <div class =" message-type" >{{ message.message_type }}</div >
134
- <div class =" time-sent" ><span class =" label-name" >Time Sent:</span >{{ new Date(message.time_sent).toLocaleString() }}</div >
135
- <div class =" critical-time" ><span class =" label-name" >Critical Time:</span >{{ formatDotNetTimespan(message.critical_time) }}</div >
136
- <div class =" processing-time" ><span class =" label-name" >Processing Time:</span >{{ formatDotNetTimespan(message.processing_time) }}</div >
137
- <div class =" delivery-time" ><span class =" label-name" >Delivery Time:</span >{{ formatDotNetTimespan(message.delivery_time) }}</div >
138
- </div >
116
+ <AuditListItem :message =" message" />
139
117
</template >
140
118
</div >
141
119
</div >
@@ -159,51 +137,4 @@ watch(autoRefreshValue, (newValue) => dataRetriever.updateTimeout(newValue));
159
137
margin-bottom : 5rem ;
160
138
background-color : #ffffff ;
161
139
}
162
- .item {
163
- padding : 0.3rem 0.2rem ;
164
- border : 1px solid #ffffff ;
165
- border-bottom : 1px solid #eee ;
166
- display : grid ;
167
- grid-template-columns : 1.8em 1fr 1fr 1fr 1fr ;
168
- grid-template-rows : 1fr 1fr ;
169
- gap : 0.375rem ;
170
- grid-template-areas :
171
- " status message-type message-type message-type time-sent"
172
- " status message-id processing-time critical-time delivery-time" ;
173
- }
174
- .item :not (:first-child ) {
175
- border-top-color : #eee ;
176
- }
177
- .item :hover {
178
- border-color : #00a3c4 ;
179
- background-color : #edf6f7 ;
180
- cursor : pointer ;
181
- }
182
- .label-name {
183
- margin-right : 0.25rem ;
184
- color : #777f7f ;
185
- }
186
- .status {
187
- grid-area : status;
188
- }
189
- .message-id {
190
- grid-area : message-id;
191
- }
192
- .time-sent {
193
- grid-area : time-sent;
194
- }
195
- .message-type {
196
- grid-area : message-type;
197
- font-weight : bold ;
198
- overflow-wrap : break-word ;
199
- }
200
- .processing-time {
201
- grid-area : processing-time;
202
- }
203
- .critical-time {
204
- grid-area : critical-time;
205
- }
206
- .delivery-time {
207
- grid-area : delivery-time;
208
- }
209
140
</style >
0 commit comments