(instanceID string)
| 68 | } |
| 69 | |
| 70 | func NewConnectFlowModel(instanceID string) ConnectFlowModel { |
| 71 | s := NewPrimarySpinner() |
| 72 | |
| 73 | phases := []Phase{ |
| 74 | {Name: "SSH key management", Status: PhasePending}, |
| 75 | {Name: "Establishing SSH connection", Status: PhasePending}, |
| 76 | {Name: "Setting up instance", Status: PhasePending}, |
| 77 | } |
| 78 | |
| 79 | styles := connectFlowStyles{ |
| 80 | title: PrimaryTitleStyle().MarginTop(1).MarginBottom(1), |
| 81 | phase: lipgloss.NewStyle().PaddingLeft(2), |
| 82 | inProgress: PrimaryStyle(), |
| 83 | pending: SubtleTextStyle(), |
| 84 | duration: DurationStyle(), |
| 85 | } |
| 86 | |
| 87 | return ConnectFlowModel{ |
| 88 | phases: phases, |
| 89 | currentPhase: -1, |
| 90 | spinner: s, |
| 91 | startTime: time.Now(), |
| 92 | lastPhaseIdx: -1, |
| 93 | styles: styles, |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | func connectDeferQuit() tea.Cmd { |
| 98 | return tea.Tick(1*time.Millisecond, func(time.Time) tea.Msg { return connectQuitNow{} }) |
no test coverage detected