jobs: header running/queued badges + GET /jobs/counts (phase 3d)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 15:48:52 +00:00
co-authored by Claude Opus 4.8
parent c277ceead7
commit f77ce3fb96
7 changed files with 83 additions and 7 deletions
@@ -65,6 +65,13 @@ pipelineJobsRouter.post('/', async (c) => {
return c.json({ jobId, status });
});
// GET /counts — header-badge summary { running, runningJobId, queued }. Before /:id so it isn't
// captured as an id.
pipelineJobsRouter.get('/counts', async (c) => {
const user = c.get('user');
return c.json(await jobManager.getCounts(user.id));
});
// GET /:id/log?offset= — tail the persisted output log (script jobs). Returns text from `offset`.
pipelineJobsRouter.get('/:id/log', async (c) => {
const user = c.get('user');