Skip to content

Commit

Permalink
Merge pull request #162 from grisu48/header
Browse files Browse the repository at this point in the history
Fix header when resizing
  • Loading branch information
grisu48 authored Aug 21, 2024
2 parents 510fd53 + 857bb5b commit 0c56df0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/openqa-mon/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func (tui *TUI) Start() {
signal.Notify(sigs, syscall.SIGWINCH)
for {
<-sigs
tui.UpdateHeader()
tui.Update()
}
}()
Expand Down Expand Up @@ -270,7 +271,11 @@ func (tui *TUI) SetHideStates(enabled bool) {
}

func (tui *TUI) UpdateHeader() {
tui.header = fmt.Sprintf("openqa-mon v%s - Monitoring %s - Page %d/%d", internal.VERSION, tui.remotes, 1+tui.currentPage, tui.totalPages)
if tui.totalPages > 1 {
tui.header = fmt.Sprintf("openqa-mon v%s - Monitoring %s - Page %d/%d", internal.VERSION, tui.remotes, tui.currentPage+1, tui.totalPages)
} else {
tui.header = fmt.Sprintf("openqa-mon v%s - Monitoring %s", internal.VERSION, tui.remotes)
}
}

func (tui *TUI) FirstPage() {
Expand Down

0 comments on commit 0c56df0

Please sign in to comment.