Skip to content

Commit e8638c3

Browse files
author
Lasim
committed
feat(frontend): add search input to tools table
1 parent 95caa84 commit e8638c3

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/frontend/src/components/mcp-server/installation/ToolsTab.vue

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useMcpToolsStore } from '@/stores/mcpToolsStore'
66
import { McpToolsService } from '@/services/mcpToolsService'
77
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'
88
import { Checkbox } from '@/components/ui/checkbox'
9+
import { Input } from '@/components/ui/input'
910
import { Button } from '@/components/ui/button'
1011
import { ButtonGroup } from '@/components/ui/button-group'
1112
import { Spinner } from '@/components/ui/spinner'
@@ -36,6 +37,7 @@ const isLoading = ref(true)
3637
const error = ref<string | null>(null)
3738
const selectedToolIds = ref<string[]>([])
3839
const isBulkToggling = ref(false)
40+
const searchQuery = ref('')
3941
4042
// Track expanded rows
4143
const expandedRows = ref<Set<string>>(new Set())
@@ -63,6 +65,19 @@ const calculateTokenPercentage = (tokenCount: number) => {
6365
return `${percentage.toFixed(1)}%`
6466
}
6567
68+
// Filter tools based on search query
69+
const filteredTools = computed(() => {
70+
if (!hasTools.value) return []
71+
if (!searchQuery.value) return tools.value.tools
72+
73+
const query = searchQuery.value.toLowerCase()
74+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
75+
return tools.value.tools.filter((tool: any) =>
76+
tool.tool_name.toLowerCase().includes(query) ||
77+
(tool.description && tool.description.toLowerCase().includes(query))
78+
)
79+
})
80+
6681
// Load tools on component mount
6782
onMounted(async () => {
6883
await loadTools()
@@ -250,8 +265,14 @@ async function handleBulkToggle(isDisabled: boolean) {
250265
:disabled-count="disabledToolsCount"
251266
/>
252267

253-
<!-- Bulk Actions -->
254-
<div class="flex items-center justify-end gap-2 mb-4">
268+
<!-- Search and Bulk Actions -->
269+
<div class="flex items-center justify-between gap-4 mb-4">
270+
<Input
271+
:placeholder="t('mcpInstallations.details.tools.table.search')"
272+
v-model="searchQuery"
273+
class="max-w-sm"
274+
/>
275+
255276
<ButtonGroup aria-label="Bulk tool actions">
256277
<Button
257278
variant="outline"
@@ -296,7 +317,7 @@ async function handleBulkToggle(isDisabled: boolean) {
296317
</TableRow>
297318
</TableHeader>
298319
<TableBody>
299-
<template v-for="tool in tools.tools" :key="tool.id">
320+
<template v-for="tool in filteredTools" :key="tool.id">
300321
<!-- Main Tool Row (clickable) -->
301322
<TableRow
302323
class="cursor-pointer hover:bg-muted/50"
@@ -382,7 +403,7 @@ async function handleBulkToggle(isDisabled: boolean) {
382403
<div class="flex-1 text-sm text-muted-foreground">
383404
{{ t('mcpInstallations.details.tools.selection.rowsSelected', {
384405
selected: selectedToolIds.length,
385-
total: tools.tools.length
406+
total: filteredTools.length
386407
}) }}
387408
</div>
388409
</div>

services/frontend/src/i18n/locales/en/mcp-installations.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ export default {
634634
description: 'No tools have been discovered yet for this MCP server installation. Tools are discovered automatically when the satellite starts the MCP server.'
635635
},
636636
table: {
637+
search: 'Search tools...',
637638
columns: {
638639
enabled: 'Enabled',
639640
toolName: 'Tool Name',

0 commit comments

Comments
 (0)