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

Updated routing to lead to dashboard

jnfrati 5 лет назад
Родитель
Сommit
ab8a4788a3

+ 4 - 0
dashboard/src/main/home/cluster-dashboard/ClusterDashboard.tsx

@@ -17,6 +17,7 @@ import ExpandedChartWrapper from "./expanded-chart/ExpandedChartWrapper";
 import { RouteComponentProps, withRouter } from "react-router";
 
 import api from "shared/api";
+import {Dashboard} from "./dashboard/Dashboard";
 
 type PropsType = RouteComponentProps & {
   currentCluster: ClusterType;
@@ -194,6 +195,9 @@ class ClusterDashboard extends Component<PropsType, StateType> {
         <Route path={["/jobs", "/applications", "/env-groups"]}>
           {this.renderContents()}
         </Route>
+        <Route path={["/cluster-dashboard"]}>
+          <Dashboard />
+        </Route>
       </Switch>
     );
   }

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

@@ -8,6 +8,7 @@ import { ClusterType } from "shared/types";
 
 import Drawer from "./Drawer";
 import { RouteComponentProps, withRouter } from "react-router";
+import { pushFiltered } from "shared/routing";
 
 type PropsType = RouteComponentProps & {
   forceCloseDrawer: boolean;
@@ -172,7 +173,7 @@ class ClusterSection extends Component<PropsType, StateType> {
       return (
         <ClusterSelector isSelected={false}>
           <LinkWrapper
-            onClick={() => this.context.setCurrentModal("UpdateClusterModal")}
+            onClick={() => pushFiltered(this.props, "/cluster-dashboard", [])}
           >
             <ClusterIcon>
               <i className="material-icons">device_hub</i>