mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-07 02:58:21 +00:00
refac
This commit is contained in:
parent
bf7b633c89
commit
dc713a68a4
1 changed files with 26 additions and 6 deletions
|
|
@ -72,7 +72,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
const sortState = (key) =>
|
||||
const sortState = (key, orderBy, direction) =>
|
||||
orderBy === key ? (direction === 'asc' ? 'ascending' : 'descending') : 'none';
|
||||
|
||||
const setSortKey = (key) => {
|
||||
|
|
@ -225,7 +225,11 @@
|
|||
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400 table-auto max-w-full">
|
||||
<thead class="text-xs text-gray-800 uppercase bg-transparent dark:text-gray-200">
|
||||
<tr class=" border-b-[1.5px] border-gray-50 dark:border-gray-850/30">
|
||||
<th scope="col" class="font-normal select-none" aria-sort={sortState('name')}>
|
||||
<th
|
||||
scope="col"
|
||||
class="font-normal select-none"
|
||||
aria-sort={sortState('name', orderBy, direction)}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="flex w-full gap-1.5 items-center px-2.5 py-1.5"
|
||||
|
|
@ -248,7 +252,11 @@
|
|||
{/if}
|
||||
</button>
|
||||
</th>
|
||||
<th scope="col" class="font-normal select-none" aria-sort={sortState('role')}>
|
||||
<th
|
||||
scope="col"
|
||||
class="font-normal select-none"
|
||||
aria-sort={sortState('role', orderBy, direction)}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="flex w-full gap-1.5 items-center px-2.5 py-1.5"
|
||||
|
|
@ -271,7 +279,11 @@
|
|||
{/if}
|
||||
</button>
|
||||
</th>
|
||||
<th scope="col" class="font-normal select-none" aria-sort={sortState('email')}>
|
||||
<th
|
||||
scope="col"
|
||||
class="font-normal select-none"
|
||||
aria-sort={sortState('email', orderBy, direction)}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="flex w-full gap-1.5 items-center px-2.5 py-1.5"
|
||||
|
|
@ -295,7 +307,11 @@
|
|||
</button>
|
||||
</th>
|
||||
|
||||
<th scope="col" class="font-normal select-none" aria-sort={sortState('last_active_at')}>
|
||||
<th
|
||||
scope="col"
|
||||
class="font-normal select-none"
|
||||
aria-sort={sortState('last_active_at', orderBy, direction)}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="flex w-full gap-1.5 items-center px-2.5 py-1.5"
|
||||
|
|
@ -319,7 +335,11 @@
|
|||
{/if}
|
||||
</button>
|
||||
</th>
|
||||
<th scope="col" class="font-normal select-none" aria-sort={sortState('created_at')}>
|
||||
<th
|
||||
scope="col"
|
||||
class="font-normal select-none"
|
||||
aria-sort={sortState('created_at', orderBy, direction)}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="flex w-full gap-1.5 items-center px-2.5 py-1.5"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue