Search updates
This commit is contained in:
@@ -29,8 +29,8 @@ export function DataTable({
|
|||||||
sorting: SortingState;
|
sorting: SortingState;
|
||||||
setSorting: Dispatch<SetStateAction<SortingState>>;
|
setSorting: Dispatch<SetStateAction<SortingState>>;
|
||||||
filtersEnabled: boolean;
|
filtersEnabled: boolean;
|
||||||
globalFilter: string;
|
globalFilter: string | number;
|
||||||
setGlobalFilter: Dispatch<SetStateAction<string>>;
|
setGlobalFilter: Dispatch<SetStateAction<string | number>>;
|
||||||
isRefreshing?: boolean;
|
isRefreshing?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([]);
|
const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([]);
|
||||||
|
|||||||
@@ -64,8 +64,14 @@ const GuacamoleClients = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (guacamoleClientsData && guacamoleClientsIsFetched) {
|
if (guacamoleClientsData && guacamoleClientsIsFetched) {
|
||||||
setGuacamoleClients(
|
setGuacamoleClients(
|
||||||
guacamoleClientsData.filter((a: GuacamoleClient) =>
|
guacamoleClientsData.filter(
|
||||||
a.clientName.toLowerCase().includes((debouncedSearch as string).toLowerCase()),
|
(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 [isLoading, setIsLoading] = useState(false);
|
||||||
const { isMobile, handleDelete } = useCommonHooks();
|
const { isMobile, handleDelete } = useCommonHooks();
|
||||||
const [filtersEnabled, setFiltersEnabled] = useState(false);
|
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 [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false);
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
closeModal();
|
closeModal();
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ const SearchProviderSettings = () => {
|
|||||||
.filter(
|
.filter(
|
||||||
(a: Provider) =>
|
(a: Provider) =>
|
||||||
a.name.toLowerCase().includes((debouncedSearch as string).toLowerCase()) ||
|
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)),
|
.sort((a: Provider, b: Provider) => (a.prefix > b.prefix ? 1 : -1)),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -59,8 +59,14 @@ const WolClientSettings = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (wolClientsData && wolClientsIsFetched) {
|
if (wolClientsData && wolClientsIsFetched) {
|
||||||
setWolClients(
|
setWolClients(
|
||||||
wolClientsData.filter((a: WolClient) =>
|
wolClientsData.filter(
|
||||||
a.hostname.toLowerCase().includes((debouncedSearch as string).toLowerCase()),
|
(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