-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
240 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<template> | ||
<span class="rounded-md bg-indigo-500 text-indigo-200 px-2 py-2 "> | ||
<span class="font-bold"><slot name="title"></slot>: </span> | ||
<slot></slot> | ||
</span> | ||
</template> | ||
<script setup> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<template> | ||
<TransitionRoot as="template" :show="open"> | ||
<Dialog as="div" class="relative z-10" @close="open = false"> | ||
<div class="fixed inset-0" /> | ||
|
||
<div class="fixed inset-0 overflow-hidden"> | ||
<div class="absolute inset-0 overflow-hidden"> | ||
<div class="pointer-events-none fixed inset-y-0 right-0 flex max-w-full pl-10 sm:pl-16"> | ||
<TransitionChild as="template" enter="transform transition ease-in-out duration-500 sm:duration-700" enter-from="translate-x-full" enter-to="translate-x-0" leave="transform transition ease-in-out duration-500 sm:duration-700" leave-from="translate-x-0" leave-to="translate-x-full"> | ||
<DialogPanel class="pointer-events-auto w-screen max-w-2xl"> | ||
<div class="flex h-full flex-col overflow-y-scroll | ||
text-gray-200 dark:text-gray-400 | ||
bg-white border-b border-gray-100 dark:border-gray-700 py-6 shadow-xl"> | ||
<div class="px-4 sm:px-6"> | ||
<div class="flex items-start justify-between"> | ||
<DialogTitle class="text-base font-semibold leading-6">Create your Collection so you can start adding data to it</DialogTitle> | ||
<div class="ml-3 flex h-7 items-center"> | ||
<button | ||
type="button" class="relative rounded-md bg-white focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2" | ||
@click="closeSlideOut()"> | ||
<span class="absolute -inset-2.5" /> | ||
<span class="sr-only">Close panel</span> | ||
<XMarkIcon class="h-6 w-6" aria-hidden="true" /> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="relative mt-6 flex-1 px-4 sm:px-6"> | ||
<form @submit.prevent="submit()"> | ||
<ResourceForm v-model="form" /> | ||
|
||
<div class="mt-8 flex justify-between"> | ||
|
||
<PrimaryButton type="submit" class="ms-3"> | ||
Save | ||
</PrimaryButton> | ||
<SecondaryButton type="button" @click="closeSlideOut()"> | ||
Cancel | ||
</SecondaryButton> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</DialogPanel> | ||
</TransitionChild> | ||
</div> | ||
</div> | ||
</div> | ||
</Dialog> | ||
</TransitionRoot> | ||
</template> | ||
|
||
|
||
<script setup> | ||
import InputError from '@/Components/InputError.vue'; | ||
import InputLabel from '@/Components/InputLabel.vue'; | ||
import PrimaryButton from '@/Components/PrimaryButton.vue'; | ||
import SecondaryButton from '@/Components/SecondaryButton.vue'; | ||
import TextInput from '@/Components/TextInput.vue'; | ||
import { computed, inject, onMounted, ref, watch } from 'vue' | ||
import { Dialog, DialogPanel, DialogTitle, TransitionChild, TransitionRoot } from '@headlessui/vue' | ||
import { XMarkIcon } from '@heroicons/vue/24/outline' | ||
import { Head, Link, useForm } from '@inertiajs/vue3'; | ||
import ResourceForm from './Components/ResourceForm.vue'; | ||
const props = defineProps({ | ||
collection: Object, | ||
open: Boolean, | ||
}); | ||
const emit = defineEmits(['closing']) | ||
const closeSlideOut = () => { | ||
emit('closing') | ||
} | ||
const form = useForm({ | ||
name: props.collection.name, | ||
driver: props.collection.driver, | ||
embedding_driver: props.collection.embedding_driver, | ||
description: props.collection.description, | ||
}) | ||
onMounted(() => { | ||
form.reset() | ||
console.log(props.collection) | ||
}) | ||
const submit = () => { | ||
form.put(route('collections.update', { | ||
collection: props.collection.id | ||
}), { | ||
onSuccess: () => { | ||
closeSlideOut() | ||
} | ||
}) | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters