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

Function NewLoginModel

tui/login.go:72–94  ·  view source on GitHub ↗
(authURL string)

Source from the content-addressed store, hash-verified

70}
71
72func NewLoginModel(authURL string) LoginModel {
73 s := NewPrimarySpinner()
74 styles := newLoginStyles()
75
76 ti := textinput.New()
77 ti.Placeholder = "Enter your Thunder Compute token..."
78 ti.CharLimit = 500
79 ti.Width = 50
80 ti.Focus()
81 ti.PromptStyle = PrimaryCursorStyle()
82 ti.TextStyle = PrimaryCursorStyle()
83 ti.PlaceholderStyle = SubtleTextStyle()
84 ti.Cursor.Style = PrimaryCursorStyle()
85
86 return LoginModel{
87 state: LoginStateWaiting,
88 authURL: authURL,
89 spinner: s,
90 tokenInput: ti,
91 width: 80,
92 styles: styles,
93 }
94}
95
96func (m LoginModel) Init() tea.Cmd {
97 return m.spinner.Tick

Callers 1

runInteractiveLoginFunction · 0.92

Calls 4

NewPrimarySpinnerFunction · 0.85
newLoginStylesFunction · 0.85
PrimaryCursorStyleFunction · 0.85
SubtleTextStyleFunction · 0.85

Tested by

no test coverage detected