소스 검색

Merge pull request #2668 from porter-dev/feat/add-instructions-to-connect-project-cluster

feat: add instructions to connect project and cluster
jusrhee 3 년 전
부모
커밋
f756db4324
1개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 10 1
      dashboard/src/main/home/cluster-dashboard/expanded-chart/jobs/ConnectToJobInstructionsModal.tsx

+ 10 - 1
dashboard/src/main/home/cluster-dashboard/expanded-chart/jobs/ConnectToJobInstructionsModal.tsx

@@ -1,5 +1,6 @@
 import Modal from "main/home/modals/Modal";
 import Modal from "main/home/modals/Modal";
-import React from "react";
+import React, { useContext } from "react";
+import { Context } from "shared/Context";
 import { ChartType } from "shared/types";
 import { ChartType } from "shared/types";
 import styled from "styled-components";
 import styled from "styled-components";
 
 
@@ -8,6 +9,7 @@ const ConnectToJobInstructionsModal: React.FC<{
   onClose: () => void;
   onClose: () => void;
   chartName: string;
   chartName: string;
 }> = ({ show, chartName, onClose }) => {
 }> = ({ show, chartName, onClose }) => {
+  const { currentCluster, currentProject } = useContext(Context);
   if (!show) {
   if (!show) {
     return null;
     return null;
   }
   }
@@ -27,6 +29,13 @@ const ConnectToJobInstructionsModal: React.FC<{
       ).
       ).
       <br />
       <br />
       <br />
       <br />
+      Run the following commands to set your current project and cluster
+      <Code>
+        porter config set-project {currentProject.id}
+        <br />
+        porter config set-cluster {currentCluster.id}
+      </Code>
+      <br />
       Run the following line of code, and make sure to change the command to
       Run the following line of code, and make sure to change the command to
       something your container can run:
       something your container can run:
       <Code>porter run {chartName || "[APP-NAME]"} -- [COMMAND]</Code>
       <Code>porter run {chartName || "[APP-NAME]"} -- [COMMAND]</Code>