mcpgraph-ux 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/app/api/execution/breakpoints/route.ts +106 -0
- package/app/api/execution/context/route.ts +69 -0
- package/app/api/execution/controller/route.ts +121 -0
- package/app/api/execution/history/route.ts +40 -0
- package/app/api/execution/history-with-indices/route.ts +57 -0
- package/app/api/execution/stream/route.ts +34 -0
- package/app/api/graph/route.ts +99 -33
- package/app/api/tools/[toolName]/route.ts +338 -21
- package/app/api/tools/route.ts +1 -16
- package/app/page.module.css +64 -18
- package/app/page.tsx +60 -26
- package/components/DebugControls.module.css +124 -0
- package/components/DebugControls.tsx +209 -0
- package/components/ExecutionHistory.module.css +371 -0
- package/components/ExecutionHistory.tsx +272 -0
- package/components/GraphVisualization.module.css +11 -0
- package/components/GraphVisualization.tsx +353 -70
- package/components/InputForm.module.css +146 -0
- package/components/InputForm.tsx +282 -0
- package/components/ServerDetails.module.css +118 -0
- package/components/ServerDetails.tsx +116 -0
- package/components/TelemetryDashboard.module.css +177 -0
- package/components/TelemetryDashboard.tsx +154 -0
- package/components/ToolList.module.css +2 -2
- package/components/ToolTester.module.css +54 -110
- package/components/ToolTester.tsx +746 -235
- package/package.json +8 -9
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
4
|
+
import styles from './InputForm.module.css';
|
|
5
|
+
|
|
6
|
+
interface JsonSchemaProperty {
|
|
7
|
+
type: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
format?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ToolInfo {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: string;
|
|
17
|
+
properties?: Record<string, JsonSchemaProperty>;
|
|
18
|
+
required?: string[];
|
|
19
|
+
};
|
|
20
|
+
outputSchema?: {
|
|
21
|
+
type: string;
|
|
22
|
+
properties?: Record<string, JsonSchemaProperty>;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface InputFormHandle {
|
|
27
|
+
submit: (startPaused: boolean) => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface InputFormProps {
|
|
31
|
+
toolName: string;
|
|
32
|
+
onSubmit: (formData: Record<string, any>, startPaused: boolean) => void;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const InputForm = forwardRef<InputFormHandle, InputFormProps>(({ toolName, onSubmit, disabled }, ref) => {
|
|
37
|
+
const [toolInfo, setToolInfo] = useState<ToolInfo | null>(null);
|
|
38
|
+
const [formData, setFormData] = useState<Record<string, any>>({});
|
|
39
|
+
const [error, setError] = useState<string | null>(null);
|
|
40
|
+
const formRef = useRef<HTMLFormElement>(null);
|
|
41
|
+
const pendingStartPausedRef = useRef<boolean>(false);
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
// Fetch tool information
|
|
45
|
+
fetch(`/api/tools/${toolName}`)
|
|
46
|
+
.then(res => res.json())
|
|
47
|
+
.then(data => {
|
|
48
|
+
if (data.error) {
|
|
49
|
+
setError(data.error);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
setToolInfo(data.tool);
|
|
53
|
+
// Initialize form data with default values
|
|
54
|
+
const defaults: Record<string, any> = {};
|
|
55
|
+
if (data.tool.inputSchema.properties) {
|
|
56
|
+
Object.entries(data.tool.inputSchema.properties).forEach(([key, prop]: [string, any]) => {
|
|
57
|
+
if (prop.type === 'string') {
|
|
58
|
+
defaults[key] = '';
|
|
59
|
+
} else if (prop.type === 'number') {
|
|
60
|
+
defaults[key] = 0;
|
|
61
|
+
} else if (prop.type === 'boolean') {
|
|
62
|
+
defaults[key] = false;
|
|
63
|
+
} else if (prop.type === 'array') {
|
|
64
|
+
defaults[key] = [];
|
|
65
|
+
} else if (prop.type === 'object') {
|
|
66
|
+
defaults[key] = {};
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
setFormData(defaults);
|
|
71
|
+
})
|
|
72
|
+
.catch(err => {
|
|
73
|
+
setError(err.message);
|
|
74
|
+
});
|
|
75
|
+
}, [toolName]);
|
|
76
|
+
|
|
77
|
+
// Expose submit method to parent via ref
|
|
78
|
+
useImperativeHandle(ref, () => ({
|
|
79
|
+
submit: (startPaused: boolean) => {
|
|
80
|
+
pendingStartPausedRef.current = startPaused;
|
|
81
|
+
if (formRef.current) {
|
|
82
|
+
formRef.current.requestSubmit();
|
|
83
|
+
} else {
|
|
84
|
+
console.warn('[InputForm] formRef.current is null, cannot submit form');
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
}));
|
|
88
|
+
|
|
89
|
+
const handleInputChange = (key: string, value: unknown) => {
|
|
90
|
+
setFormData(prev => ({
|
|
91
|
+
...prev,
|
|
92
|
+
[key]: value,
|
|
93
|
+
}));
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const handleSubmit = (e: React.FormEvent) => {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
const startPaused = pendingStartPausedRef.current;
|
|
99
|
+
pendingStartPausedRef.current = false;
|
|
100
|
+
|
|
101
|
+
// Validate required fields
|
|
102
|
+
if (toolInfo?.inputSchema.required) {
|
|
103
|
+
for (const field of toolInfo.inputSchema.required) {
|
|
104
|
+
if (!formData[field] || (typeof formData[field] === 'string' && formData[field].trim() === '')) {
|
|
105
|
+
setError(`Field "${field}" is required`);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
setError(null);
|
|
112
|
+
onSubmit(formData, startPaused);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const renderInputField = (key: string, prop: JsonSchemaProperty) => {
|
|
116
|
+
const value = formData[key];
|
|
117
|
+
const isRequired = toolInfo?.inputSchema.required?.includes(key);
|
|
118
|
+
|
|
119
|
+
switch (prop.type) {
|
|
120
|
+
case 'string':
|
|
121
|
+
if (prop.format === 'multiline' || (typeof value === 'string' && value.includes('\n'))) {
|
|
122
|
+
return (
|
|
123
|
+
<div key={key} className={styles.field}>
|
|
124
|
+
<label htmlFor={key} className={styles.label}>
|
|
125
|
+
{key}
|
|
126
|
+
{isRequired && <span className={styles.required}>*</span>}
|
|
127
|
+
</label>
|
|
128
|
+
<textarea
|
|
129
|
+
id={key}
|
|
130
|
+
value={typeof value === 'string' ? value : JSON.stringify(value)}
|
|
131
|
+
onChange={e => {
|
|
132
|
+
try {
|
|
133
|
+
const parsed = JSON.parse(e.target.value);
|
|
134
|
+
handleInputChange(key, parsed);
|
|
135
|
+
} catch {
|
|
136
|
+
handleInputChange(key, e.target.value);
|
|
137
|
+
}
|
|
138
|
+
}}
|
|
139
|
+
className={styles.textarea}
|
|
140
|
+
placeholder={prop.description || `Enter ${key}`}
|
|
141
|
+
rows={3}
|
|
142
|
+
disabled={disabled}
|
|
143
|
+
/>
|
|
144
|
+
{prop.description && (
|
|
145
|
+
<div className={styles.hint}>{prop.description}</div>
|
|
146
|
+
)}
|
|
147
|
+
</div>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
return (
|
|
151
|
+
<div key={key} className={styles.field}>
|
|
152
|
+
<label htmlFor={key} className={styles.label}>
|
|
153
|
+
{key}
|
|
154
|
+
{isRequired && <span className={styles.required}>*</span>}
|
|
155
|
+
</label>
|
|
156
|
+
<input
|
|
157
|
+
id={key}
|
|
158
|
+
type="text"
|
|
159
|
+
value={typeof value === 'string' ? value : JSON.stringify(value)}
|
|
160
|
+
onChange={e => {
|
|
161
|
+
try {
|
|
162
|
+
const parsed = JSON.parse(e.target.value);
|
|
163
|
+
handleInputChange(key, parsed);
|
|
164
|
+
} catch {
|
|
165
|
+
handleInputChange(key, e.target.value);
|
|
166
|
+
}
|
|
167
|
+
}}
|
|
168
|
+
className={styles.input}
|
|
169
|
+
placeholder={prop.description || `Enter ${key}`}
|
|
170
|
+
disabled={disabled}
|
|
171
|
+
/>
|
|
172
|
+
{prop.description && (
|
|
173
|
+
<div className={styles.hint}>{prop.description}</div>
|
|
174
|
+
)}
|
|
175
|
+
</div>
|
|
176
|
+
);
|
|
177
|
+
case 'number':
|
|
178
|
+
return (
|
|
179
|
+
<div key={key} className={styles.field}>
|
|
180
|
+
<label htmlFor={key} className={styles.label}>
|
|
181
|
+
{key}
|
|
182
|
+
{isRequired && <span className={styles.required}>*</span>}
|
|
183
|
+
</label>
|
|
184
|
+
<input
|
|
185
|
+
id={key}
|
|
186
|
+
type="number"
|
|
187
|
+
value={typeof value === 'number' ? value : ''}
|
|
188
|
+
onChange={e => handleInputChange(key, e.target.value ? Number(e.target.value) : 0)}
|
|
189
|
+
className={styles.input}
|
|
190
|
+
placeholder={prop.description || `Enter ${key}`}
|
|
191
|
+
disabled={disabled}
|
|
192
|
+
/>
|
|
193
|
+
{prop.description && (
|
|
194
|
+
<div className={styles.hint}>{prop.description}</div>
|
|
195
|
+
)}
|
|
196
|
+
</div>
|
|
197
|
+
);
|
|
198
|
+
case 'boolean':
|
|
199
|
+
return (
|
|
200
|
+
<div key={key} className={styles.field}>
|
|
201
|
+
<label htmlFor={key} className={styles.checkboxLabel}>
|
|
202
|
+
<input
|
|
203
|
+
id={key}
|
|
204
|
+
type="checkbox"
|
|
205
|
+
checked={value === true}
|
|
206
|
+
onChange={e => handleInputChange(key, e.target.checked)}
|
|
207
|
+
className={styles.checkbox}
|
|
208
|
+
disabled={disabled}
|
|
209
|
+
/>
|
|
210
|
+
{key}
|
|
211
|
+
{isRequired && <span className={styles.required}>*</span>}
|
|
212
|
+
</label>
|
|
213
|
+
{prop.description && (
|
|
214
|
+
<div className={styles.hint}>{prop.description}</div>
|
|
215
|
+
)}
|
|
216
|
+
</div>
|
|
217
|
+
);
|
|
218
|
+
default:
|
|
219
|
+
// For complex types (object, array), use textarea with JSON
|
|
220
|
+
return (
|
|
221
|
+
<div key={key} className={styles.field}>
|
|
222
|
+
<label htmlFor={key} className={styles.label}>
|
|
223
|
+
{key}
|
|
224
|
+
{isRequired && <span className={styles.required}>*</span>}
|
|
225
|
+
</label>
|
|
226
|
+
<textarea
|
|
227
|
+
id={key}
|
|
228
|
+
value={typeof value === 'string' ? value : JSON.stringify(value, null, 2)}
|
|
229
|
+
onChange={e => {
|
|
230
|
+
try {
|
|
231
|
+
const parsed = JSON.parse(e.target.value);
|
|
232
|
+
handleInputChange(key, parsed);
|
|
233
|
+
} catch {
|
|
234
|
+
handleInputChange(key, e.target.value);
|
|
235
|
+
}
|
|
236
|
+
}}
|
|
237
|
+
className={styles.textarea}
|
|
238
|
+
placeholder={prop.description || `Enter ${key}`}
|
|
239
|
+
rows={3}
|
|
240
|
+
disabled={disabled}
|
|
241
|
+
/>
|
|
242
|
+
{prop.description && (
|
|
243
|
+
<div className={styles.hint}>{prop.description}</div>
|
|
244
|
+
)}
|
|
245
|
+
</div>
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
if (!toolInfo) {
|
|
251
|
+
return <div className={styles.loading}>Loading tool information...</div>;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return (
|
|
255
|
+
<form ref={formRef} onSubmit={handleSubmit} className={styles.form}>
|
|
256
|
+
{error && (
|
|
257
|
+
<div className={styles.error}>
|
|
258
|
+
<strong>Error:</strong> {error}
|
|
259
|
+
<button
|
|
260
|
+
type="button"
|
|
261
|
+
onClick={() => setError(null)}
|
|
262
|
+
className={styles.dismissButton}
|
|
263
|
+
aria-label="Dismiss error"
|
|
264
|
+
>
|
|
265
|
+
×
|
|
266
|
+
</button>
|
|
267
|
+
</div>
|
|
268
|
+
)}
|
|
269
|
+
<div className={styles.inputs}>
|
|
270
|
+
{toolInfo.inputSchema.properties &&
|
|
271
|
+
Object.entries(toolInfo.inputSchema.properties).map(([key, prop]) =>
|
|
272
|
+
renderInputField(key, prop)
|
|
273
|
+
)}
|
|
274
|
+
</div>
|
|
275
|
+
</form>
|
|
276
|
+
);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
InputForm.displayName = 'InputForm';
|
|
280
|
+
|
|
281
|
+
export default InputForm;
|
|
282
|
+
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
flex-shrink: 0;
|
|
5
|
+
border-bottom: 1px solid #e0e0e0;
|
|
6
|
+
margin-bottom: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.title {
|
|
10
|
+
padding: 1rem 1.5rem;
|
|
11
|
+
font-size: 1.1rem;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
color: #333;
|
|
14
|
+
border-bottom: 1px solid #e0e0e0;
|
|
15
|
+
background-color: #fafafa;
|
|
16
|
+
margin: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.configInfo {
|
|
20
|
+
padding: 1rem 1.5rem;
|
|
21
|
+
border-bottom: 1px solid #f0f0f0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.configName {
|
|
25
|
+
font-weight: 600;
|
|
26
|
+
color: #333;
|
|
27
|
+
font-size: 0.95rem;
|
|
28
|
+
margin-bottom: 0.25rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.configVersion {
|
|
32
|
+
font-size: 0.85rem;
|
|
33
|
+
color: #666;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.configDescription {
|
|
37
|
+
font-size: 0.85rem;
|
|
38
|
+
color: #666;
|
|
39
|
+
margin-top: 0.25rem;
|
|
40
|
+
font-style: italic;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.servers {
|
|
44
|
+
max-height: 300px;
|
|
45
|
+
overflow-y: auto;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.server {
|
|
49
|
+
padding: 1rem 1.5rem;
|
|
50
|
+
border-bottom: 1px solid #f0f0f0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.serverName {
|
|
54
|
+
font-weight: 600;
|
|
55
|
+
color: #2196f3;
|
|
56
|
+
font-size: 0.9rem;
|
|
57
|
+
margin-bottom: 0.5rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.serverType,
|
|
61
|
+
.serverCommand,
|
|
62
|
+
.serverArgs,
|
|
63
|
+
.serverCwd,
|
|
64
|
+
.serverUrl,
|
|
65
|
+
.serverHeaders {
|
|
66
|
+
margin-bottom: 0.5rem;
|
|
67
|
+
font-size: 0.85rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.serverType:last-child,
|
|
71
|
+
.serverCommand:last-child,
|
|
72
|
+
.serverArgs:last-child,
|
|
73
|
+
.serverCwd:last-child,
|
|
74
|
+
.serverUrl:last-child,
|
|
75
|
+
.serverHeaders:last-child {
|
|
76
|
+
margin-bottom: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.server:last-child {
|
|
80
|
+
border-bottom: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.label {
|
|
84
|
+
color: #666;
|
|
85
|
+
margin-right: 0.5rem;
|
|
86
|
+
font-weight: 500;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.code {
|
|
90
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
91
|
+
font-size: 0.85rem;
|
|
92
|
+
color: #333;
|
|
93
|
+
word-break: break-all;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.headers {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
gap: 0.25rem;
|
|
100
|
+
margin-top: 0.25rem;
|
|
101
|
+
margin-left: 0.5rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.header {
|
|
105
|
+
margin: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.loading,
|
|
109
|
+
.error {
|
|
110
|
+
padding: 0.5rem;
|
|
111
|
+
font-size: 0.85rem;
|
|
112
|
+
color: #666;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.error {
|
|
116
|
+
color: #d32f2f;
|
|
117
|
+
}
|
|
118
|
+
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import styles from './ServerDetails.module.css';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
interface ServerInfo {
|
|
7
|
+
name: string;
|
|
8
|
+
type: string;
|
|
9
|
+
command?: string;
|
|
10
|
+
args?: string[];
|
|
11
|
+
cwd?: string;
|
|
12
|
+
url?: string;
|
|
13
|
+
headers?: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface ServerDetailsProps {
|
|
17
|
+
config: {
|
|
18
|
+
name: string;
|
|
19
|
+
version: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
servers: ServerInfo[];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Server config section
|
|
26
|
+
export function ServerConfig({ config }: ServerDetailsProps) {
|
|
27
|
+
if (!config || !config.name) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className={styles.container}>
|
|
33
|
+
<h2 className={styles.title}>Server</h2>
|
|
34
|
+
<div className={styles.configInfo}>
|
|
35
|
+
<div className={styles.configName}>{config.name}</div>
|
|
36
|
+
{config.version && (
|
|
37
|
+
<div className={styles.configVersion}>v{config.version}</div>
|
|
38
|
+
)}
|
|
39
|
+
{config.description && (
|
|
40
|
+
<div className={styles.configDescription}>{config.description}</div>
|
|
41
|
+
)}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// MCP Servers section
|
|
48
|
+
export function McpServers({ config }: ServerDetailsProps) {
|
|
49
|
+
if (!config || !config.servers || config.servers.length === 0) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className={styles.container}>
|
|
55
|
+
<h2 className={styles.title}>MCP Servers</h2>
|
|
56
|
+
<div className={styles.servers}>
|
|
57
|
+
{config.servers.map((server, index) => (
|
|
58
|
+
<div key={index} className={styles.server}>
|
|
59
|
+
<div className={styles.serverName}>{server.name}</div>
|
|
60
|
+
<div className={styles.serverType}>
|
|
61
|
+
<span className={styles.label}>Type:</span>
|
|
62
|
+
<code className={styles.code}>{server.type}</code>
|
|
63
|
+
</div>
|
|
64
|
+
{server.command && (
|
|
65
|
+
<div className={styles.serverCommand}>
|
|
66
|
+
<span className={styles.label}>Command:</span>
|
|
67
|
+
<code className={styles.code}>{server.command}</code>
|
|
68
|
+
</div>
|
|
69
|
+
)}
|
|
70
|
+
{server.args && server.args.length > 0 && (
|
|
71
|
+
<div className={styles.serverArgs}>
|
|
72
|
+
<span className={styles.label}>Args:</span>
|
|
73
|
+
<code className={styles.code}>{server.args.join(' ')}</code>
|
|
74
|
+
</div>
|
|
75
|
+
)}
|
|
76
|
+
{server.cwd && (
|
|
77
|
+
<div className={styles.serverCwd}>
|
|
78
|
+
<span className={styles.label}>CWD:</span>
|
|
79
|
+
<code className={styles.code}>{server.cwd}</code>
|
|
80
|
+
</div>
|
|
81
|
+
)}
|
|
82
|
+
{server.url && (
|
|
83
|
+
<div className={styles.serverUrl}>
|
|
84
|
+
<span className={styles.label}>URL:</span>
|
|
85
|
+
<code className={styles.code}>{server.url}</code>
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
{server.headers && Object.keys(server.headers).length > 0 && (
|
|
89
|
+
<div className={styles.serverHeaders}>
|
|
90
|
+
<span className={styles.label}>Headers:</span>
|
|
91
|
+
<div className={styles.headers}>
|
|
92
|
+
{Object.entries(server.headers).map(([key, value]) => (
|
|
93
|
+
<div key={key} className={styles.header}>
|
|
94
|
+
<code className={styles.code}>{key}: {value}</code>
|
|
95
|
+
</div>
|
|
96
|
+
))}
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
)}
|
|
100
|
+
</div>
|
|
101
|
+
))}
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Legacy default export for backwards compatibility
|
|
108
|
+
export default function ServerDetails({ config }: ServerDetailsProps) {
|
|
109
|
+
return (
|
|
110
|
+
<>
|
|
111
|
+
<ServerConfig config={config} />
|
|
112
|
+
<McpServers config={config} />
|
|
113
|
+
</>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
border: 1px solid #e0e0e0;
|
|
6
|
+
border-radius: 8px;
|
|
7
|
+
background: white;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.title {
|
|
11
|
+
padding: 12px 16px;
|
|
12
|
+
margin: 0;
|
|
13
|
+
font-size: 16px;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
border-bottom: 1px solid #e0e0e0;
|
|
16
|
+
background: #f5f5f5;
|
|
17
|
+
border-radius: 8px 8px 0 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.empty {
|
|
21
|
+
padding: 24px;
|
|
22
|
+
text-align: center;
|
|
23
|
+
color: #999;
|
|
24
|
+
font-style: italic;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.metrics {
|
|
28
|
+
display: grid;
|
|
29
|
+
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
|
30
|
+
gap: 12px;
|
|
31
|
+
padding: 16px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.metricCard {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
padding: 12px;
|
|
38
|
+
background: #f9f9f9;
|
|
39
|
+
border-radius: 6px;
|
|
40
|
+
border: 1px solid #e0e0e0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.metricLabel {
|
|
44
|
+
font-size: 11px;
|
|
45
|
+
color: #666;
|
|
46
|
+
text-transform: uppercase;
|
|
47
|
+
letter-spacing: 0.5px;
|
|
48
|
+
margin-bottom: 4px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.metricValue {
|
|
52
|
+
font-size: 20px;
|
|
53
|
+
font-weight: 600;
|
|
54
|
+
color: #2196f3;
|
|
55
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.metricValue.error {
|
|
59
|
+
color: #ef5350;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.section {
|
|
63
|
+
padding: 16px;
|
|
64
|
+
border-top: 1px solid #e0e0e0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.sectionTitle {
|
|
68
|
+
margin: 0 0 12px 0;
|
|
69
|
+
font-size: 14px;
|
|
70
|
+
font-weight: 600;
|
|
71
|
+
color: #333;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.nodeTypeList {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
gap: 12px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.nodeTypeItem {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
gap: 6px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.nodeTypeHeader {
|
|
87
|
+
display: flex;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
align-items: center;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.nodeTypeName {
|
|
93
|
+
font-weight: 600;
|
|
94
|
+
font-size: 13px;
|
|
95
|
+
color: #333;
|
|
96
|
+
text-transform: capitalize;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.nodeTypeCount {
|
|
100
|
+
font-size: 11px;
|
|
101
|
+
color: #666;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.progressBar {
|
|
105
|
+
height: 8px;
|
|
106
|
+
background: #e0e0e0;
|
|
107
|
+
border-radius: 4px;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.progressFill {
|
|
112
|
+
height: 100%;
|
|
113
|
+
background: linear-gradient(90deg, #2196f3, #42a5f5);
|
|
114
|
+
transition: width 0.3s ease;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.nodeTypeStats {
|
|
118
|
+
display: flex;
|
|
119
|
+
gap: 12px;
|
|
120
|
+
font-size: 11px;
|
|
121
|
+
color: #666;
|
|
122
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.slowNodesList {
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
gap: 8px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.slowNodeItem {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
gap: 12px;
|
|
135
|
+
padding: 8px;
|
|
136
|
+
background: #f9f9f9;
|
|
137
|
+
border-radius: 4px;
|
|
138
|
+
position: relative;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.slowNodeId {
|
|
142
|
+
flex: 1;
|
|
143
|
+
font-size: 12px;
|
|
144
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
145
|
+
color: #333;
|
|
146
|
+
min-width: 0;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
white-space: nowrap;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.slowNodeDuration {
|
|
153
|
+
font-size: 12px;
|
|
154
|
+
font-weight: 600;
|
|
155
|
+
color: #2196f3;
|
|
156
|
+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
|
157
|
+
white-space: nowrap;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.slowNodeBar {
|
|
161
|
+
position: absolute;
|
|
162
|
+
bottom: 0;
|
|
163
|
+
left: 0;
|
|
164
|
+
right: 0;
|
|
165
|
+
height: 2px;
|
|
166
|
+
background: transparent;
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
border-radius: 0 0 4px 4px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.slowNodeFill {
|
|
172
|
+
height: 100%;
|
|
173
|
+
background: #2196f3;
|
|
174
|
+
opacity: 0.3;
|
|
175
|
+
transition: width 0.3s ease;
|
|
176
|
+
}
|
|
177
|
+
|