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