UI: add unit property (#21396)

This commit is contained in:
andig 2025-05-30 11:47:51 +02:00 • committed by GitHub
parent 0b033933aa
commit c136ebc2e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 105 additions and 71 deletions

View file

@ -438,6 +438,10 @@ func (c *CmdConfigure) processInputConfig(param templates.Param) string {
label = langLabel
}
if param.Unit != "" {
label = fmt.Sprintf("%s (%s)", label, param.Unit)
}
value := c.askValue(question{
label: label,
defaultValue: param.Default,

View file

@ -129,8 +129,13 @@ func (c *CmdConfigure) askParam(p templates.Param) string {
required = *p.Required
}
label := p.Description.String(c.lang)
if p.Unit != "" {
label = fmt.Sprintf("%s (%s)", label, p.Unit)
}
return c.askValue(question{
label: p.Description.String(c.lang),
label: label,
valueType: p.Type,
choice: p.Choice,
mask: mask,