github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/ui/src/routes/visualization.tsx (about) 1 // Copyright 2018 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 import React from "react"; 12 import { Route, Switch, Redirect } from "react-router-dom"; 13 14 import { NodesOverview } from "src/views/cluster/containers/nodesOverview"; 15 import ClusterOverview from "src/views/cluster/containers/clusterOverview"; 16 17 class NodesWrapper extends React.Component<{}, {}> { 18 render() { 19 return ( 20 <div style={{ 21 paddingTop: 12, 22 width: "100%", 23 height: "100%", 24 overflow: "auto", 25 }}> 26 <NodesOverview /> 27 </div> 28 ); 29 } 30 } 31 32 export default function createClusterOverviewRoutes(): JSX.Element { 33 return ( 34 <Route path="overview" component={ ClusterOverview } > 35 <Switch> 36 <Route exact path="/" component={() => <Redirect to="list" />}/> 37 <Route path="list" component={ NodesWrapper } /> 38 </Switch> 39 </Route> 40 ); 41 }