Reset state and then set newly reset state to web UI

This commit is contained in:
mmcwilliams 2018-02-12 14:57:06 -05:00
parent ec2215ec76
commit 45e427caf9
2 changed files with 3 additions and 5 deletions

View File

@ -168,15 +168,12 @@ web.reset = function () {
}
fetch('/reset', opts)
.then(web.useJson)
.then(web.resetSuccess)
.then(setState)
.catch(err => {
console.error('Error posting to /reset');
console.error(err);
})
};
web.resetSuccess = function (res) {
console.dir(res)
}
web.restart = function () {
const opts = {
method : 'POST',

View File

@ -340,7 +340,8 @@ function rReset (req, res, next) {
log.info(`/reset`, {time : +new Date()})
intval.reset()
setTimeout(() => {
res.send(intval._state)
const obj = intval.status()
res.send(obj)
return next()
}, 10)
}