Add Lamassu support microsite

This commit is contained in:
goga-m 2017-11-06 19:01:24 +02:00 committed by Josh Harvey
parent 4f9cc88a5e
commit d901a36f29
5 changed files with 13347 additions and 12 deletions

View file

@ -69,6 +69,15 @@ function update (deviceId, logLines) {
* @returns {array} Array of logs for the requested machinej
*/
function getMachineLogs (deviceId, until = new Date().toISOString()) {
const defaults = {
logs: [],
currentMachine: {
name: '',
deviceId: ''
}
}
if (!deviceId) return defaults
const sql = `select id, log_level, timestamp, message from logs
where device_id=$1
and timestamp <= $3