mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-06 05:30:08 +00:00
Queue preview gallery (#519)
* Custom preview event * Plub event * Basic gallery * Gallery nits * Navigate with keyboard keys
This commit is contained in:
@@ -38,7 +38,15 @@ export class ResultItemImpl {
|
||||
|
||||
get url(): string {
|
||||
return api.apiURL(`/view?filename=${encodeURIComponent(this.filename)}&type=${this.type}&
|
||||
subfolder=${encodeURIComponent(this.subfolder || '')}&t=${+new Date()}`)
|
||||
subfolder=${encodeURIComponent(this.subfolder || '')}`)
|
||||
}
|
||||
|
||||
get urlWithTimestamp(): string {
|
||||
return `${this.url}&t=${+new Date()}`
|
||||
}
|
||||
|
||||
get supportsPreview(): boolean {
|
||||
return ['images', 'gifs'].includes(this.mediaType)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +73,10 @@ export class TaskItemImpl {
|
||||
)
|
||||
}
|
||||
|
||||
get previewOutput(): ResultItemImpl | undefined {
|
||||
return this.flatOutputs.find((output) => output.supportsPreview)
|
||||
}
|
||||
|
||||
get apiTaskType(): APITaskType {
|
||||
switch (this.taskType) {
|
||||
case 'Running':
|
||||
|
||||
Reference in New Issue
Block a user