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

Function NewModifyModel

tui/modify.go:76–101  ·  view source on GitHub ↗
(client *api.Client, instance *api.Instance, specs *utils.SpecStore)

Source from the content-addressed store, hash-verified

74}
75
76func NewModifyModel(client *api.Client, instance *api.Instance, specs *utils.SpecStore) tea.Model {
77 styles := NewPanelStyles()
78
79 ti := textinput.New()
80 ti.Placeholder = fmt.Sprintf("%d", instance.Storage)
81 ti.SetValue(fmt.Sprintf("%d", instance.Storage))
82 ti.CharLimit = 4
83 ti.Width = 20
84 ti.Prompt = "▶ "
85
86 m := modifyModel{
87 step: modifyStepGPU,
88 cursor: 0,
89 config: ModifyConfig{},
90 currentInstance: instance,
91 client: client,
92 diskInput: ti,
93 diskInputTouched: false,
94 skippedSteps: make(map[modifyStep]bool),
95 styles: styles,
96 specs: specs,
97 }
98 m.cursor = m.getCurrentGPUCursorPosition()
99
100 return m
101}
102
103// NewModifyModelWithPresets creates a modifyModel with pre-filled values from CLI flags.
104func NewModifyModelWithPresets(client *api.Client, instance *api.Instance, specs *utils.SpecStore, presets *ModifyPresets) modifyModel {

Calls 2

NewPanelStylesFunction · 0.85