Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions tools/agent_tui/ui/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ type Controller struct {
ui *UI
channel chan checks.CheckResult

checks map[string]checks.CheckResult
state bool
rendezvousIPSet bool
checks map[string]checks.CheckResult
state bool
}

func NewController(ui *UI) *Controller {
Expand Down
4 changes: 2 additions & 2 deletions tools/agent_tui/ui/rendezvous_ip_connectivity_fail_modal.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

const (
PAGE_RENDEZVOUS_IP_CONNECTIVITY_FAIL string = "rendezvousIPConnectivityFailPage"
SAVE_AND_CONTINUE_BUTTON = "<Save and Continue>"
SAVE_AND_CONTINUE_BUTTON string = "<Save and Continue>"

CONNECTIVITY_CHECK_FAIL_TEXT_FORMAT = "Warning: the specified rendezvous IP was not found or yet active."
CONNECTIVITY_CHECK_FAIL_TEXT_FORMAT string = "Warning: the specified rendezvous IP was not found or yet active."
)

func (u *UI) showRendezvousIPConnectivityFailModal(ipAddress string, focusForBackButton func()) {
Expand Down
4 changes: 2 additions & 2 deletions tools/agent_tui/ui/rendezvous_ip_save_success_modal.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

const (
PAGE_RENDEZVOUS_IP_SAVE_SUCCESS string = "rendezvousIPSaveSuccessPage"
CONTINUE_BUTTON = "<Continue>"
BACK_BUTTON = "<Back>"
CONTINUE_BUTTON string = "<Continue>"
BACK_BUTTON string = "<Back>"

SUCCESS_TEXT_FORMAT = "Successfully saved %s as the rendezvous node IP. "
OTHER_NODES_TEXT_FORMAT = "Enter %s as the rendezvous node IP on the other nodes that will form the cluster."
Expand Down
14 changes: 6 additions & 8 deletions tools/agent_tui/ui/rendezvous_ip_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (u *UI) createSelectHostIPPage() {
u.selectIPList.SetInputCapture(getSelectIPListInputCapture(u.selectIPList))
}

descriptionText := fmt.Sprintf("Select an IP address from this node to be the rendezvous node IP.")
descriptionText := "Select an IP address from this node to be the rendezvous node IP."
textFlex := u.createTextFlex(descriptionText)
textRows := 3

Expand Down Expand Up @@ -82,20 +82,18 @@ func getSelectIPListInputCapture(list *tview.List) (capture func(event *tcell.Ev
// List.GetCurrentItem actually returns not the current selected item but the
// item that was last selected
previousItemIndex := list.GetCurrentItem()
previousItem, _ := list.GetItemText(previousItemIndex)
currentItem := previousItem
updatedItemIndex := previousItemIndex

switch event.Key() {
case tcell.KeyTab, tcell.KeyDown, tcell.KeyRight:
currentItemIndex := previousItemIndex + 1
if previousItemIndex == list.GetItemCount()-1 {
// reached the bottom of the selectIPList
currentItemIndex = 0
}
currentItem, _ = list.GetItemText(currentItemIndex)
currentItem, _ := list.GetItemText(currentItemIndex)
if currentItem == EMPTY_OPTION {
// move the current index up one place to skip the EMPTY_OPTION
updatedItemIndex = currentItemIndex
updatedItemIndex := currentItemIndex
if updatedItemIndex > list.GetItemCount() {
// reached the bottom of the list
updatedItemIndex = 0
Expand All @@ -108,10 +106,10 @@ func getSelectIPListInputCapture(list *tview.List) (capture func(event *tcell.Ev
// reached the top of the selectIPList
currentItemIndex = list.GetItemCount() - 1
}
currentItem, _ = list.GetItemText(currentItemIndex)
currentItem, _ := list.GetItemText(currentItemIndex)
if currentItem == EMPTY_OPTION {
// move the current index down one place to skip the EMPTY_OPTION
updatedItemIndex = currentItemIndex
updatedItemIndex := currentItemIndex
if updatedItemIndex < 0 {
updatedItemIndex = list.GetItemCount() - 1
}
Expand Down