pref: Use virtual scroll load models

This commit is contained in:
hayden
2024-10-28 18:08:38 +08:00
parent 86e587eba2
commit 14a31a8ca8
7 changed files with 179 additions and 56 deletions

View File

@@ -8,7 +8,6 @@ import { app } from 'scripts/comfyAPI'
import { bytesToSize, formatDate, previewUrlToFile } from 'utils/common'
import { ModelGrid } from 'utils/legacy'
import { resolveModelType } from 'utils/model'
// import {}
import {
computed,
inject,
@@ -22,10 +21,7 @@ import {
import { useI18n } from 'vue-i18n'
export const useModels = defineStore('models', () => {
const { data, refresh } = useRequest<(Model & { visible?: boolean })[]>(
'/models',
{ defaultValue: [] },
)
const { data, refresh } = useRequest<Model[]>('/models', { defaultValue: [] })
const { toast, confirm } = useToast()
const { t } = useI18n()
const loading = useLoading()