Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix the connect to enclave CLI commands in the EM UI #2203

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading