mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 08:53:30 +02:00
add remoteDebugUrl into database so that it is accessible from api
This commit is contained in:
@@ -142,6 +142,15 @@ module.exports = syrup.serial()
|
||||
channel
|
||||
, reply.okay(url)
|
||||
])
|
||||
// Update DB
|
||||
push.send([
|
||||
wireutil.global
|
||||
, wireutil.envelope(new wire.ConnectStartedMessage(
|
||||
options.serial
|
||||
, url
|
||||
))
|
||||
])
|
||||
log.info('Remote Connect Started for device "%s" at "%s"', options.serial, url)
|
||||
})
|
||||
.catch(function(err) {
|
||||
log.error('Unable to start remote connect service', err.stack)
|
||||
@@ -159,6 +168,14 @@ module.exports = syrup.serial()
|
||||
channel
|
||||
, reply.okay()
|
||||
])
|
||||
// Update DB
|
||||
push.send([
|
||||
wireutil.global
|
||||
, wireutil.envelope(new wire.ConnectStoppedMessage(
|
||||
options.serial
|
||||
))
|
||||
])
|
||||
log.info('Remote Connect Stopped for device "%s"', options.serial)
|
||||
})
|
||||
.catch(function(err) {
|
||||
log.error('Failed to stop connect service', err.stack)
|
||||
|
||||
@@ -165,6 +165,12 @@ module.exports = function(options) {
|
||||
)
|
||||
})
|
||||
})
|
||||
.on(wire.ConnectStartedMessage, function(channel, message, data) {
|
||||
dbapi.setDeviceConnectUrl(message.serial, message.url)
|
||||
})
|
||||
.on(wire.ConnectStoppedMessage, function(channel, message, data) {
|
||||
dbapi.unsetDeviceConnectUrl(message.serial)
|
||||
})
|
||||
.on(wire.JoinGroupMessage, function(channel, message, data) {
|
||||
dbapi.setDeviceOwner(message.serial, message.owner)
|
||||
appDealer.send([channel, data])
|
||||
|
||||
Reference in New Issue
Block a user