Added handlers for ign/exh buttons
This commit is contained in:
parent
ef726b1853
commit
78a502e959
@ -58,6 +58,46 @@ app.post('/', (req, response) => {
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (req.body.igniterOn != undefined) {
|
||||
fn.commands.igniterOn();
|
||||
fn.commands.refreshConfig().then(res => {
|
||||
config = res.config;
|
||||
response.render('index', { config: JSON.stringify(config) });
|
||||
return;
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (req.body.igniterOff != undefined) {
|
||||
fn.commands.igniterOff();
|
||||
fn.commands.refreshConfig().then(res => {
|
||||
config = res.config;
|
||||
response.render('index', { config: JSON.stringify(config) });
|
||||
return;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (req.body.exhaustOn != undefined) {
|
||||
fn.commands.exhaustOn();
|
||||
fn.commands.refreshConfig().then(res => {
|
||||
config = res.config;
|
||||
response.render('index', { config: JSON.stringify(config) });
|
||||
return;
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (req.body.exhaustOff != undefined) {
|
||||
fn.commands.exhaustOff();
|
||||
fn.commands.refreshConfig().then(res => {
|
||||
config = res.config;
|
||||
response.render('index', { config: JSON.stringify(config) });
|
||||
return;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (req.body.reload != undefined) {
|
||||
const updateAugerOffIntervalQuery = `UPDATE intervals SET value = '${2000 - req.body.feedRate}' WHERE key = 'auger_off'`;
|
||||
const updateAugerOnIntervalQuery = `UPDATE intervals SET value = '${req.body.feedRate}' WHERE key = 'auger_on'`;
|
||||
|
Loading…
Reference in New Issue
Block a user