{ deleteUserHandler(selectedUser.id); }} /> {#key selectedUser} { users = await getUsers(localStorage.token); }} /> {/key} { users = await getUsers(localStorage.token); }} /> {#if loaded}
{$i18n.t('All Users')}
{users.length}
{#each users .filter((user) => { if (search === '') { return true; } else { let name = user.name.toLowerCase(); const query = search.toLowerCase(); return name.includes(query); } }) .sort((a, b) => { if (a[sortKey] < b[sortKey]) return sortOrder === 'asc' ? -1 : 1; if (a[sortKey] > b[sortKey]) return sortOrder === 'asc' ? 1 : -1; return 0; }) .slice((page - 1) * 20, page * 20) as user} {/each}
setSortKey('role')} > {$i18n.t('Role')} {#if sortKey === 'role'} {sortOrder === 'asc' ? '▲' : '▼'} {:else} {/if} setSortKey('name')} > {$i18n.t('Name')} {#if sortKey === 'name'} {sortOrder === 'asc' ? '▲' : '▼'} {:else} {/if} setSortKey('email')} > {$i18n.t('Email')} {#if sortKey === 'email'} {sortOrder === 'asc' ? '▲' : '▼'} {:else} {/if} setSortKey('oauth_sub')} > {$i18n.t('OAuth ID')} {#if sortKey === 'oauth_sub'} {sortOrder === 'asc' ? '▲' : '▼'} {:else} {/if} setSortKey('last_active_at')} > {$i18n.t('Last Active')} {#if sortKey === 'last_active_at'} {sortOrder === 'asc' ? '▲' : '▼'} {:else} {/if} setSortKey('created_at')} > {$i18n.t('Created at')} {#if sortKey === 'created_at'} {sortOrder === 'asc' ? '▲' : '▼'} {:else} {/if}
user
{user.name}
{user.email} {user.oauth_sub ?? ''} {dayjs(user.last_active_at * 1000).fromNow()} {dayjs(user.created_at * 1000).format($i18n.t('MMMM DD, YYYY'))}
{#if $config.features.enable_admin_chat_access && user.role !== 'admin'} {/if} {#if user.role !== 'admin'} {/if}
ⓘ {$i18n.t("Click on the user role button to change a user's role.")}
{/if}