Quellcode durchsuchen

show relevant banners when cluster provisioning fails (#4387)

ianedwards vor 2 Jahren
Ursprung
Commit
96d6b726db

+ 6 - 2
dashboard/src/main/home/app-dashboard/apps/Apps.tsx

@@ -23,12 +23,12 @@ import { useAppAnalytics } from "lib/hooks/useAppAnalytics";
 import api from "shared/api";
 import { Context } from "shared/Context";
 import { useDeploymentTarget } from "shared/DeploymentTargetContext";
+import applicationGrad from "assets/application-grad.svg";
 import calendar from "assets/calendar-number.svg";
 import grid from "assets/grid.png";
 import list from "assets/list.png";
 import pull_request from "assets/pull_request_icon.svg";
 import letter from "assets/vector.svg";
-import applicationGrad from "assets/application-grad.svg";
 
 import AppGrid from "./AppGrid";
 import { appRevisionWithSourceValidator } from "./types";
@@ -202,6 +202,10 @@ const Apps: React.FC = () => {
     }
 
     if (apps.length === 0) {
+      if (currentCluster?.status === "FAILED") {
+        return <ClusterProvisioningPlaceholder />;
+      }
+
       return (
         <DashboardPlaceholder>
           <Text size={16}>No applications have been created yet</Text>
@@ -383,4 +387,4 @@ const Badge = styled.div`
   text-align: center;
   border-radius: 3px;
   font-size: 12px;
-`;
+`;

+ 24 - 0
dashboard/src/main/home/infrastructure-dashboard/ClusterTabs.tsx

@@ -8,6 +8,7 @@ import { match } from "ts-pattern";
 
 import Banner from "components/porter/Banner";
 import Spacer from "components/porter/Spacer";
+import Text from "components/porter/Text";
 import TabSelector from "components/TabSelector";
 import { type ClientClusterContract } from "lib/clusters/types";
 
@@ -89,6 +90,29 @@ const ClusterTabs: React.FC<Props> = ({ tabParam }) => {
           <Spacer y={1} />
         </>
       )}
+      {cluster.status === "FAILED" && (
+        <>
+          <Banner
+            type="error"
+            suffix={
+              <>
+                <ClusterSaveButton
+                  height={"10px"}
+                  disabledTooltipPosition={"bottom"}
+                  isClusterUpdating={isClusterUpdating}
+                >
+                  Retry
+                </ClusterSaveButton>
+              </>
+            }
+          >
+            An error occurred while applying the latest updates to your
+            infrastructure.
+            <Spacer inline width="5px" />
+          </Banner>
+          <Spacer y={1} />
+        </>
+      )}
       <AnimateHeight height={isDirty ? "auto" : 0}>
         <Banner
           type="warning"