50 lines
1.4 KiB
Vue
50 lines
1.4 KiB
Vue
<script setup lang="ts">
|
|
import { Head, Link } from '@inertiajs/vue3';
|
|
import { ArrowLeft } from '@lucide/vue';
|
|
import RoleForm from '@/components/admin/system/roles/RoleForm.vue';
|
|
import { Button } from '@/components/ui/button';
|
|
import AdminLayout from '@/layouts/AdminLayout.vue';
|
|
|
|
interface PermissionOption {
|
|
value: string;
|
|
label: string;
|
|
group: string;
|
|
}
|
|
|
|
interface RoleData {
|
|
id: number;
|
|
name: string;
|
|
permission_names: string[];
|
|
}
|
|
|
|
const props = defineProps<{
|
|
role: RoleData;
|
|
permissions: PermissionOption[];
|
|
isProtected: boolean;
|
|
}>();
|
|
</script>
|
|
|
|
<template>
|
|
<Head title="Ubah Role" />
|
|
|
|
<AdminLayout>
|
|
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
|
<div class="space-y-1">
|
|
<h2 class="text-2xl font-bold tracking-tight">
|
|
Ubah Role
|
|
</h2>
|
|
</div>
|
|
|
|
<Button variant="outline" as-child class="shrink-0 self-start sm:self-center">
|
|
<Link href="/admin/system/roles">
|
|
<ArrowLeft class="size-4" />
|
|
Kembali
|
|
</Link>
|
|
</Button>
|
|
</div>
|
|
|
|
<RoleForm :submit-url="`/admin/system/roles/${role.id}`" method="put" submit-label="Perbarui"
|
|
:initial-data="role" :permissions="permissions" :is-protected="isProtected" />
|
|
</AdminLayout>
|
|
</template>
|