瀏覽代碼

highlight on collapse

Justin Rhee 3 年之前
父節點
當前提交
0771e18734
共有 2 個文件被更改,包括 15 次插入2 次删除
  1. 1 1
      dashboard/src/main/home/dashboard/ClusterList.tsx
  2. 14 1
      dashboard/src/main/home/sidebar/ClusterSection.tsx

+ 1 - 1
dashboard/src/main/home/dashboard/ClusterList.tsx

@@ -162,7 +162,7 @@ class Templates extends Component<PropsType, StateType> {
           <TemplateBlock
             onClick={() => {
               this.context.setCurrentCluster(cluster);
-              pushFiltered(this.props, "/cluster-dashboard", ["project_id"], {
+              pushFiltered(this.props, "/applications", ["project_id"], {
                 cluster: cluster.name,
               });
             }}

+ 14 - 1
dashboard/src/main/home/sidebar/ClusterSection.tsx

@@ -134,7 +134,20 @@ export const ClusterSection: React.FC<Props> = ({
 
   return (
     <>
-      <ClusterSelector onClick={() => setIsExpanded(!isExpanded)}>
+      <ClusterSelector 
+        onClick={() => setIsExpanded(!isExpanded)}
+        active={
+          !isExpanded && cluster.id === currentCluster.id && [
+            "/cluster-dashboard",
+            "/preview-environments",
+            "/stacks",
+            "/databases",
+            "/env-groups",
+            "/jobs",
+            "/applications"
+          ].includes(window.location.pathname)
+        }
+      >
         <LinkWrapper>
           <ClusterIcon>
             <svg