Add user-selectable page size to MassData grid

Users can now choose how many records to display per page in the MassData grid (100, 1,000, 10,000, 100,000, or all). The backend and API client are updated to support nullable skip/take parameters, allowing "all" records to be fetched when desired. The pager and page count calculations are updated to reflect the selected page size, and the pager is hidden if only one page exists. Additional UI and CSS changes provide a combo box for page size selection. The API controller now treats take <= 0 as "no limit."
This commit is contained in:
OlgunR
2026-02-05 15:45:36 +01:00
parent 9d7b3591cc
commit 52b2cf9a5b
5 changed files with 156 additions and 23 deletions

View File

@@ -19,9 +19,20 @@ public class MassDataApiClient
return result ?? 0;
}
public async Task<List<MassDataReadDto>> GetAllAsync(int skip, int take)
public async Task<List<MassDataReadDto>> GetAllAsync(int? skip, int? take)
{
var result = await _httpClient.GetFromJsonAsync<List<MassDataReadDto>>($"{Endpoint}?skip={skip}&take={take}");
var query = new List<string>();
if (skip.HasValue)
{
query.Add($"skip={skip.Value}");
}
if (take.HasValue)
{
query.Add($"take={take.Value}");
}
var url = query.Count == 0 ? Endpoint : $"{Endpoint}?{string.Join("&", query)}";
var result = await _httpClient.GetFromJsonAsync<List<MassDataReadDto>>(url);
return result ?? new List<MassDataReadDto>();
}