mirror of
https://github.com/open-webui/open-webui
synced 2025-06-04 03:37:35 +00:00
refac
This commit is contained in:
parent
19a23a5b7d
commit
79fbab7341
@ -34,7 +34,8 @@
|
|||||||
mobile,
|
mobile,
|
||||||
showOverview,
|
showOverview,
|
||||||
chatTitle,
|
chatTitle,
|
||||||
showArtifacts
|
showArtifacts,
|
||||||
|
tools
|
||||||
} from '$lib/stores';
|
} from '$lib/stores';
|
||||||
import {
|
import {
|
||||||
convertMessagesToHistory,
|
convertMessagesToHistory,
|
||||||
@ -78,6 +79,7 @@
|
|||||||
import ChatControls from './ChatControls.svelte';
|
import ChatControls from './ChatControls.svelte';
|
||||||
import EventConfirmDialog from '../common/ConfirmDialog.svelte';
|
import EventConfirmDialog from '../common/ConfirmDialog.svelte';
|
||||||
import Placeholder from './Placeholder.svelte';
|
import Placeholder from './Placeholder.svelte';
|
||||||
|
import { getTools } from '$lib/apis/tools';
|
||||||
|
|
||||||
export let chatIdProp = '';
|
export let chatIdProp = '';
|
||||||
|
|
||||||
@ -158,12 +160,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const setToolIds = async () => {
|
const setToolIds = async () => {
|
||||||
|
if (!$tools) {
|
||||||
|
tools.set(await getTools(localStorage.token));
|
||||||
|
}
|
||||||
|
|
||||||
if (selectedModels.length !== 1) {
|
if (selectedModels.length !== 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const model = $models.find((m) => m.id === selectedModels[0]);
|
const model = $models.find((m) => m.id === selectedModels[0]);
|
||||||
if (model) {
|
if (model) {
|
||||||
selectedToolIds = model?.info?.meta?.toolIds ?? [];
|
selectedToolIds = (model?.info?.meta?.toolIds ?? []).filter((id) =>
|
||||||
|
$tools.find((t) => t.id === id)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -632,7 +632,7 @@
|
|||||||
showAccessControlModal = true;
|
showAccessControlModal = true;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<LockClosed strokeWidth="2.5" />
|
<LockClosed strokeWidth="2.5" className="size-3.5" />
|
||||||
|
|
||||||
<div class="text-sm font-medium flex-shrink-0">
|
<div class="text-sm font-medium flex-shrink-0">
|
||||||
{$i18n.t('Share')}
|
{$i18n.t('Share')}
|
||||||
|
@ -104,7 +104,7 @@
|
|||||||
showAccessControlModal = true;
|
showAccessControlModal = true;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<LockClosed strokeWidth="2.5" />
|
<LockClosed strokeWidth="2.5" className="size-3.5" />
|
||||||
|
|
||||||
<div class="text-sm font-medium flex-shrink-0">
|
<div class="text-sm font-medium flex-shrink-0">
|
||||||
{$i18n.t('Share')}
|
{$i18n.t('Share')}
|
||||||
|
@ -231,7 +231,7 @@ class Tools:
|
|||||||
showAccessControlModal = true;
|
showAccessControlModal = true;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<LockClosed strokeWidth="2.5" />
|
<LockClosed strokeWidth="2.5" className="size-3.5" />
|
||||||
|
|
||||||
<div class="text-sm font-medium flex-shrink-0">
|
<div class="text-sm font-medium flex-shrink-0">
|
||||||
{$i18n.t('Share')}
|
{$i18n.t('Share')}
|
||||||
|
Loading…
Reference in New Issue
Block a user