@open-commune/web 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app.config.ts +6 -0
- package/assets/css/main.css +119 -0
- package/components/layout/entrance-mark.vue +18 -0
- package/components/layout/navigations/primary/dropdown-publish.vue +6 -4
- package/components/layout/shell/shell-account-menu.vue +55 -0
- package/components/layout/shell/shell-header.vue +99 -0
- package/composables/core/domains/use-auth.ts +108 -0
- package/composables/use-models.js +1 -3
- package/layouts/default.vue +1 -2
- package/layouts/entrance.vue +1 -6
- package/layouts/record.vue +1 -2
- package/middleware/00.light-mode.global.ts +8 -0
- package/nuxt.config.ts +8 -0
- package/package.json +5 -3
- package/pages/index/index.vue +54 -62
- package/pages/index/password/define/[token].vue +44 -68
- package/pages/index/password/recover/index.vue +43 -54
- package/pages/index/welcome/[token].vue +42 -79
- package/pages/index.vue +6 -37
- package/plugins/00.appearance.client.ts +7 -0
- package/components/layout/navigations/primary.vue +0 -132
- package/models/entrance.js +0 -42
- package/public/logo-black.svg +0 -1
- package/public/logo-white.svg +0 -1
package/pages/index/index.vue
CHANGED
|
@@ -1,78 +1,70 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
2
|
+
<UAuthForm
|
|
3
|
+
class="entrance-sign-in"
|
|
4
|
+
title="Connexion"
|
|
5
|
+
description="Administrez le site de votre commune."
|
|
6
|
+
:fields="FIELDS"
|
|
7
|
+
:schema="SCHEMA"
|
|
8
|
+
:submit="{ label: 'S\'identifier', color: 'neutral', loading: isLoading }"
|
|
9
|
+
@submit="_signIn"
|
|
10
|
+
>
|
|
11
|
+
<template #leading>
|
|
12
|
+
<layout-entrance-mark />
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<template #footer>
|
|
16
|
+
<div class="flex flex-col items-center gap-1">
|
|
17
|
+
<UButton
|
|
18
|
+
color="neutral"
|
|
19
|
+
variant="link"
|
|
20
|
+
label="Vous avez oublié votre mot de passe ?"
|
|
21
|
+
to="/password/recover"
|
|
22
|
+
/>
|
|
23
|
+
<UButton
|
|
24
|
+
v-if="supportUrl"
|
|
25
|
+
color="neutral"
|
|
26
|
+
variant="link"
|
|
27
|
+
label="Je n'arrive pas à m'identifier"
|
|
28
|
+
:to="supportUrl"
|
|
29
|
+
target="_blank"
|
|
30
|
+
rel="noopener"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
</UAuthForm>
|
|
34
35
|
</template>
|
|
35
36
|
|
|
36
37
|
<script setup>
|
|
37
|
-
import
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
import * as z from 'zod'
|
|
39
|
+
|
|
40
|
+
// Prepare constants
|
|
41
|
+
const FIELDS = [
|
|
42
|
+
{ name: 'email', type: 'email', label: 'Adresse email', placeholder: 'Adresse email', autocomplete: 'email', required: true },
|
|
43
|
+
{ name: 'password', type: 'password', label: 'Mot de passe', placeholder: 'Mot de passe', autocomplete: 'current-password', required: true }
|
|
44
|
+
]
|
|
45
|
+
const SCHEMA = z.object({
|
|
46
|
+
email: z.email('Adresse email invalide'),
|
|
47
|
+
password: z.string().min(1, 'Mot de passe requis')
|
|
48
|
+
})
|
|
49
|
+
// Where someone locked out asks for help: the host's support, from the
|
|
50
|
+
// configuration. Without it the link is not shown rather than leading nowhere.
|
|
51
|
+
const { public: { supportUrl } } = useRuntimeConfig()
|
|
41
52
|
|
|
42
53
|
// Prepare composables
|
|
43
|
-
const
|
|
44
|
-
const
|
|
54
|
+
const $session = useSession()
|
|
55
|
+
const $toast = useToast()
|
|
45
56
|
|
|
46
|
-
// Prepare reactive
|
|
57
|
+
// Prepare reactive
|
|
47
58
|
const isLoading = ref(false)
|
|
48
|
-
const emailAddress = ref('')
|
|
49
|
-
const password = ref('')
|
|
50
|
-
|
|
51
|
-
// Prepare emitters
|
|
52
|
-
defineEmits(['enter'])
|
|
53
59
|
|
|
54
60
|
// Prepare methods
|
|
55
|
-
const
|
|
56
|
-
// https://forms.fillout.com/t/vjkLG9ZXsLus
|
|
57
|
-
const formUrl = 'https://forms.fillout.com/t/vjkLG9ZXsLus'
|
|
58
|
-
const formWindow = window.open(formUrl, '_blank')
|
|
59
|
-
if (formWindow) {
|
|
60
|
-
// Browser has allowed it to be opened
|
|
61
|
-
formWindow.focus()
|
|
62
|
-
} else {
|
|
63
|
-
// Browser has blocked it
|
|
64
|
-
alert('Please allow popups for this website')
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
const _signIn = async () => {
|
|
61
|
+
const _signIn = async (event) => {
|
|
68
62
|
isLoading.value = true
|
|
69
63
|
try {
|
|
70
|
-
await session.login(
|
|
71
|
-
notificationsStore.add({ icon: 'iconoir:password-pass', type: 'success', title: 'Authentification réussie.' })
|
|
64
|
+
await $session.login(event.data.email, event.data.password)
|
|
72
65
|
await navigateTo('/overview')
|
|
73
|
-
} catch
|
|
74
|
-
|
|
75
|
-
notificationsStore.add({ icon: 'iconoir:password-error', type: 'warn', title: 'Identifiants incorrects.' })
|
|
66
|
+
} catch {
|
|
67
|
+
$toast.add({ icon: 'iconoir:password-error', color: 'warning', title: 'Identifiants incorrects.' })
|
|
76
68
|
} finally {
|
|
77
69
|
isLoading.value = false
|
|
78
70
|
}
|
|
@@ -1,79 +1,55 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
autocomplete="new-password"
|
|
24
|
-
:value="passwordConfirmation"
|
|
25
|
-
required
|
|
26
|
-
@change="passwordConfirmation = $event"
|
|
27
|
-
/>
|
|
28
|
-
<button-primary
|
|
29
|
-
type="submit"
|
|
30
|
-
:label="isLoading ? 'Envoie en cours' : 'Confirmer'"
|
|
31
|
-
:disabled="!password || password !== passwordConfirmation"
|
|
32
|
-
:loading="isLoading"
|
|
33
|
-
class="w-full"
|
|
34
|
-
/>
|
|
35
|
-
</form>
|
|
36
|
-
</div>
|
|
2
|
+
<UAuthForm
|
|
3
|
+
title="Définir un mot de passe"
|
|
4
|
+
description="Il vous servira à vous identifier."
|
|
5
|
+
:fields="FIELDS"
|
|
6
|
+
:schema="SCHEMA"
|
|
7
|
+
:submit="{ label: 'Définir le mot de passe', color: 'neutral', loading: isLoading }"
|
|
8
|
+
@submit="_updatePassword"
|
|
9
|
+
>
|
|
10
|
+
<template #leading>
|
|
11
|
+
<layout-entrance-mark />
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<template #footer>
|
|
15
|
+
<div class="flex flex-col items-center gap-3">
|
|
16
|
+
<p class="text-xs text-dimmed">
|
|
17
|
+
Dix caractères minimum.
|
|
18
|
+
</p>
|
|
19
|
+
<UButton color="neutral" variant="link" label="← Retour à la connexion" to="/" />
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
</UAuthForm>
|
|
37
23
|
</template>
|
|
38
24
|
|
|
39
25
|
<script setup>
|
|
40
|
-
import
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
import * as z from 'zod'
|
|
27
|
+
|
|
28
|
+
// Prepare constants
|
|
29
|
+
const FIELDS = [
|
|
30
|
+
{ name: 'password', type: 'password', label: 'Nouveau mot de passe', placeholder: 'Nouveau mot de passe', autocomplete: 'new-password', required: true },
|
|
31
|
+
{ name: 'confirmation', type: 'password', label: 'Confirmer le mot de passe', placeholder: 'Confirmer le mot de passe', autocomplete: 'new-password', required: true }
|
|
32
|
+
]
|
|
33
|
+
const SCHEMA = z
|
|
34
|
+
.object({
|
|
35
|
+
password: z.string().min(10, '10 caractères minimum'),
|
|
36
|
+
confirmation: z.string()
|
|
37
|
+
})
|
|
38
|
+
.refine((values) => values.password === values.confirmation, {
|
|
39
|
+
message: 'Les deux mots de passe diffèrent',
|
|
40
|
+
path: ['confirmation']
|
|
41
|
+
})
|
|
43
42
|
|
|
44
43
|
// Prepare composables
|
|
45
|
-
const notificationsStore = useNotificationsStore()
|
|
46
44
|
const $route = useRoute()
|
|
47
|
-
const $
|
|
48
|
-
const { Entrance } = useModels()
|
|
45
|
+
const $auth = useAuth()
|
|
49
46
|
|
|
50
|
-
// Prepare
|
|
51
|
-
const
|
|
52
|
-
const passwordConfirmation = ref('')
|
|
53
|
-
const isLoading = ref(false)
|
|
47
|
+
// Prepare computed
|
|
48
|
+
const isLoading = computed(() => $auth.isDefiningPassword.value)
|
|
54
49
|
|
|
55
50
|
// Prepare methods
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// oublié » se voyait réclamer un nom sous un titre « Votre compte ».
|
|
61
|
-
const _updatePassword = async () => {
|
|
62
|
-
isLoading.value = true
|
|
63
|
-
try {
|
|
64
|
-
const { token } = $route.params
|
|
65
|
-
await Entrance.updatePassword({ token, password: password.value })
|
|
66
|
-
notificationsStore.add({ icon: 'iconoir:password-cursor', type: 'success', title: 'Mot de passe mis à jour, connectez-vous.' })
|
|
67
|
-
$router.push('/')
|
|
68
|
-
} catch (err) {
|
|
69
|
-
console.log(err)
|
|
70
|
-
notificationsStore.add({
|
|
71
|
-
icon: 'iconoir:password-error',
|
|
72
|
-
type: 'warn',
|
|
73
|
-
title: 'Lien expiré ou déjà utilisé, ou mot de passe trop court (10 caractères minimum).'
|
|
74
|
-
})
|
|
75
|
-
} finally {
|
|
76
|
-
isLoading.value = false
|
|
77
|
-
}
|
|
78
|
-
}
|
|
51
|
+
const _updatePassword = (event) => $auth.definePassword({
|
|
52
|
+
token: $route.params.token,
|
|
53
|
+
password: event.data.password,
|
|
54
|
+
})
|
|
79
55
|
</script>
|
|
@@ -1,72 +1,61 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
3
|
-
<h2 class="
|
|
4
|
-
|
|
2
|
+
<div v-if="isSent" class="text-center">
|
|
3
|
+
<h2 class="text-lg font-medium text-highlighted">
|
|
4
|
+
Le mail est parti
|
|
5
5
|
</h2>
|
|
6
|
-
<p class="mt-
|
|
7
|
-
|
|
6
|
+
<p class="mt-2 text-sm text-muted">
|
|
7
|
+
N'hésitez pas à vérifier vos courriers indésirables.
|
|
8
8
|
</p>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
:value="emailAddress"
|
|
16
|
-
:read-only="isLoading"
|
|
17
|
-
required
|
|
18
|
-
@change="emailAddress = $event"
|
|
19
|
-
/>
|
|
20
|
-
<button-primary
|
|
21
|
-
type="submit"
|
|
22
|
-
:label="isLoading ? 'Envoie en cours' : 'Continuer'"
|
|
23
|
-
:disabled="!emailAddress"
|
|
24
|
-
:loading="isLoading"
|
|
25
|
-
class="w-full"
|
|
26
|
-
/>
|
|
27
|
-
</form>
|
|
28
|
-
<button-primary
|
|
29
|
-
v-if="isSent"
|
|
30
|
-
label="← Revenir à l'espace de connexion"
|
|
31
|
-
class="w-full mt-8"
|
|
32
|
-
@click="$router.push('/')"
|
|
9
|
+
<UButton
|
|
10
|
+
class="mt-8"
|
|
11
|
+
color="neutral"
|
|
12
|
+
variant="link"
|
|
13
|
+
label="← Retour à la connexion"
|
|
14
|
+
to="/"
|
|
33
15
|
/>
|
|
34
16
|
</div>
|
|
17
|
+
|
|
18
|
+
<UAuthForm
|
|
19
|
+
v-else
|
|
20
|
+
title="Mot de passe oublié"
|
|
21
|
+
description="Recevez un lien pour définir un nouveau mot de passe."
|
|
22
|
+
:fields="FIELDS"
|
|
23
|
+
:schema="SCHEMA"
|
|
24
|
+
:submit="{ label: isLoading ? 'Envoi en cours' : 'Envoyer le lien', color: 'neutral', loading: isLoading }"
|
|
25
|
+
@submit="_recoverPassword"
|
|
26
|
+
>
|
|
27
|
+
<template #leading>
|
|
28
|
+
<layout-entrance-mark />
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<template #footer>
|
|
32
|
+
<div class="flex justify-center">
|
|
33
|
+
<UButton color="neutral" variant="link" label="← Retour à la connexion" to="/" />
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
</UAuthForm>
|
|
35
37
|
</template>
|
|
36
38
|
|
|
37
39
|
<script setup>
|
|
38
|
-
import
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
import * as z from 'zod'
|
|
41
|
+
|
|
42
|
+
// Prepare constants
|
|
43
|
+
const FIELDS = [
|
|
44
|
+
{ name: 'email', type: 'email', label: 'Adresse email', placeholder: 'Adresse email', autocomplete: 'email', required: true }
|
|
45
|
+
]
|
|
46
|
+
const SCHEMA = z.object({ email: z.email('Adresse email invalide') })
|
|
41
47
|
|
|
42
48
|
// Prepare composables
|
|
43
|
-
const
|
|
44
|
-
const { Entrance } = useModels()
|
|
49
|
+
const $auth = useAuth()
|
|
45
50
|
|
|
46
|
-
// Prepare
|
|
47
|
-
const isLoading = ref(false)
|
|
51
|
+
// Prepare reactive
|
|
48
52
|
const isSent = ref(false)
|
|
49
|
-
const emailAddress = ref('')
|
|
50
53
|
|
|
51
54
|
// Prepare computed
|
|
52
|
-
const
|
|
53
|
-
return isSent.value ? 'Le mail est parti' : 'Réinitialiser votre mot de passe'
|
|
54
|
-
})
|
|
55
|
-
const message = computed(() => {
|
|
56
|
-
return isSent.value ? 'N\'hésitez pas à vérifier vos courriers indesirables.' : 'Entrez votre adresse email et nous vous enverrons un lien pour mettre à jour votre mot de passe.'
|
|
57
|
-
})
|
|
55
|
+
const isLoading = computed(() => $auth.isRequestingPasswordReset.value)
|
|
58
56
|
|
|
59
57
|
// Prepare methods
|
|
60
|
-
const _recoverPassword = async () => {
|
|
61
|
-
|
|
62
|
-
try {
|
|
63
|
-
await Entrance.recoverPassword(emailAddress.value)
|
|
64
|
-
notificationsStore.add({ icon: 'iconoir:mail-out', type: 'success', title: 'Email envoyé.' })
|
|
65
|
-
isSent.value = true
|
|
66
|
-
} catch (err) {
|
|
67
|
-
console.log(err) // eslint-disable-line
|
|
68
|
-
} finally {
|
|
69
|
-
setTimeout(() => { isLoading.value = false }, 2 * 1000)
|
|
70
|
-
}
|
|
58
|
+
const _recoverPassword = async (event) => {
|
|
59
|
+
if (await $auth.requestPasswordReset(event.data.email)) isSent.value = true
|
|
71
60
|
}
|
|
72
61
|
</script>
|
|
@@ -1,90 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
autocomplete="new-password"
|
|
24
|
-
:value="password"
|
|
25
|
-
required
|
|
26
|
-
@change="password = $event"
|
|
27
|
-
/>
|
|
28
|
-
<input-text
|
|
29
|
-
place-holder="Confirmation"
|
|
30
|
-
name="password-confirmation"
|
|
31
|
-
type="password"
|
|
32
|
-
autocomplete="new-password"
|
|
33
|
-
:value="passwordConfirmation"
|
|
34
|
-
required
|
|
35
|
-
@change="passwordConfirmation = $event"
|
|
36
|
-
/>
|
|
37
|
-
<button-primary
|
|
38
|
-
type="submit"
|
|
39
|
-
:label="isLoading ? 'Envoie en cours' : 'Créer mon compte'"
|
|
40
|
-
:disabled="!name || !password || password !== passwordConfirmation"
|
|
41
|
-
:loading="isLoading"
|
|
42
|
-
class="w-full"
|
|
43
|
-
/>
|
|
44
|
-
</form>
|
|
45
|
-
</div>
|
|
2
|
+
<UAuthForm
|
|
3
|
+
title="Bienvenue !"
|
|
4
|
+
description="Vous avez été invité·e à rejoindre l'espace d'administration. Choisissez votre nom d'affichage et un mot de passe robuste."
|
|
5
|
+
:fields="FIELDS"
|
|
6
|
+
:schema="SCHEMA"
|
|
7
|
+
:submit="{ label: 'Accepter l\'invitation', color: 'neutral', loading: isLoading }"
|
|
8
|
+
@submit="_createAccount"
|
|
9
|
+
>
|
|
10
|
+
<template #leading>
|
|
11
|
+
<layout-entrance-mark />
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<template #footer>
|
|
15
|
+
<div class="flex flex-col items-center gap-3">
|
|
16
|
+
<p class="text-xs text-dimmed">
|
|
17
|
+
Dix caractères minimum.
|
|
18
|
+
</p>
|
|
19
|
+
<UButton color="neutral" variant="link" label="← Retour à la connexion" to="/" />
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
</UAuthForm>
|
|
46
23
|
</template>
|
|
47
24
|
|
|
48
25
|
<script setup>
|
|
49
|
-
import
|
|
50
|
-
|
|
51
|
-
|
|
26
|
+
import * as z from 'zod'
|
|
27
|
+
|
|
28
|
+
// Prepare constants
|
|
29
|
+
const FIELDS = [
|
|
30
|
+
{ name: 'name', type: 'text', label: 'Votre nom', placeholder: 'Votre nom', autocomplete: 'name', required: true },
|
|
31
|
+
{ name: 'password', type: 'password', label: 'Mot de passe', placeholder: 'Mot de passe', autocomplete: 'new-password', required: true }
|
|
32
|
+
]
|
|
33
|
+
const SCHEMA = z.object({
|
|
34
|
+
name: z.string().min(1, 'Votre nom est requis'),
|
|
35
|
+
password: z.string().min(10, '10 caractères minimum')
|
|
36
|
+
})
|
|
52
37
|
|
|
53
|
-
//
|
|
54
|
-
// l'acceptation (auth.acceptInvitation) — plus d'étape « confirmation d'email »
|
|
55
|
-
// préalable.
|
|
56
|
-
//
|
|
57
|
-
// L'écran porte désormais le formulaire au lieu de renvoyer sur
|
|
58
|
-
// /password/define : cette page-là ne sert plus qu'à la réinitialisation, où
|
|
59
|
-
// il n'y a pas de nom à demander.
|
|
60
|
-
const notificationsStore = useNotificationsStore()
|
|
38
|
+
// Prepare composables
|
|
61
39
|
const $route = useRoute()
|
|
62
|
-
const $
|
|
63
|
-
const { Entrance } = useModels()
|
|
40
|
+
const $auth = useAuth()
|
|
64
41
|
|
|
65
|
-
// Prepare
|
|
66
|
-
const
|
|
67
|
-
const password = ref('')
|
|
68
|
-
const passwordConfirmation = ref('')
|
|
69
|
-
const isLoading = ref(false)
|
|
42
|
+
// Prepare computed
|
|
43
|
+
const isLoading = computed(() => $auth.isAcceptingInvitation.value)
|
|
70
44
|
|
|
71
45
|
// Prepare methods
|
|
72
|
-
const _createAccount = async () => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
$router.push('/')
|
|
79
|
-
} catch (err) {
|
|
80
|
-
console.log(err)
|
|
81
|
-
notificationsStore.add({
|
|
82
|
-
icon: 'iconoir:password-error',
|
|
83
|
-
type: 'warn',
|
|
84
|
-
title: 'Invitation invalide ou mot de passe trop court (10 caractères minimum).'
|
|
85
|
-
})
|
|
86
|
-
} finally {
|
|
87
|
-
isLoading.value = false
|
|
88
|
-
}
|
|
46
|
+
const _createAccount = async (event) => {
|
|
47
|
+
await $auth.acceptInvitation({
|
|
48
|
+
token: $route.params.token,
|
|
49
|
+
name: event.data.name,
|
|
50
|
+
password: event.data.password
|
|
51
|
+
})
|
|
89
52
|
}
|
|
90
53
|
</script>
|
package/pages/index.vue
CHANGED
|
@@ -1,44 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="min-h-screen bg-
|
|
3
|
-
<div class="
|
|
4
|
-
<div class="
|
|
5
|
-
<
|
|
6
|
-
src="/logo-black.svg"
|
|
7
|
-
alt="Logo"
|
|
8
|
-
class="dark:hidden h-16 w-auto"
|
|
9
|
-
>
|
|
10
|
-
<img
|
|
11
|
-
src="/logo-white.svg"
|
|
12
|
-
alt="Logo"
|
|
13
|
-
class="hidden h-24 w-auto"
|
|
14
|
-
>
|
|
15
|
-
<p v-if="demoEnv" class="text-sm text-gray-400 w-full border-t border-gray-100 text-center pt-2">
|
|
16
|
-
<span class="bg-black rounded-lg text-white px-4 text-xs py-0.5 h-5 mx-auto">
|
|
17
|
-
beta
|
|
18
|
-
</span>
|
|
19
|
-
</p>
|
|
2
|
+
<div class="entrance flex min-h-screen items-center justify-center bg-default px-4 py-12">
|
|
3
|
+
<div class="w-full max-w-sm">
|
|
4
|
+
<div class="entrance-card rounded-xl bg-elevated p-8 shadow-sm">
|
|
5
|
+
<nuxt-page />
|
|
20
6
|
</div>
|
|
21
|
-
<nuxt-page />
|
|
22
7
|
</div>
|
|
23
8
|
</div>
|
|
24
9
|
</template>
|
|
25
10
|
|
|
26
11
|
<script setup>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
definePageMeta({
|
|
30
|
-
layout: 'entrance',
|
|
31
|
-
auth: {
|
|
32
|
-
unauthenticatedOnly: true,
|
|
33
|
-
navigateAuthenticatedTo: '/overview',
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
// Prepare computed
|
|
38
|
-
// L'image d'instance est COMMUNE à tous les clients : rien de spécifique n'y est
|
|
39
|
-
// cuit. L'hôte servi est donc la seule source fiable pour distinguer une démo.
|
|
40
|
-
const demoEnv = computed(() => {
|
|
41
|
-
const host = import.meta.client ? window.location.host : ''
|
|
42
|
-
return host.includes('.beta') || host.includes('localhost')
|
|
43
|
-
})
|
|
44
|
-
</script>
|
|
12
|
+
definePageMeta({ layout: 'entrance' })
|
|
13
|
+
</script>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Writes the instance's appearance on the document root, before anything
|
|
2
|
+
// paints: the tokens of assets/css/main.css are keyed on this attribute.
|
|
3
|
+
export default defineNuxtPlugin(() => {
|
|
4
|
+
const { appearance } = useRuntimeConfig().public
|
|
5
|
+
// `default` names the default aloud, for a layer whose own default is another.
|
|
6
|
+
if (appearance && appearance !== 'default') document.documentElement.dataset.appearance = String(appearance)
|
|
7
|
+
})
|