mirror of
https://github.com/LukeHagar/idn-admin-console.git
synced 2025-12-10 04:20:12 +00:00
Refactor pagination logic in identities page
This commit is contained in:
@@ -27,23 +27,27 @@
|
|||||||
|
|
||||||
<div class="card flex justify-center flex-col align-middle">
|
<div class="card flex justify-center flex-col align-middle">
|
||||||
{#await data.totalCount then totalCount}
|
{#await data.totalCount then totalCount}
|
||||||
<Paginator
|
{#if totalCount > 250 || Number(data.params.limit) < totalCount}
|
||||||
{onAmountChange}
|
<Paginator
|
||||||
{onGo}
|
{onAmountChange}
|
||||||
{onPageChange}
|
{onGo}
|
||||||
settings={{
|
{onPageChange}
|
||||||
page: Number(data.params.page),
|
settings={{
|
||||||
limit: Number(data.params.limit),
|
page: Number(data.params.page),
|
||||||
size: totalCount,
|
limit: Number(data.params.limit),
|
||||||
amounts: [10, 50, 100, 250]
|
size: totalCount,
|
||||||
}}
|
amounts: [10, 50, 100, 250]
|
||||||
{filters}
|
}}
|
||||||
{sorters}
|
{filters}
|
||||||
{totalCount}
|
{sorters}
|
||||||
/>
|
{totalCount}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
{/await}
|
{/await}
|
||||||
{#await data.identities}
|
{#await data.identities}
|
||||||
<Progress />
|
<div class="grid h-full place-content-center p-8">
|
||||||
|
<Progress width="w-[100px]" />
|
||||||
|
</div>
|
||||||
{:then identities}
|
{:then identities}
|
||||||
<div class="table-container">
|
<div class="table-container">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
@@ -99,19 +103,21 @@
|
|||||||
</div>
|
</div>
|
||||||
{/await}
|
{/await}
|
||||||
{#await data.totalCount then totalCount}
|
{#await data.totalCount then totalCount}
|
||||||
<Paginator
|
{#if totalCount > 250 || Number(data.params.limit) < totalCount}
|
||||||
{onAmountChange}
|
<Paginator
|
||||||
{onGo}
|
{onAmountChange}
|
||||||
{onPageChange}
|
{onGo}
|
||||||
settings={{
|
{onPageChange}
|
||||||
page: Number(data.params.page),
|
settings={{
|
||||||
limit: Number(data.params.limit),
|
page: Number(data.params.page),
|
||||||
size: totalCount,
|
limit: Number(data.params.limit),
|
||||||
amounts: [10, 50, 100, 250]
|
size: totalCount,
|
||||||
}}
|
amounts: [10, 50, 100, 250]
|
||||||
{filters}
|
}}
|
||||||
{sorters}
|
{filters}
|
||||||
{totalCount}
|
{sorters}
|
||||||
/>
|
{totalCount}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
{/await}
|
{/await}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user