forked from yvv/decision
v3 : une session dure jusqu'à ce qu'on la ferme, l'administration ferme celles d'une identité
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
status?: { pending: number; lastError: string | null; lastPublishedAt: string | null; lastCommit: string | null };
|
||||
};
|
||||
groups: { slug: string; name: string; policy: string; hidden: boolean; members: { identityId: string; grantedAt: string }[] }[];
|
||||
identities: { id: string; kind: 'g1' | 'invite' | 'dev'; displayName: string; g1Member: boolean; admin: boolean; lastSeenAt: string | null; teamLink: string | null }[];
|
||||
identities: { id: string; kind: 'g1' | 'invite' | 'dev'; displayName: string; g1Member: boolean; admin: boolean; lastSeenAt: string | null; teamLink: string | null; sessions: number }[];
|
||||
invitations: { id: string; label: string; admin: boolean; groups: string[]; expiresAt: string }[];
|
||||
teamLinks: TeamLink[];
|
||||
}
|
||||
@@ -77,6 +77,14 @@
|
||||
});
|
||||
}
|
||||
|
||||
// A lost device, a person who left: their sessions close (never the one in use here).
|
||||
async function closeSessions(id: string) {
|
||||
await act(async () => {
|
||||
const r = await api.del<{ closed: number }>(`/access/identities/${encodeURIComponent(id)}/sessions`);
|
||||
toasts.show(t('access.sessions.closed', { n: r.closed }));
|
||||
});
|
||||
}
|
||||
|
||||
async function status(id: number, s: 'seen' | 'done') {
|
||||
await api.post(`/access/feedback/${id}`, { status: s });
|
||||
await fb.load();
|
||||
@@ -165,6 +173,7 @@
|
||||
</span>
|
||||
<span class="row">
|
||||
{#if i.kind === 'invite'}<button class="btn quiet small" type="button" onclick={() => relink(i.id, i.displayName)}>{t('access.relink')}</button>{/if}
|
||||
{#if i.sessions > 0}<button class="btn quiet small" type="button" onclick={() => closeSessions(i.id)}>{t(i.id === session.me?.id ? 'access.sessions.closeMine' : 'access.sessions.close', { n: i.sessions })}</button>{/if}
|
||||
<button class="btn quiet small" type="button" onclick={() => act(() => api.post(`/access/identities/${encodeURIComponent(i.id)}/admin`, { admin: !i.admin }))}>{i.admin ? t('access.admin.take') : t('access.admin.give')}</button>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user