mirror of
https://github.com/henrygd/beszel.git
synced 2026-04-21 20:21:49 +02:00
ui: allow filtering systems by host and agent version (#163)
This commit is contained in:
@@ -110,20 +110,23 @@ export function SystemsTableColumns(viewMode: "table" | "grid"): ColumnDef<Syste
|
|||||||
|
|
||||||
// match filter value against name or translated status
|
// match filter value against name or translated status
|
||||||
return (row, _, newFilterInput) => {
|
return (row, _, newFilterInput) => {
|
||||||
const { name, status } = row.original
|
const sys = row.original
|
||||||
|
if (sys.host.includes(newFilterInput) || sys.info.v?.includes(newFilterInput)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
if (newFilterInput !== filterInput) {
|
if (newFilterInput !== filterInput) {
|
||||||
filterInput = newFilterInput
|
filterInput = newFilterInput
|
||||||
filterInputLower = newFilterInput.toLowerCase()
|
filterInputLower = newFilterInput.toLowerCase()
|
||||||
}
|
}
|
||||||
let nameLower = nameCache.get(name)
|
let nameLower = nameCache.get(sys.name)
|
||||||
if (nameLower === undefined) {
|
if (nameLower === undefined) {
|
||||||
nameLower = name.toLowerCase()
|
nameLower = sys.name.toLowerCase()
|
||||||
nameCache.set(name, nameLower)
|
nameCache.set(sys.name, nameLower)
|
||||||
}
|
}
|
||||||
if (nameLower.includes(filterInputLower)) {
|
if (nameLower.includes(filterInputLower)) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
const statusLower = statusTranslations[status as keyof typeof statusTranslations]
|
const statusLower = statusTranslations[sys.status as keyof typeof statusTranslations]
|
||||||
return statusLower?.includes(filterInputLower) || false
|
return statusLower?.includes(filterInputLower) || false
|
||||||
}
|
}
|
||||||
})(),
|
})(),
|
||||||
|
|||||||
Reference in New Issue
Block a user