| 90 | } |
| 91 | |
| 92 | func NewCreateModel(client *api.Client, specs *utils.SpecStore) createModel { |
| 93 | styles := NewPanelStyles() |
| 94 | s := NewPrimarySpinner() |
| 95 | |
| 96 | ti := textinput.New() |
| 97 | ti.Placeholder = "100" |
| 98 | ti.SetValue("100") |
| 99 | ti.CharLimit = 4 |
| 100 | ti.Width = 20 |
| 101 | ti.Prompt = "▶ " |
| 102 | |
| 103 | m := createModel{ |
| 104 | step: stepGPU, |
| 105 | client: client, |
| 106 | spinner: s, |
| 107 | styles: styles, |
| 108 | skippedSteps: make(map[createStep]bool), |
| 109 | diskInput: ti, |
| 110 | config: CreateConfig{ |
| 111 | DiskSizeGB: 100, |
| 112 | }, |
| 113 | } |
| 114 | if specs != nil { |
| 115 | m.specs = specs |
| 116 | m.specsLoaded = true |
| 117 | } |
| 118 | return m |
| 119 | } |
| 120 | |
| 121 | // NewCreateModelWithPresets creates a createModel with pre-filled values from CLI flags. |
| 122 | func NewCreateModelWithPresets(client *api.Client, specs *utils.SpecStore, presets *CreatePresets) createModel { |