11 changed files with 234 additions and 97 deletions
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
<script> |
||||
import { t } from '../../translations.svelte.js'; |
||||
import { user } from '../../user.svelte.js'; |
||||
import { onMount } from 'svelte'; |
||||
|
||||
let connections = $state([]); |
||||
|
||||
onMount(async () => { |
||||
let url = `${location.protocol}//${location.host.replace('5173','8080')}/api/user/oidc/connected`; |
||||
|
||||
let resp = await fetch(url,{credentials:'include'}); |
||||
if (resp.ok){ |
||||
const arr = await resp.json(); |
||||
for (let entry of arr){ |
||||
connections.push(entry) |
||||
console.log(entry); |
||||
} |
||||
} |
||||
}); |
||||
</script> |
||||
|
||||
{#if connections.length>0} |
||||
<fieldset tabindex="0"> |
||||
<legend>{t('user.connected_services')}</legend> |
||||
<table> |
||||
<thead> |
||||
<tr> |
||||
<th>{t('user.service')}</th> |
||||
<th>{t('user.foreign_id')}</th> |
||||
<th>{t('user.actions')}</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{#each connections as connection,i} |
||||
<tr> |
||||
<td>{connection.service}</td> |
||||
<td>{connection.foreign_id}</td> |
||||
<td> |
||||
<button>{t('user.unlink')}</button> |
||||
</td> |
||||
</tr> |
||||
{/each} |
||||
</tbody> |
||||
</table> |
||||
</fieldset> |
||||
{/if} |
||||
@ -0,0 +1,65 @@
@@ -0,0 +1,65 @@
|
||||
<script> |
||||
import { t } from '../../translations.svelte.js'; |
||||
import { user } from '../../user.svelte.js'; |
||||
import { useTinyRouter } from 'svelte-tiny-router'; |
||||
|
||||
import EditPassword from './EditPassword.svelte'; |
||||
const router = useTinyRouter(); |
||||
|
||||
let editPassword = false; |
||||
|
||||
</script> |
||||
<fieldset> |
||||
<legend> |
||||
{t('user.your_profile')} <button onclick={() => router.navigate(`/user/${user.id}/edit`)}>{t('user.edit')}</button> |
||||
</legend> |
||||
<table> |
||||
<tbody> |
||||
<tr> |
||||
<th>{t('user.id')}</th> |
||||
<td>{user.id}</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('user.name')}</th> |
||||
<td>{user.name}</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('user.login')}</th> |
||||
<td>{user.login}</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('user.email')}</th> |
||||
<td>{user.email}</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('user.language')}</th> |
||||
<td>{user.language}</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('user.theme')}</th> |
||||
<td>{user.theme}</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('user.password')}</th> |
||||
<td> |
||||
{#if editPassword} |
||||
<EditPassword bind:editPassword={editPassword} /> |
||||
{:else} |
||||
<button onclick={() => editPassword = true}>{t('user.edit_password')}</button> |
||||
{/if} |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th>{t('user.permissions')}</th> |
||||
<td> |
||||
<ul> |
||||
{#each user.permissions as permission,i} |
||||
<li>{t('user.'+permission)}</li> |
||||
{/each} |
||||
</ul> |
||||
</td> |
||||
</tr> |
||||
|
||||
</tbody> |
||||
</table> |
||||
</fieldset> |
||||
Loading…
Reference in new issue