initial commit
This commit is contained in:
commit
4fc3bb0a01
202 changed files with 41729 additions and 0 deletions
72
resources/js/Pages/Admin/Permission/Create.vue
Normal file
72
resources/js/Pages/Admin/Permission/Create.vue
Normal file
|
@ -0,0 +1,72 @@
|
|||
<script setup>
|
||||
import { Head, Link, useForm } from "@inertiajs/vue3"
|
||||
import {
|
||||
mdiAccountKey,
|
||||
mdiArrowLeftBoldOutline
|
||||
} from "@mdi/js"
|
||||
import LayoutAuthenticated from "@/Layouts/LayoutAuthenticated.vue"
|
||||
import SectionMain from "@/Components/SectionMain.vue"
|
||||
import SectionTitleLineWithButton from "@/Components/SectionTitleLineWithButton.vue"
|
||||
import CardBox from "@/Components/CardBox.vue"
|
||||
import FormField from '@/Components/FormField.vue'
|
||||
import FormControl from '@/Components/FormControl.vue'
|
||||
import BaseButton from '@/Components/BaseButton.vue'
|
||||
import BaseButtons from '@/Components/BaseButtons.vue'
|
||||
|
||||
const form = useForm({
|
||||
name: '',
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<LayoutAuthenticated>
|
||||
<Head title="Create permission" />
|
||||
<SectionMain>
|
||||
<SectionTitleLineWithButton
|
||||
:icon="mdiAccountKey"
|
||||
title="Add permission"
|
||||
main
|
||||
>
|
||||
<BaseButton
|
||||
:route-name="route('permission.index')"
|
||||
:icon="mdiArrowLeftBoldOutline"
|
||||
label="Back"
|
||||
color="white"
|
||||
rounded-full
|
||||
small
|
||||
/>
|
||||
</SectionTitleLineWithButton>
|
||||
<CardBox
|
||||
form
|
||||
@submit.prevent="form.post(route('permission.store'))"
|
||||
>
|
||||
<FormField
|
||||
label="Name"
|
||||
:class="{ 'text-red-400': form.errors.name }"
|
||||
>
|
||||
<FormControl
|
||||
v-model="form.name"
|
||||
type="text"
|
||||
placeholder="Enter Name"
|
||||
:error="form.errors.name"
|
||||
>
|
||||
<div class="text-red-400 text-sm" v-if="form.errors.name">
|
||||
{{ form.errors.name }}
|
||||
</div>
|
||||
</FormControl>
|
||||
</FormField>
|
||||
<template #footer>
|
||||
<BaseButtons>
|
||||
<BaseButton
|
||||
type="submit"
|
||||
color="info"
|
||||
label="Submit"
|
||||
:class="{ 'opacity-25': form.processing }"
|
||||
:disabled="form.processing"
|
||||
/>
|
||||
</BaseButtons>
|
||||
</template>
|
||||
</CardBox>
|
||||
</SectionMain>
|
||||
</LayoutAuthenticated>
|
||||
</template>
|
80
resources/js/Pages/Admin/Permission/Edit.vue
Normal file
80
resources/js/Pages/Admin/Permission/Edit.vue
Normal file
|
@ -0,0 +1,80 @@
|
|||
<script setup>
|
||||
import { Head, Link, useForm } from "@inertiajs/vue3"
|
||||
import {
|
||||
mdiAccountKey,
|
||||
mdiArrowLeftBoldOutline
|
||||
} from "@mdi/js"
|
||||
import LayoutAuthenticated from "@/Layouts/LayoutAuthenticated.vue"
|
||||
import SectionMain from "@/Components/SectionMain.vue"
|
||||
import SectionTitleLineWithButton from "@/Components/SectionTitleLineWithButton.vue"
|
||||
import CardBox from "@/Components/CardBox.vue"
|
||||
import FormField from '@/Components/FormField.vue'
|
||||
import FormControl from '@/Components/FormControl.vue'
|
||||
import BaseButton from '@/Components/BaseButton.vue'
|
||||
import BaseButtons from '@/Components/BaseButtons.vue'
|
||||
|
||||
const props = defineProps({
|
||||
permission: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
})
|
||||
|
||||
const form = useForm({
|
||||
_method: 'put',
|
||||
name: props.permission.name,
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<LayoutAuthenticated>
|
||||
<Head title="Update permission" />
|
||||
<SectionMain>
|
||||
<SectionTitleLineWithButton
|
||||
:icon="mdiAccountKey"
|
||||
title="Update permission"
|
||||
main
|
||||
>
|
||||
<BaseButton
|
||||
:route-name="route('permission.index')"
|
||||
:icon="mdiArrowLeftBoldOutline"
|
||||
label="Back"
|
||||
color="white"
|
||||
rounded-full
|
||||
small
|
||||
/>
|
||||
</SectionTitleLineWithButton>
|
||||
<CardBox
|
||||
form
|
||||
@submit.prevent="form.post(route('permission.update', props.permission.id))"
|
||||
>
|
||||
<FormField
|
||||
label="Name"
|
||||
:class="{ 'text-red-400': form.errors.name }"
|
||||
>
|
||||
<FormControl
|
||||
v-model="form.name"
|
||||
type="text"
|
||||
placeholder="Enter Name"
|
||||
:error="form.errors.name"
|
||||
>
|
||||
<div class="text-red-400 text-sm" v-if="form.errors.name">
|
||||
{{ form.errors.name }}
|
||||
</div>
|
||||
</FormControl>
|
||||
</FormField>
|
||||
<template #footer>
|
||||
<BaseButtons>
|
||||
<BaseButton
|
||||
type="submit"
|
||||
color="info"
|
||||
label="Submit"
|
||||
:class="{ 'opacity-25': form.processing }"
|
||||
:disabled="form.processing"
|
||||
/>
|
||||
</BaseButtons>
|
||||
</template>
|
||||
</CardBox>
|
||||
</SectionMain>
|
||||
</LayoutAuthenticated>
|
||||
</template>
|
158
resources/js/Pages/Admin/Permission/Index.vue
Normal file
158
resources/js/Pages/Admin/Permission/Index.vue
Normal file
|
@ -0,0 +1,158 @@
|
|||
<script setup>
|
||||
import { Head, Link, useForm } from "@inertiajs/vue3"
|
||||
import {
|
||||
mdiAccountKey,
|
||||
mdiPlus,
|
||||
mdiSquareEditOutline,
|
||||
mdiTrashCan,
|
||||
mdiAlertBoxOutline,
|
||||
} from "@mdi/js"
|
||||
import LayoutAuthenticated from "@/Layouts/LayoutAuthenticated.vue"
|
||||
import SectionMain from "@/Components/SectionMain.vue"
|
||||
import SectionTitleLineWithButton from "@/Components/SectionTitleLineWithButton.vue"
|
||||
import BaseButton from "@/Components/BaseButton.vue"
|
||||
import CardBox from "@/Components/CardBox.vue"
|
||||
import BaseButtons from "@/Components/BaseButtons.vue"
|
||||
import NotificationBar from "@/Components/NotificationBar.vue"
|
||||
import Pagination from "@/Components/Admin/Pagination.vue"
|
||||
import Sort from "@/Components/Admin/Sort.vue"
|
||||
|
||||
const props = defineProps({
|
||||
permissions: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
filters: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
can: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
})
|
||||
|
||||
const form = useForm({
|
||||
search: props.filters.search,
|
||||
})
|
||||
|
||||
const formDelete = useForm({})
|
||||
|
||||
function destroy(id) {
|
||||
if (confirm("Are you sure you want to delete?")) {
|
||||
formDelete.delete(route("permission.destroy", id))
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<LayoutAuthenticated>
|
||||
<Head title="Permissions" />
|
||||
<SectionMain>
|
||||
<SectionTitleLineWithButton
|
||||
:icon="mdiAccountKey"
|
||||
title="Permissions"
|
||||
main
|
||||
>
|
||||
<BaseButton
|
||||
v-if="can.delete"
|
||||
:route-name="route('permission.create')"
|
||||
:icon="mdiPlus"
|
||||
label="Add"
|
||||
color="info"
|
||||
rounded-full
|
||||
small
|
||||
/>
|
||||
</SectionTitleLineWithButton>
|
||||
<NotificationBar
|
||||
v-if="$page.props.flash.message"
|
||||
color="success"
|
||||
:icon="mdiAlertBoxOutline"
|
||||
>
|
||||
{{ $page.props.flash.message }}
|
||||
</NotificationBar>
|
||||
<CardBox class="mb-6" has-table>
|
||||
<form @submit.prevent="form.get(route('permission.index'))">
|
||||
<div class="py-2 flex">
|
||||
<div class="flex pl-4">
|
||||
<input
|
||||
type="search"
|
||||
v-model="form.search"
|
||||
class="
|
||||
rounded-md
|
||||
shadow-sm
|
||||
border-gray-300
|
||||
focus:border-indigo-300
|
||||
focus:ring
|
||||
focus:ring-indigo-200
|
||||
focus:ring-opacity-50
|
||||
"
|
||||
placeholder="Search"
|
||||
/>
|
||||
<BaseButton
|
||||
label="Search"
|
||||
type="submit"
|
||||
color="info"
|
||||
class="ml-4 inline-flex items-center px-4 py-2"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</CardBox>
|
||||
<CardBox class="mb-6" has-table>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<Sort label="Name" attribute="name" />
|
||||
</th>
|
||||
<th v-if="can.edit || can.delete">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr v-for="permission in permissions.data" :key="permission.id">
|
||||
<td data-label="Name">
|
||||
<Link
|
||||
:href="route('permission.show', permission.id)"
|
||||
class="
|
||||
no-underline
|
||||
hover:underline
|
||||
text-cyan-600
|
||||
dark:text-cyan-400
|
||||
"
|
||||
>
|
||||
{{ permission.name }}
|
||||
</Link>
|
||||
</td>
|
||||
<td
|
||||
v-if="can.edit || can.delete"
|
||||
class="before:hidden lg:w-1 whitespace-nowrap"
|
||||
>
|
||||
<BaseButtons type="justify-start lg:justify-end" no-wrap>
|
||||
<BaseButton
|
||||
v-if="can.edit"
|
||||
:route-name="route('permission.edit', permission.id)"
|
||||
color="info"
|
||||
:icon="mdiSquareEditOutline"
|
||||
small
|
||||
/>
|
||||
<BaseButton
|
||||
v-if="can.delete"
|
||||
color="danger"
|
||||
:icon="mdiTrashCan"
|
||||
small
|
||||
@click="destroy(permission.id)"
|
||||
/>
|
||||
</BaseButtons>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="py-4">
|
||||
<Pagination :data="permissions" />
|
||||
</div>
|
||||
</CardBox>
|
||||
</SectionMain>
|
||||
</LayoutAuthenticated>
|
||||
</template>
|
81
resources/js/Pages/Admin/Permission/Show.vue
Normal file
81
resources/js/Pages/Admin/Permission/Show.vue
Normal file
|
@ -0,0 +1,81 @@
|
|||
<script setup>
|
||||
import { Head, Link, useForm } from "@inertiajs/vue3"
|
||||
import {
|
||||
mdiAccountKey,
|
||||
mdiArrowLeftBoldOutline,
|
||||
} from "@mdi/js"
|
||||
import LayoutAuthenticated from "@/Layouts/LayoutAuthenticated.vue"
|
||||
import SectionMain from "@/Components/SectionMain.vue"
|
||||
import SectionTitleLineWithButton from "@/Components/SectionTitleLineWithButton.vue"
|
||||
import CardBox from "@/Components/CardBox.vue"
|
||||
import BaseButton from "@/Components/BaseButton.vue"
|
||||
|
||||
const props = defineProps({
|
||||
permission: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<LayoutAuthenticated>
|
||||
<Head title="View permission" />
|
||||
<SectionMain>
|
||||
<SectionTitleLineWithButton
|
||||
:icon="mdiAccountKey"
|
||||
title="View permission"
|
||||
main
|
||||
>
|
||||
<BaseButton
|
||||
:route-name="route('permission.index')"
|
||||
:icon="mdiArrowLeftBoldOutline"
|
||||
label="Back"
|
||||
color="white"
|
||||
rounded-full
|
||||
small
|
||||
/>
|
||||
</SectionTitleLineWithButton>
|
||||
<CardBox class="mb-6">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td
|
||||
class="
|
||||
p-4
|
||||
pl-8
|
||||
text-slate-500
|
||||
dark:text-slate-400
|
||||
hidden
|
||||
lg:block
|
||||
"
|
||||
>
|
||||
Name
|
||||
</td>
|
||||
<td data-label="Name">
|
||||
{{ permission.name }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td
|
||||
class="
|
||||
p-4
|
||||
pl-8
|
||||
text-slate-500
|
||||
dark:text-slate-400
|
||||
hidden
|
||||
lg:block
|
||||
"
|
||||
>
|
||||
Created
|
||||
</td>
|
||||
<td data-label="Created">
|
||||
{{ new Date(permission.created_at).toLocaleString() }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</CardBox>
|
||||
</SectionMain>
|
||||
</LayoutAuthenticated>
|
||||
</template>
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue