()
| 764 | } |
| 765 | |
| 766 | func (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 | |
| 793 | func (m createModel) View() string { |
| 794 | if m.err != nil { |
no test coverage detected