forked from external-repos/pa11y-dashboard
Add the ability to run tasks ad-hoc
This commit is contained in:
@@ -23,6 +23,7 @@ function route (app) {
|
||||
results: presentResultList(results.map(presentResult)),
|
||||
mainResult: task.lastResult || null,
|
||||
added: (typeof req.query.added !== 'undefined'),
|
||||
running: (typeof req.query.running !== 'undefined'),
|
||||
isTaskPage: true
|
||||
});
|
||||
});
|
||||
|
17
route/task/run.js
Normal file
17
route/task/run.js
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = route;
|
||||
|
||||
// Route definition
|
||||
function route (app) {
|
||||
|
||||
app.express.get('/:id/run', function (req, res, next) {
|
||||
app.webservice.task(req.params.id).run(function (err, task) {
|
||||
if (err) {
|
||||
return next();
|
||||
}
|
||||
res.redirect('/' + req.params.id + '?running');
|
||||
});
|
||||
});
|
||||
|
||||
}
|
Reference in New Issue
Block a user