feat: Implement initial agent integration management system with role-based dashboards, status tracking, and activity timelines.
This commit is contained in:
75
resources/js/Pages/Role/Create.vue
Normal file
75
resources/js/Pages/Role/Create.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<script setup>
|
||||
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue';
|
||||
import { Head, useForm, Link } from '@inertiajs/vue3';
|
||||
import PrimaryButton from '@/Components/PrimaryButton.vue';
|
||||
import InputError from '@/Components/InputError.vue';
|
||||
import InputLabel from '@/Components/InputLabel.vue';
|
||||
import TextInput from '@/Components/TextInput.vue';
|
||||
|
||||
const props = defineProps({
|
||||
permissions: Array,
|
||||
});
|
||||
|
||||
const form = useForm({
|
||||
name: '',
|
||||
permissions: [],
|
||||
});
|
||||
|
||||
const submit = () => {
|
||||
form.post(route('roles.store'));
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Nouveau Rôle" />
|
||||
|
||||
<AuthenticatedLayout>
|
||||
<template #header>
|
||||
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
||||
Nouveau Rôle
|
||||
</h2>
|
||||
</template>
|
||||
|
||||
<div class="py-12">
|
||||
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
|
||||
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg dark:bg-gray-800 p-6">
|
||||
<form @submit.prevent="submit" class="space-y-6 max-w-xl">
|
||||
<div>
|
||||
<InputLabel for="name" value="Nom du Rôle" />
|
||||
<TextInput
|
||||
id="name"
|
||||
type="text"
|
||||
class="mt-1 block w-full"
|
||||
v-model="form.name"
|
||||
required
|
||||
autofocus
|
||||
/>
|
||||
<InputError class="mt-2" :message="form.errors.name" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Permissions</span>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<label v-for="permission in permissions" :key="permission.id" class="flex items-center space-x-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
:value="permission.name"
|
||||
v-model="form.permissions"
|
||||
class="rounded border-gray-300 text-indigo-600 shadow-sm focus:ring-indigo-500 dark:border-gray-700 dark:bg-gray-900 dark:focus:ring-indigo-600 dark:focus:ring-offset-gray-800"
|
||||
>
|
||||
<span class="text-sm text-gray-700 dark:text-gray-300">{{ permission.name }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<InputError class="mt-2" :message="form.errors.permissions" />
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
<PrimaryButton :disabled="form.processing">Enregistrer</PrimaryButton>
|
||||
<Link :href="route('roles.index')" class="text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 underline">Annuler</Link>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AuthenticatedLayout>
|
||||
</template>
|
||||
Reference in New Issue
Block a user