@@ -9,6 +9,8 @@ import { getRegistry } from '../Registry';
9
9
import { FolderOpenRounded , Search , Settings } from '@mui/icons-material' ;
10
10
import { tryRunImageSync } from '../FileWatcher' ;
11
11
import { CATALOG_URL , POLL_INTERVAL } from '../Constants' ;
12
+ import { SecretList } from './SecretList' ;
13
+ import Secrets from '../Secrets' ;
12
14
13
15
interface CatalogGridProps {
14
16
registryItems : { [ key : string ] : { ref : string } } ;
@@ -38,6 +40,7 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({
38
40
const [ showReloadModal , setShowReloadModal ] = useState < boolean > ( false ) ;
39
41
const [ search , setSearch ] = useState < string > ( '' ) ;
40
42
const [ tab , setTab ] = useState < number > ( 0 ) ;
43
+ const [ secrets , setSecrets ] = useState < Secrets . Secret [ ] > ( [ ] ) ;
41
44
42
45
const filteredCatalogItems = filterCatalog ( catalogItems , registryItems , showRegistered , showUnregistered , search ) ;
43
46
@@ -65,6 +68,12 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({
65
68
}
66
69
}
67
70
71
+ const loadSecrets = async ( ) => {
72
+ const response = await Secrets . getSecrets ( client ) ;
73
+ console . log ( response ) ;
74
+ setSecrets ( response ) ;
75
+ }
76
+
68
77
const registerCatalogItem = async ( item : CatalogItemWithName ) => {
69
78
try {
70
79
const currentRegistry = await getRegistry ( client ) ;
@@ -107,8 +116,10 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({
107
116
108
117
useEffect ( ( ) => {
109
118
loadCatalog ( false ) ;
119
+ loadSecrets ( ) ;
110
120
const interval = setInterval ( ( ) => {
111
121
loadCatalog ( false ) ;
122
+ loadSecrets ( ) ;
112
123
} , POLL_INTERVAL ) ;
113
124
return ( ) => {
114
125
clearInterval ( interval ) ;
@@ -144,10 +155,13 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({
144
155
</ Alert > }
145
156
< Tabs value = { tab } onChange = { ( e , v ) => setTab ( v ) } sx = { { mb : 0 , mt : 1 } } >
146
157
< Tooltip title = "These are all of the tiles you have available across the catalog." >
147
- < Tab sx = { { fontSize : '1.5em' } } label = "Available " />
158
+ < Tab sx = { { fontSize : '1.5em' } } label = "Tool Catalog " />
148
159
</ Tooltip >
149
160
< Tooltip title = "These are tiles which you have allowed MCP clients to use." >
150
- < Tab sx = { { fontSize : '1.5em' } } label = "Allowed" />
161
+ < Tab sx = { { fontSize : '1.5em' } } label = "Your Tools" />
162
+ </ Tooltip >
163
+ < Tooltip title = "These are secrets which you have set for your MCP clients." >
164
+ < Tab sx = { { fontSize : '1.5em' } } label = "Secrets" />
151
165
</ Tooltip >
152
166
</ Tabs >
153
167
< FormGroup sx = { { width : '100%' , mt : 0 } } >
@@ -203,6 +217,7 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({
203
217
</ Grid2 >
204
218
) ) }
205
219
</ Grid2 > }
220
+ { tab === 2 && < SecretList secrets = { secrets } /> }
206
221
</ Stack >
207
222
) ;
208
223
} ;
0 commit comments