Ship duration control, hidden previews, job resume, and desktop file purge.

The slider never left this machine, so deploy the generate UI with separate input/output hide toggles, reconnect in-progress jobs after refresh, and delete Comfy input/output files after they are saved to the library.
This commit is contained in:
2026-08-25 20:25:36 -05:00
parent 1a271c05a4
commit c5ed4d7ac4
16 changed files with 651 additions and 104 deletions
+33
View File
@@ -0,0 +1,33 @@
export default defineEventHandler((event) => {
const owner = libraryOwnerKey(event)
const live = listJobs()
.filter(job => job.library?.ownerKey === owner && (job.status === 'queued' || job.status === 'uploading' || job.status === 'running'))
.sort((a, b) => b.startedAt - a.startedAt)[0]
if (live) {
return {
jobId: live.id,
hideThumbnail: live.hideThumbnail === true,
folderLocked: live.library?.folderLocked === true,
...jobSnapshot(live)
}
}
const pending = listPendingJobs()
.filter(job => job.ownerKey === owner)
.sort((a, b) => b.startedAt - a.startedAt)[0]
if (pending) {
return {
jobId: pending.jobId,
type: 'snapshot',
status: 'running',
message: 'Reconnecting to ComfyUI...',
progress: Math.max(8, Math.min(90, Math.round((Date.now() - pending.startedAt) / 1000))),
promptId: pending.promptId,
elapsedMs: Date.now() - pending.startedAt,
hideThumbnail: pending.hideThumbnail === true,
folderLocked: pending.folderLocked === true
}
}
return { jobId: null }
})