Search updates

This commit is contained in:
Sean Edmunds
2025-12-30 11:24:58 -06:00
parent 9b5bf901d5
commit 0df4f28f40
5 changed files with 21 additions and 8 deletions

View File

@@ -29,8 +29,8 @@ export function DataTable({
sorting: SortingState;
setSorting: Dispatch<SetStateAction<SortingState>>;
filtersEnabled: boolean;
globalFilter: string;
setGlobalFilter: Dispatch<SetStateAction<string>>;
globalFilter: string | number;
setGlobalFilter: Dispatch<SetStateAction<string | number>>;
isRefreshing?: boolean;
}) {
const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([]);

View File

@@ -64,8 +64,14 @@ const GuacamoleClients = () => {
useEffect(() => {
if (guacamoleClientsData && guacamoleClientsIsFetched) {
setGuacamoleClients(
guacamoleClientsData.filter((a: GuacamoleClient) =>
a.clientName.toLowerCase().includes((debouncedSearch as string).toLowerCase()),
guacamoleClientsData.filter(
(a: GuacamoleClient) =>
a.clientName
.toLowerCase()
.includes((debouncedSearch as string).toLowerCase()) ||
a.clientIdentifier
.toLowerCase()
.includes((debouncedSearch as string).toLowerCase()),
),
);
}

View File

@@ -23,7 +23,7 @@ const SearchHistory = () => {
const [isLoading, setIsLoading] = useState(false);
const { isMobile, handleDelete } = useCommonHooks();
const [filtersEnabled, setFiltersEnabled] = useState(false);
const [globalFilter, setGlobalFilter] = useState<string>('');
const [globalFilter, setGlobalFilter] = useState<string | number>('');
const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false);
const handleClose = () => {
closeModal();

View File

@@ -80,7 +80,8 @@ const SearchProviderSettings = () => {
.filter(
(a: Provider) =>
a.name.toLowerCase().includes((debouncedSearch as string).toLowerCase()) ||
a.url.toLowerCase().includes((debouncedSearch as string).toLowerCase()),
a.url.toLowerCase().includes((debouncedSearch as string).toLowerCase()) ||
a.prefix.toLowerCase().includes((debouncedSearch as string).toLowerCase()),
)
.sort((a: Provider, b: Provider) => (a.prefix > b.prefix ? 1 : -1)),
);

View File

@@ -59,8 +59,14 @@ const WolClientSettings = () => {
useEffect(() => {
if (wolClientsData && wolClientsIsFetched) {
setWolClients(
wolClientsData.filter((a: WolClient) =>
a.hostname.toLowerCase().includes((debouncedSearch as string).toLowerCase()),
wolClientsData.filter(
(a: WolClient) =>
a.hostname
.toLowerCase()
.includes((debouncedSearch as string).toLowerCase()) ||
a.macAddress
.toLowerCase()
.includes((debouncedSearch as string).toLowerCase()),
),
);
}