Example #1
0
func wrapList(list *termui.List) *termui.List {
	list.Border.Label = "List - Wrapped"
	list.Overflow = "wrap"
	list.X = 30

	return list
}
func addJob(list *ui.List, job *gojenkins.Job, redbox *ui.Par, yellowbox *ui.Par, greenbox *ui.Par) {
	if filterBuildName == nil || (filterBuildName != nil && filterBuildName.MatchString(job.GetName())) {
		str := job.GetName()
		lastBuild, _ := job.GetLastBuild()
		if lastBuild != nil {
			isRunning, _ := job.IsRunning()
			if isRunning {
				str = "...building " + str
			}
			str += " " + " " + lastBuild.GetResult()
			switch lastBuild.GetResult() {
			case "SUCCESS":
				greenbox.BgColor = ui.ColorGreen
			case "UNSTABLE":
				yellowbox.BgColor = ui.ColorYellow
			case "FAILURE":
				redbox.BgColor = ui.ColorRed
			}
		}
		list.Items = append(list.Items, str)
	}
}
func resizeUI(ls *ui.List) {
	w, h := tm.Size()
	ui.Body.Width = w
	ls.Height = h - 6
	ui.Body.Align()
}
Example #4
0
func hideList(list *termui.List) *termui.List {
	list.Border.Label = "List - Hidden"
	list.Overflow = "hidden"

	return list
}