mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 05:53:19 +02:00
Allow to update device notes column from STF UI. https://github.com/openstf/stf/issues/124
This commit is contained in:
@@ -305,6 +305,28 @@ module.exports = function(options) {
|
||||
|
||||
new Promise(function(resolve) {
|
||||
socket.on('disconnect', resolve)
|
||||
// Global messages for all clients using socket.io
|
||||
//
|
||||
// Device note
|
||||
.on('device.note', function(data) {
|
||||
return dbapi.setDeviceNote(data.serial, data.note)
|
||||
.then(function() {
|
||||
return dbapi.loadDevice(data.serial)
|
||||
})
|
||||
.then(function(device) {
|
||||
if(device) {
|
||||
io.emit('device.change', {
|
||||
important: true
|
||||
, data: {
|
||||
serial: device.serial
|
||||
, notes: device.notes
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
// Client specific messages
|
||||
//
|
||||
// Settings
|
||||
.on('user.settings.update', function(data) {
|
||||
dbapi.updateUserSettings(user.email, data)
|
||||
|
||||
Reference in New Issue
Block a user