mirror of
https://github.com/open-webui/open-webui
synced 2024-11-06 00:32:05 +00:00
feat: combine with search result
This commit is contained in:
parent
872ea83c50
commit
8a9cf44dbc
@ -73,7 +73,17 @@
|
||||
loaded = true;
|
||||
});
|
||||
|
||||
$: paginatedSource = users.slice(
|
||||
$: paginatedSource = users
|
||||
.filter((user) => {
|
||||
if (search === '') {
|
||||
return true;
|
||||
} else {
|
||||
let name = user.name.toLowerCase();
|
||||
const query = search.toLowerCase();
|
||||
return name.includes(query);
|
||||
}
|
||||
})
|
||||
.slice(
|
||||
paginatorSettings.page * paginatorSettings.limit,
|
||||
paginatorSettings.page * paginatorSettings.limit + paginatorSettings.limit
|
||||
);
|
||||
@ -174,15 +184,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each paginatedSource.filter((user) => {
|
||||
if (search === '') {
|
||||
return true;
|
||||
} else {
|
||||
let name = user.name.toLowerCase();
|
||||
const query = search.toLowerCase();
|
||||
return name.includes(query);
|
||||
}
|
||||
}) as user}
|
||||
{#each paginatedSource as user}
|
||||
<tr class="bg-white border-b dark:bg-gray-900 dark:border-gray-700 text-xs">
|
||||
<td class="px-3 py-2 min-w-[7rem] w-28">
|
||||
<button
|
||||
@ -280,12 +282,13 @@
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
<Paginator bind:settings={paginatorSettings} showNumerals />
|
||||
</div>
|
||||
|
||||
<div class=" text-gray-500 text-xs mt-2 text-right">
|
||||
ⓘ {$i18n.t("Click on the user role button to change a user's role.")}
|
||||
</div>
|
||||
|
||||
<Paginator bind:settings={paginatorSettings} showNumerals />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user