mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 17:30:07 +00:00
26 lines
583 B
TypeScript
26 lines
583 B
TypeScript
import { ref } from 'vue'
|
|
|
|
import type { JobAction } from '../../composables/queue/useJobActions'
|
|
import type { JobListItem } from '../../composables/queue/useJobList'
|
|
|
|
const actionsByJobId = ref<Record<string, JobAction[]>>({})
|
|
|
|
export function setMockJobActions(actions: Record<string, JobAction[]>) {
|
|
actionsByJobId.value = actions
|
|
}
|
|
|
|
export function useJobActions() {
|
|
function getJobActions(job: JobListItem) {
|
|
return actionsByJobId.value[job.id] ?? []
|
|
}
|
|
|
|
async function runJobAction() {
|
|
return undefined
|
|
}
|
|
|
|
return {
|
|
getJobActions,
|
|
runJobAction
|
|
}
|
|
}
|