Skip to content

Commit efd62b7

Browse files
committed
bring back search form
1 parent a8ee1c9 commit efd62b7

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/App.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import AddIcon from '@mui/icons-material/Add';
3838
import SearchIcon from '@mui/icons-material/Search';
3939
import SwapHorizIcon from '@mui/icons-material/SwapHoriz';
4040
import MoreIcon from '@mui/icons-material/MoreVert';
41+
import ClearIcon from '@mui/icons-material/Clear';
4142
import ConnectionManager from './components/ConnectionManager';
4243
const { ipcRenderer } = window.require('electron');
4344

@@ -314,6 +315,44 @@ function App() {
314315
Showing {keys.length} of {totalKeys} keys
315316
</Typography>
316317
</Box>
318+
319+
<Box sx={{ mb: 2 }}>
320+
<TextField
321+
fullWidth
322+
label="Search Keys"
323+
value={searchPattern}
324+
onChange={(e) => setSearchPattern(e.target.value)}
325+
onKeyPress={(e) => e.key === 'Enter' && loadKeys(true)}
326+
placeholder="Use * as wildcard (e.g., user:*, *name)"
327+
InputProps={{
328+
endAdornment: (
329+
<InputAdornment position="end">
330+
<Tooltip title="Search">
331+
<IconButton
332+
onClick={() => loadKeys(true)}
333+
disabled={loading}
334+
>
335+
<SearchIcon />
336+
</IconButton>
337+
</Tooltip>
338+
{searchPattern && (
339+
<Tooltip title="Clear search">
340+
<IconButton
341+
onClick={() => {
342+
setSearchPattern('');
343+
loadKeys(true);
344+
}}
345+
disabled={loading}
346+
>
347+
<ClearIcon />
348+
</IconButton>
349+
</Tooltip>
350+
)}
351+
</InputAdornment>
352+
),
353+
}}
354+
/>
355+
</Box>
317356

318357
<List>
319358
{keys.map((k) => (

0 commit comments

Comments
 (0)