templates/CRUD/list__environment_resourceinfo.html.twig line 1

Open in your IDE?
  1. {% block field %}
  2.     {% set cpu = 0.5 %}
  3.     {% set memory = 768 %}
  4.     {% set type = "nonkubernetes" %}
  5.     {% for option in object.environmentOptions %}
  6.         {% if option.optionType.name == "java.memoryLimit" %}
  7.             {% set memory = option.value %}
  8.         {% elseif option.optionType.name == "java.cpuLimit" %}
  9.             {% set cpu = option.value %}
  10.         {% elseif option.optionType.name == "kubernetes.cluster" %}
  11.             {% set type = option.value %}
  12.         {% endif %}
  13.     {% endfor %}
  14.     <div style="white-space: nowrap;">
  15.         <ul>
  16.             <li>CPU: {{ cpu }} vCore</li>
  17.             <li>RAM: {{ memory }} MB</li>
  18.             {% if type != "nonkubernetes" and type in admin.costs|keys %}
  19.                 {% set costCPU =  ((admin.costs[type].cost / admin.costs[type].cpu) * cpu) %}
  20.                 {% set costRAM =  ((admin.costs[type].cost / admin.costs[type].ram) * memory) %}
  21.                 <li>Cost: {{ max(costCPU, costRAM) }}{{ admin.costs[type].currency }}/month </li>
  22.             {% endif %}
  23.         </ul>
  24.     </div>
  25. {% endblock %}