Add new reboot option and restart lamassu-browser

This commit is contained in:
Rafael Taranto 2019-07-16 12:00:16 +01:00 committed by Josh Harvey
parent 371454b6d4
commit 9f8693a33e
6 changed files with 89 additions and 5 deletions

View file

@ -71,11 +71,16 @@ function reboot (rec) {
return axios.post(`http://localhost:3030/reboot?device_id=${rec.deviceId}`)
}
function restartServices (rec) {
return axios.post(`http://localhost:3030/restartServices?device_id=${rec.deviceId}`)
}
function setMachine (rec) {
switch (rec.action) {
case 'resetCashOutBills': return resetCashOutBills(rec)
case 'unpair': return unpair(rec)
case 'reboot': return reboot(rec)
case 'restartServices': return restartServices(rec)
default: throw new Error('No such action: ' + rec.action)
}
}