1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

Allow to update device notes column from STF UI. https://github.com/openstf/stf/issues/124

This commit is contained in:
Vishal Banthia 2015-10-23 01:36:41 +09:00
parent 26421fd322
commit 466890777d
9 changed files with 135 additions and 7 deletions

View file

@ -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)