- second commit

This commit is contained in:
Kaimbacher 2023-03-17 16:13:37 +01:00
parent 4fc3bb0a01
commit 59a99ff3c8
61 changed files with 2625 additions and 1182 deletions

View file

@ -1,6 +1,7 @@
<script setup>
<script setup lang="ts">
// import { Head, Link, useForm } from '@inertiajs/inertia-vue3';
import { Head, Link, useForm, router } from '@inertiajs/vue3';
import { useForm } from '@inertiajs/vue3';
// import { reactive } from 'vue';
import {
mdiAccount,
mdiAccountCircle,
@ -9,7 +10,7 @@ import {
mdiAsterisk,
mdiFormTextboxPassword,
mdiArrowLeftBoldOutline,
mdiAlertBoxOutline,
// mdiAlertBoxOutline,
} from '@mdi/js';
import SectionMain from '@/Components/SectionMain.vue';
import CardBox from '@/Components/CardBox.vue';
@ -18,7 +19,7 @@ import FormField from '@/Components/FormField.vue';
import FormControl from '@/Components/FormControl.vue';
import BaseButton from '@/Components/BaseButton.vue';
import BaseButtons from '@/Components/BaseButtons.vue';
import NotificationBar from '@/Components/NotificationBar.vue';
// import NotificationBar from '@/Components/NotificationBar.vue';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
import { stardust } from '@eidellev/adonis-stardust/client';
@ -41,16 +42,16 @@ const profileForm = useForm({
email: props.user.email,
});
const profileSubmit = async () => {
await router.post(stardust.route('admin.account.info.store', [props.user.id]), profileForm);
await profileForm.post(stardust.route('admin.account.info.store', [props.user.id]));
};
const passwordForm = useForm({
old_password: null,
new_password: null,
confirm_password: null,
old_password: "",
new_password: "",
confirm_password: "",
});
const passwordSubmit = async () => {
await router.post(stardust.route('admin.account.info.store'), passwordForm, {
await passwordForm.post(stardust.route('admin.account.info.store'), {
preserveScroll: true,
onSuccess: (resp) => {
console.log(resp);
@ -68,9 +69,9 @@ const passwordSubmit = async () => {
rounded-full small />
</SectionTitleLineWithButton>
<NotificationBar v-if="$page.props.flash.message" color="success" :icon="mdiAlertBoxOutline">
<!-- <NotificationBar v-if="$page.props.flash.message" color="success" :icon="mdiAlertBoxOutline">
{{ $page.props.flash.message }}
</NotificationBar>
</NotificationBar> -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">

View file

@ -1,5 +1,5 @@
<script setup>
import { Head, Link, useForm, router } from '@inertiajs/vue3';
<script setup lang="ts">
import { Head, useForm, router } from '@inertiajs/vue3';
import { mdiAccountKey, mdiArrowLeftBoldOutline } from '@mdi/js';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionMain from '@/Components/SectionMain.vue';
@ -45,11 +45,11 @@ const submit = async () => {
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="Add user" main>
<BaseButton :route-name="stardust.route('user.index')" :icon="mdiArrowLeftBoldOutline" label="Back"
color="white" rounded-full small />
color="modern" rounded-full small />
</SectionTitleLineWithButton>
<!-- @submit.prevent="form.post(stardust.route('user.store'))" -->
<CardBox form @submit.prevent="submit()">
<FormField label="Login" :class="{ 'text-red-400': errors.name }">
<FormField label="Login" :class="{ 'text-red-400': errors.login }">
<FormControl v-model="form.login" type="text" placeholder="Enter Login" :errors="errors.login">
<div class="text-red-400 text-sm" v-if="errors.login && Array.isArray(errors.login)">
<!-- {{ errors.login }} -->

View file

@ -1,5 +1,5 @@
<script setup>
import { Head, Link, useForm, router } from "@inertiajs/vue3"
<script setup lang="ts">
import { Head, useForm, router } from "@inertiajs/vue3"
import {
mdiAccountKey,
mdiArrowLeftBoldOutline

View file

@ -1,6 +1,7 @@
<script setup>
<script setup lang="ts">
// import { Head, Link, useForm, usePage } from '@inertiajs/inertia-vue3';
import { Head, Link, useForm, usePage } from '@inertiajs/vue3';
import { ComputedRef } from 'vue';
import {
mdiAccountKey,
mdiPlus,
@ -8,7 +9,7 @@ import {
mdiTrashCan,
mdiAlertBoxOutline,
} from '@mdi/js';
import { watch, computed } from 'vue';
import { computed } from 'vue';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionMain from '@/Components/SectionMain.vue';
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
@ -44,7 +45,7 @@ const props = defineProps({
// return props.filters.search;
// });
const flash = computed(() => {
const flash: ComputedRef<any> = computed(() => {
// let test = usePage();
// console.log(test);
return usePage().props.flash;
@ -73,7 +74,7 @@ const destroy = async (id) => {
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="Tethys Users" main>
<BaseButton v-if="can.create" :route-name="stardust.route('user.create')" :icon="mdiPlus" label="Add"
color="info" rounded-full small />
color="modern" rounded-full small />
</SectionTitleLineWithButton>
<!-- <label>{{ form.search }}</label> -->
<NotificationBar v-if="flash.message" color="success" :icon="mdiAlertBoxOutline">
@ -87,7 +88,7 @@ const destroy = async (id) => {
<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"
<BaseButton label="Search" type="submit" color="modern"
class="ml-4 inline-flex items-center px-4 py-2" />
</div>
</div>

View file

@ -1,92 +1,67 @@
<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"
<script setup lang="ts">
import { Head } 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';
import { stardust } from '@eidellev/adonis-stardust/client';
const props = defineProps({
user: {
type: Object,
default: () => ({}),
},
roles: {
type: Object,
default: () => ({}),
},
userHasRoles: {
type: Object,
default: () => ({}),
}
})
defineProps({
user: {
type: Object,
default: () => ({}),
},
roles: {
type: Object,
default: () => ({}),
},
userHasRoles: {
type: Object,
default: () => ({}),
},
});
</script>
<template>
<LayoutAuthenticated :user="user">
<Head title="View user" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="View user" main>
<BaseButton :route-name="stardust.route('user.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
">
Login
</td>
<td data-label="Login">
{{ user.login }}
</td>
</tr>
<tr>
<td class="
p-4
pl-8
text-slate-500
dark:text-slate-400
hidden
lg:block
">
Email
</td>
<td data-label="Email">
{{ user.email }}
</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(user.created_at).toLocaleString() }}
</td>
</tr>
</tbody>
</table>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
<LayoutAuthenticated :user="user">
<Head title="View user" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="View user" main>
<BaseButton
:route-name="stardust.route('user.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">Login</td>
<td data-label="Login">
{{ user.login }}
</td>
</tr>
<tr>
<td class="p-4 pl-8 text-slate-500 dark:text-slate-400 hidden lg:block">Email</td>
<td data-label="Email">
{{ user.email }}
</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(user.created_at).toLocaleString() }}
</td>
</tr>
</tbody>
</table>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
</template>