default channel on create node + send callback

This commit is contained in:
Martin/Geno 2018-07-15 22:47:05 +02:00
parent 63f77d87c7
commit 485ecc13c6
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
3 changed files with 9 additions and 3 deletions

View File

@ -5,6 +5,8 @@ export default {
'title': 'FreifunkManager - Breminale',
'backend': `ws${location.protocol == 'https:' ? 's' : ''}://${location.host}/ws`,
'node': {
'channel24': 6,
'channel5': 44,
// Minuten till is shown as offline
'offline': 5
},

View File

@ -1,3 +1,5 @@
import config from './config';
const current = {},
list = {};
@ -22,7 +24,10 @@ export function getNode (nodeid) {
export function createNode (nodeid) {
return {
'node_id': nodeid,
'wireless': {},
'wireless': {
'channel24': config.node.channel24,
'channel5': config.node.channel5,
},
'location': {}
};
};

View File

@ -27,8 +27,7 @@ func (ws *WebsocketServer) nodeHandler(logger *log.Entry, msg *wsLib.Message) er
logger.Debugf("%v", node)
return nil
}
ws.nodes.UpdateNode(&node)
msg.Answer(msg.Subject, true)
msg.Answer(msg.Subject, ws.nodes.UpdateNode(&node))
logger.Infof("change %s", node.NodeID)
return nil
}