From e353e6852061ee25d1b8f068686878ebfe1218a5 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Sun, 14 Apr 2019 08:01:21 +0100 Subject: [PATCH] Fix error in status page when we don't have status for a peer yet Handle the case when IcecastMount is nil in the template by using the protobuf getter. --- cmd/radiobench/radiobench.go | 2 +- node/bindata.go | 6 +++--- node/templates/index.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/radiobench/radiobench.go b/cmd/radiobench/radiobench.go index 326437b1..0da71313 100644 --- a/cmd/radiobench/radiobench.go +++ b/cmd/radiobench/radiobench.go @@ -148,7 +148,7 @@ func worker(id int, streamUrl string) { for { err := readstream(id, streamUrl) log.Printf("worker(%d): %v", id, err) - time.Sleep(retryTime) + time.Sleep(randomDuration(retryTime)) } } diff --git a/node/bindata.go b/node/bindata.go index dfadcf5f..2754c47c 100644 --- a/node/bindata.go +++ b/node/bindata.go @@ -579,8 +579,8 @@ var _templatesIndexHtml = []byte(`<!DOCTYPE html> <a href="http://{{$domain}}{{$m.Mount.Path}}" {{if $m.Mount.RelayUrl}} data-toggle="tooltip" data-delay="300" title="relay of {{$m.Mount.RelayUrl}}" - {{else if and $m.IcecastMount $m.IcecastMount.Description}} - data-toggle="tooltip" data-delay="300" title="{{$m.IcecastMount.Description}}" + {{else if $m.IcecastMount.GetDescription}} + data-toggle="tooltip" data-delay="300" title="{{$m.IcecastMount.GetDescription}}" {{end}} >{{$m.Mount.Path}}</a> <a href="http://{{$domain}}{{$m.Mount.Path}}.m3u">(m3u)</a> @@ -650,7 +650,7 @@ func templatesIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/index.html", size: 2909, mode: os.FileMode(420), modTime: time.Unix(1555197346, 0)} + info := bindataFileInfo{name: "templates/index.html", size: 2895, mode: os.FileMode(420), modTime: time.Unix(1555225167, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/node/templates/index.html b/node/templates/index.html index 654896c6..e2a4eb8a 100644 --- a/node/templates/index.html +++ b/node/templates/index.html @@ -27,8 +27,8 @@ <a href="http://{{$domain}}{{$m.Mount.Path}}" {{if $m.Mount.RelayUrl}} data-toggle="tooltip" data-delay="300" title="relay of {{$m.Mount.RelayUrl}}" - {{else if and $m.IcecastMount $m.IcecastMount.Description}} - data-toggle="tooltip" data-delay="300" title="{{$m.IcecastMount.Description}}" + {{else if $m.IcecastMount.GetDescription}} + data-toggle="tooltip" data-delay="300" title="{{$m.IcecastMount.GetDescription}}" {{end}} >{{$m.Mount.Path}}</a> <a href="http://{{$domain}}{{$m.Mount.Path}}.m3u">(m3u)</a> -- GitLab