Skip to content

Commit eb34f4c

Browse files
committed
show parameter type in front-end
1 parent 266b278 commit eb34f4c

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

webui/src/Views/ParameterFormView.elm

+44
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ editParameterValueView instance parameterValues parameterInfos maybeInstancePara
341341
]
342342
]
343343
[ text parameterName ]
344+
, span
345+
[ class "input-group-addon" ]
346+
[ icon
347+
(dataTypeToIcon dataType)
348+
[ title (dataTypeToTitle dataType) ]
349+
]
344350
, input
345351
[ type_
346352
(if (isSecret && (not secretVisible)) then
@@ -613,6 +619,12 @@ newParameterValueView template parameterInfos maybeInstanceParameterForm enabled
613619
]
614620
]
615621
[ text parameterName ]
622+
, span
623+
[ class "input-group-addon" ]
624+
[ icon
625+
(dataTypeToIcon dataType)
626+
[ title (dataTypeToTitle dataType) ]
627+
]
616628
, input
617629
[ type_
618630
(if (isSecret && (not secretVisible)) then
@@ -704,3 +716,35 @@ getErrorMessage maybeValue paramName dataType =
704716
Err _ ->
705717
Just (String.concat <| [ paramName, " must be ", dataTypeToString dataType ])
706718
)
719+
720+
721+
dataTypeToIcon : ParameterType -> String
722+
dataTypeToIcon dataType =
723+
case dataType of
724+
StringParam ->
725+
"glyphicon glyphicon-text-size"
726+
727+
RawParam ->
728+
"glyphicon glyphicon-asterisk"
729+
730+
IntParam ->
731+
"fa fa-hashtag"
732+
733+
DecimalParam ->
734+
"glyphicon glyphicon-sound-5-1"
735+
736+
737+
dataTypeToTitle : ParameterType -> String
738+
dataTypeToTitle dataType =
739+
case dataType of
740+
StringParam ->
741+
"String"
742+
743+
RawParam ->
744+
"Unsafe String"
745+
746+
IntParam ->
747+
"Integer"
748+
749+
DecimalParam ->
750+
"Decimal"

0 commit comments

Comments
 (0)