mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-04 21:22:07 +00:00
feat: allow user to add job-id to clipboard
This commit is contained in:
@@ -200,6 +200,30 @@ const menuTargetTask = ref<TaskItemImpl | null>(null)
|
||||
const menuTargetNode = ref<ComfyNode | null>(null)
|
||||
const menuItems = computed<MenuItem[]>(() => {
|
||||
const items: MenuItem[] = [
|
||||
{
|
||||
label: t('g.copyJobId'),
|
||||
icon: 'pi pi-copy',
|
||||
command: async () => {
|
||||
if (menuTargetTask.value) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(menuTargetTask.value.promptId)
|
||||
toast.add({
|
||||
severity: 'success',
|
||||
summary: t('g.copied'),
|
||||
detail: t('g.jobIdCopied'),
|
||||
life: 2000
|
||||
})
|
||||
} catch (err) {
|
||||
toast.add({
|
||||
severity: 'error',
|
||||
summary: t('g.error'),
|
||||
detail: t('g.failedToCopyJobId'),
|
||||
life: 3000
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: t('g.delete'),
|
||||
icon: 'pi pi-trash',
|
||||
|
||||
Reference in New Issue
Block a user