| 379 | } |
| 380 | |
| 381 | function getJobStateLabel(job) { |
| 382 | const state = String(job.state || '').toLowerCase(); |
| 383 | if (state === 'queued') return 'Queued'; |
| 384 | if (state === 'cancel_requested' || state === 'cancelling') return 'Cancelling'; |
| 385 | if (state === 'finishing') return 'Finalizing'; |
| 386 | if (state === 'done') return 'Done'; |
| 387 | if (state === 'error' || state === 'failed') return 'Failed'; |
| 388 | if (state === 'cancelled') return 'Cancelled'; |
| 389 | return 'Running'; |
| 390 | } |
| 391 | |
| 392 | function buildTitle(job) { |
| 393 | if (job.title) return job.title; |