Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
8a9cf44d
Commit
8a9cf44d
authored
Apr 08, 2024
by
tabacoWang
Browse files
feat: combine with search result
parent
872ea83c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
src/routes/(app)/admin/+page.svelte
src/routes/(app)/admin/+page.svelte
+17
-14
No files found.
src/routes/(app)/admin/+page.svelte
View file @
8a9cf44d
...
@@ -73,7 +73,17 @@
...
@@ -73,7 +73,17 @@
loaded = true;
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.page * paginatorSettings.limit + paginatorSettings.limit
paginatorSettings.page * paginatorSettings.limit + paginatorSettings.limit
);
);
...
@@ -174,15 +184,7 @@
...
@@ -174,15 +184,7 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
{#each paginatedSource.filter((user) => {
{#each paginatedSource as user}
if (search === '') {
return true;
} else {
let name = user.name.toLowerCase();
const query = search.toLowerCase();
return name.includes(query);
}
}) as user}
<tr class="bg-white border-b dark:bg-gray-900 dark:border-gray-700 text-xs">
<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">
<td class="px-3 py-2 min-w-[7rem] w-28">
<button
<button
...
@@ -280,12 +282,13 @@
...
@@ -280,12 +282,13 @@
{/each}
{/each}
</tbody>
</tbody>
</table>
</table>
<Paginator bind:settings={paginatorSettings} showNumerals />
</div>
</div>
<div class=" text-gray-500 text-xs mt-2 text-right">
<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.")}
ⓘ {$i18n.t("Click on the user role button to change a user's role.")}
</div>
</div>
<Paginator bind:settings={paginatorSettings} showNumerals />
</div>
</div>
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment