72 lines
1.9 KiB
Vue
72 lines
1.9 KiB
Vue
<script lang="ts" setup>
|
|
import teamRoutes from '@/routes/teams';
|
|
import { Save } from '@lucide/vue';
|
|
import { Head, useForm } from '@inertiajs/vue3';
|
|
import { Button } from '@/components/ui/button';
|
|
import { Input } from '@/components/ui/input';
|
|
import { Label } from '@/components/ui/label';
|
|
import InputError from '@/components/InputError.vue';
|
|
import { Checkbox } from '@/components/ui/checkbox';
|
|
import { Team } from '@/types/models';
|
|
|
|
const props = defineProps<{
|
|
team: Team;
|
|
}>();
|
|
|
|
defineOptions({
|
|
layout: {
|
|
breadcrumbs: [
|
|
{
|
|
title: 'Teams',
|
|
href: teamRoutes.index(),
|
|
},
|
|
{
|
|
title: props.team.name,
|
|
href: teamRoutes.create(),
|
|
},
|
|
],
|
|
},
|
|
});
|
|
|
|
const form = useForm({
|
|
name: props.team.name,
|
|
require_2fa: props.team.multi_factor_required,
|
|
});
|
|
|
|
function submit(): void {
|
|
form.patch(teamRoutes.patch({ team: props.team.slug }).url);
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<Head title="Teams" />
|
|
|
|
<div class="flex flex-col justify-center p-16">
|
|
<form class="grid w-full gap-5 py-4" @submit.prevent="submit">
|
|
<div class="grid grid-cols-2 gap-5">
|
|
<div class="grid items-start gap-3">
|
|
<Label for="name">Name</Label>
|
|
<Input id="name" v-model="form.name" name="name" />
|
|
<InputError :message="form.errors.name" />
|
|
<InputError :message="(form.errors as any).slug" />
|
|
</div>
|
|
<div class="grid items-start gap-3">
|
|
<Label for="require_2fa">Require 2FA</Label>
|
|
<Checkbox
|
|
id="require_2fa"
|
|
v-model="form.require_2fa"
|
|
name="require_2fa"
|
|
/>
|
|
<InputError :message="form.errors.require_2fa" />
|
|
</div>
|
|
</div>
|
|
<div class="flex w-full justify-end">
|
|
<Button :disabled="form.processing" class="w-fit" type="submit">
|
|
<component :is="Save" />
|
|
Speichern
|
|
</Button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</template>
|