From a44eb98456d8e987e49560ce1435040684e9763d Mon Sep 17 00:00:00 2001 From: Kristina Durivage Date: Wed, 10 Dec 2025 20:51:35 -0600 Subject: [PATCH] change limit --- public/app/features/correlations/CorrelationsPageWrapper.tsx | 5 +---- public/app/features/correlations/useCorrelations.ts | 4 +--- public/app/features/correlations/useCorrelationsK8s.ts | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/public/app/features/correlations/CorrelationsPageWrapper.tsx b/public/app/features/correlations/CorrelationsPageWrapper.tsx index f300113c1ca..a8f335d3b48 100644 --- a/public/app/features/correlations/CorrelationsPageWrapper.tsx +++ b/public/app/features/correlations/CorrelationsPageWrapper.tsx @@ -22,12 +22,9 @@ function CorrelationsPageLegacy() { } function CorrelationsPageAppPlatform() { - // todo remove fake limit - const [page, setPage] = useState(1); let totalItems = useRef(0); - - const limit = 10; + const limit = 100; const { currentData, isLoading, error, remainingItems } = useCorrelationsK8s(limit, page); const [deleteCorrelation] = useDeleteCorrelationMutation(); if (page === 1) { diff --git a/public/app/features/correlations/useCorrelations.ts b/public/app/features/correlations/useCorrelations.ts index e725a072818..5891e510573 100644 --- a/public/app/features/correlations/useCorrelations.ts +++ b/public/app/features/correlations/useCorrelations.ts @@ -3,7 +3,6 @@ import { lastValueFrom } from 'rxjs'; import { getDataSourceSrv, FetchResponse, CorrelationData, CorrelationsData } from '@grafana/runtime'; import { useGrafana } from 'app/core/context/GrafanaContext'; -//import { dispatch } from 'app/store/store'; import { Correlation, @@ -95,7 +94,7 @@ export const useCorrelations = () => { return lastValueFrom( backend.fetch({ url: '/api/datasources/correlations', - params: { page: params.page, limit: 10 }, // todo this is to force pagination for testing, remove + params: { page: params.page }, method: 'GET', showErrorAlert: false, }) @@ -119,7 +118,6 @@ export const useCorrelations = () => { throw new Error('invalid sourceUID'); } }); - // } }, [backend] ); diff --git a/public/app/features/correlations/useCorrelationsK8s.ts b/public/app/features/correlations/useCorrelationsK8s.ts index 7b354af06e1..13238f96dd4 100644 --- a/public/app/features/correlations/useCorrelationsK8s.ts +++ b/public/app/features/correlations/useCorrelationsK8s.ts @@ -48,7 +48,7 @@ export const toEnrichedCorrelationDataK8s = (item: CorrelationK8s): CorrelationD }; // we're faking traditional pagination here, realistically folks shouldnt have enough correlations to see a performance impact but if they do we can change the ui -export const useCorrelationsK8s = (limit: number, page: number) => { +export const useCorrelationsK8s = (limit = 100, page: number) => { let pagedLimit = limit; if (page > 1) { pagedLimit = limit * page;