From 4876edcb50b4cce6c354a9180f66278d41d66bc9 Mon Sep 17 00:00:00 2001 From: Mengling Ding Date: Thu, 22 Aug 2024 11:12:08 -0500 Subject: [PATCH] feat: only display the http code after the client error --- webui/src/components/Appliance/ComposeMemoryButton.vue | 2 +- webui/src/components/Stores/ApplianceStore.ts | 4 ++-- webui/src/components/Stores/BladeMemoryStore.ts | 6 +++--- webui/src/components/Stores/BladeStore.ts | 6 +++--- webui/src/components/Stores/HostStore.ts | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/webui/src/components/Appliance/ComposeMemoryButton.vue b/webui/src/components/Appliance/ComposeMemoryButton.vue index fb14720..aee07d5 100644 --- a/webui/src/components/Appliance/ComposeMemoryButton.vue +++ b/webui/src/components/Appliance/ComposeMemoryButton.vue @@ -354,7 +354,7 @@ export default { this.newMemoryCredentials.port ) { this.partialSuccess = - "Note: Memory allocation succeeded but memory port assignment failed."; + "Memory allocation succeeded but memory port assignment failed (206)"; } // Get the size of the new memory chunk to update the blade memory, // The final allocated memory size may be changed by the compose memory algorithm, so it may not be the same with the input one diff --git a/webui/src/components/Stores/ApplianceStore.ts b/webui/src/components/Stores/ApplianceStore.ts index 39ef5b4..530647e 100644 --- a/webui/src/components/Stores/ApplianceStore.ts +++ b/webui/src/components/Stores/ApplianceStore.ts @@ -73,7 +73,7 @@ export const useApplianceStore = defineStore('appliance', { if (axios.isAxiosError(error)) { this.addApplianceError = error.message; if (error.response) { - this.addApplianceError = error.response?.data.status.message + " (" + error.message + ")"; + this.addApplianceError = error.response?.data.status.message + " (" + error.response?.request.status + ")"; } } else { @@ -101,7 +101,7 @@ export const useApplianceStore = defineStore('appliance', { if (axios.isAxiosError(error)) { this.deleteApplianceError = error.message; if (error.response) { - this.deleteApplianceError = error.response?.data.status.message + " (" + error.message + ")"; + this.deleteApplianceError = error.response?.data.status.message + " (" + error.response?.request.status + ")"; } } else { diff --git a/webui/src/components/Stores/BladeMemoryStore.ts b/webui/src/components/Stores/BladeMemoryStore.ts index d9c01f5..6c1e993 100644 --- a/webui/src/components/Stores/BladeMemoryStore.ts +++ b/webui/src/components/Stores/BladeMemoryStore.ts @@ -67,7 +67,7 @@ export const useBladeMemoryStore = defineStore('bladeMemory', { if (axios.isAxiosError(error)) { this.composeMemoryError = error.message; if (error.response) { - this.composeMemoryError = error.response?.data.status.message + " (" + error.message + ")"; + this.composeMemoryError = error.response?.data.status.message + " (" + error.response?.request.status + ")"; } } else { @@ -91,7 +91,7 @@ export const useBladeMemoryStore = defineStore('bladeMemory', { if (axios.isAxiosError(error)) { this.assignOrUnassignMemoryError = error.message; if (error.response) { - this.assignOrUnassignMemoryError = error.response?.data.status.message + " (" + error.message + ")"; + this.assignOrUnassignMemoryError = error.response?.data.status.message + " (" + error.response?.request.status + ")"; } } else { @@ -120,7 +120,7 @@ export const useBladeMemoryStore = defineStore('bladeMemory', { if (axios.isAxiosError(error)) { this.freeMemoryError = error.message; if (error.response) { - this.freeMemoryError = error.response?.data.status.message + " (" + error.message + ")"; + this.freeMemoryError = error.response?.data.status.message + " (" + error.response?.request.status + ")"; } } else { diff --git a/webui/src/components/Stores/BladeStore.ts b/webui/src/components/Stores/BladeStore.ts index 59fcafe..b93761c 100644 --- a/webui/src/components/Stores/BladeStore.ts +++ b/webui/src/components/Stores/BladeStore.ts @@ -79,7 +79,7 @@ export const useBladeStore = defineStore('blade', { if (axios.isAxiosError(error)) { this.resyncBladeError = error.message; if (error.response) { - this.resyncBladeError = error.response?.data.status.message + " (" + error.message + ")"; + this.resyncBladeError = error.response?.data.status.message + " (" + error.response?.request.status + ")"; } } else { @@ -106,7 +106,7 @@ export const useBladeStore = defineStore('blade', { if (axios.isAxiosError(error)) { this.addBladeError = error.message; if (error.response) { - this.addBladeError = error.response?.data.status.message + " (" + error.message + ")"; + this.addBladeError = error.response?.data.status.message + " (" + error.response?.request.status + ")"; } } else { @@ -134,7 +134,7 @@ export const useBladeStore = defineStore('blade', { if (axios.isAxiosError(error)) { this.deleteBladeError = error.message; if (error.response) { - this.deleteBladeError = error.response?.data.status.message + " (" + error.message + ")"; + this.deleteBladeError = error.response?.data.status.message + " (" + error.response?.request.status + ")"; } } else { diff --git a/webui/src/components/Stores/HostStore.ts b/webui/src/components/Stores/HostStore.ts index daf649d..3c04cae 100644 --- a/webui/src/components/Stores/HostStore.ts +++ b/webui/src/components/Stores/HostStore.ts @@ -63,7 +63,7 @@ export const useHostStore = defineStore('host', { if (axios.isAxiosError(error)) { this.addHostError = error.message; if (error.response) { - this.addHostError = error.response?.data.status.message + " (" + error.message + ")"; + this.addHostError = error.response?.data.status.message + " (" + error.response?.request.status + ")"; } } else { @@ -91,7 +91,7 @@ export const useHostStore = defineStore('host', { if (axios.isAxiosError(error)) { this.deleteHostError = error.message; if (error.response) { - this.deleteHostError = error.response?.data.status.message + " (" + error.message + ")"; + this.deleteHostError = error.response?.data.status.message + " (" + error.response?.request.status + ")"; } } else { @@ -113,7 +113,7 @@ export const useHostStore = defineStore('host', { if (axios.isAxiosError(error)) { this.resyncHostError = error.message; if (error.response) { - this.resyncHostError = error.response?.data.status.message + " (" + error.message + ")"; + this.resyncHostError = error.response?.data.status.message + " (" + error.response?.request.status + ")"; } } else {