WebSocket API, new ID/encrypt/decrypt algorithm.

This commit is contained in:
Clément Pons
2025-11-18 17:54:11 +01:00
parent 2a158be3fa
commit 7a40f8abac
26 changed files with 2303 additions and 293 deletions

View File

@@ -16,6 +16,10 @@ onMounted(() => {
{
const campaign = new CampaignSheet(id, user);
container.value.appendChild(campaign.container);
onUnmounted(() => {
campaign.ws?.close();
})
}
});
})

View File

@@ -38,7 +38,7 @@ function create()
{
useRequestFetch()('/api/campaign', {
method: 'POST',
body: { id: 'new', name: 'Test', description: '', joinby: 'link' },
body: { name: 'Margooning', public_notes: '', dm_notes: '', settings: {} },
}).then(() => Toaster.add({ duration: 8000, content: 'Campagne créée', type: 'info' })).catch((e) => Toaster.add({ duration: 8000, title: 'Une erreur est survenue', content: e, type: 'error' }))
}
</script>
@@ -52,6 +52,7 @@ function create()
<Loading size="large" />
</div>
<template v-else-if="status === 'success' && loggedIn && user">
<div class="flex flex-row items-center w-full"><Button @click="() => create()">Nouvelle campagne</Button></div>
<div v-if="campaigns && campaigns.length > 0" class="flex flex-col gap-4">
<div v-if="valids && valids.length > 0" class="grid p-6 2xl:grid-cols-3 lg:grid-cols-2 grid-cols-1 gap-4 w-full">
<div class="flex flex-col w-[360px] border border-light-35 dark:border-dark-35" v-for="campaign of valids">