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

Function NewProgressModel

tui/progress.go:32–41  ·  view source on GitHub ↗

NewProgressModel creates a ProgressModel that runs apiCmd while showing a spinner. On success, renderSuccess is called to produce the final View output.

(message string, apiCmd tea.Cmd, renderSuccess func() string)

Source from the content-addressed store, hash-verified

30// NewProgressModel creates a ProgressModel that runs apiCmd while showing a spinner.
31// On success, renderSuccess is called to produce the final View output.
32func NewProgressModel(message string, apiCmd tea.Cmd, renderSuccess func() string) ProgressModel {
33 InitCommonStyles(os.Stdout)
34 s := NewPrimarySpinner()
35 return ProgressModel{
36 spinner: s,
37 message: message,
38 apiCmd: apiCmd,
39 renderSuccess: renderSuccess,
40 }
41}
42
43func (m ProgressModel) Init() tea.Cmd {
44 return tea.Batch(m.spinner.Tick, m.apiCmd)

Callers 4

runPortsForwardFunction · 0.92
runModifyFunction · 0.92
runCreateFunction · 0.92
runSnapshotCreateFunction · 0.92

Calls 2

InitCommonStylesFunction · 0.85
NewPrimarySpinnerFunction · 0.85

Tested by

no test coverage detected