refac: documents -> projects
This commit is contained in:
@@ -3,50 +3,46 @@
|
||||
import { onMount, tick, getContext } from 'svelte';
|
||||
import { openDB, deleteDB } from 'idb';
|
||||
import fileSaver from 'file-saver';
|
||||
const { saveAs } = fileSaver;
|
||||
import mermaid from 'mermaid';
|
||||
|
||||
const { saveAs } = fileSaver;
|
||||
|
||||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
import { getProjects } from '$lib/apis/projects';
|
||||
import { getFunctions } from '$lib/apis/functions';
|
||||
import { getModels as _getModels, getVersionUpdates } from '$lib/apis';
|
||||
import { getAllChatTags } from '$lib/apis/chats';
|
||||
|
||||
import { getPrompts } from '$lib/apis/prompts';
|
||||
import { getDocs } from '$lib/apis/documents';
|
||||
import { getTools } from '$lib/apis/tools';
|
||||
|
||||
import { getBanners } from '$lib/apis/configs';
|
||||
import { getUserSettings } from '$lib/apis/users';
|
||||
|
||||
import {
|
||||
user,
|
||||
showSettings,
|
||||
settings,
|
||||
models,
|
||||
prompts,
|
||||
documents,
|
||||
tags,
|
||||
banners,
|
||||
showChangelog,
|
||||
config,
|
||||
showCallOverlay,
|
||||
tools,
|
||||
functions,
|
||||
temporaryChatEnabled
|
||||
} from '$lib/stores';
|
||||
|
||||
import SettingsModal from '$lib/components/chat/SettingsModal.svelte';
|
||||
import Sidebar from '$lib/components/layout/Sidebar.svelte';
|
||||
import ChangelogModal from '$lib/components/ChangelogModal.svelte';
|
||||
import AccountPending from '$lib/components/layout/Overlay/AccountPending.svelte';
|
||||
import { getFunctions } from '$lib/apis/functions';
|
||||
import { page } from '$app/stores';
|
||||
import { WEBUI_VERSION } from '$lib/constants';
|
||||
import { compareVersion } from '$lib/utils';
|
||||
|
||||
import {
|
||||
config,
|
||||
user,
|
||||
settings,
|
||||
models,
|
||||
prompts,
|
||||
projects,
|
||||
tools,
|
||||
functions,
|
||||
tags,
|
||||
banners,
|
||||
showSettings,
|
||||
showChangelog,
|
||||
temporaryChatEnabled
|
||||
} from '$lib/stores';
|
||||
|
||||
import Sidebar from '$lib/components/layout/Sidebar.svelte';
|
||||
import SettingsModal from '$lib/components/chat/SettingsModal.svelte';
|
||||
import ChangelogModal from '$lib/components/ChangelogModal.svelte';
|
||||
import AccountPending from '$lib/components/layout/Overlay/AccountPending.svelte';
|
||||
import UpdateInfoToast from '$lib/components/layout/UpdateInfoToast.svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
@@ -109,7 +105,7 @@
|
||||
prompts.set(await getPrompts(localStorage.token));
|
||||
})(),
|
||||
(async () => {
|
||||
documents.set(await getDocs(localStorage.token));
|
||||
projects.set(await getProjects(localStorage.token));
|
||||
})(),
|
||||
(async () => {
|
||||
tools.set(await getTools(localStorage.token));
|
||||
|
||||
@@ -69,14 +69,12 @@
|
||||
>
|
||||
|
||||
<a
|
||||
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname.includes(
|
||||
'/workspace/documents'
|
||||
)
|
||||
class="min-w-fit rounded-lg p-1.5 px-3 {$page.url.pathname.includes('/workspace/projects')
|
||||
? 'bg-gray-50 dark:bg-gray-850'
|
||||
: ''} transition"
|
||||
href="/workspace/documents"
|
||||
href="/workspace/projects"
|
||||
>
|
||||
{$i18n.t('Documents')}
|
||||
{$i18n.t('Projects')}
|
||||
</a>
|
||||
|
||||
<a
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<script>
|
||||
import Documents from '$lib/components/workspace/Documents.svelte';
|
||||
</script>
|
||||
|
||||
<Documents />
|
||||
5
src/routes/(app)/workspace/projects/+page.svelte
Normal file
5
src/routes/(app)/workspace/projects/+page.svelte
Normal file
@@ -0,0 +1,5 @@
|
||||
<script>
|
||||
import Projects from '$lib/components/workspace/Projects.svelte';
|
||||
</script>
|
||||
|
||||
<Projects />
|
||||
5
src/routes/(app)/workspace/projects/create/+page.svelte
Normal file
5
src/routes/(app)/workspace/projects/create/+page.svelte
Normal file
@@ -0,0 +1,5 @@
|
||||
<script>
|
||||
import CreateProject from '$lib/components/workspace/Projects/CreateProject.svelte';
|
||||
</script>
|
||||
|
||||
<CreateProject />
|
||||
5
src/routes/(app)/workspace/projects/edit/+page.svelte
Normal file
5
src/routes/(app)/workspace/projects/edit/+page.svelte
Normal file
@@ -0,0 +1,5 @@
|
||||
<script>
|
||||
import EditProject from '$lib/components/workspace/Projects/EditProject.svelte';
|
||||
</script>
|
||||
|
||||
<EditProject />
|
||||
Reference in New Issue
Block a user