1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

WTF-575: URL-Decode Jenkins branch names

This commit is contained in:
Erik Steenman 2019-09-01 11:44:44 +02:00
parent c3a54de181
commit 1365b6023b

View File

@ -5,6 +5,7 @@ import (
"github.com/rivo/tview" "github.com/rivo/tview"
"github.com/wtfutil/wtf/utils" "github.com/wtfutil/wtf/utils"
"github.com/wtfutil/wtf/view" "github.com/wtfutil/wtf/view"
"net/url"
) )
type Widget struct { type Widget struct {
@ -75,12 +76,13 @@ func (widget *Widget) content() (string, string, bool) {
var str string var str string
jobs := widget.view.Jobs jobs := widget.view.Jobs
for idx, job := range jobs { for idx, job := range jobs {
jobName, _ := url.QueryUnescape(job.Name)
row := fmt.Sprintf( row := fmt.Sprintf(
`[%s] [%s]%-6s[white]`, `[%s] [%s]%-6s[white]`,
widget.RowColor(idx), widget.RowColor(idx),
widget.jobColor(&job), widget.jobColor(&job),
job.Name, jobName,
) )
str += utils.HighlightableHelper(widget.View, row, idx, len(job.Name)) str += utils.HighlightableHelper(widget.View, row, idx, len(job.Name))