1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

fix(edge/devices): search waiting room devices [EE-5895] (#10014)

This commit is contained in:
Chaim Lev-Ari 2023-08-15 06:05:10 +03:00 committed by GitHub
parent 0ef4aad79a
commit d514eeec86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 108 additions and 37 deletions

View file

@ -9,11 +9,22 @@ import { useEnvironments } from './useEnvironments';
const storageKey = 'edge-devices-waiting-room';
const settingsStore = createPersistedStore(storageKey, 'Name');
const settingsStore = createPersistedStore(storageKey);
export function Datatable() {
const tableState = useTableState(settingsStore, storageKey);
const { data: environments, totalCount, isLoading } = useEnvironments();
const {
data: environments,
totalCount,
isLoading,
page,
setPage,
} = useEnvironments({
pageLimit: tableState.pageSize,
search: tableState.search,
});
const pageCount = Math.ceil(totalCount / tableState.pageSize);
return (
<GenericDatatable
@ -27,6 +38,9 @@ export function Datatable() {
)}
isLoading={isLoading}
totalCount={totalCount}
pageCount={pageCount}
page={page}
onPageChange={setPage}
description={<Filter />}
/>
);