Yosef Mihretie 2 年之前
父節點
當前提交
729f1cbc43
共有 2 個文件被更改,包括 17 次插入3 次删除
  1. 13 0
      dashboard/src/main/Main.tsx
  2. 4 3
      dashboard/src/main/status/StatusPage2.tsx

+ 13 - 0
dashboard/src/main/Main.tsx

@@ -16,6 +16,8 @@ import VerifyEmail from "./auth/VerifyEmail";
 import CurrentError from "./CurrentError";
 import Home from "./home/Home";
 
+import StatusPage from "./status/StatusPage";
+
 type PropsType = {};
 
 type StateType = {
@@ -233,6 +235,17 @@ export default class Main extends Component<PropsType, StateType> {
               return <Redirect to="/login" />;
             }
           }}
+        />
+         <Route
+          path={`/:status/:projectId?/:clusterId?`}
+          render={() => {
+            if (!this.state.isLoggedIn) {
+              return <Redirect to="/login" />;
+            } else if (!this.context.user?.email?.includes("@porter.run")) {
+              return <Redirect to="/dashboard" />;
+            }
+            return <StatusPage />;
+          }}
         />
         <Route
           path={`/:baseRoute/:cluster?/:namespace?`}

+ 4 - 3
dashboard/src/main/status/StatusPage.tsx → dashboard/src/main/status/StatusPage2.tsx

@@ -18,6 +18,7 @@ import logo from "assets/logo.png";
 type Props = RouteComponentProps;
 
 const StatusPage: React.FC<Props> = ({ match }) => {
+  const projects = [{id: 0,  name: "project-1" }, {id: 1, name: "project-2" }];
   return (
     <ThemeProvider theme={midnight}>
       <StyledStatusPage>
@@ -25,14 +26,14 @@ const StatusPage: React.FC<Props> = ({ match }) => {
           <Image src={logo} size={30} />
           <Spacer y={1.5} />
             <>
-              {Array.from({ length: 100 }).map((_, j) => (
+              {projects.map((project, _) => (
                 <>
                   <Expandable
-                    key={j}
+                    key={project.id}
                     alt
                     header={
                       <Container row>
-                        <Text size={16}>project-{j}</Text>
+                        <Text size={16}> { project.name } </Text>
                         <Spacer x={1} inline />
                         <Text color="#01a05d">Operational</Text>
                       </Container>