Add the ability to set a per-task timeout

This commit is contained in:
Rowan Manning
2015-07-02 16:03:12 +01:00
parent 0b1daf1482
commit 780b66128f
5 changed files with 30 additions and 10 deletions

View File

@@ -25,7 +25,7 @@
"express": "~3.4",
"express-hbs": "~0.2",
"moment": "~2.2",
"pa11y-webservice": "~1.4",
"pa11y-webservice": "~1.5",
"pa11y-webservice-client-node": "~1.1",
"underscore": "~1.5"
},

View File

@@ -1,15 +1,15 @@
// This file is part of pa11y-dashboard.
//
//
// pa11y-dashboard is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// pa11y-dashboard is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with pa11y-dashboard. If not, see <http://www.gnu.org/licenses/>.
@@ -40,7 +40,8 @@ function route (app) {
name: req.body.name,
url: req.body.url,
standard: req.body.standard,
ignore: req.body.ignore || []
ignore: req.body.ignore || [],
timeout: req.body.timeout
};
app.webservice.tasks.create(newTask, function (err, task) {
if (err) {

View File

@@ -1,15 +1,15 @@
// This file is part of pa11y-dashboard.
//
//
// pa11y-dashboard is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// pa11y-dashboard is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with pa11y-dashboard. If not, see <http://www.gnu.org/licenses/>.
@@ -60,6 +60,7 @@ function route (app) {
if (err) {
task.name = req.body.name;
task.ignore = req.body.ignore;
task.timeout = req.body.timeout;
var standards = getStandards().map(function (standard) {
if (standard.title === task.standard) {
standard.selected = true;

View File

@@ -1,4 +1,4 @@
{{!
{{!
This file is part of pa11y-dashboard.
pa11y-dashboard is free software: you can redistribute it and/or modify
@@ -65,6 +65,15 @@ along with pa11y-dashboard. If not, see <http://www.gnu.org/licenses/>.
</div>
</div>
<div class="form-group clearfix">
<div class="row">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="control-label" for="new-task-timeout">Timeout (milliseconds)</label>
<input class="form-control" id="new-task-timeout" type="text" placeholder="E.g. 30000" name="timeout" value="{{task.timeout}}"/>
</div>
</div>
</div>
<p class="control-label"><b>Ignore these rules</b> <a target="_blank" href="https://github.com/nature/pa11y/wiki/HTML-CodeSniffer-Rules">(full list of rules here)</a></p>
<div class="standards-lists">

View File

@@ -1,4 +1,4 @@
{{!
{{!
This file is part of pa11y-dashboard.
pa11y-dashboard is free software: you can redistribute it and/or modify
@@ -77,6 +77,15 @@ along with pa11y-dashboard. If not, see <http://www.gnu.org/licenses/>.
</div>
</div>
<div class="form-group clearfix">
<div class="row">
<div class="col-md-4 col-sm-4 col-xs-6">
<label class="control-label" for="new-task-timeout">Timeout (milliseconds)</label>
<input class="form-control" id="new-task-timeout" type="text" placeholder="E.g. 30000" name="timeout" value="{{task.timeout}}"/>
</div>
</div>
</div>
<p class="control-label"><b>Ignore these rules</b> <a target="_blank" href="https://github.com/nature/pa11y/wiki/HTML-CodeSniffer-Rules">(full list of rules here)</a></p>
<div class="standards-lists">