Jelajahi Sumber

case on destroyed better + sort infras

Alexander Belanger 4 tahun lalu
induk
melakukan
8129168d69

+ 5 - 4
dashboard/src/components/ProvisionerStatus.tsx

@@ -70,6 +70,10 @@ const ProvisionerStatus: React.FC<Props> = ({ modules }) => {
 
       let errors: string[] = [];
 
+      if (val.status == "destroyed") {
+        errors.push("Note: this infrastructure was automatically destroyed.")
+      }
+
       let hasError = val.resources?.filter((resource) => {
         if (resource.errored?.errored_out) {
           errors.push(resource.errored?.error_context)
@@ -93,10 +97,7 @@ const ProvisionerStatus: React.FC<Props> = ({ modules }) => {
         error = errors.map((error, index) => {
           return <ExpandedError key={index}>{error}</ExpandedError>
         })
-      } else if (val.status == "destroyed") {
-        error = <ExpandedError>This infrastructure was destroyed.</ExpandedError>
-      }
-
+      } 
       let loadingFill;
       let status;
 

+ 3 - 1
dashboard/src/main/home/onboarding/steps/ProvisionResources/forms/SharedStatus.tsx

@@ -237,9 +237,11 @@ export const SharedStatus: React.FC<{
     return closeAllWebsockets;
   }, []);
 
+  let sortedModules = tfModules.sort((a, b) => b.id < a.id ? -1 : b.id > a.id ? 1 : 0)
+
   return (
     <>
-      <ProvisionerStatus modules={tfModules} />
+      <ProvisionerStatus modules={sortedModules} />
     </>
   );
 };