77 Card ,
88 CardContent ,
99 CardHeader ,
10- Chip ,
1110 CircularProgress ,
1211 Collapse ,
1312 Divider ,
@@ -16,7 +15,6 @@ import {
1615 ListItem ,
1716 ListItemText ,
1817 Stack ,
19- Theme ,
2018 Typography
2119} from '@mui/material' ;
2220import { useEffect , useState } from 'react' ;
@@ -26,7 +24,6 @@ import ContinueIcon from '../../assets/continue.svg';
2624import CursorIcon from '../../assets/cursor.svg' ;
2725import GordonIcon from '../../assets/gordon-icon.png' ;
2826import { CATALOG_LAYOUT_SX , DOCKER_MCP_COMMAND } from '../../Constants' ;
29- import { LinkOffOutlined , LinkOutlined } from '@mui/icons-material' ;
3027
3128// Initialize the Docker Desktop client
3229const client = createDockerDesktopClient ( ) ;
@@ -42,16 +39,6 @@ const iconMap = {
4239 'Continue.dev' : ContinueIcon ,
4340} ;
4441
45- const ConnectButtonStyle = ( theme : Theme ) => ( {
46- fontSize : '1.3em' ,
47- p : 1 ,
48- alignItems : 'center' ,
49- justifyContent : 'center' ,
50- [ theme . breakpoints . down ( 'sm' ) ] : {
51- fontSize : '1em' ,
52- } ,
53- } ) ;
54-
5542const MCPClientSettings = ( { appProps } : MCPClientSettingsProps ) => {
5643 // Extract all the values we need from appProps
5744 const { mcpClientStates, updateMCPClientStates } = appProps ;
@@ -140,7 +127,6 @@ function ClientSetting({
140127 mcpClientState : any ;
141128 appProps : any ;
142129} ) {
143-
144130 const [ expanded , setExpanded ] = useState ( false ) ;
145131
146132 // Extract all the values we need from appProps
@@ -163,68 +149,75 @@ function ClientSetting({
163149 />
164150 )
165151 }
166- title = { < Typography variant = "subtitle2" > { name } { mcpClientState . exists ? '' : < Chip sx = { { ml : 1 } } label = "Not detected" color = "error" size = "small" /> } </ Typography > }
152+ title = { < Typography variant = "subtitle2" > { name } </ Typography > }
167153 subheader = {
168- < Typography
169- variant = "body2"
170- sx = { {
171- color : 'text.secondary' ,
172- alignItems : 'center ' ,
173- display : 'flex ' ,
174- cursor : 'pointer ' ,
175- } }
176- onClick = { ( ) => setExpanded ( ! expanded ) }
177- >
178- Manual configuration
179- {
180- expanded ? (
154+ mcpClientState . exists ? (
155+ < Typography
156+ variant = "body2"
157+ sx = { {
158+ color : 'text.secondary ' ,
159+ alignItems : 'center ' ,
160+ display : 'flex ' ,
161+ cursor : 'pointer' ,
162+ } }
163+ onClick = { ( ) => setExpanded ( ! expanded ) }
164+ >
165+ Manual configuration
166+ { expanded ? (
181167 < KeyboardArrowDownIcon fontSize = "small" />
182168 ) : (
183169 < KeyboardArrowRightIcon fontSize = "small" />
184- )
185- }
186- </ Typography >
170+ ) }
171+ </ Typography >
172+ ) : (
173+ < Typography
174+ variant = "body2"
175+ sx = { {
176+ color : 'text.secondary' ,
177+ } }
178+ >
179+ Client not installed
180+ </ Typography >
181+ )
187182 }
188183 action = {
189- < Stack direction = "row" spacing = { 1 } >
190- {
191- mcpClientState . exists && mcpClientState . configured && (
192- < Button
193- onClick = { async ( ) => {
184+ < Stack direction = "row" spacing = { 1 } >
185+ { mcpClientState . exists && mcpClientState . configured && (
186+ < Button
187+ onClick = { async ( ) => {
188+ setButtonsLoading ( {
189+ ...buttonsLoading ,
190+ [ name ] : true ,
191+ } ) ;
192+ try {
193+ await disconnectClient ( name ) ;
194+ } finally {
194195 setButtonsLoading ( {
195196 ...buttonsLoading ,
196- [ name ] : true ,
197+ [ name ] : false ,
197198 } ) ;
198- try {
199- await disconnectClient ( name ) ;
200- } finally {
201- setButtonsLoading ( {
202- ...buttonsLoading ,
203- [ name ] : false ,
204- } ) ;
205- }
206- } }
207- disabled = {
208- buttonsLoading [ name ] ||
209- Boolean ( mcpClientState . preventAutoConnectMessage )
210199 }
211- >
212- < Stack direction = "row" alignItems = "center" spacing = { 1 } sx = { ConnectButtonStyle } >
213- { ( buttonsLoading [ name ] && (
214- < >
215- < Typography sx = { { fontSize : 12 , width : 70 } } >
216- Connect
217- </ Typography >
218- < CircularProgress size = { 12 } />
219- </ >
220- ) ) || (
221- < Typography sx = { { fontSize : 12 , width : 90 } } >
222- Disconnect
223- </ Typography >
224- ) }
225- </ Stack >
226- </ Button >
227- ) }
200+ } }
201+ disabled = { buttonsLoading [ name ] }
202+ color = "warning"
203+ size = "small"
204+ >
205+ < Stack direction = "row" alignItems = "center" spacing = { 1 } >
206+ { ( buttonsLoading [ name ] && (
207+ < >
208+ < Typography sx = { { fontSize : 12 , width : 70 } } >
209+ Connect
210+ </ Typography >
211+ < CircularProgress size = { 12 } />
212+ </ >
213+ ) ) || (
214+ < Typography sx = { { fontSize : 12 , width : 90 } } >
215+ Disconnect
216+ </ Typography >
217+ ) }
218+ </ Stack >
219+ </ Button >
220+ ) }
228221 { mcpClientState . exists && ! mcpClientState . configured && (
229222 < Button
230223 sx = { { fontSize : 12 } }
@@ -238,23 +231,15 @@ function ClientSetting({
238231 } finally {
239232 setButtonsLoading ( {
240233 ...buttonsLoading ,
241- [ name ] : true ,
234+ [ name ] : false ,
242235 } ) ;
243- try {
244- await connectClient ( name ) ;
245- } finally {
246- setButtonsLoading ( {
247- ...buttonsLoading ,
248- [ name ] : false ,
249- } ) ;
250- }
251236 }
252237 } }
253238 disabled = { buttonsLoading [ name ] }
254239 color = "primary"
255240 size = "small"
256241 >
257- < Stack direction = "row" alignItems = "center" spacing = { 1 } sx = { ConnectButtonStyle } >
242+ < Stack direction = "row" alignItems = "center" spacing = { 1 } >
258243 { ( buttonsLoading [ name ] && (
259244 < >
260245 < Typography sx = { { fontSize : 12 , width : 70 } } >
@@ -270,47 +255,46 @@ function ClientSetting({
270255 </ Stack >
271256 </ Button >
272257 ) }
273- {
274- ! mcpClientState . exists && (
275- < Button
276- sx = { { fontSize : 12 } }
277- size = "small"
278- disabled
279- onClick = { async ( ) => {
258+ { ! mcpClientState . exists && (
259+ < Button
260+ sx = { { fontSize : 12 } }
261+ size = "small"
262+ disabled
263+ onClick = { async ( ) => {
264+ setButtonsLoading ( {
265+ ...buttonsLoading ,
266+ [ name ] : true ,
267+ } ) ;
268+ try {
269+ await connectClient ( name ) ;
270+ } finally {
280271 setButtonsLoading ( {
281272 ...buttonsLoading ,
282- [ name ] : true ,
273+ [ name ] : false ,
283274 } ) ;
284- try {
285- await connectClient ( name ) ;
286- } finally {
287- setButtonsLoading ( {
288- ...buttonsLoading ,
289- [ name ] : true ,
290- } ) ;
291- }
292- } }
293- >
294- < Stack direction = "row" alignItems = "center" spacing = { 1 } sx = { ConnectButtonStyle } >
295- { ( buttonsLoading [ name ] && (
296- < >
297- < Typography sx = { { fontSize : 12 , width : 70 } } >
298- Disconnect
299- </ Typography >
300- < CircularProgress size = { 12 } />
301- </ >
302- ) ) || (
303- < Typography sx = { { fontSize : 12 , width : 90 } } >
304- Connect
305- </ Typography >
306- ) }
307- </ Stack >
308- </ Button >
309- ) }
310- </ Stack >
275+ }
276+ } }
277+ >
278+ < Stack direction = "row" alignItems = "center" spacing = { 1 } >
279+ { ( buttonsLoading [ name ] && (
280+ < >
281+ < Typography sx = { { fontSize : 12 , width : 70 } } >
282+ Disconnect
283+ </ Typography >
284+ < CircularProgress size = { 12 } />
285+ </ >
286+ ) ) || (
287+ < Typography sx = { { fontSize : 12 , width : 90 } } >
288+ Connect
289+ </ Typography >
290+ ) }
291+ </ Stack >
292+ </ Button >
293+ ) }
294+ </ Stack >
311295 }
312296 />
313- < Collapse in = { expanded } timeout = "auto" unmountOnExit >
297+ < Collapse in = { expanded } timeout = "auto" unmountOnExit >
314298 < CardContent >
315299 < Stack direction = "column" justifyContent = "center" spacing = { 1 } >
316300 < Stack direction = "row" alignItems = "center" spacing = { 1 } >
@@ -361,8 +345,8 @@ function ClientSetting({
361345 ) }
362346 </ List >
363347 </ CardContent >
364- </ Collapse >
365- </ Card >
348+ </ Collapse >
349+ </ Card >
366350 ) ;
367351}
368352
0 commit comments