refac
This commit is contained in:
@@ -30,24 +30,6 @@
|
||||
await goto('/');
|
||||
}
|
||||
|
||||
await Promise.all([
|
||||
(async () => {
|
||||
models.set(await getModels(localStorage.token));
|
||||
})(),
|
||||
(async () => {
|
||||
knowledge.set(await getKnowledgeItems(localStorage.token));
|
||||
})(),
|
||||
(async () => {
|
||||
prompts.set(await getPrompts(localStorage.token));
|
||||
})(),
|
||||
(async () => {
|
||||
tools.set(await getTools(localStorage.token));
|
||||
})(),
|
||||
(async () => {
|
||||
functions.set(await getFunctions(localStorage.token));
|
||||
})()
|
||||
]);
|
||||
|
||||
loaded = true;
|
||||
});
|
||||
</script>
|
||||
@@ -136,7 +118,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" pb-1 px-[18px] flex-1 max-h-full overflow-y-auto" id="workspace-container">
|
||||
<div class=" -mt-1 pb-1 px-[18px] flex-1 max-h-full overflow-y-auto" id="workspace-container">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { functions } from '$lib/stores';
|
||||
|
||||
import { getFunctions } from '$lib/apis/functions';
|
||||
import Functions from '$lib/components/workspace/Functions.svelte';
|
||||
|
||||
onMount(async () => {
|
||||
await Promise.all([
|
||||
(async () => {
|
||||
functions.set(await getFunctions(localStorage.token));
|
||||
})()
|
||||
]);
|
||||
});
|
||||
</script>
|
||||
|
||||
<Functions />
|
||||
{#if $functions !== null}
|
||||
<Functions />
|
||||
{/if}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { knowledge } from '$lib/stores';
|
||||
|
||||
import { getKnowledgeItems } from '$lib/apis/knowledge';
|
||||
import Knowledge from '$lib/components/workspace/Knowledge.svelte';
|
||||
|
||||
onMount(async () => {
|
||||
await Promise.all([
|
||||
(async () => {
|
||||
knowledge.set(await getKnowledgeItems(localStorage.token));
|
||||
})()
|
||||
]);
|
||||
});
|
||||
</script>
|
||||
|
||||
<Knowledge />
|
||||
{#if $knowledge !== null}
|
||||
<Knowledge />
|
||||
{/if}
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { models } from '$lib/stores';
|
||||
import { getModels } from '$lib/apis';
|
||||
import Models from '$lib/components/workspace/Models.svelte';
|
||||
|
||||
onMount(async () => {
|
||||
await Promise.all([
|
||||
(async () => {
|
||||
models.set(await getModels(localStorage.token));
|
||||
})()
|
||||
]);
|
||||
});
|
||||
</script>
|
||||
|
||||
<Models />
|
||||
{#if $models !== null}
|
||||
<Models />
|
||||
{/if}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { prompts } from '$lib/stores';
|
||||
|
||||
import { getPrompts } from '$lib/apis/prompts';
|
||||
import Prompts from '$lib/components/workspace/Prompts.svelte';
|
||||
|
||||
onMount(async () => {
|
||||
await Promise.all([
|
||||
(async () => {
|
||||
prompts.set(await getPrompts(localStorage.token));
|
||||
})()
|
||||
]);
|
||||
});
|
||||
</script>
|
||||
|
||||
<Prompts />
|
||||
{#if $prompts !== null}
|
||||
<Prompts />
|
||||
{/if}
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { tools } from '$lib/stores';
|
||||
|
||||
import { getTools } from '$lib/apis/tools';
|
||||
import Tools from '$lib/components/workspace/Tools.svelte';
|
||||
|
||||
onMount(async () => {
|
||||
await Promise.all([
|
||||
(async () => {
|
||||
tools.set(await getTools(localStorage.token));
|
||||
})()
|
||||
]);
|
||||
});
|
||||
</script>
|
||||
|
||||
<Tools />
|
||||
{#if $tools !== null}
|
||||
<Tools />
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user