diff --git a/components/analysis/AnalysisControlButtons.vue b/components/analysis/AnalysisControlButtons.vue index 3ebc72d..f174908 100644 --- a/components/analysis/AnalysisControlButtons.vue +++ b/components/analysis/AnalysisControlButtons.vue @@ -73,10 +73,6 @@ const showSuccess = (summary: string, msg: string) => { }); }; -// async function updateHubAnalysisRunStatus(update: string) { -// await updateAnalysis(props.analysisId!, { run_status: update }); -// } - async function onStartAnalysis() { loading.value = true; setButtonStatuses(AnalysisNodeRunStatus.Starting); diff --git a/composables/connectionErrorToast.ts b/composables/connectionErrorToast.ts index d17a625..c57aba1 100644 --- a/composables/connectionErrorToast.ts +++ b/composables/connectionErrorToast.ts @@ -24,7 +24,18 @@ export const showKongConnectionErrorToast = () => { severity: "error", summary: "Connection error", detail: "Unable to contact the Kong gateway service.", - life: 3000, + life: 5000, }); console.warn("Kong service unreachable"); }; + +export const showDownstreamConnectionErrorToast = () => { + const toast = useToastService(); + toast.add({ + severity: "error", + summary: "Connection error", + detail: "Unable to contact the downstream service.", + life: 5000, + }); + console.warn("A downstream service unreachable"); +}; diff --git a/plugins/api.ts b/plugins/api.ts index 7e05e25..97cec0a 100644 --- a/plugins/api.ts +++ b/plugins/api.ts @@ -1,6 +1,7 @@ import { showKongConnectionErrorToast, showHubAdapterConnectionErrorToast, + showDownstreamConnectionErrorToast, } from "~/composables/connectionErrorToast"; export default defineNuxtPlugin(() => { @@ -33,6 +34,8 @@ export default defineNuxtPlugin(() => { } else { showHubAdapterConnectionErrorToast(); } + } else if (response.status === 503) { + showDownstreamConnectionErrorToast(); } }, });