feat: allow user to add job-id to clipboard

This commit is contained in:
Richard Yu
2025-09-15 15:03:19 -07:00
parent 992efc4486
commit 98e543ec31
2 changed files with 28 additions and 0 deletions

View File

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

View File

@@ -134,6 +134,10 @@
"title": "Title",
"edit": "Edit",
"copy": "Copy",
"copyJobId": "Copy Job ID",
"copied": "Copied",
"jobIdCopied": "Job ID copied to clipboard",
"failedToCopyJobId": "Failed to copy job ID",
"imageUrl": "Image URL",
"clear": "Clear",
"clearAll": "Clear all",