refac
This commit is contained in:
@@ -49,7 +49,7 @@
|
|||||||
import '../app.css';
|
import '../app.css';
|
||||||
import 'tippy.js/dist/tippy.css';
|
import 'tippy.js/dist/tippy.css';
|
||||||
|
|
||||||
import { executeToolServer, getBackendConfig, getVersion } from '$lib/apis';
|
import { executeToolServer, getBackendConfig, getModels, getVersion } from '$lib/apis';
|
||||||
import { getSessionUser, userSignOut } from '$lib/apis/auths';
|
import { getSessionUser, userSignOut } from '$lib/apis/auths';
|
||||||
import { getAllTags, getChatList } from '$lib/apis/chats';
|
import { getAllTags, getChatList } from '$lib/apis/chats';
|
||||||
import { chatCompletion } from '$lib/apis/openai';
|
import { chatCompletion } from '$lib/apis/openai';
|
||||||
@@ -704,6 +704,24 @@
|
|||||||
location.reload();
|
location.reload();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (event.type === 'page:navigate' && event.data?.path) {
|
||||||
|
await goto(event.data.path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.type === 'models:refresh') {
|
||||||
|
const token = localStorage.token;
|
||||||
|
if (token) {
|
||||||
|
models.set(
|
||||||
|
await getModels(
|
||||||
|
token,
|
||||||
|
$config?.features?.enable_direct_connections
|
||||||
|
? ($settings?.directConnections ?? null)
|
||||||
|
: null
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const token = localStorage.token;
|
const token = localStorage.token;
|
||||||
if (!token) return;
|
if (!token) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user