new admin structure

This commit is contained in:
Josh Harvey 2017-05-09 00:37:38 +03:00
parent 7d82874916
commit c2282e61b4
17 changed files with 5768 additions and 1204 deletions

View file

@ -50,12 +50,6 @@ exports.machineEvent = function machineEvent (rec) {
.then(() => db.none(deleteSql, [rec.deviceId, rec.eventType]))
}
exports.devices = function devices () {
const sql = 'SELECT device_id, name FROM devices'
return db.any(sql)
}
exports.machineEvents = function machineEvents () {
const sql = 'SELECT *, (EXTRACT(EPOCH FROM (now() - created))) * 1000 AS age FROM machine_events'