working on user lost for admin

This commit is contained in:
2025-07-02 09:17:05 +02:00
parent 086f722074
commit 372cce43fa
7 changed files with 89 additions and 34 deletions

View File

@@ -0,0 +1,44 @@
<script>
import { onMount } from 'svelte';
import { t } from '../../translations.svelte.js';
import { user } from '../../user.svelte.js';
let users = $state([]);
onMount(async () => {
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/user/list`;
const resp = await fetch(url,{credentials:'include'});
if (resp.ok){
const json = await resp.json();
for (let user of json) users.push(user);
}
});
</script>
<fieldset>
<legend>{t('user.list')}</legend>
<table>
<thead>
<tr>
<th>{t('user.id')}</th>
<th>{t('user.name')}</th>
<th>{t('user.email')}</th>
<th>{t('user.language')}</th>
<th>{t('user.actions')}</th>
</tr>
</thead>
<tbody>
{#each users as u,i}
<tr>
<td>{u.id}</td>
<td>{u.name}</td>
<td>{u.email}</td>
<td>{u.language}</td>
<td>
Check permissions, add button here
</td>
</tr>
{/each}
</tbody>
</table>
</fieldset>