fixes
This commit is contained in:
1 parent
0bb8d1cb46
commit
f1b176ae4a
18 files changed
+29
-43
No files matched your search
Binary file not shown.
@@ -3,9 +3,8 @@
|
|||||||
import Menu from "$lib/components/Menu.svelte"
|
import Menu from "$lib/components/Menu.svelte"
|
||||||
import { logout } from "$lib/state/auth.svelte"
|
import { logout } from "$lib/state/auth.svelte"
|
||||||
import logo from "$lib/assets/logo-txt.png"
|
import logo from "$lib/assets/logo-txt.png"
|
||||||
import { space } from '$lib/state/space.svelte'
|
|
||||||
|
|
||||||
let {spaceid, handleMenuDesktop, handleMenuMobile} = $props();
|
let {spaces, spaceid, handleMenuDesktop, handleMenuMobile} = $props();
|
||||||
|
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
logout()
|
logout()
|
||||||
@@ -30,7 +29,7 @@
|
|||||||
<div class="m-2">
|
<div class="m-2">
|
||||||
<div class="formelement">
|
<div class="formelement">
|
||||||
<select class="textinput">
|
<select class="textinput">
|
||||||
{#each space.spaces as s (s.id)}
|
{#each spaces as s (s.id)}
|
||||||
<option value={s.id}>{s.label}</option>
|
<option value={s.id}>{s.label}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import type { Team } from "$lib/types/api"
|
import type { Team } from "$lib/types/api"
|
||||||
|
|
||||||
export const space = $state({
|
export const space = $state({
|
||||||
spaces: [] as Team[]
|
spaces: [] as Team[],
|
||||||
|
current: "",
|
||||||
});
|
});
|
||||||
@@ -41,7 +41,6 @@
|
|||||||
handleResize()
|
handleResize()
|
||||||
if (data.me) {
|
if (data.me) {
|
||||||
auth.user = data.me.user
|
auth.user = data.me.user
|
||||||
space.spaces = data.me.teams
|
|
||||||
themeToLocalStorage(auth.user.theme)
|
themeToLocalStorage(auth.user.theme)
|
||||||
applyTheme()
|
applyTheme()
|
||||||
auth.status = 'authenticated'
|
auth.status = 'authenticated'
|
||||||
@@ -61,12 +60,13 @@
|
|||||||
<svelte:window onresize={handleResize} />
|
<svelte:window onresize={handleResize} />
|
||||||
|
|
||||||
<div id="outer" class={[uiState.sidebarDesktopOpen ? "desktopMenuOpen" : "desktopMenuClosed", uiState.sidebarMobileOpen ? "mobileMenuOpen" : "mobileMenuClosed" ]}>
|
<div id="outer" class={[uiState.sidebarDesktopOpen ? "desktopMenuOpen" : "desktopMenuClosed", uiState.sidebarMobileOpen ? "mobileMenuOpen" : "mobileMenuClosed" ]}>
|
||||||
<div id="sidebar" class="flex flex-col">
|
<div id="sidebar" class="flex flex-col z-10">
|
||||||
<Sidebar spaceid={data.spaceid} {handleMenuDesktop} {handleMenuMobile}/>
|
<Sidebar spaces={space.spaces} spaceid={data.spaceid} {handleMenuDesktop} {handleMenuMobile}/>
|
||||||
</div>
|
</div>
|
||||||
<div id="main">
|
<div id="main">
|
||||||
<div class="flex flex-col h-screen ">
|
<div class="flex flex-col h-screen ">
|
||||||
<div class={["header", "container" , page.data.theme]}>
|
<div class="px-2">
|
||||||
|
<div class="header container">
|
||||||
<h1 class="flex">
|
<h1 class="flex">
|
||||||
<span class="flex-1">{page.data.title}</span>
|
<span class="flex-1">{page.data.title}</span>
|
||||||
{#if page.data.back}
|
{#if page.data.back}
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="overflow-scroll flex-1 p-2">
|
<div class="overflow-scroll flex-1 p-2">
|
||||||
{@render children()}
|
{@render children()}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
import { userApi } from "$lib/api/endpoints/user"
|
import { userApi } from "$lib/api/endpoints/user"
|
||||||
import type { LayoutLoad } from './$types';
|
import type { LayoutLoad } from './$types';
|
||||||
|
import { space } from '$lib/state/space.svelte'
|
||||||
|
|
||||||
|
export const load: LayoutLoad = async () => {
|
||||||
|
const me = await userApi.me()
|
||||||
|
space.spaces = me.teams
|
||||||
|
if (!space.current) {
|
||||||
|
space.current = space.spaces[0].id
|
||||||
|
}
|
||||||
|
|
||||||
export const load: LayoutLoad = async ({params}) => {
|
|
||||||
return {
|
return {
|
||||||
spaceid: params.space,
|
spaceid: space.current,
|
||||||
me: await userApi.me()
|
me: me,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageProps } from './$types';
|
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
|
import { space } from '$lib/state/space.svelte'
|
||||||
|
|
||||||
let { data }: PageProps = $props();
|
goto(`/${space.current}/`, { replaceState: true });
|
||||||
|
|
||||||
goto(`/${data.me.teams[0].id}/`, { replaceState: true });
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -1,8 +1,4 @@
|
|||||||
<script lang="ts">
|
<div class="container grid grid-cols-[repeat(auto-fit,minmax(250px, 1fr))] gap-4">
|
||||||
import { space } from '$lib/state/space.svelte'
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container grid grid-cols-[repeat(auto-fit,minmax(250px,1fr))] gap-4">
|
|
||||||
|
|
||||||
<a class="bt p-5 text-center"
|
<a class="bt p-5 text-center"
|
||||||
title="Modèles"
|
title="Modèles"
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export function load() {
|
export function load() {
|
||||||
return { title: 'Paramétrage', theme: "settings" };
|
return { title: 'Paramétrage' };
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,6 @@ export const load: PageLoad = async ({ params }) => {
|
|||||||
return {
|
return {
|
||||||
title: 'Paramétrage : Agents',
|
title: 'Paramétrage : Agents',
|
||||||
back: "../settings",
|
back: "../settings",
|
||||||
theme: "settings",
|
|
||||||
space: params.space,
|
space: params.space,
|
||||||
agents: await agentApi.getAgents(params.space),
|
agents: await agentApi.getAgents(params.space),
|
||||||
providersModels: await providerApi.getProvidersModels(params.space),
|
providersModels: await providerApi.getProvidersModels(params.space),
|
||||||
|
|||||||
@@ -59,9 +59,10 @@ const handleCancel = (e: Event) => {
|
|||||||
<div class="formelement">
|
<div class="formelement">
|
||||||
<label for="systemPrompt">Prompt système</label>
|
<label for="systemPrompt">Prompt système</label>
|
||||||
<textarea
|
<textarea
|
||||||
|
rows="10"
|
||||||
id="systemPrompt"
|
id="systemPrompt"
|
||||||
bind:value={item.systemPrompt}
|
bind:value={item.systemPrompt}
|
||||||
class="textinput"
|
class="areainput"
|
||||||
placeholder="prompt système"
|
placeholder="prompt système"
|
||||||
></textarea>
|
></textarea>
|
||||||
<FormError key="baseUrl" errors={errors} />
|
<FormError key="baseUrl" errors={errors} />
|
||||||
@@ -79,7 +80,6 @@ const handleCancel = (e: Event) => {
|
|||||||
|
|
||||||
|
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<span>{item._version}</span>
|
|
||||||
<button type="button" class="bt" onclick={handleCancel}>Annuler</button>
|
<button type="button" class="bt" onclick={handleCancel}>Annuler</button>
|
||||||
<button type="submit" class="bt mx-4">Enregistrer</button>
|
<button type="submit" class="bt mx-4">Enregistrer</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,6 +2,5 @@ export function load() {
|
|||||||
return {
|
return {
|
||||||
title: 'Paramétrage : Canaux de communication',
|
title: 'Paramétrage : Canaux de communication',
|
||||||
back: "/settings",
|
back: "/settings",
|
||||||
theme: "settings"
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,5 @@ export function load() {
|
|||||||
return {
|
return {
|
||||||
title: 'Paramétrage : Base de connaissance',
|
title: 'Paramétrage : Base de connaissance',
|
||||||
back: "/settings",
|
back: "/settings",
|
||||||
theme: "settings"
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,5 @@ export function load() {
|
|||||||
return {
|
return {
|
||||||
title: 'Paramétrage : Mémoire',
|
title: 'Paramétrage : Mémoire',
|
||||||
back: "/settings",
|
back: "/settings",
|
||||||
theme: "settings"
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,6 @@ export const load: PageLoad = async ({params}) => {
|
|||||||
return {
|
return {
|
||||||
title: 'Paramétrage : Modèles',
|
title: 'Paramétrage : Modèles',
|
||||||
back: "../settings",
|
back: "../settings",
|
||||||
theme: "settings",
|
|
||||||
space: params.space,
|
space: params.space,
|
||||||
providerTypes: await providerApi.providerTypes(),
|
providerTypes: await providerApi.providerTypes(),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,5 @@ export function load() {
|
|||||||
return {
|
return {
|
||||||
title: 'Paramétrage : Skills',
|
title: 'Paramétrage : Skills',
|
||||||
back: "/settings",
|
back: "/settings",
|
||||||
theme: "settings"
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,5 @@ export function load() {
|
|||||||
return {
|
return {
|
||||||
title: 'Paramétrage : Outils',
|
title: 'Paramétrage : Outils',
|
||||||
back: "/settings",
|
back: "/settings",
|
||||||
theme: "settings"
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,5 @@ export function load() {
|
|||||||
return {
|
return {
|
||||||
title: 'Paramétrage : Utilisateurs',
|
title: 'Paramétrage : Utilisateurs',
|
||||||
back: "/settings",
|
back: "/settings",
|
||||||
theme: "settings"
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -41,18 +41,6 @@ h2 {
|
|||||||
|
|
||||||
.header {
|
.header {
|
||||||
@apply py-2 text-lg font-bold;
|
@apply py-2 text-lg font-bold;
|
||||||
|
|
||||||
/*
|
|
||||||
h1 {
|
|
||||||
@apply rounded bg-stone-200 px-2 font-bold uppercase dark:bg-stone-800;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
&.settings {
|
|
||||||
h1 {
|
|
||||||
@apply rounded border-none bg-sky-200 px-2 text-sky-700 dark:bg-sky-950 dark:text-sky-300;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.public h1 {
|
.public h1 {
|
||||||
@@ -123,6 +111,10 @@ h2 {
|
|||||||
@apply h-8 w-full rounded border-stone-700 bg-stone-50 px-2 py-1 text-sm text-stone-900 dark:bg-stone-950 dark:text-stone-100;
|
@apply h-8 w-full rounded border-stone-700 bg-stone-50 px-2 py-1 text-sm text-stone-900 dark:bg-stone-950 dark:text-stone-100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.areainput {
|
||||||
|
@apply w-full rounded border-stone-700 bg-stone-50 px-2 py-1 text-sm text-stone-900 dark:bg-stone-950 dark:text-stone-100;
|
||||||
|
}
|
||||||
|
|
||||||
/* svelte select */
|
/* svelte select */
|
||||||
|
|
||||||
.svelte-select {
|
.svelte-select {
|
||||||
|
|||||||
Reference in new issue
Block a user