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
1efa25ee
Commit
1efa25ee
authored
Jun 16, 2024
by
Timothy J. Baek
Browse files
chore: format
parent
54b65a89
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
36 deletions
+57
-36
src/routes/(app)/admin/+page.svelte
src/routes/(app)/admin/+page.svelte
+57
-36
No files found.
src/routes/(app)/admin/+page.svelte
View file @
1efa25ee
...
@@ -159,45 +159,65 @@
...
@@ -159,45 +159,65 @@
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400 table-auto max-w-full">
<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-700 uppercase bg-gray-50 dark:bg-gray-850 dark:text-gray-400">
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-850 dark:text-gray-400">
<tr>
<tr>
<th scope="col" class="px-3 py-2 cursor-pointer select-none" on:click={() => setSortKey('role')}>
<th
{$i18n.t('Role')}
scope="col"
{#if sortKey === 'role'}
class="px-3 py-2 cursor-pointer select-none"
{sortOrder === 'asc' ? '▲' : '▼'}
on:click={() => setSortKey('role')}
{:else}
>
<span class="invisible">▲</span>
{$i18n.t('Role')}
{/if}
{#if sortKey === 'role'}
{sortOrder === 'asc' ? '▲' : '▼'}
{:else}
<span class="invisible">▲</span>
{/if}
</th>
</th>
<th scope="col" class="px-3 py-2 cursor-pointer select-none" on:click={() => setSortKey('name')}>
<th
{$i18n.t('Name')}
scope="col"
{#if sortKey === 'name'}
class="px-3 py-2 cursor-pointer select-none"
{sortOrder === 'asc' ? '▲' : '▼'}
on:click={() => setSortKey('name')}
{:else}
>
<span class="invisible">▲</span>
{$i18n.t('Name')}
{/if}
{#if sortKey === 'name'}
{sortOrder === 'asc' ? '▲' : '▼'}
{:else}
<span class="invisible">▲</span>
{/if}
</th>
</th>
<th scope="col" class="px-3 py-2 cursor-pointer select-none" on:click={() => setSortKey('email')}>
<th
{$i18n.t('Email')}
scope="col"
{#if sortKey === 'email'}
class="px-3 py-2 cursor-pointer select-none"
{sortOrder === 'asc' ? '▲' : '▼'}
on:click={() => setSortKey('email')}
{:else}
>
<span class="invisible">▲</span>
{$i18n.t('Email')}
{/if}
{#if sortKey === 'email'}
{sortOrder === 'asc' ? '▲' : '▼'}
{:else}
<span class="invisible">▲</span>
{/if}
</th>
</th>
<th scope="col" class="px-3 py-2 cursor-pointer select-none" on:click={() => setSortKey('last_active_at')}>
<th
{$i18n.t('Last Active')}
scope="col"
{#if sortKey === 'last_active_at'}
class="px-3 py-2 cursor-pointer select-none"
{sortOrder === 'asc' ? '▲' : '▼'}
on:click={() => setSortKey('last_active_at')}
{:else}
>
<span class="invisible">▲</span>
{$i18n.t('Last Active')}
{/if}
{#if sortKey === 'last_active_at'}
{sortOrder === 'asc' ? '▲' : '▼'}
{:else}
<span class="invisible">▲</span>
{/if}
</th>
</th>
<th scope="col" class="px-3 py-2 cursor-pointer select-none" on:click={() => setSortKey('created_at')}>
<th
{$i18n.t('Created at')}
scope="col"
{#if sortKey === 'created_at'}
class="px-3 py-2 cursor-pointer select-none"
{sortOrder === 'asc' ? '▲' : '▼'}
on:click={() => setSortKey('created_at')}
{:else}
>
<span class="invisible">▲</span>
{$i18n.t('Created at')}
{/if}
{#if sortKey === 'created_at'}
{sortOrder === 'asc' ? '▲' : '▼'}
{:else}
<span class="invisible">▲</span>
{/if}
</th>
</th>
<th scope="col" class="px-3 py-2 text-right" />
<th scope="col" class="px-3 py-2 text-right" />
...
@@ -213,7 +233,8 @@
...
@@ -213,7 +233,8 @@
const query = search.toLowerCase();
const query = search.toLowerCase();
return name.includes(query);
return name.includes(query);
}
}
}).sort((a, b) => {
})
.sort((a, b) => {
if (a[sortKey] < b[sortKey]) return sortOrder === 'asc' ? -1 : 1;
if (a[sortKey] < b[sortKey]) return sortOrder === 'asc' ? -1 : 1;
if (a[sortKey] > b[sortKey]) return sortOrder === 'asc' ? 1 : -1;
if (a[sortKey] > b[sortKey]) return sortOrder === 'asc' ? 1 : -1;
return 0;
return 0;
...
...
Prev
1
2
3
Next
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