diff --git a/src/components/Agents/InstalAgentInstruction/useAgentsBaseURL.tsx b/src/components/Agents/InstalAgentInstruction/useAgentsBaseURL.tsx index 5d84eb6f3..ade762272 100644 --- a/src/components/Agents/InstalAgentInstruction/useAgentsBaseURL.tsx +++ b/src/components/Agents/InstalAgentInstruction/useAgentsBaseURL.tsx @@ -7,7 +7,8 @@ export function useAgentsBaseURL() { // if we are on the SaaS platform, we need to use the backend URL from the user // profile, not the current URL - const baseUrl = authSystem === "clerk" ? backendUrl : window.location.origin; + const baseUrl = + authSystem === "clerk" ? backendUrl : window.location.origin + "/api"; return baseUrl; } diff --git a/src/components/Authentication/Kratos/KratosUserProfileDropdown.tsx b/src/components/Authentication/Kratos/KratosUserProfileDropdown.tsx index 4c24c6d4d..1de9fbbc5 100644 --- a/src/components/Authentication/Kratos/KratosUserProfileDropdown.tsx +++ b/src/components/Authentication/Kratos/KratosUserProfileDropdown.tsx @@ -14,10 +14,12 @@ import KratosLogoutButton from "./KratosLogoutButton"; type UserProfileDropdownProps = { openKubeConfigModal: () => void; + openMcpTokenModal: () => void; }; export function KratosUserProfileDropdown({ - openKubeConfigModal + openKubeConfigModal, + openMcpTokenModal }: UserProfileDropdownProps) { const { user } = useUser(); const userNavigation = [{ name: "Your Profile", href: "/profile-settings" }]; @@ -75,6 +77,14 @@ export function KratosUserProfileDropdown({ Download kubeconfig + diff --git a/src/components/Tokens/Add/TokenDisplayModal.tsx b/src/components/Tokens/Add/TokenDisplayModal.tsx index f43498e38..01829d86a 100644 --- a/src/components/Tokens/Add/TokenDisplayModal.tsx +++ b/src/components/Tokens/Add/TokenDisplayModal.tsx @@ -2,22 +2,28 @@ import { useState } from "react"; import { FaCopy, FaEye, FaEyeSlash } from "react-icons/fa"; import { CreateTokenResponse } from "../../../api/services/tokens"; import { Button } from "../../../ui/Buttons/Button"; +import { JSONViewer } from "../../../ui/Code/JSONViewer"; import { Modal } from "../../../ui/Modal"; +import { Tab, Tabs } from "../../../ui/Tabs/Tabs"; import { toastSuccess } from "../../Toast/toast"; import { TokenFormValues } from "./CreateTokenForm"; +import { useAgentsBaseURL } from "../../../components/Agents/InstalAgentInstruction/useAgentsBaseURL"; +import CodeBlock from "@flanksource-ui/ui/Code/CodeBlock"; type Props = { isOpen: boolean; onClose: () => void; tokenResponse: CreateTokenResponse; formValues?: TokenFormValues; + isMcp?: boolean; }; export default function TokenDisplayModal({ isOpen, onClose, tokenResponse, - formValues + formValues, + isMcp = false }: Props) { const [showToken, setShowToken] = useState(false); @@ -77,6 +83,15 @@ export default function TokenDisplayModal({ + {isMcp && ( +
+ {code}
+
+ }
+ title="Copy to clipboard"
+ className={clsx(
+ "absolute right-4 top-4 whitespace-pre-line bg-white",
+ "text-black"
+ )}
+ onClick={() => {
+ copyFn(`${code}`);
+ }}
+ />
+
- {code}
-
+ + {tokens.map((line, i) => { + const { style: lineStyle, ...lineProps } = getLineProps({ + line, + key: i + }); + return ( ++ )} ++ {showLineNumbers && ( + + {i + 1} + + )} + + {line.map((token, key) => ( + + ))} + ++ ); + })} +
Copy the following command to install the chart
-