Skip to content

Commit

Permalink
Add domain fail to list warning (#3563)
Browse files Browse the repository at this point in the history
* update alert conditions

* Update manage_gateway_dialog.vue

---------

Co-authored-by: xmonader <[email protected]>
  • Loading branch information
amiraabouhadid and xmonader authored Oct 31, 2024
1 parent c572637 commit 4d8bbd4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/playground/src/components/manage_gateway_dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
type="warning"
variant="tonal"
class="mb-4"
v-if="failedToListGws.length && gatewayTab === 0 && !loadingGateways"
v-if="errorMessage && gatewayTab === 0 && !loadingGateways"
>
Failed to list {{ failedToListGws.length }} domains.
Failed to list {{ failedToListGws.length }} domain(s).
<template #append>
<v-btn
icon="mdi-format-list-bulleted-square"
Expand Down Expand Up @@ -266,6 +266,7 @@ export default {
const availableK8SNodesNames = availableK8SNodes.map(node => node.name);
const selectedK8SNodeName = ref(availableK8SNodesNames[0]);
const selectedNode = ref();
const errorMessage = ref("");
watch(selectedK8SNodeName, getSupportedNetworks, { deep: true });
const tableHeaders = ref([
Expand Down Expand Up @@ -330,8 +331,12 @@ export default {
});
gateways.value = gws;
failedToListGws.value = failedToList;
if (failedToListGws.value.length) {
errorMessage.value = `Failed to list ${failedToListGws.value.length} domains`;
}
} catch (error) {
layout.value.setStatus("failed", normalizeError(error, "Failed to list this deployment's domains."));
errorMessage.value = "Failed to list this deployment's domains";
layout.value.setStatus("failed", normalizeError(error, errorMessage.value));
} finally {
loadingGateways.value = false;
}
Expand Down Expand Up @@ -509,6 +514,7 @@ export default {
isWireGuard,
availableK8SNodesNames,
selectedK8SNodeName,
errorMessage,
};
},
};
Expand Down

0 comments on commit 4d8bbd4

Please sign in to comment.