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';
|
type ViewMode = 'paged' | 'all';
|
||||||
|
|
||||||
|
const MAX_ITEMS_PER_PAGE = 14;
|
||||||
const MAX_SHOW_ALL_THRESHOLD = 30;
|
const MAX_SHOW_ALL_THRESHOLD = 30;
|
||||||
|
|
||||||
interface QuotaPaginationState<T> {
|
interface QuotaPaginationState<T> {
|
||||||
@@ -153,8 +154,8 @@ export function QuotaSection<TState extends QuotaStatusState, TData>({
|
|||||||
if (effectiveViewMode === 'all') {
|
if (effectiveViewMode === 'all') {
|
||||||
setPageSize(Math.max(1, filteredFiles.length));
|
setPageSize(Math.max(1, filteredFiles.length));
|
||||||
} else {
|
} else {
|
||||||
// Paged mode: 3 rows * columns
|
// Paged mode: 3 rows * columns, capped to avoid oversized pages.
|
||||||
setPageSize(columns * 3);
|
setPageSize(Math.min(columns * 3, MAX_ITEMS_PER_PAGE));
|
||||||
}
|
}
|
||||||
}, [effectiveViewMode, columns, filteredFiles.length, setPageSize]);
|
}, [effectiveViewMode, columns, filteredFiles.length, setPageSize]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user