mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
feat: Remove successful model downloads (#1710)
* feat: Remove successful model downloads * PR comments --------- Co-authored-by: Oto Ciulis <oto.ciulis@gmail.com>
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mx-6 mb-4" v-if="downloads.length > 0">
|
<div class="mx-6 mb-4" v-if="inProgressDownloads.length > 0">
|
||||||
<div class="text-lg my-4">
|
<div class="text-lg my-4">
|
||||||
{{ $t('electronFileDownload.inProgress') }}
|
{{ $t('electronFileDownload.inProgress') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template v-for="download in downloads" :key="download.url">
|
<template v-for="download in inProgressDownloads" :key="download.url">
|
||||||
<DownloadItem :download="download" />
|
<DownloadItem :download="download" />
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
@@ -16,5 +16,5 @@ import { useElectronDownloadStore } from '@/stores/electronDownloadStore'
|
|||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
|
|
||||||
const electronDownloadStore = useElectronDownloadStore()
|
const electronDownloadStore = useElectronDownloadStore()
|
||||||
const { downloads } = storeToRefs(electronDownloadStore)
|
const { inProgressDownloads } = storeToRefs(electronDownloadStore)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ export const useModelLibrarySidebarTab = (): SidebarTabExtension => {
|
|||||||
iconBadge: () => {
|
iconBadge: () => {
|
||||||
if (isElectron()) {
|
if (isElectron()) {
|
||||||
const electronDownloadStore = useElectronDownloadStore()
|
const electronDownloadStore = useElectronDownloadStore()
|
||||||
if (electronDownloadStore.downloads.length > 0) {
|
if (electronDownloadStore.inProgressDownloads.length > 0) {
|
||||||
return electronDownloadStore.downloads.length.toString()
|
return electronDownloadStore.inProgressDownloads.length.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { isElectron, electronAPI } from '@/utils/envUtil'
|
import { isElectron, electronAPI } from '@/utils/envUtil'
|
||||||
import type {
|
import {
|
||||||
DownloadState,
|
type DownloadState,
|
||||||
DownloadStatus
|
DownloadStatus
|
||||||
} from '@comfyorg/comfyui-electron-types'
|
} from '@comfyorg/comfyui-electron-types'
|
||||||
|
|
||||||
@@ -69,6 +69,11 @@ export const useElectronDownloadStore = defineStore('downloads', () => {
|
|||||||
resume,
|
resume,
|
||||||
cancel,
|
cancel,
|
||||||
findByUrl,
|
findByUrl,
|
||||||
initialize
|
initialize,
|
||||||
|
inProgressDownloads: computed(() =>
|
||||||
|
downloads.value.filter(
|
||||||
|
({ status }) => status !== DownloadStatus.COMPLETED
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user