mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-26 02:35:25 +02:00
Tell the UI why the device became unusable.
This commit is contained in:
@@ -130,6 +130,7 @@ module.exports = function(options) {
|
||||
, ready: false
|
||||
, lastHeartbeatAt: null
|
||||
, using: false
|
||||
, likelyLeaveReason: 'device_absent'
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -139,6 +140,7 @@ module.exports = function(options) {
|
||||
, data: datautil.applyOwner({
|
||||
serial: message.serial
|
||||
, owner: message.owner
|
||||
, likelyLeaveReason: 'owner_change'
|
||||
}
|
||||
, user
|
||||
)
|
||||
@@ -150,12 +152,14 @@ module.exports = function(options) {
|
||||
, data: datautil.applyOwner({
|
||||
serial: message.serial
|
||||
, owner: null
|
||||
, likelyLeaveReason: message.reason
|
||||
}
|
||||
, user
|
||||
)
|
||||
})
|
||||
})
|
||||
.on(wire.DeviceStatusMessage, function(channel, message) {
|
||||
message.likelyLeaveReason = 'status_change'
|
||||
socket.emit('device.change', {
|
||||
important: true
|
||||
, data: message
|
||||
|
||||
Reference in New Issue
Block a user