34dc52d92b
- Calendrier MalioDate en vue Jour (Heures + Heures Conducteurs) : jours entièrement validés (admin) peints en vert. Endpoint GET /work-hours/validation-status?from=&to=[&driver=1] (scope conducteur inversé), chargement à la volée par mois, refresh après validation/saisie/absence. - Suite à @malio/layer-ui 1.7.11 : reserveMessageSpace=false sur les champs ; tous les drawers migrés sur MalioDrawer (titre via slot #header, AppDrawer custom supprimé) ; boutons d'action en MalioButton (deux boutons partagent l'espace) ; inputs date en MalioDate ; MalioDateWeek en vue Semaine. - Boutons d'ajout uniformisés sur « Ajouter » + icône. - .env : EXCLUDED_PUBLIC_HOLIDAYS="null". - Doc : doc/hours-validated-days.md, documentation-content.ts, CLAUDE.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
66 lines
1.9 KiB
Vue
66 lines
1.9 KiB
Vue
<template>
|
|
<div class="mx-auto w-full max-w-lg">
|
|
<span
|
|
class="flex items-center justify-center bg-white text-xl font-bold uppercase text-primary-500 p-4"
|
|
>
|
|
<img src="/malio.png" alt="Logo" class="w-[150px]"/>
|
|
</span>
|
|
<form
|
|
class="mt-8 space-y-6 rounded-lg border border-neutral-200 bg-white p-6 shadow-sm"
|
|
@submit.prevent="handleSubmit"
|
|
>
|
|
<MalioInputText :reserve-message-space="false"
|
|
v-model="username"
|
|
label="Nom d'utilisateur"
|
|
autocomplete="username"
|
|
group-class="mt-2"
|
|
/>
|
|
|
|
<MalioInputPassword :reserve-message-space="false"
|
|
v-model="password"
|
|
label="Mot de passe"
|
|
autocomplete="current-password"
|
|
/>
|
|
|
|
<button
|
|
type="submit"
|
|
class="w-full rounded-md bg-primary-500 px-4 py-2 text-base font-semibold text-white transition hover:bg-secondary-500 disabled:cursor-not-allowed disabled:opacity-60"
|
|
:disabled="isSubmitting"
|
|
>
|
|
Se connecter
|
|
</button>
|
|
<p class="font-bold">v{{ version }}</p>
|
|
</form>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
definePageMeta({layout: 'auth'})
|
|
useHead({
|
|
title: 'Connexion'
|
|
})
|
|
|
|
const router = useRouter()
|
|
const auth = useAuthStore()
|
|
const { version } = useAppVersion()
|
|
|
|
const username = ref('')
|
|
const password = ref('')
|
|
const isSubmitting = ref(false)
|
|
|
|
const handleSubmit = async () => {
|
|
if (isSubmitting.value) return
|
|
|
|
isSubmitting.value = true
|
|
try {
|
|
await auth.login(username.value, password.value)
|
|
|
|
const isAdmin = auth.user?.roles?.includes('ROLE_ADMIN')
|
|
const isDriver = auth.user?.isDriver
|
|
await router.push(isAdmin ? '/calendar' : isDriver ? '/driver-hours' : '/hours')
|
|
} finally {
|
|
isSubmitting.value = false
|
|
}
|
|
}
|
|
</script>
|