浏览代码

Merge branch 'master' into nafees/cli-sentry

Mohammed Nafees 3 年之前
父节点
当前提交
80573a86ba

+ 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>