mirror of
https://github.com/pa11y/pa11y-dashboard.git
synced 2025-09-24 22:31:15 +00:00
header and hide fields
This commit is contained in:

committed by
Rowan Manning

parent
c562bb07f3
commit
39435f37e4
12
route/new.js
12
route/new.js
@@ -36,6 +36,15 @@ function route(app) {
|
||||
});
|
||||
|
||||
app.express.post('/new', (req, res) => {
|
||||
|
||||
let parsedHeaders = '';
|
||||
|
||||
try {
|
||||
parsedHeaders = JSON.parse(req.body.headers);
|
||||
} catch (e) {
|
||||
console.log(`error parsing headers object: ${req.body.headers}. Ignoring.`);
|
||||
}
|
||||
|
||||
const newTask = {
|
||||
name: req.body.name,
|
||||
url: req.body.url,
|
||||
@@ -45,7 +54,10 @@ function route(app) {
|
||||
wait: req.body.wait || undefined,
|
||||
username: req.body.username || undefined,
|
||||
password: req.body.password || undefined
|
||||
headers: parsedHeaders || undefined,
|
||||
hideElements: req.body.hide || undefined
|
||||
};
|
||||
|
||||
app.webservice.tasks.create(newTask, (err, task) => {
|
||||
if (err) {
|
||||
const standards = getStandards().map(standard => {
|
||||
|
@@ -69,6 +69,8 @@ function route(app) {
|
||||
task.wait = req.body.wait;
|
||||
task.username = req.body.username;
|
||||
task.password = req.body.password;
|
||||
task.headers = req.body.headers;
|
||||
task.hideElements = req.body.hideElements;
|
||||
const standards = getStandards().map(standard => {
|
||||
if (standard.title === task.standard) {
|
||||
standard.selected = true;
|
||||
|
Reference in New Issue
Block a user