MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / renderCreateSuccess

Function renderCreateSuccess

cmd/create.go:65–89  ·  view source on GitHub ↗
(resp **api.CreateInstanceResponse)

Source from the content-addressed store, hash-verified

63}
64
65func renderCreateSuccess(resp **api.CreateInstanceResponse) func() string {
66 return func() string {
67 headerStyle := theme.Primary().Bold(true)
68 labelStyle := theme.Neutral()
69 valueStyle := lipgloss.NewStyle().Bold(true)
70 cmdStyle := theme.Neutral()
71 boxStyle := lipgloss.NewStyle().
72 Border(lipgloss.RoundedBorder()).
73 BorderForeground(lipgloss.Color(theme.PrimaryColor)).
74 Padding(1, 2)
75
76 var lines []string
77 successTitleStyle := theme.Success()
78 lines = append(lines, successTitleStyle.Render("✓ Instance created successfully!"))
79 lines = append(lines, "")
80 lines = append(lines, labelStyle.Render("Instance ID:")+" "+valueStyle.Render(fmt.Sprintf("%d", (*resp).Identifier)))
81 lines = append(lines, "")
82 lines = append(lines, headerStyle.Render("Next steps:"))
83 lines = append(lines, cmdStyle.Render(" • Run 'tnr status' to monitor provisioning progress"))
84 lines = append(lines, cmdStyle.Render(fmt.Sprintf(" • Run 'tnr connect %d' once the instance is RUNNING", (*resp).Identifier)))
85
86 content := lipgloss.JoinVertical(lipgloss.Left, lines...)
87 return "\n" + boxStyle.Render(content) + "\n\n"
88 }
89}
90
91func buildCreatePresets(cmd *cobra.Command) *tui.CreatePresets {
92 p := &tui.CreatePresets{}

Callers 1

runCreateFunction · 0.85

Calls 3

PrimaryFunction · 0.92
NeutralFunction · 0.92
SuccessFunction · 0.92

Tested by

no test coverage detected