Работа над viewport формы, добавление описания для поля формы, комментарии к fileSelect модели
This commit is contained in:
parent
ecc89e34c5
commit
c7ff7662ba
9 changed files with 333 additions and 207 deletions
|
|
@ -6,14 +6,16 @@ import (
|
|||
)
|
||||
|
||||
type ComputeModel struct {
|
||||
Label string
|
||||
value string
|
||||
Label string
|
||||
description string
|
||||
value string
|
||||
}
|
||||
|
||||
func NewComputeModel(label, value string) *ComputeModel {
|
||||
func NewComputeModel(label, value, description string) *ComputeModel {
|
||||
return &ComputeModel{
|
||||
Label: label,
|
||||
value: value,
|
||||
Label: label,
|
||||
description: description,
|
||||
value: value,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -26,7 +28,11 @@ func (m *ComputeModel) Update(msg tea.Msg) (FieldModel, tea.Cmd) {
|
|||
}
|
||||
|
||||
func (m *ComputeModel) View() string {
|
||||
return fmt.Sprintf("%s: %s", m.Label, m.value)
|
||||
res := fmt.Sprintf("%s: %s", m.Label, m.value)
|
||||
if m.description != "" {
|
||||
res += fmt.Sprintf("\n%s", m.description)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func (m *ComputeModel) Focus() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue