feat: initial Speedboard implementation
sitespeed.io web UI with Express/Pug/SQLite — port 3132. Includes job queue, SSE live log, full metrics dashboard, site history, CO2/axe/CWV sections, and Docker support. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
21
routes/results.js
Normal file
21
routes/results.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Router } from 'express';
|
||||
import { getJob } from '../db.js';
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.get('/:id', (req, res) => {
|
||||
const job = getJob(req.params.id);
|
||||
if (!job) return res.status(404).render('error', { title: '404', message: 'Job not found.' });
|
||||
|
||||
if (job.status !== 'done') return res.redirect(`/status/${job.id}`);
|
||||
|
||||
res.render('results', {
|
||||
title: `Results — ${job.url}`,
|
||||
job,
|
||||
reportUrl: job.report_folder
|
||||
? `/reports/${job.id}/index.html`
|
||||
: null,
|
||||
});
|
||||
});
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user