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

Merge pull request #589 from lesteenman/WTF-575-url-decode-jenkins-job-names

WTF-575: URL-Decode Jenkins branch names
This commit is contained in:
Chris Cummer 2019-09-01 08:46:53 -07:00 committed by GitHub
commit fcda904e1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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))