diff --git a/cmd/deploy/main.go b/cmd/deploy/main.go index cf9ad82..f5cd7f1 100644 --- a/cmd/deploy/main.go +++ b/cmd/deploy/main.go @@ -221,20 +221,18 @@ func deployMenu() { fmt.Println("\n─── Deploy Node ───") available := []int{} for i, nc := range nodes { - marker := " " if deployed[nc.Name] { - marker = "✓ " - } - fmt.Printf(" %s[%d] %s (port %s)\n", marker, i+1, nc.Name, nc.Port) - if !deployed[nc.Name] { + fmt.Printf(" ✓ %s (port %s) [deployed]\n", nc.Name, nc.Port) + } else { available = append(available, i) + fmt.Printf(" [%d] %s (port %s)\n", len(available), nc.Name, nc.Port) } } if len(available) == 0 { fmt.Println("All nodes deployed.") return } - fmt.Print("\nSelect node number (or Enter for all undeployed): ") + fmt.Print("\nSelect node number (or Enter for all): ") reader := bufio.NewReader(os.Stdin) choice, _ := reader.ReadString('\n') choice = strings.TrimSpace(choice) @@ -244,11 +242,11 @@ func deployMenu() { for _, i := range available { selected = append(selected, nodes[i]) } } else { idx, err := strconv.Atoi(choice) - if err != nil || idx < 1 || idx > len(nodes) { + if err != nil || idx < 1 || idx > len(available) { fmt.Println("Invalid choice") return } - selected = append(selected, nodes[idx-1]) + selected = append(selected, nodes[available[idx-1]]) } for _, nc := range selected {