Queue preview gallery (#519)

* Custom preview event

* Plub event

* Basic gallery

* Gallery nits

* Navigate with keyboard keys
This commit is contained in:
Chenlei Hu
2024-08-18 20:42:42 -04:00
committed by GitHub
parent 4e1f14139b
commit 22e2628479
5 changed files with 170 additions and 36 deletions

View File

@@ -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':