コード例 #1
0
ファイル: coloredList.go プロジェクト: sguiheux/termui
func wrapList(list *termui.List) *termui.List {
	list.Border.Label = "List - Wrapped"
	list.Overflow = "wrap"
	list.X = 30

	return list
}
コード例 #2
0
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)
	}
}
コード例 #3
0
func resizeUI(ls *ui.List) {
	w, h := tm.Size()
	ui.Body.Width = w
	ls.Height = h - 6
	ui.Body.Align()
}
コード例 #4
0
ファイル: coloredList.go プロジェクト: sguiheux/termui
func hideList(list *termui.List) *termui.List {
	list.Border.Label = "List - Hidden"
	list.Overflow = "hidden"

	return list
}