diff --git a/cmd/mesh/main.go b/cmd/mesh/main.go index 28779930..cc230075 100644 --- a/cmd/mesh/main.go +++ b/cmd/mesh/main.go @@ -275,6 +275,9 @@ func run(args yggArgs, ctx context.Context) { } } + // Start HTTP server + n.admin.StartHttpServer(args.useconffile, cfg) + // Setup the multicast module. { options := []multicast.SetupOption{} @@ -317,8 +320,6 @@ func run(args yggArgs, ctx context.Context) { logger.Infof("Your public key is %s", hex.EncodeToString(public[:])) logger.Infof("Your IPv6 address is %s", address.String()) logger.Infof("Your IPv6 subnet is %s", subnet.String()) - // Start HTTP server - n.admin.StartHttpServer(args.useconffile, cfg) // Block until we are told to shut down. <-ctx.Done() diff --git a/contrib/ui/mesh-ui/ui/assets/mesh-ui-es5.js b/contrib/ui/mesh-ui/ui/assets/mesh-ui-es5.js index f931f0d7..3a1c20d0 100644 --- a/contrib/ui/mesh-ui/ui/assets/mesh-ui-es5.js +++ b/contrib/ui/mesh-ui/ui/assets/mesh-ui-es5.js @@ -1,4 +1,5 @@ "use strict"; +console.log("IE load fix"); var $ = function $(id) { return document.getElementById(id); @@ -231,8 +232,9 @@ function togglePrivKeyVisibility() { } function humanReadableSpeed(speed) { - var i = speed == 0 ? 0 : Math.floor(Math.log(speed) / Math.log(1024)); - return (speed / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['Bps', 'kBps', 'MBps', 'GBps', 'TBps'][i]; + if (speed < 0) return "? B/s"; + var i = speed < 1 ? 0 : Math.floor(Math.log(speed) / Math.log(1024)); + return (speed / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['bps', 'kbps', 'Mbps', 'Gbps', 'Tbps'][i]; } var ui = ui || { @@ -347,8 +349,8 @@ ui.updateSpeed = function (peers) { ui._rsbytes = rsbytes; } else { delete ui._rsbytes; - $("dn_speed").innerText = "? Bs"; - $("up_speed").innerText = "? Bs"; + $("dn_speed").innerText = humanReadableSpeed(-1); + $("up_speed").innerText = humanReadableSpeed(-1); } }; diff --git a/contrib/ui/mesh-ui/ui/assets/mesh-ui.js b/contrib/ui/mesh-ui/ui/assets/mesh-ui.js index 294b4f3d..37f17914 100644 --- a/contrib/ui/mesh-ui/ui/assets/mesh-ui.js +++ b/contrib/ui/mesh-ui/ui/assets/mesh-ui.js @@ -225,8 +225,9 @@ function togglePrivKeyVisibility() { } function humanReadableSpeed(speed) { - var i = speed == 0 ? 0 : Math.floor(Math.log(speed) / Math.log(1024)); - return (speed / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['Bps', 'kBps', 'MBps', 'GBps', 'TBps'][i]; + if (speed < 0) return "? B/s"; + var i = speed < 1 ? 0 : Math.floor(Math.log(speed) / Math.log(1024)); + return (speed / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['bps', 'kbps', 'Mbps', 'Gbps', 'Tbps'][i]; } var ui = ui || { @@ -327,8 +328,8 @@ ui.updateSpeed = peers => { ui._rsbytes = rsbytes; } else { delete ui._rsbytes; - $("dn_speed").innerText = "? Bs"; - $("up_speed").innerText = "? Bs"; + $("dn_speed").innerText = humanReadableSpeed(-1); + $("up_speed").innerText = humanReadableSpeed(-1); } }