Skip to content

Commit

Permalink
fix: Fix the connect to enclave CLI commands in the EM UI (#2203)
Browse files Browse the repository at this point in the history
Add api key environment variable set command to the list of connect to
enclave CLI commands in the EM UI.

## Is this change user facing?
YES

## References (if applicable):
kurtosis-tech/kurtosis-cloud-frontend#84
  • Loading branch information
laurentluce authored Feb 21, 2024
1 parent ad00ee1 commit 225f8c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ import { EnclaveFullInfo } from "../../types";
export type ConnectEnclaveModalProps = {
enclave: EnclaveFullInfo;
instanceUUID: string;
apiKey: string;
isOpen: boolean;
onClose: () => void;
};

export const ConnectEnclaveModal = ({ isOpen, onClose, enclave, instanceUUID }: ConnectEnclaveModalProps) => {
export const ConnectEnclaveModal = ({ isOpen, onClose, enclave, instanceUUID, apiKey }: ConnectEnclaveModalProps) => {
const commands = `
export KURTOSIS_CLOUD_API_KEY="${apiKey}"
kurtosis cloud load ${instanceUUID}
kurtosis enclave connect ${enclave.name}
kurtosis enclave inspect ${enclave.name}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { ConnectEnclaveModal } from "../modals/ConnectEnclaveModal";
type ConnectEnclaveButtonProps = ButtonProps & {
enclave: EnclaveFullInfo;
instanceUUID: string;
apiKey: string;
};

export const ConnectEnclaveButton = ({ enclave, instanceUUID, ...buttonProps }: ConnectEnclaveButtonProps) => {
export const ConnectEnclaveButton = ({ enclave, instanceUUID, apiKey, ...buttonProps }: ConnectEnclaveButtonProps) => {
const [showModal, setShowModal] = useState(false);

return (
Expand All @@ -29,6 +30,7 @@ export const ConnectEnclaveButton = ({ enclave, instanceUUID, ...buttonProps }:
<ConnectEnclaveModal
enclave={enclave}
instanceUUID={instanceUUID}
apiKey={apiKey}
isOpen={showModal}
onClose={() => setShowModal(false)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const EnclaveImpl = ({ enclave }: EnclaveImplProps) => {
};

const instanceUUID = Cookies.get("_kurtosis_instance_id") || "";
const apiKey = Cookies.get("_kurtosis_api_key") || "";

return (
<Tabs isManual isLazy index={activeIndex} onChange={handleTabChange} variant={"kurtosisHeaderLine"}>
Expand All @@ -58,7 +59,7 @@ const EnclaveImpl = ({ enclave }: EnclaveImplProps) => {
<Flex gap={"8px"} alignItems={"center"} pb={"16px"}>
<DeleteEnclavesButton enclaves={[enclave]} />
<EditEnclaveButton enclave={enclave} />
<ConnectEnclaveButton enclave={enclave} instanceUUID={instanceUUID} />
<ConnectEnclaveButton enclave={enclave} instanceUUID={instanceUUID} apiKey={apiKey} />
</Flex>
</Flex>
<TabPanels>
Expand Down

0 comments on commit 225f8c1

Please sign in to comment.