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

Method getMaxCursor

tui/create.go:766–791  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

764}
765
766func (m createModel) getMaxCursor() int {
767 switch m.step {
768 case stepGPU:
769 return len(m.getGPUOptions()) - 1
770 case stepCompute:
771 if m.gpuCountPhase {
772 return len(m.specs.GPUCounts(m.config.GPUType)) - 1
773 }
774 return len(m.specs.VCPUOptions(m.config.GPUType, m.config.NumGPUs)) - 1
775 case stepTemplate:
776 if m.templateBrowse {
777 return len(m.templates) - 1
778 }
779 if m.snapshotBrowse {
780 return len(m.snapshots) - 1
781 }
782 // None / Browse Templates / Custom Snapshots
783 if m.snapshotsLoaded && len(m.snapshots) > 0 {
784 return 2
785 }
786 return 1
787 case stepConfirmation:
788 return 1
789 }
790 return 0
791}
792
793func (m createModel) View() string {
794 if m.err != nil {

Callers 1

UpdateMethod · 0.95

Calls 3

getGPUOptionsMethod · 0.95
GPUCountsMethod · 0.80
VCPUOptionsMethod · 0.80

Tested by

no test coverage detected