mirror of
https://github.com/open-webui/open-webui
synced 2025-01-29 13:58:09 +00:00
refac
This commit is contained in:
parent
ee05455155
commit
f470f3fce2
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
import { getKnowledgeItems } from '$lib/apis/knowledge';
|
import { getKnowledgeItems } from '$lib/apis/knowledge';
|
||||||
import { getFunctions } from '$lib/apis/functions';
|
import { getFunctions } from '$lib/apis/functions';
|
||||||
import { getModels as _getModels, getVersionUpdates } from '$lib/apis';
|
import { getModels, getVersionUpdates } from '$lib/apis';
|
||||||
import { getAllTags } from '$lib/apis/chats';
|
import { getAllTags } from '$lib/apis/chats';
|
||||||
import { getPrompts } from '$lib/apis/prompts';
|
import { getPrompts } from '$lib/apis/prompts';
|
||||||
import { getTools } from '$lib/apis/tools';
|
import { getTools } from '$lib/apis/tools';
|
||||||
@ -52,10 +52,6 @@
|
|||||||
|
|
||||||
let version;
|
let version;
|
||||||
|
|
||||||
const getModels = async () => {
|
|
||||||
return _getModels(localStorage.token);
|
|
||||||
};
|
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
if ($user === undefined) {
|
if ($user === undefined) {
|
||||||
await goto('/auth');
|
await goto('/auth');
|
||||||
@ -97,14 +93,8 @@
|
|||||||
settings.set(localStorageSettings);
|
settings.set(localStorageSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
await Promise.all([
|
models.set(await getModels(localStorage.token));
|
||||||
(async () => {
|
|
||||||
models.set(await getModels());
|
|
||||||
})(),
|
|
||||||
(async () => {
|
|
||||||
banners.set(await getBanners(localStorage.token));
|
banners.set(await getBanners(localStorage.token));
|
||||||
})()
|
|
||||||
]);
|
|
||||||
|
|
||||||
document.addEventListener('keydown', function (event) {
|
document.addEventListener('keydown', function (event) {
|
||||||
const isCtrlPressed = event.ctrlKey || event.metaKey; // metaKey is for Cmd key on Mac
|
const isCtrlPressed = event.ctrlKey || event.metaKey; // metaKey is for Cmd key on Mac
|
||||||
|
Loading…
Reference in New Issue
Block a user