mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
fix: show directory-level MCP servers in RepoMcpDialog (#134)
* fix: show directory-level MCP servers in RepoMcpDialog - Derive server list from MCP status response instead of global config - Add GET /opencode-configs/:name endpoint to fetch named configs - Fetch repo-specific config via openCodeConfigName in RepoDetail/SessionDetail - Add null guards for serverConfig to handle directory-only servers - Update empty state text to mention project's opencode.json Closes #130 * Switch RepoMcpDialog to use directory-level server configs
This commit is contained in:
1 parent
c78c96ed86
commit
24609ef6c3
4 files changed
+29
-38
No files matched your search
@@ -10,7 +10,7 @@ import { RepoMcpDialog } from "@/components/repo/RepoMcpDialog";
|
||||
import { SourceControlPanel } from "@/components/source-control";
|
||||
import { useCreateSession } from "@/hooks/useOpenCode";
|
||||
import { useSSE } from "@/hooks/useSSE";
|
||||
import { OPENCODE_API_ENDPOINT, API_BASE_URL } from "@/config";
|
||||
import { OPENCODE_API_ENDPOINT } from "@/config";
|
||||
import { useSwipeBack } from "@/hooks/useMobile";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
@@ -58,15 +58,6 @@ export function RepoDetail() {
|
||||
enabled: !!repoId,
|
||||
});
|
||||
|
||||
const { data: settings } = useQuery({
|
||||
queryKey: ["opencode-config"],
|
||||
queryFn: async () => {
|
||||
const response = await fetch(`${API_BASE_URL}/api/settings/opencode-configs/default`);
|
||||
if (!response.ok) throw new Error("Failed to fetch config");
|
||||
return response.json();
|
||||
},
|
||||
});
|
||||
|
||||
const opcodeUrl = OPENCODE_API_ENDPOINT;
|
||||
|
||||
const repoDirectory = repo?.fullPath;
|
||||
@@ -244,7 +235,6 @@ export function RepoDetail() {
|
||||
<RepoMcpDialog
|
||||
open={mcpDialogOpen}
|
||||
onOpenChange={setMcpDialogOpen}
|
||||
config={settings}
|
||||
directory={repoDirectory}
|
||||
/>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import { ContextUsageIndicator } from "@/components/session/ContextUsageIndicator";
|
||||
import { useSession, useAbortSession, useUpdateSession, useMessages, useTitleGenerating, useCreateSession } from "@/hooks/useOpenCode";
|
||||
import { OPENCODE_API_ENDPOINT, API_BASE_URL } from "@/config";
|
||||
import { OPENCODE_API_ENDPOINT } from "@/config";
|
||||
import { useSSE } from "@/hooks/useSSE";
|
||||
import { useUIState } from "@/stores/uiStateStore";
|
||||
import { useSettings } from "@/hooks/useSettings";
|
||||
@@ -80,15 +80,6 @@ export function SessionDetail() {
|
||||
enabled: !!repoId,
|
||||
});
|
||||
|
||||
const { data: settings } = useQuery({
|
||||
queryKey: ["opencode-config"],
|
||||
queryFn: async () => {
|
||||
const response = await fetch(`${API_BASE_URL}/api/settings/opencode-configs/default`);
|
||||
if (!response.ok) throw new Error("Failed to fetch config");
|
||||
return response.json();
|
||||
},
|
||||
});
|
||||
|
||||
const opcodeUrl = OPENCODE_API_ENDPOINT;
|
||||
|
||||
const repoDirectory = repo?.fullPath;
|
||||
@@ -531,7 +522,6 @@ export function SessionDetail() {
|
||||
<RepoMcpDialog
|
||||
open={mcpDialogOpen}
|
||||
onOpenChange={setMcpDialogOpen}
|
||||
config={settings}
|
||||
directory={repoDirectory}
|
||||
/>
|
||||
|
||||
|
||||
Reference in new issue
Block a user