mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-10 05:15:35 +08:00
feat(connections): optimized search
This commit is contained in:
parent
dac920a8c1
commit
17d9ae4872
@ -15,6 +15,7 @@ import {
|
||||
createSolidTable,
|
||||
flexRender,
|
||||
getCoreRowModel,
|
||||
getFilteredRowModel,
|
||||
getSortedRowModel,
|
||||
} from '@tanstack/solid-table'
|
||||
import byteSize from 'byte-size'
|
||||
@ -217,20 +218,17 @@ export default () => {
|
||||
get columnVisibility() {
|
||||
return columnVisibility()
|
||||
},
|
||||
get globalFilter() {
|
||||
return search()
|
||||
},
|
||||
},
|
||||
get data() {
|
||||
return search()
|
||||
? connectionsWithSpeed().filter((connection) =>
|
||||
Object.values(connection).some((conn) =>
|
||||
JSON.stringify(conn)
|
||||
.toLowerCase()
|
||||
.includes(search().toLowerCase()),
|
||||
),
|
||||
)
|
||||
: connectionsWithSpeed()
|
||||
return connectionsWithSpeed()
|
||||
},
|
||||
enableHiding: true,
|
||||
columns,
|
||||
onGlobalFilterChange: setSearch,
|
||||
getFilteredRowModel: getFilteredRowModel(),
|
||||
onSortingChange: setSorting,
|
||||
getSortedRowModel: getSortedRowModel(),
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
|
Loading…
Reference in New Issue
Block a user