Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion src/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function AppRouter() {
<Route path="projects" element={<ProjectListView />} />
<Route path="projects/:projectName" element={<ControlPlaneListView />} />
<Route
path="projects/:projectName/workspaces/:workspaceName/mcps/:controlPlaneName/context/:contextName"
path="projects/:projectName/workspaces/:workspaceName/mcps/:controlPlaneName"
element={<ControlPlaneView />}
/>
</Route>
Expand Down
10 changes: 2 additions & 8 deletions src/components/ControlPlanes/ConnectButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import yaml from 'js-yaml';
import { useRef, useState } from 'react';
import { DownloadKubeconfig } from './CopyKubeconfigButton.tsx';
import { useApiResource } from '../../lib/api/useApiResource.ts';
import { extractWorkspaceNameFromNamespace } from '../../utils/index.ts';
import { extractWorkspaceNameFromNamespace } from '../../utils';
import { useTranslation } from 'react-i18next';

interface Props {
Expand Down Expand Up @@ -45,10 +45,6 @@ export default function ConnectButton(props: Props) {

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const contexts = kubeconfig.contexts as any[];
const currentContext = kubeconfig['current-context'];
if (!currentContext) {
return <></>;
}

if (contexts.length === 1) {
return (
Expand All @@ -57,9 +53,7 @@ export default function ConnectButton(props: Props) {
disabled={props.disabled}
onClick={() =>
navigate(
`/mcp/projects/${props.projectName}/workspaces/${extractWorkspaceNameFromNamespace(
props.workspaceName,
)}/mcps/${props.controlPlaneName}/context/${currentContext}`,
`/mcp/projects/${props.projectName}/workspaces/${extractWorkspaceNameFromNamespace(props.workspaceName)}/mcps/${props.controlPlaneName}`,
)
}
>
Expand Down
2 changes: 0 additions & 2 deletions src/lib/api/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const useCrateClusterHeader = 'X-use-crate';
const projectNameHeader = 'X-project';
const workspaceNameHeader = 'X-workspace';
const mcpNameHeader = 'X-mcp';
const contextHeader = 'X-context';
const jqHeader = 'X-jq';
const contentTypeHeader = 'Content-Type';

Expand Down Expand Up @@ -35,7 +34,6 @@ export const fetchApiServer = async (
headers[projectNameHeader] = config.mcpConfig.projectName;
headers[workspaceNameHeader] = config.mcpConfig.workspaceName;
headers[mcpNameHeader] = config.mcpConfig.controlPlaneName;
headers[contextHeader] = config.mcpConfig.contextName;
} else {
headers[useCrateClusterHeader] = 'true';
}
Expand Down
1 change: 0 additions & 1 deletion src/lib/api/types/apiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ type McpConfig = {
projectName: string;
workspaceName: string;
controlPlaneName: string;
contextName: string;
};

//syntax basically combines all the atrributes from the types into one
Expand Down
2 changes: 0 additions & 2 deletions src/lib/shared/McpContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ interface Mcp {
project: string;
workspace: string;
name: string;
context: string;

secretNamespace?: string;
secretName?: string;
Expand Down Expand Up @@ -56,7 +55,6 @@ function RequireDownstreamLogin(props: { children?: ReactNode }) {
<ApiConfigProvider
apiConfig={{
mcpConfig: {
contextName: mcp.context,
projectName: mcp.project,
workspaceName: mcp.workspace,
controlPlaneName: mcp.name,
Expand Down
3 changes: 1 addition & 2 deletions src/views/ControlPlanes/ControlPlaneView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { Landscapers } from '../../components/ControlPlane/Landscapers.tsx';
import { AuthProviderMcp } from '../../spaces/mcp/auth/AuthContextMcp.tsx';

export default function ControlPlaneView() {
const { projectName, workspaceName, controlPlaneName, contextName } = useParams();
const { projectName, workspaceName, controlPlaneName } = useParams();
const { t } = useTranslation();

const { data: mcp, error } = useApiResource(
Expand All @@ -48,7 +48,6 @@ export default function ControlPlaneView() {
project: projectName,
workspace: workspaceName,
name: controlPlaneName,
context: contextName!,
}}
>
<AuthProviderMcp>
Expand Down
Loading