Преглед изворни кода

Added namespace to stack list item

jnfrati пре 3 година
родитељ
комит
73086c55e3

+ 50 - 8
dashboard/src/main/home/cluster-dashboard/stacks/_StackList.tsx

@@ -111,13 +111,19 @@ const StackList = ({ namespace }: { namespace: string }) => {
             to={`/stacks/${namespace}/${stack?.id}`}
             to={`/stacks/${namespace}/${stack?.id}`}
           >
           >
             <DataContainer>
             <DataContainer>
-              <StackName>
-                <StackIcon>
-                  <i className="material-icons-outlined">lan</i>
-                </StackIcon>
-                <span>{stack.name}</span>
-              </StackName>
-
+              <Top>
+                <StackName>
+                  <StackIcon>
+                    <i className="material-icons-outlined">lan</i>
+                  </StackIcon>
+                  <span>{stack.name}</span>
+                </StackName>
+                <SepDot>•</SepDot>
+                <TagWrapper>
+                  Namespace
+                  <NamespaceTag>{stack.namespace}</NamespaceTag>
+                </TagWrapper>
+              </Top>
               <InfoWrapper>
               <InfoWrapper>
                 <LastDeployed>
                 <LastDeployed>
                   <Status
                   <Status
@@ -204,7 +210,6 @@ const StackName = styled.div`
   display: flex;
   display: flex;
   font-size: 14px;
   font-size: 14px;
   align-items: center;
   align-items: center;
-  margin-bottom: 10px;
 `;
 `;
 
 
 const DataContainer = styled.div`
 const DataContainer = styled.div`
@@ -219,3 +224,40 @@ const StackCard = styled(Card)`
   font-size: 13px;
   font-size: 13px;
   font-weight: 500;
   font-weight: 500;
 `;
 `;
+
+const TagWrapper = styled.div`
+  height: 20px;
+  font-size: 12px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  color: #ffffff44;
+  border: 1px solid #ffffff44;
+  border-radius: 3px;
+  padding-left: 5px;
+`;
+
+const NamespaceTag = styled.div`
+  height: 20px;
+  margin-left: 6px;
+  color: #aaaabb;
+  background: #ffffff22;
+  border-radius: 3px;
+  font-size: 12px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  padding: 0px 6px;
+  padding-left: 7px;
+  border-top-left-radius: 0px;
+  border-bottom-left-radius: 0px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+`;
+
+const Top = styled.div`
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+`;

+ 1 - 0
dashboard/src/main/home/cluster-dashboard/stacks/types.ts

@@ -31,6 +31,7 @@ export type Stack = {
   name: string;
   name: string;
   created_at: string;
   created_at: string;
   updated_at: string;
   updated_at: string;
+  namespace: string;
 
 
   revisions: StackRevision[];
   revisions: StackRevision[];