Skip to content

Commit 9b4a696

Browse files
warwickschroederjasontaylordev
authored andcommitted
Add a banner to the All Messages view if no successful messages
1 parent 0a3f5a4 commit 9b4a696

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

src/Frontend/src/components/audit/AuditList.vue

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import { useRoute, useRouter } from "vue-router";
55
import ResultsCount from "@/components/ResultsCount.vue";
66
import FiltersPanel from "@/components/audit/FiltersPanel.vue";
77
import AuditListItem from "@/components/audit/AuditListItem.vue";
8-
import { onBeforeMount, ref, watch } from "vue";
8+
import { computed, onBeforeMount, ref, watch } from "vue";
99
import RefreshConfig from "../RefreshConfig.vue";
1010
import LoadingSpinner from "@/components/LoadingSpinner.vue";
1111
import useFetchWithAutoRefresh from "@/composables/autoRefresh";
12+
import { MessageStatus } from "@/resources/Message";
1213
1314
const store = useAuditStore();
1415
const { messages, totalCount, sortBy, messageFilterString, selectedEndpointName, itemsPerPage, dateRange } = storeToRefs(store);
@@ -18,6 +19,14 @@ const autoRefreshValue = ref<number | null>(null);
1819
const { refreshNow, isRefreshing, updateInterval, isActive, start, stop } = useFetchWithAutoRefresh("audit-list", store.refresh, 0);
1920
const firstLoad = ref(true);
2021
22+
// Check if there are no successful audit messages
23+
const hasNoSuccessfulMessages = computed(() => {
24+
if (firstLoad.value || messages.value.length === 0) {
25+
return false;
26+
}
27+
return !messages.value.some((msg) => msg.status === MessageStatus.Successful || msg.status === MessageStatus.ResolvedSuccessfully);
28+
});
29+
2130
onBeforeMount(() => {
2231
setQuery();
2332
@@ -100,6 +109,16 @@ watch(autoRefreshValue, (newValue) => {
100109
<div class="row">
101110
<ResultsCount :displayed="messages.length" :total="totalCount" />
102111
</div>
112+
<div v-if="hasNoSuccessfulMessages" class="no-audit-banner">
113+
<div class="banner-content">
114+
<div class="banner-icon">ℹ️</div>
115+
<div class="banner-text">
116+
<strong>No successful audit messages found.</strong>
117+
<p>Auditing may not be enabled on your endpoints. Learn how to enable auditing to track all messages flowing through your system.</p>
118+
</div>
119+
<a href="https://docs.particular.net/nservicebus/operations/auditing" target="_blank" class="banner-link">Learn More</a>
120+
</div>
121+
</div>
103122
</div>
104123
<div class="row results-table">
105124
<LoadingSpinner v-if="firstLoad" />
@@ -128,4 +147,59 @@ watch(autoRefreshValue, (newValue) => {
128147
margin-bottom: 5rem;
129148
background-color: #ffffff;
130149
}
150+
151+
.no-audit-banner {
152+
background: linear-gradient(135deg, #f6f9fc 0%, #e9f2f9 100%);
153+
border: 1px solid #c3ddf5;
154+
border-left: 4px solid #007bff;
155+
border-radius: 8px;
156+
padding: 16px;
157+
margin-top: 1rem;
158+
}
159+
160+
.banner-content {
161+
display: flex;
162+
align-items: flex-start;
163+
gap: 16px;
164+
}
165+
166+
.banner-icon {
167+
font-size: 24px;
168+
flex-shrink: 0;
169+
}
170+
171+
.banner-text {
172+
flex: 1;
173+
}
174+
175+
.banner-text strong {
176+
display: block;
177+
margin-bottom: 4px;
178+
color: #333;
179+
font-size: 14px;
180+
}
181+
182+
.banner-text p {
183+
margin: 0;
184+
color: #666;
185+
font-size: 13px;
186+
line-height: 1.5;
187+
}
188+
189+
.banner-link {
190+
padding: 8px 16px;
191+
background-color: #007bff;
192+
color: white;
193+
border-radius: 4px;
194+
text-decoration: none;
195+
font-size: 14px;
196+
font-weight: 500;
197+
white-space: nowrap;
198+
align-self: center;
199+
transition: background-color 0.2s ease;
200+
}
201+
202+
.banner-link:hover {
203+
background-color: #0056b3;
204+
}
131205
</style>

0 commit comments

Comments
 (0)