feat: changed old server ports so it can coexists with the new server
feat: removed deleted references from old server feat: created reset and migrate mutations on gql server and correspondent functions on new settings loader feat: created front end for the config migration with reset and migrate functionalities style: add spacing between buttons Signed-off-by: Liordino Neto <liordinoneto@gmail.com>
This commit is contained in:
parent
368d528ee2
commit
df8a1804a3
6 changed files with 144 additions and 65 deletions
|
|
@ -31,7 +31,6 @@ const server = require('./server')
|
|||
const transactions = require('./transactions')
|
||||
const customers = require('../customers')
|
||||
const logs = require('../logs')
|
||||
const supportLogs = require('../support_logs')
|
||||
const funding = require('./funding')
|
||||
const supportServer = require('./admin-support')
|
||||
|
||||
|
|
@ -208,29 +207,6 @@ app.get('/api/logs', (req, res, next) => {
|
|||
.catch(next)
|
||||
})
|
||||
|
||||
app.get('/api/support_logs', (req, res, next) => {
|
||||
return supportLogs.batch()
|
||||
.then(supportLogs => res.send({ supportLogs }))
|
||||
.catch(next)
|
||||
})
|
||||
|
||||
app.get('/api/support_logs/logs', (req, res, next) => {
|
||||
return supportLogs.get(req.query.supportLogId)
|
||||
.then(log => (!_.isNil(log) && !_.isEmpty(log)) ? log : supportLogs.batch().then(_.first))
|
||||
.then(result => {
|
||||
const log = result || {}
|
||||
return logs.getMachineLogs(log.deviceId, log.timestamp)
|
||||
})
|
||||
.then(r => res.send(r))
|
||||
.catch(next)
|
||||
})
|
||||
|
||||
app.post('/api/support_logs', (req, res, next) => {
|
||||
return supportLogs.insert(req.query.deviceId)
|
||||
.then(r => res.send(r))
|
||||
.catch(next)
|
||||
})
|
||||
|
||||
app.patch('/api/customer/:id', (req, res, next) => {
|
||||
if (!req.params.id) return res.status(400).send({Error: 'Requires id'})
|
||||
const token = req.token || req.cookies.token
|
||||
|
|
@ -349,7 +325,7 @@ wss.on('connection', ws => {
|
|||
})
|
||||
|
||||
function run () {
|
||||
const serverPort = devMode ? 8070 : 443
|
||||
const serverPort = devMode ? 8072 : 443
|
||||
const supportPort = 8071
|
||||
|
||||
const serverLog = `lamassu-admin-server listening on port ${serverPort}`
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ const _ = require('lodash/fp')
|
|||
const serveStatic = require('serve-static')
|
||||
const path = require('path')
|
||||
|
||||
const logs = require('../logs')
|
||||
const supportLogs = require('../support_logs')
|
||||
const options = require('../options')
|
||||
|
||||
app.use(morgan('dev'))
|
||||
|
|
@ -30,29 +28,6 @@ const certOptions = {
|
|||
rejectUnauthorized: true
|
||||
}
|
||||
|
||||
app.get('/api/support_logs', (req, res, next) => {
|
||||
return supportLogs.batch()
|
||||
.then(supportLogs => res.send({ supportLogs }))
|
||||
.catch(next)
|
||||
})
|
||||
|
||||
app.get('/api/support_logs/logs', (req, res, next) => {
|
||||
return supportLogs.get(req.query.supportLogId)
|
||||
.then(log => (!_.isNil(log) && !_.isEmpty(log)) ? log : supportLogs.batch().then(_.first))
|
||||
.then(result => {
|
||||
const log = result || {}
|
||||
return logs.getUnlimitedMachineLogs(log.deviceId, log.timestamp)
|
||||
})
|
||||
.then(r => res.send(r))
|
||||
.catch(next)
|
||||
})
|
||||
|
||||
app.post('/api/support_logs', (req, res, next) => {
|
||||
return supportLogs.insert(req.query.deviceId)
|
||||
.then(r => res.send(r))
|
||||
.catch(next)
|
||||
})
|
||||
|
||||
function run (port) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const webServer = https.createServer(certOptions, app)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue