@@ -5,6 +5,7 @@ import { fetchRequests } from '../../api/requests';
55import { fetchSources } from '../../api/sources' ;
66import { ApiError } from '../../api/errors' ;
77import { DB_LOGOS } from '../../lib/db-logos' ;
8+ import LockIcon from '../icons/LockIcon' ;
89import type { Request } from '../../types/request' ;
910import type { DatabaseType } from '../../types/datasource' ;
1011
@@ -129,6 +130,7 @@ function StatusBadge({ success, error }: { success: boolean; error?: string }) {
129130export default function RequestView ( ) {
130131 const [ requests , setRequests ] = useState < Request [ ] > ( [ ] ) ;
131132 const [ sourceTypes , setSourceTypes ] = useState < Record < string , DatabaseType > > ( { } ) ;
133+ const [ toolReadonly , setToolReadonly ] = useState < Record < string , boolean > > ( { } ) ;
132134 const [ isLoading , setIsLoading ] = useState ( true ) ;
133135 const [ error , setError ] = useState < string | null > ( null ) ;
134136 const [ selectedSource , setSelectedSource ] = useState < string | null > ( null ) ;
@@ -138,10 +140,17 @@ export default function RequestView() {
138140 . then ( ( [ requestsData , sourcesData ] ) => {
139141 setRequests ( requestsData . requests ) ;
140142 const typeMap : Record < string , DatabaseType > = { } ;
143+ const readonlyMap : Record < string , boolean > = { } ;
141144 for ( const source of sourcesData ) {
142145 typeMap [ source . id ] = source . type ;
146+ for ( const tool of source . tools ) {
147+ if ( tool . readonly ) {
148+ readonlyMap [ tool . name ] = true ;
149+ }
150+ }
143151 }
144152 setSourceTypes ( typeMap ) ;
153+ setToolReadonly ( readonlyMap ) ;
145154 setIsLoading ( false ) ;
146155 } )
147156 . catch ( ( err ) => {
@@ -258,9 +267,12 @@ export default function RequestView() {
258267 < td className = "px-4 py-2 text-sm whitespace-nowrap" >
259268 < Link
260269 to = { `/source/${ request . sourceId } ` }
261- className = "text-primary hover:underline"
270+ className = "text-primary hover:underline inline-flex items-center gap-1 "
262271 >
263272 { request . toolName }
273+ { toolReadonly [ request . toolName ] && (
274+ < LockIcon className = "w-3 h-3 text-muted-foreground" />
275+ ) }
264276 </ Link >
265277 </ td >
266278 < td className = "px-4 py-2 text-sm font-mono text-foreground max-w-0" >
0 commit comments