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

Added image and source next to application name

jnfrati 4 лет назад
Родитель
Сommit
4047f2d854

+ 33 - 0
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedChart.tsx

@@ -35,6 +35,7 @@ import SettingsSection from "./SettingsSection";
 import { useWebsockets } from "shared/hooks/useWebsockets";
 import { useWebsockets } from "shared/hooks/useWebsockets";
 import useAuth from "shared/auth/useAuth";
 import useAuth from "shared/auth/useAuth";
 import TitleSection from "components/TitleSection";
 import TitleSection from "components/TitleSection";
+import { integrationList } from "shared/common";
 
 
 type Props = {
 type Props = {
   namespace: string;
   namespace: string;
@@ -645,6 +646,19 @@ const ExpandedChart: React.FC<Props> = (props) => {
     return () => (isSubscribed = false);
     return () => (isSubscribed = false);
   }, [components, currentCluster, currentProject, currentChart]);
   }, [components, currentCluster, currentProject, currentChart]);
 
 
+  const renderDeploymentType = () => {
+    const githubRepository = currentChart?.git_action_config?.git_repo;
+    const icon = githubRepository
+      ? integrationList.repo.icon
+      : integrationList.registry.icon;
+    return (
+      <DeploymentImageContainer>
+        <DeploymentTypeIcon src={icon} />
+        {githubRepository || currentChart?.image_repo_uri}
+      </DeploymentImageContainer>
+    );
+  };
+
   return (
   return (
     <>
     <>
       <StyledExpandedChart>
       <StyledExpandedChart>
@@ -672,6 +686,7 @@ const ExpandedChart: React.FC<Props> = (props) => {
             <TagWrapper>
             <TagWrapper>
               Namespace <NamespaceTag>{currentChart.namespace}</NamespaceTag>
               Namespace <NamespaceTag>{currentChart.namespace}</NamespaceTag>
             </TagWrapper>
             </TagWrapper>
+            {renderDeploymentType()}
           </TitleSection>
           </TitleSection>
 
 
           {currentChart.chart.metadata.name != "worker" &&
           {currentChart.chart.metadata.name != "worker" &&
@@ -972,3 +987,21 @@ const StyledExpandedChart = styled.div`
     }
     }
   }
   }
 `;
 `;
+
+const DeploymentImageContainer = styled.div`
+  height: 20px;
+  font-size: 14px;
+  display: flex;
+  margin-left: 20px;
+  margin-bottom: -3px;
+  align-items: center;
+  font-weight: 400;
+  justify-content: center;
+  color: #ffffff66;
+  padding-left: 5px;
+`;
+
+const DeploymentTypeIcon = styled(Icon)`
+  width: 25px;
+  margin-right: 5px;
+`;

+ 2 - 0
dashboard/src/shared/types.tsx

@@ -19,6 +19,8 @@ export interface DetailedIngressError {
 }
 }
 
 
 export interface ChartType {
 export interface ChartType {
+  image_repo_uri: string;
+  git_action_config: any;
   name: string;
   name: string;
   info: {
   info: {
     last_deployed: string;
     last_deployed: string;