Skip to content

Commit

Permalink
[Security Solution] Note 10k object paging limit on Endpoint list (#8…
Browse files Browse the repository at this point in the history
  • Loading branch information
pzl committed Nov 12, 2020
1 parent 5f36a27 commit 647e4d1
Showing 1 changed file with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ import { useKibana } from '../../../../../../../../src/plugins/kibana_react/publ
import { APP_ID } from '../../../../../common/constants';
import { LinkToApp } from '../../../../common/components/endpoint/link_to_app';

const MAX_PAGINATED_ITEM = 9999;

const EndpointListNavLink = memo<{
name: string;
href: string;
Expand Down Expand Up @@ -145,16 +147,18 @@ export const EndpointList = () => {
const { formatUrl, search } = useFormatUrl(SecurityPageName.administration);

const dispatch = useDispatch<(a: EndpointAction) => void>();
// cap ability to page at 10k records. (max_result_window)
const maxPageCount = totalItemCount > MAX_PAGINATED_ITEM ? MAX_PAGINATED_ITEM : totalItemCount;

const paginationSetup = useMemo(() => {
return {
pageIndex,
pageSize,
totalItemCount,
totalItemCount: maxPageCount,
pageSizeOptions: [...MANAGEMENT_PAGE_SIZE_OPTIONS],
hidePerPageOptions: false,
};
}, [pageIndex, pageSize, totalItemCount]);
}, [pageIndex, pageSize, maxPageCount]);

const onTableChange = useCallback(
({ page }: { page: { index: number; size: number } }) => {
Expand Down Expand Up @@ -631,11 +635,19 @@ export const EndpointList = () => {
{hasListData && (
<>
<EuiText color="subdued" size="xs" data-test-subj="endpointListTableTotal">
<FormattedMessage
id="xpack.securitySolution.endpoint.list.totalCount"
defaultMessage="{totalItemCount, plural, one {# Host} other {# Hosts}}"
values={{ totalItemCount }}
/>
{totalItemCount > MAX_PAGINATED_ITEM + 1 ? (
<FormattedMessage
id="xpack.securitySolution.endpoint.list.totalCount.limited"
defaultMessage="Showing {limit} of {totalItemCount, plural, one {# Host} other {# Hosts}}"
values={{ totalItemCount, limit: MAX_PAGINATED_ITEM + 1 }}
/>
) : (
<FormattedMessage
id="xpack.securitySolution.endpoint.list.totalCount"
defaultMessage="{totalItemCount, plural, one {# Host} other {# Hosts}}"
values={{ totalItemCount }}
/>
)}
</EuiText>
<EuiHorizontalRule margin="xs" />
</>
Expand Down

0 comments on commit 647e4d1

Please sign in to comment.