From f8364bea6803e2ceddb1d5b31c6b08fdaedc75e4 Mon Sep 17 00:00:00 2001
From: goulustis
Date: Thu, 5 Mar 2026 17:46:47 +0800
Subject: [PATCH] remove full path
---
frontend/src/App.tsx | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 424cbed..8d81125 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -355,6 +355,23 @@ function getGraphArchImage(graphId: string): string | null {
return null;
}
+function sanitizeConfigPath(path: string): string {
+ if (!path.trim()) {
+ return path;
+ }
+ const normalized = path.replace(/\\/g, "/");
+ const marker = "/configs/";
+ const markerIndex = normalized.lastIndexOf(marker);
+ if (markerIndex >= 0) {
+ return normalized.slice(markerIndex + 1);
+ }
+ const parts = normalized.split("/").filter(Boolean);
+ if (parts.length >= 2) {
+ return parts.slice(-2).join("/");
+ }
+ return normalized;
+}
+
function toEditable(
config: GraphConfigReadResponse,
draft: boolean
@@ -1110,7 +1127,7 @@ export default function App() {
{mcpConfigPath ? (
- File: {mcpConfigPath}
+ File: {sanitizeConfigPath(mcpConfigPath)}
) : null}