Commit e353e685 authored by ale's avatar ale

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.
parent a7261348
......@@ -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))
}
}
......
......@@ -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
}
......
......@@ -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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment