Skip to content

Commit 5fb8f03

Browse files
committed
Indicating when the body wasn't stored for the audited message
1 parent f521388 commit 5fb8f03

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/Frontend/src/components/messages/BodyView.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ const body = computed(() => bodyState.value.data.value);
2525
<div v-if="bodyState.not_found" class="alert alert-info">Could not find the 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>
2626
<div v-else-if="bodyState.failed_to_load" class="alert alert-info">Message body unavailable.</div>
2727
<LoadingSpinner v-else-if="bodyState.loading" />
28+
<div v-else-if="bodyState.empty_data" class="alert alert-info">
29+
Body was too large and not stored. Edit <a href="https://docs.particular.net/servicecontrol/audit-instances/configuration#performance-tuning-servicecontrol-auditmaxbodysizetostore">ServiceControl/MaxBodySizeToStore</a> to be larger in the
30+
ServiceControl configuration.
31+
</div>
2832
<CodeEditor v-else-if="body !== undefined && contentType.isSupported" :model-value="body" :language="contentType.language" :read-only="true" :show-gutter="true"></CodeEditor>
2933
<div v-else-if="body && !contentType.isSupported" class="alert alert-warning">Message body cannot be displayed because content type "{{ bodyState.data.content_type }}" is not supported.</div>
3034
</div>

src/Frontend/src/stores/DataContainer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ export interface DataContainer<T> {
77
failed_to_load?: boolean;
88
not_found?: boolean;
99
data: T;
10+
empty_data?: boolean;
1011
}

src/Frontend/src/stores/MessageStore.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export const useMessageStore = defineStore("MessageStore", () => {
8989
state.loading = true;
9090
state.failed_to_load = false;
9191
state.not_found = false;
92+
state.empty_data = false;
9293

9394
try {
9495
const response = await useFetchFromServiceControl(`errors/last/${id}`);
@@ -134,6 +135,7 @@ export const useMessageStore = defineStore("MessageStore", () => {
134135
state.loading = headers.value.loading = true;
135136
state.failed_to_load = headers.value.failed_to_load = false;
136137
state.not_found = headers.value.not_found = false;
138+
state.empty_data = false;
137139

138140
try {
139141
const [, data] = await useTypedFetchFromServiceControl<Message[]>(`messages/search/${messageId}`);
@@ -214,6 +216,7 @@ export const useMessageStore = defineStore("MessageStore", () => {
214216
if (contentType === "text/xml") {
215217
body.value.data.value = xmlFormat(body.value.data.value, { indentation: " ", collapseContent: true });
216218
}
219+
body.value.empty_data = body.value.data.value === "";
217220
} catch {
218221
body.value.failed_to_load = true;
219222
} finally {

0 commit comments

Comments
 (0)