{{ item.repo_id }} |
@@ -113,9 +113,9 @@ import { useGlobalSetup } from '@/assets/js/store/globalSetup';
import ProgressBar from './ProgressBar.vue';
import { useI18N } from '@/assets/js/store/i18n';
import { SSEProcessor } from '@/assets/js/sseProcessor';
-import { util } from '@/assets/js/util';
-import { Const } from '@/assets/js/const';
-import { toast } from '@/assets/js/toast';
+import * as util from '@/assets/js/util';
+import * as Const from '@/assets/js/const';
+import * as toast from '@/assets/js/toast';
import { useModels } from '@/assets/js/store/models';
const i18nState = useI18N().state;
@@ -155,7 +155,7 @@ function dataProcess(line: string) {
if (completeCount.value == allTaskCount) {
downloding = false;
emits("close");
- downloadResolve && downloadResolve();
+ downloadResolve?.();
} else {
taskPercent.value = util.toFixed(completeCount.value / allTaskCount * 100, 1);
percent.value = 100;
@@ -171,7 +171,7 @@ function dataProcess(line: string) {
hashError.value = true;
abortController?.abort();
fetch(`${globalSetup.apiHost}/api/stopDownloadModel`)
- downloadReject && downloadReject({ type: "error", error: errorText.value });
+ downloadReject?.({ type: "error", error: errorText.value });
switch (data.err_type) {
case "not_enough_disk_space":
@@ -197,7 +197,7 @@ let downloadReject: ((args: DownloadFailedParams) => void) | undefined
async function showConfirmDialog(downList: DownloadModelParam[], success?: () => void, fail?: (args: DownloadFailedParams) => void) {
if (downloding) {
toast.error(i18nState.DOWNLOADER_CONFLICT);
- fail && fail({ type: "conflict" })
+ fail?.({ type: "conflict" })
return;
}
sizeRequesting.value = true;
@@ -245,7 +245,7 @@ async function showConfirmDialog(downList: DownloadModelParam[], success?: () =>
}
sizeRequesting.value = false;
} catch (ex) {
- fail && fail({ type: "error", error: ex });
+ fail?.({ type: "error", error: ex });
sizeRequesting.value = false;
}
}
@@ -317,13 +317,13 @@ function download() {
const reader = response.body!.getReader();
return new SSEProcessor(reader, dataProcess, undefined).start();
}).catch(ex => {
- downloadReject && downloadReject({ type: "error", error: ex });
+ downloadReject?.({ type: "error", error: ex });
downloding = false;
})
}
function cancelConfirm() {
- downloadReject && downloadReject({ type: "cancelConfrim" });
+ downloadReject?.({ type: "cancelConfrim" });
emits("close");
}
@@ -336,7 +336,7 @@ function confirmDownload() {
function cancelDownload() {
abortController?.abort();
fetch(`${globalSetup.apiHost}/api/stopDownloadModel`)
- downloadReject && downloadReject({ type: "cancelDownload" });
+ downloadReject?.({ type: "cancelDownload" });
emits("close");
}
diff --git a/WebUI/src/components/DropSelector.vue b/WebUI/src/components/DropSelector.vue
index e252032c..21a88d08 100644
--- a/WebUI/src/components/DropSelector.vue
+++ b/WebUI/src/components/DropSelector.vue
@@ -1,5 +1,6 @@
+
-
\ No newline at end of file
diff --git a/WebUI/src/components/ui/loadImage/LoadImage.vue b/WebUI/src/components/ui/loadImage/LoadImage.vue
index 02b72c29..f8f4e637 100644
--- a/WebUI/src/components/ui/loadImage/LoadImage.vue
+++ b/WebUI/src/components/ui/loadImage/LoadImage.vue
@@ -57,7 +57,7 @@ function processFiles(files: File[] | null, inputCurrent: Ref ) {
Load Image
- ![Image]()
+
-import { ref, computed, watchEffect } from 'vue'
+import { computed } from 'vue'
import { type SliderRootProps } from 'radix-vue'
import { SliderRange, SliderRoot, SliderThumb, SliderTrack } from 'radix-vue'
import { cn } from '@/lib/utils'
@@ -47,8 +47,8 @@ function findBestResolution(totalPixels: number, aspectRatio: number) {
if (w < MIN_SIZE || w > MAX_SIZE) continue
- let actualPixels = w * h
- let diff = Math.abs(actualPixels - totalPixels)
+ const actualPixels = w * h
+ const diff = Math.abs(actualPixels - totalPixels)
if (diff < minDiff) {
minDiff = diff
diff --git a/WebUI/src/env.d.ts b/WebUI/src/env.d.ts
index a5f93d8a..72d3b706 100644
--- a/WebUI/src/env.d.ts
+++ b/WebUI/src/env.d.ts
@@ -77,9 +77,11 @@ type Chrome = {
type WebView = {
hostObjects: HostProxyObjects;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
addEventListener: (event: "message", callback: (args: any) => void) => void;
removeEventListener: (
event: "message",
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
callback: (args: any) => void
) => void;
};
@@ -114,6 +116,7 @@ type ApiResponse = {
type KVObject = {
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
};
@@ -289,6 +292,7 @@ type NumberRange = {
max: number;
}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
type DownloadFailedParams = { type: "error" | "cancelConfrim" | "cancelDownload" | "conflict", error?: any }
type CheckModelAlreadyLoadedParameters = {
diff --git a/WebUI/src/toast.d.ts b/WebUI/src/toast.d.ts
index aa19d24a..015c7bfa 100644
--- a/WebUI/src/toast.d.ts
+++ b/WebUI/src/toast.d.ts
@@ -14,6 +14,6 @@ type ToastOptions = {
};
type ToastTransitions = {
- show: Object;
- hide: Object;
+ show: object;
+ hide: object;
};
\ No newline at end of file
diff --git a/WebUI/src/views/Answer.vue b/WebUI/src/views/Answer.vue
index 3baa91e4..fd9a50ff 100644
--- a/WebUI/src/views/Answer.vue
+++ b/WebUI/src/views/Answer.vue
@@ -1,3 +1,4 @@
+
@@ -225,21 +226,18 @@ import LoadingBar from "../components/LoadingBar.vue";
import DropSelector from "@/components/DropSelector.vue";
import ModelDropDownItem from "@/components/ModelDropDownItem.vue";
import { useI18N } from '@/assets/js/store/i18n';
-import { toast } from '@/assets/js/toast';
-import { util } from '@/assets/js/util';
+import * as toast from '@/assets/js/toast';
+import * as util from '@/assets/js/util';
import { SSEProcessor } from "@/assets/js/sseProcessor";
import { useGlobalSetup } from "@/assets/js/store/globalSetup";
-import { Model, useModels } from "@/assets/js/store/models";
+import { useModels } from "@/assets/js/store/models";
import { MarkdownParser } from "@/assets/js/markdownParser";
import "highlight.js/styles/github-dark.min.css";
-import { Const } from "@/assets/js/const";
+import * as Const from "@/assets/js/const";
import { useConversations } from "@/assets/js/store/conversations";
-import { useComfyUi } from "@/assets/js/store/comfyUi";
import { useTextInference } from "@/assets/js/store/textInference";
-import { nextTick } from 'vue';
const conversations = useConversations();
-const comfyUi = useComfyUi();
const models = useModels();
const globalSetup = useGlobalSetup();
const textInference = useTextInference();
@@ -509,7 +507,7 @@ async function checkModel() {
reject
);
} else {
- resolve && resolve();
+ resolve();
}
});
}
@@ -571,7 +569,6 @@ async function stopGenerate() {
function copyText(e: Event) {
const target = e.target as HTMLElement;
if (target) {
- target
util.copyText((target.parentElement!.parentElement!.previousElementSibling! as HTMLElement).innerText);
}
}
@@ -581,10 +578,6 @@ function removeRonate360(ev: AnimationEvent) {
target.classList.remove("animate-ronate360");
}
-function changeLLMModel(model: Model, _: number) {
- globalSetup.applyModelSettings({ llm_model: model.name });
-}
-
async function addLLMModel() {
return new Promise(async (resolve, reject) => {
emits("showModelRequest", resolve, reject);
@@ -623,7 +616,7 @@ function copyCode(e: MouseEvent) {
}
}
-function changeEmbeddingModel(item: any, _: number) {
+function changeEmbeddingModel(item: unknown, _: number) {
globalSetup.applyModelSettings({ embedding: item as string });
}
@@ -634,7 +627,7 @@ async function toggleRag(value: boolean) {
ragData.processEnable = true;
try {
if (value) {
- var checkList: CheckModelAlreadyLoadedParameters[] = [{ repo_id: globalSetup.modelSettings.embedding, type: Const.MODEL_TYPE_EMBEDDING, backend: "default" }];
+ const checkList: CheckModelAlreadyLoadedParameters[] = [{ repo_id: globalSetup.modelSettings.embedding, type: Const.MODEL_TYPE_EMBEDDING, backend: "default" }];
if (!(await globalSetup.checkModelAlreadyLoaded(checkList))[0].already_loaded) {
emits("showDownloadModelConfirm",
checkList,
diff --git a/WebUI/src/views/AppSettings.vue b/WebUI/src/views/AppSettings.vue
index 76aafdc2..59156c6a 100644
--- a/WebUI/src/views/AppSettings.vue
+++ b/WebUI/src/views/AppSettings.vue
@@ -51,7 +51,7 @@ const emits = defineEmits<{
(e: "close"): void
}>();
-function showDownloadModelConfirm(downList: DownloadModelParam[], success?: () => void, fail?: () => void) {
+function showDownloadModelConfirm(downList: DownloadModelParam[], _success?: () => void, _fail?: () => void) {
emits("showDownloadModelConfirm", downList);
}
diff --git a/WebUI/src/views/Create.vue b/WebUI/src/views/Create.vue
index f90770ee..48d8529a 100644
--- a/WebUI/src/views/Create.vue
+++ b/WebUI/src/views/Create.vue
@@ -78,8 +78,8 @@
|