fix some issues on connect

This commit is contained in:
Martin/Geno 2018-07-27 14:09:31 +02:00
parent 9fbdd5a798
commit 58d843ae7e
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
3 changed files with 10 additions and 5 deletions

View File

@ -66,8 +66,8 @@ table.nodes tbody tr:nth-child(odd) {
table.nodes tbody tr:hover { table.nodes tbody tr:hover {
background: #ccc; background: #ccc;
} }
table.nodes tbody tr.offline:first-child, table.nodes tbody tr.offline td:first-child,
table.nodes tbody tr.offline:hover:first-child{ table.nodes tbody tr.offline:hover td:first-child{
background: #dc0067; background: #dc0067;
} }
table.nodes tbody tr.unseen:first-child{ table.nodes tbody tr.unseen:first-child{

View File

@ -44,6 +44,8 @@ function onerror (err) {
function onopen () { function onopen () {
connectionEstablished = true; connectionEstablished = true;
sendjson({'subject': 'auth_status'});
sendjson({'subject': 'connect'});
render(); render();
} }
@ -123,8 +125,6 @@ function connect () {
socket.onerror = onerror; socket.onerror = onerror;
socket.onmessage = onmessage; socket.onmessage = onmessage;
socket.onclose = onclose; socket.onclose = onclose;
sendjson({'subject': 'auth_status'});
sendjson({'subject': 'connect'});
} }
window.setInterval(() => { window.setInterval(() => {

View File

@ -21,7 +21,12 @@ func (ws *WebsocketServer) connectHandler(logger *log.Entry, msg *wsLib.Message)
ws.nodes.Lock() ws.nodes.Lock()
i := 0 i := 0
for _, node := range ws.nodes.List { for _, node := range ws.nodes.List {
msg.From.Write(&wsLib.Message{Subject: MessageTypeCurrentNode, Body: node}) n := runtime.NewNode(node, "")
if n == nil {
continue
}
n.Lastseen = node.Lastseen
msg.From.Write(&wsLib.Message{Subject: MessageTypeCurrentNode, Body: n})
i++ i++
} }
ws.nodes.Unlock() ws.nodes.Unlock()