mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-02 19:00:49 +08:00
fix(quota): cap per-page credentials to 14
This commit is contained in:
@@ -24,6 +24,7 @@ type QuotaSetter<T> = (updater: QuotaUpdater<T>) => void;
|
||||
|
||||
type ViewMode = 'paged' | 'all';
|
||||
|
||||
const MAX_ITEMS_PER_PAGE = 14;
|
||||
const MAX_SHOW_ALL_THRESHOLD = 30;
|
||||
|
||||
interface QuotaPaginationState<T> {
|
||||
@@ -153,8 +154,8 @@ export function QuotaSection<TState extends QuotaStatusState, TData>({
|
||||
if (effectiveViewMode === 'all') {
|
||||
setPageSize(Math.max(1, filteredFiles.length));
|
||||
} else {
|
||||
// Paged mode: 3 rows * columns
|
||||
setPageSize(columns * 3);
|
||||
// Paged mode: 3 rows * columns, capped to avoid oversized pages.
|
||||
setPageSize(Math.min(columns * 3, MAX_ITEMS_PER_PAGE));
|
||||
}
|
||||
}, [effectiveViewMode, columns, filteredFiles.length, setPageSize]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user