| 490 | } |
| 491 | |
| 492 | func renderModifySuccess(instanceID string, resp **api.InstanceModifyResponse) func() string { |
| 493 | return func() string { |
| 494 | headerStyle := theme.Primary().Bold(true) |
| 495 | labelStyle := theme.Neutral() |
| 496 | valueStyle := lipgloss.NewStyle().Bold(true) |
| 497 | cmdStyle := theme.Neutral() |
| 498 | boxStyle := lipgloss.NewStyle(). |
| 499 | Border(lipgloss.RoundedBorder()). |
| 500 | BorderForeground(lipgloss.Color(theme.PrimaryColor)). |
| 501 | Padding(1, 2) |
| 502 | |
| 503 | var lines []string |
| 504 | successTitleStyle := theme.Success() |
| 505 | lines = append(lines, successTitleStyle.Render("✓ Instance modified successfully!")) |
| 506 | lines = append(lines, "") |
| 507 | lines = append(lines, labelStyle.Render("Instance ID:")+" "+valueStyle.Render((*resp).Identifier)) |
| 508 | lines = append(lines, labelStyle.Render("Instance Name:")+" "+valueStyle.Render((*resp).InstanceName)) |
| 509 | |
| 510 | if (*resp).GPUType != nil { |
| 511 | lines = append(lines, labelStyle.Render("New GPU:")+" "+valueStyle.Render(*(*resp).GPUType)) |
| 512 | } |
| 513 | if (*resp).NumGPUs != nil { |
| 514 | lines = append(lines, labelStyle.Render("New GPUs:")+" "+valueStyle.Render(fmt.Sprintf("%d", *(*resp).NumGPUs))) |
| 515 | } |
| 516 | |
| 517 | lines = append(lines, "") |
| 518 | lines = append(lines, headerStyle.Render("Next steps:")) |
| 519 | lines = append(lines, cmdStyle.Render(" • Instance is restarting with new configuration")) |
| 520 | lines = append(lines, cmdStyle.Render(" • Run 'tnr status' to monitor progress")) |
| 521 | lines = append(lines, cmdStyle.Render(fmt.Sprintf(" • Run 'tnr connect %s' once RUNNING", instanceID))) |
| 522 | |
| 523 | content := lipgloss.JoinVertical(lipgloss.Left, lines...) |
| 524 | return "\n" + boxStyle.Render(content) + "\n\n" |
| 525 | } |
| 526 | } |