Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security] Note 10k object paging limit on Endpoint list #82889

Merged
merged 5 commits into from
Nov 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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