Create support_logs (db & api)

This commit is contained in:
goga-m 2017-10-27 17:36:40 +03:00 committed by Josh Harvey
parent b7d6f3f419
commit 62d606cc80
8 changed files with 279 additions and 58 deletions

View file

@ -3,9 +3,7 @@ const _ = require('lodash/fp')
const db = require('./db')
const pgp = require('pg-promise')()
const settingsLoader = require('./settings-loader')
const configManager = require('./config-manager')
const getMachineName = require('./machine-loader').getMachineName
const NUM_RESULTS = 1000
/**
@ -79,22 +77,4 @@ function getMachineLogs (deviceId) {
}))
}
/**
* Given the machine id, get the machine name
*
* @name getMachineName
* @function
* @async
*
* @param {string} machineId machine id
* @returns {string} machine name
*/
function getMachineName (machineId) {
return settingsLoader.loadRecentConfig()
.then(config => {
const machineScoped = configManager.machineScoped(machineId, config)
return machineScoped.machineName
})
}
module.exports = { getMachineLogs, update, getLastSeen }