Просмотр исходного кода

provisioner status max height and icons

jusrhee 4 лет назад
Родитель
Сommit
9e05d2841a

+ 28 - 7
dashboard/src/components/ProvisionerStatus.tsx

@@ -1,5 +1,6 @@
 import { Steps } from "main/home/onboarding/types";
 import { Steps } from "main/home/onboarding/types";
 import React, { useState } from "react";
 import React, { useState } from "react";
+import { integrationList } from "shared/common";
 
 
 import loading from "assets/loading.gif";
 import loading from "assets/loading.gif";
 
 
@@ -62,7 +63,7 @@ const ProvisionerStatus: React.FC<Props> = ({ modules }) => {
   };
   };
 
 
   const renderModules = () => {
   const renderModules = () => {
-    return modules.map((val) => {
+    return modules.map(val => {
       const totalResources = val.resources?.length;
       const totalResources = val.resources?.length;
       const provisionedResources = val.resources?.filter((resource) => {
       const provisionedResources = val.resources?.filter((resource) => {
         return resource.provisioned;
         return resource.provisioned;
@@ -116,10 +117,15 @@ const ProvisionerStatus: React.FC<Props> = ({ modules }) => {
         <InfraObject key={val.id}>
         <InfraObject key={val.id}>
           <InfraHeader>
           <InfraHeader>
             {status}
             {status}
+            {
+              integrationList[val.kind] && <Icon src={integrationList[val.kind].icon} />
+            }
             {nameMap[val.kind]}
             {nameMap[val.kind]}
           </InfraHeader>
           </InfraHeader>
           <LoadingBar>{loadingFill}</LoadingBar>
           <LoadingBar>{loadingFill}</LoadingBar>
-          {error}
+          <ErrorWrapper>
+            {error}
+          </ErrorWrapper>
         </InfraObject>
         </InfraObject>
       );
       );
     });
     });
@@ -127,13 +133,26 @@ const ProvisionerStatus: React.FC<Props> = ({ modules }) => {
 
 
   return (
   return (
     <StyledProvisionerStatus>
     <StyledProvisionerStatus>
-        {renderModules()}
+      {renderModules()}
     </StyledProvisionerStatus>
     </StyledProvisionerStatus>
   );
   );
 };
 };
 
 
 export default ProvisionerStatus;
 export default ProvisionerStatus;
 
 
+const Icon = styled.img`
+  height: 20px;
+  margin-right: 10px;
+`;
+
+const ErrorWrapper = styled.div`
+  max-height: 150px;
+  margin-top: 20px;
+  overflow-y: auto;
+  user-select: text;
+  padding: 0 15px;
+`;
+
 const ExpandedError = styled.div`
 const ExpandedError = styled.div`
   background: #ffffff22;
   background: #ffffff22;
   border-radius: 5px;
   border-radius: 5px;
@@ -141,7 +160,8 @@ const ExpandedError = styled.div`
   font-size: 13px;
   font-size: 13px;
   font-family: monospace;
   font-family: monospace;
   border: 1px solid #aaaabb;
   border: 1px solid #aaaabb;
-  margin-top: 17px;
+  margin-bottom: 17px;
+  padding-bottom: 17px;
 `;
 `;
 
 
 const LoadingFill = styled.div<{ width: string; status: string }>`
 const LoadingFill = styled.div<{ width: string; status: string }>`
@@ -199,10 +219,10 @@ const StyledProvisionerStatus = styled.div`
 `;
 `;
 
 
 const LoadingBar = styled.div`
 const LoadingBar = styled.div`
-  width: 100%;
+  width: calc(100% - 30px);
   background: #ffffff22;
   background: #ffffff22;
   border: 100px;
   border: 100px;
-  margin: 15px 0 0;
+  margin: 15px 15px 0;
   height: 18px;
   height: 18px;
   overflow: hidden;
   overflow: hidden;
   border-radius: 100px;
   border-radius: 100px;
@@ -210,7 +230,7 @@ const LoadingBar = styled.div`
 
 
 const InfraObject = styled.div`
 const InfraObject = styled.div`
   background: #ffffff22;
   background: #ffffff22;
-  padding: 15px 15px 17px;
+  padding: 15px 0 0;
   border: 1px solid #aaaabb;
   border: 1px solid #aaaabb;
   border-radius: 5px;
   border-radius: 5px;
   margin-bottom: 10px;
   margin-bottom: 10px;
@@ -219,6 +239,7 @@ const InfraObject = styled.div`
 const InfraHeader = styled.div`
 const InfraHeader = styled.div`
   font-size: 13px;
   font-size: 13px;
   font-weight: 500;
   font-weight: 500;
+  padding: 0 15px;
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
 `;
 `;

+ 1 - 0
dashboard/src/components/Selector.tsx

@@ -196,6 +196,7 @@ const DropdownWrapper = styled.div`
   position: absolute;
   position: absolute;
   width: 100%;
   width: 100%;
   right: 0;
   right: 0;
+  z-index: 1;
   top: calc(100% + 5px);
   top: calc(100% + 5px);
 `;
 `;
 
 

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

@@ -11,7 +11,7 @@ export const SharedStatus: React.FC<{
   nextFormStep: () => void;
   nextFormStep: () => void;
   project_id: number;
   project_id: number;
   filter: string[];
   filter: string[];
-  goBack?: () => void;
+  goBack?: any;
 }> = ({ nextFormStep, project_id, filter, goBack }) => {
 }> = ({ nextFormStep, project_id, filter, goBack }) => {
   const {
   const {
     newWebsocket,
     newWebsocket,