Search updates
This commit is contained in:
@@ -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>([]);
|
||||
|
||||
@@ -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()),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)),
|
||||
);
|
||||
|
||||
@@ -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()),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user