Skip to content

Commit

Permalink
Merge pull request #582 from grycap/devel
Browse files Browse the repository at this point in the history
Add support to greater_than and less_than TOSCA constaints
  • Loading branch information
micafer authored Oct 28, 2024
2 parents 7a03354 + 99d8834 commit 4d738c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/templates/input_types.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@
<!-- end PortSpec type -->

{% elif value.type == "integer" %}
{% set min_value = value.constraints | selectattr('greater_than') | map(attribute='greater_than') | list %}
{% set max_value = value.constraints | selectattr('less_than') | map(attribute='less_than') | list %}
<!-- number type -->
<input type="number" class="form-control" id="{{key}}" name="{{key}}" value="{{input_value}}" aria-describedby="help{{key}}" {% if value.required %}required{%endif%}/>
<input type="number" class="form-control" id="{{key}}" name="{{key}}" value="{{input_value}}" aria-describedby="help{{key}}" {% if value.required %}required{%endif%} {% if min_value %}min="{{min_value[0]}}"{%endif%} {% if max_value %}max="{{max_value[0]}}"{%endif%}/>
{% elif value.type == "scalar-unit.size" %}
<input type="text" class="form-control" id="{{key}}" name="{{key}}" value="{{input_value}}" pattern="[0-9]*( )([TMG]B)" title="Number Unit(MB, GB or TB)">
{% else %}
Expand Down

0 comments on commit 4d738c4

Please sign in to comment.