From 77278ca130b7344abddaade9edc49ee849acf07e Mon Sep 17 00:00:00 2001 From: Martin/Geno Date: Sat, 1 Sep 2018 17:46:51 +0200 Subject: [PATCH] [BUGFIX] session_init before auth_status --- runtime/node_ssh.go | 4 ++-- webroot/css/_login.less | 4 ++++ webroot/js/socket.js | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/runtime/node_ssh.go b/runtime/node_ssh.go index 9792c15..d396d4f 100644 --- a/runtime/node_ssh.go +++ b/runtime/node_ssh.go @@ -62,7 +62,7 @@ func (n *Node) SSHUpdate(sshmgmt *ssh.Manager) bool { uci set wireless.%s.txpower='%d'; uci commit wireless;`, radio, n.Wireless.TxPower24)) - runWifi = true + //runWifi = true } if n.Wireless.Channel24 != n.WirelessRespondd.Channel24 { //ubus call hostapd.%s switch_chan '{"freq":%d}' @@ -92,7 +92,7 @@ func (n *Node) SSHUpdate(sshmgmt *ssh.Manager) bool { uci set wireless.%s.txpower='%d'; uci commit wireless;`, radio, n.Wireless.TxPower5)) - runWifi = true + //runWifi = true } if n.Wireless.Channel5 != n.WirelessRespondd.Channel5 { //ubus call hostapd.%s switch_chan '{"freq":%d}' diff --git a/webroot/css/_login.less b/webroot/css/_login.less index c2e66c2..09eaefe 100644 --- a/webroot/css/_login.less +++ b/webroot/css/_login.less @@ -13,4 +13,8 @@ nav .login { color: #fff; padding-left: 2px; } + + input { + color: white; + } } diff --git a/webroot/js/socket.js b/webroot/js/socket.js index 9e7ee4c..f8e0fe0 100644 --- a/webroot/js/socket.js +++ b/webroot/js/socket.js @@ -11,6 +11,7 @@ const RECONNECT_AFTER = 5000, let connectionID = localStorage.getItem('session'), socket = null, + sessionInit = false, connectionEstablished = false; function newUUID () { @@ -51,7 +52,7 @@ function onopen () { export function sendjson (obj, callback) { - if (socket.readyState !== 1) { + if (socket.readyState !== 1 || (!sessionInit && obj.subject !== 'session_init')) { query.push({ 'callback': callback, 'obj': obj @@ -79,6 +80,7 @@ function onmessage (raw) { msg.id = connectionID; sendjson(msg); render(); + sessionInit = true; return; }