From ab756859552b2242b3938e0ea9ce27face55d6a0 Mon Sep 17 00:00:00 2001 From: michelia Date: Wed, 10 Jun 2026 14:58:18 +0800 Subject: [PATCH] fix: extend usage query limit --- src/pages/usage/components/gpu-instances-tab.tsx | 9 ++++++--- src/pages/usage/components/storage-tab.tsx | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/pages/usage/components/gpu-instances-tab.tsx b/src/pages/usage/components/gpu-instances-tab.tsx index d9994fd5..af1933c7 100644 --- a/src/pages/usage/components/gpu-instances-tab.tsx +++ b/src/pages/usage/components/gpu-instances-tab.tsx @@ -144,10 +144,13 @@ const GpuInstancesTab: React.FC = () => { try { const data = await queryGpuInstancesBreakdown({ ...baseRequest(), - // Split each bucket by the chosen dimension when grouping; fetch the - // whole range (date × groups can exceed a normal page). + // Split each bucket by the chosen dimension when grouping. group_by: chartGroupBy ? ['date', chartGroupBy] : ['date'], - ...(chartGroupBy ? { perPage: 10000 } : {}) + // A trend is a time series, not a paginated table: always fetch the + // whole range. The default order is metric-desc, so partial (current/ + // recent) buckets have smaller values and would be pushed onto later + // pages — dropping the newest hours from the chart under a small page. + perPage: 10000 }); setChartData(data); } catch { diff --git a/src/pages/usage/components/storage-tab.tsx b/src/pages/usage/components/storage-tab.tsx index 4a75d89f..b6319fce 100644 --- a/src/pages/usage/components/storage-tab.tsx +++ b/src/pages/usage/components/storage-tab.tsx @@ -128,10 +128,13 @@ const StorageTab: React.FC = () => { try { const data = await queryStorageBreakdown({ ...baseRequest(), - // Split each bucket by the chosen dimension when grouping; fetch the - // whole range (date × groups can exceed a normal page). + // Split each bucket by the chosen dimension when grouping. group_by: chartGroupBy ? ['date', chartGroupBy] : ['date'], - ...(chartGroupBy ? { perPage: 10000 } : {}) + // A trend is a time series, not a paginated table: always fetch the + // whole range. The default order is metric-desc, so partial (current/ + // recent) buckets have smaller values and would be pushed onto later + // pages — dropping the newest hours from the chart under a small page. + perPage: 10000 }); setChartData(data); } catch {