Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
642ca5a9
"git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "89b35e455647c1a5ec147a4a65967e7807229e95"
Commit
642ca5a9
authored
Mar 23, 2024
by
Timothy J. Baek
Browse files
refac: ui
parent
7e6d4994
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
25 deletions
+36
-25
src/lib/components/chat/Settings/Models.svelte
src/lib/components/chat/Settings/Models.svelte
+36
-25
No files found.
src/lib/components/chat/Settings/Models.svelte
View file @
642ca5a9
...
@@ -159,7 +159,7 @@
...
@@ -159,7 +159,7 @@
// Remove the downloaded model
// Remove the downloaded model
delete modelDownloadStatus[modelName];
delete modelDownloadStatus[modelName];
modelDownloadStatus = {...modelDownloadStatus
}
modelDownloadStatus = {
...modelDownloadStatus
};
if (!data.success) {
if (!data.success) {
toast.error(data.error);
toast.error(data.error);
...
@@ -467,17 +467,15 @@
...
@@ -467,17 +467,15 @@
ollamaVersion = await getOllamaVersion(localStorage.token).catch((error) => false);
ollamaVersion = await getOllamaVersion(localStorage.token).catch((error) => false);
liteLLMModelInfo = await getLiteLLMModelInfo(localStorage.token);
liteLLMModelInfo = await getLiteLLMModelInfo(localStorage.token);
});
});
const deleteModelPull = async(model: string) => {
const deleteModelPull = async
(model: string) => {
const {reader} = modelDownloadStatus[model];
const {
reader
} = modelDownloadStatus[model];
if(reader){
if
(reader)
{
await reader.cancel();
await reader.cancel();
delete modelDownloadStatus[model];
delete modelDownloadStatus[model];
await deleteModel(localStorage.token, model);
await deleteModel(localStorage.token, model);
toast.success(`${model} download has been canceled`);
toast.success(`${model} download has been canceled`);
}
}
};
}
</script>
</script>
<div class="flex flex-col h-full justify-between text-sm">
<div class="flex flex-col h-full justify-between text-sm">
...
@@ -611,25 +609,38 @@
...
@@ -611,25 +609,38 @@
<div class="flex flex-col">
<div class="flex flex-col">
<div class="font-medium mb-1">{model}</div>
<div class="font-medium mb-1">{model}</div>
<div class="">
<div class="">
<div class="flex flex-row space-x-4">
<div class="flex flex-row space-x-4 pr-2">
<div
<div
class="dark:bg-gray-600 bg-gray-500 text-xs font-medium text-gray-100 text-center p-0.5 leading-none rounded-full"
class="dark:bg-gray-600 bg-gray-500 text-xs font-medium text-gray-100 text-center p-0.5 leading-none rounded-full"
style="width: {Math.max(15, modelDownloadStatus[model].pullProgress ?? 0)}%"
style="width: {Math.max(15, modelDownloadStatus[model].pullProgress ?? 0)}%"
>
>
{modelDownloadStatus[model].pullProgress ?? 0}%
{modelDownloadStatus[model].pullProgress ?? 0}%
</div>
<button
class="text-gray-800 dark:text-gray-100"
on:click={() => {
deleteModelPull(model);
}}
>
<svg
class="w-4 h-4 text-gray-800 dark:text-white"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
viewBox="0 0 24 24"
>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M6 18 17.94 6M18 18 6.06 6"
/>
</svg>
</button>
</div>
</div>
<button
class="px-2.5 bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition"
on:click={() => {
deleteModelPull(model);
}}
>
<svg class="w-4 h-4 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18 17.94 6M18 18 6.06 6"/>
</svg>
</button>
</div>
<div class="mt-1 text-xs dark:text-gray-500" style="font-size: 0.5rem;">
<div class="mt-1 text-xs dark:text-gray-500" style="font-size: 0.5rem;">
{modelDownloadStatus[model].digest}
{modelDownloadStatus[model].digest}
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment