{% extends "base.html" %}

{% block title %}Deploy{% endblock %}

{% block page_content %}

        <script>
        window.onload =$(function(){                        
          $("#noUiSlider").empty().noUiSlider( 'init', {
        start: 0,
        step: 1,
        format: wNumb({
                decimals: 0
        }),

        range: {
                min: 1,
                max: 16
        }

        });

});

        </script> 


<div class="page-header">
    <h1>Deploy</h1>
</div>

<div class="container-fluid">
  <br />
  <div class="row">

    <div class="col-md-4">
      <div class="panel panel-info">
      <div class="panel-heading">{{ product_name }}</div>
      <div class="panel-body">
        <img src="{{ product_pic }}"></img><br />
        {{ product_description }}
      </div>
      </div>
    </div>

    <div class="col-md-8">
      <div class="panel panel-default">
        <div class="panel-heading">Настройки</div>
        <div class="panel-body">
    <form method="POST" action="{{ url_for('vmanager.deploy', product_id=product_id) }}">
    <p>
        {{ form.servername.label }}<br />{{ form.servername(size=42) }}<br />
        {% for error in form.servername.errors %}
            {{ error }}<br />
        {% endfor %}
    </p>

<br />

    <p>
        {{ form.region.label }}<br /> {{ form.region }}<br />
        {% for error in form.region.errors %}
            {{ error }}<br />
        {% endfor %}
    </p>

<br />

<p>
    {{ form.vmpassword.label }}<br /> {{ form.vmpassword }}<br />
    {% for error in form.vmpassword.errors %}
        {{ error }}<br />
    {% endfor %}
</p>

<br />

    <p>
        <div id="noUiSlider" class="noUiSlider"></div>
        <div id="valueInput">
           {{ form.cpu.label }} {{ form.cpu(class_="noUiSluder") }}<br />
        </div>
        {{ form.mem.label }} {{ form.mem }}<br />
        {{ form.hdd.label }} {{ form.hdd }}<br />
        {{ form.recipe.label }} {{ form.recipe }}<br />
    <p>

<br />

        {{ form.invite_key.label }} {{ form.invite_key }}<br />
        {% for error in form.invite_key.errors %}
            {{ error }}<br />
        {% endfor %}


    </div>
    </div>

    <p>
        {{ form.csrf_token() }}
        {{ form.submit }}
    </p>

 
    </div>



  </div>
</div>

{% endblock %}

