mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
refac
This commit is contained in:
parent
227139aa33
commit
7e70f8d2c1
1 changed files with 12 additions and 12 deletions
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
const MAX_PARALLEL_DOWNLOADS = 3;
|
const MAX_PARALLEL_DOWNLOADS = 3;
|
||||||
|
|
||||||
let modelTransferring = false;
|
let modelLoading = false;
|
||||||
let modelTag = '';
|
let modelTag = '';
|
||||||
|
|
||||||
let createModelLoading = false;
|
let createModelLoading = false;
|
||||||
|
|
@ -168,7 +168,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
modelTransferring = true;
|
modelLoading = true;
|
||||||
const [res, controller] = await pullModel(localStorage.token, sanitizedModelTag, urlIdx).catch(
|
const [res, controller] = await pullModel(localStorage.token, sanitizedModelTag, urlIdx).catch(
|
||||||
(error) => {
|
(error) => {
|
||||||
if (error.name !== 'AbortError') {
|
if (error.name !== 'AbortError') {
|
||||||
|
|
@ -283,11 +283,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
modelTag = '';
|
modelTag = '';
|
||||||
modelTransferring = false;
|
modelLoading = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const uploadModelHandler = async () => {
|
const uploadModelHandler = async () => {
|
||||||
modelTransferring = true;
|
modelLoading = true;
|
||||||
|
|
||||||
let uploaded = false;
|
let uploaded = false;
|
||||||
let fileResponse = null;
|
let fileResponse = null;
|
||||||
|
|
@ -426,7 +426,7 @@
|
||||||
modelUploadInputElement.value = '';
|
modelUploadInputElement.value = '';
|
||||||
}
|
}
|
||||||
modelInputFile = null;
|
modelInputFile = null;
|
||||||
modelTransferring = false;
|
modelLoading = false;
|
||||||
uploadProgress = null;
|
uploadProgress = null;
|
||||||
|
|
||||||
models.set(
|
models.set(
|
||||||
|
|
@ -649,9 +649,9 @@
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
pullModelHandler();
|
pullModelHandler();
|
||||||
}}
|
}}
|
||||||
disabled={modelTransferring || modelTag.trim() === ''}
|
disabled={modelLoading || modelTag.trim() === ''}
|
||||||
>
|
>
|
||||||
{#if modelTransferring}
|
{#if modelLoading}
|
||||||
<div class="self-center">
|
<div class="self-center">
|
||||||
<svg
|
<svg
|
||||||
class=" w-4 h-4"
|
class=" w-4 h-4"
|
||||||
|
|
@ -875,9 +875,9 @@
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
createModelHandler();
|
createModelHandler();
|
||||||
}}
|
}}
|
||||||
disabled={
|
disabled={createModelLoading ||
|
||||||
createModelLoading || createModelName.trim() === '' || createModelObject.trim() === ''
|
createModelName.trim() === '' ||
|
||||||
}
|
createModelObject.trim() === ''}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
|
@ -1014,9 +1014,9 @@
|
||||||
<button
|
<button
|
||||||
class="px-2.5 bg-gray-50 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg disabled:cursor-not-allowed transition"
|
class="px-2.5 bg-gray-50 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg disabled:cursor-not-allowed transition"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={modelTransferring}
|
disabled={modelLoading}
|
||||||
>
|
>
|
||||||
{#if modelTransferring}
|
{#if modelLoading}
|
||||||
<div class="self-center">
|
<div class="self-center">
|
||||||
<svg
|
<svg
|
||||||
class=" w-4 h-4"
|
class=" w-4 h-4"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue