Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/js/Components/Graph/KnowledgeGraphViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ async function fetchGraph() {
const url = props.contentId
? `/api/v1/graph/node/${props.contentId}`
: `/api/v1/graph/space/${props.spaceId}`;
const xsrfToken = document.cookie.match(/XSRF-TOKEN=([^;]+)/)?.[1] ?? '';
const xsrfToken = decodeURIComponent(document.cookie.match(/XSRF-TOKEN=([^;]+)/)?.[1] ?? '');
const res = await fetch(url, {
credentials: 'same-origin',
credentials: 'include',
headers: {
'Accept': 'application/json',
'X-Requested-With': 'XMLHttpRequest',
Expand Down
3 changes: 2 additions & 1 deletion resources/js/Components/Media/MediaUploadZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ async function uploadFile(file) {
resolve({ ok: false });
});

xhr.open('POST', '/api/media');
xhr.open('POST', '/api/v1/media');
xhr.setRequestHeader('Accept', 'application/json');
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('X-XSRF-TOKEN', xsrfToken());
xhr.withCredentials = true;
xhr.send(formData);
Expand Down
1 change: 0 additions & 1 deletion resources/js/Layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const navigation = [
{ name: 'API Tokens', href: '/admin/tokens', icon: 'πŸ”‘' },
{ name: 'Webhooks', href: '/admin/webhooks', icon: 'πŸ”—' },
{ name: 'Spaces', href: '/admin/spaces', icon: '🏒' },
{ name: 'Spaces', href: '/admin/spaces', icon: '🌐' },
{ name: 'Settings', href: '/admin/settings', icon: 'βš™οΈ' },
{ name: 'Languages', href: '/admin/settings/locales', icon: '🌐' },
{ name: 'Plugins', href: '/admin/plugins', icon: '🧩' },
Expand Down
142 changes: 71 additions & 71 deletions resources/js/Pages/Admin/Spaces/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,85 +34,85 @@ watch(() => form.name, (value) => {
function submit() {
form.post('/admin/spaces')
}

defineOptions({ layout: MainLayout })
</script>

<template>
<MainLayout>
<Head title="Create Space" />
<Head title="Create Space" />

<div class="max-w-2xl mx-auto">
<div class="mb-6">
<a href="/admin/spaces" class="text-sm text-gray-400 hover:text-white transition-colors">← Back to Spaces</a>
</div>
<div class="max-w-2xl mx-auto">
<div class="mb-6">
<a href="/admin/spaces" class="text-sm text-gray-400 hover:text-white transition-colors">← Back to Spaces</a>
</div>

<h1 class="text-2xl font-bold text-white mb-6">Create Space</h1>
<h1 class="text-2xl font-bold text-white mb-6">Create Space</h1>

<form @submit.prevent="submit" class="bg-gray-900 rounded-xl border border-gray-800 p-6 space-y-5">
<!-- Name -->
<div>
<label class="block text-sm font-medium text-gray-300 mb-1.5">Name</label>
<input
v-model="form.name"
type="text"
placeholder="My Space"
class="w-full bg-gray-800 border border-gray-700 rounded-lg px-3 py-2.5 text-white placeholder-gray-500 focus:outline-none focus:border-indigo-500 transition-colors"
:class="{ 'border-red-500': form.errors.name }"
/>
<p v-if="form.errors.name" class="mt-1 text-xs text-red-400">{{ form.errors.name }}</p>
</div>
<form @submit.prevent="submit" class="bg-gray-900 rounded-xl border border-gray-800 p-6 space-y-5">
<!-- Name -->
<div>
<label class="block text-sm font-medium text-gray-300 mb-1.5">Name</label>
<input
v-model="form.name"
type="text"
placeholder="My Space"
class="w-full bg-gray-800 border border-gray-700 rounded-lg px-3 py-2.5 text-white placeholder-gray-500 focus:outline-none focus:border-indigo-500 transition-colors"
:class="{ 'border-red-500': form.errors.name }"
/>
<p v-if="form.errors.name" class="mt-1 text-xs text-red-400">{{ form.errors.name }}</p>
</div>

<!-- Slug -->
<div>
<label class="block text-sm font-medium text-gray-300 mb-1.5">Slug</label>
<input
v-model="form.slug"
type="text"
placeholder="my-space"
class="w-full bg-gray-800 border border-gray-700 rounded-lg px-3 py-2.5 text-white placeholder-gray-500 focus:outline-none focus:border-indigo-500 transition-colors font-mono text-sm"
:class="{ 'border-red-500': form.errors.slug }"
/>
<p v-if="form.errors.slug" class="mt-1 text-xs text-red-400">{{ form.errors.slug }}</p>
<p class="mt-1 text-xs text-gray-500">Auto-generated from name. Only letters, numbers, and dashes.</p>
</div>
<!-- Slug -->
<div>
<label class="block text-sm font-medium text-gray-300 mb-1.5">Slug</label>
<input
v-model="form.slug"
type="text"
placeholder="my-space"
class="w-full bg-gray-800 border border-gray-700 rounded-lg px-3 py-2.5 text-white placeholder-gray-500 focus:outline-none focus:border-indigo-500 transition-colors font-mono text-sm"
:class="{ 'border-red-500': form.errors.slug }"
/>
<p v-if="form.errors.slug" class="mt-1 text-xs text-red-400">{{ form.errors.slug }}</p>
<p class="mt-1 text-xs text-gray-500">Auto-generated from name. Only letters, numbers, and dashes.</p>
</div>

<!-- Description -->
<div>
<label class="block text-sm font-medium text-gray-300 mb-1.5">Description <span class="text-gray-500">(optional)</span></label>
<textarea
v-model="form.description"
rows="3"
placeholder="Brief description of this space..."
class="w-full bg-gray-800 border border-gray-700 rounded-lg px-3 py-2.5 text-white placeholder-gray-500 focus:outline-none focus:border-indigo-500 transition-colors resize-none"
:class="{ 'border-red-500': form.errors.description }"
/>
<p v-if="form.errors.description" class="mt-1 text-xs text-red-400">{{ form.errors.description }}</p>
</div>
<!-- Description -->
<div>
<label class="block text-sm font-medium text-gray-300 mb-1.5">Description <span class="text-gray-500">(optional)</span></label>
<textarea
v-model="form.description"
rows="3"
placeholder="Brief description of this space..."
class="w-full bg-gray-800 border border-gray-700 rounded-lg px-3 py-2.5 text-white placeholder-gray-500 focus:outline-none focus:border-indigo-500 transition-colors resize-none"
:class="{ 'border-red-500': form.errors.description }"
/>
<p v-if="form.errors.description" class="mt-1 text-xs text-red-400">{{ form.errors.description }}</p>
</div>

<!-- Default Locale -->
<div>
<label class="block text-sm font-medium text-gray-300 mb-1.5">Default Locale</label>
<select
v-model="form.default_locale"
class="w-full bg-gray-800 border border-gray-700 rounded-lg px-3 py-2.5 text-white focus:outline-none focus:border-indigo-500 transition-colors"
:class="{ 'border-red-500': form.errors.default_locale }"
>
<option v-for="locale in locales" :key="locale.value" :value="locale.value">
{{ locale.label }}
</option>
</select>
<p v-if="form.errors.default_locale" class="mt-1 text-xs text-red-400">{{ form.errors.default_locale }}</p>
</div>
<!-- Default Locale -->
<div>
<label class="block text-sm font-medium text-gray-300 mb-1.5">Default Locale</label>
<select
v-model="form.default_locale"
class="w-full bg-gray-800 border border-gray-700 rounded-lg px-3 py-2.5 text-white focus:outline-none focus:border-indigo-500 transition-colors"
:class="{ 'border-red-500': form.errors.default_locale }"
>
<option v-for="locale in locales" :key="locale.value" :value="locale.value">
{{ locale.label }}
</option>
</select>
<p v-if="form.errors.default_locale" class="mt-1 text-xs text-red-400">{{ form.errors.default_locale }}</p>
</div>

<div class="flex justify-end pt-2">
<button
type="submit"
:disabled="form.processing"
class="px-5 py-2.5 bg-indigo-600 hover:bg-indigo-700 disabled:opacity-50 text-white text-sm font-medium rounded-lg transition-colors"
>
{{ form.processing ? 'Creating...' : 'Create Space' }}
</button>
</div>
</form>
</div>
</MainLayout>
<div class="flex justify-end pt-2">
<button
type="submit"
:disabled="form.processing"
class="px-5 py-2.5 bg-indigo-600 hover:bg-indigo-700 disabled:opacity-50 text-white text-sm font-medium rounded-lg transition-colors"
>
{{ form.processing ? 'Creating...' : 'Create Space' }}
</button>
</div>
</form>
</div>
</template>
Loading
Loading