{% extends "infrastructure/overview/deployment_base.html" %}

{% load i18n %}
{% load url from future %}

{% block deployment-heading %}
  <div class="deployment-icon">
      <i class="fa fa-check fa-3x fa-fw"></i>
  </div>
  <div class="deployment-box clearfix">
    <h4>{% trans "Deployment is live" %}</h4>
  </div>
{% endblock %}

{% block deployment-icon %}fa-key{% endblock %}
{% block deployment-title %}{% trans "Access Information" %}{% endblock %}
{% block deployment-info %}
<div>
  {% for dashboard_url in dashboard_urls %}
  <div class="row">
    <div class="col-xs-4">{% trans "Horizon URL:" %}</div>
    <div class="col-xs-8"><a href="{{ dashboard_url }}">{{ dashboard_url }}</a></div>
  </div>
  {% endfor %}
  <div class="row">
    <div class="col-xs-4">{% trans "User name:" %}</div>
    <div class="col-xs-8">admin</div>
  </div>
  <div class="row">
    <div class="col-xs-4">{% trans "Password" %}</div>
    <div class="col-xs-8">
        <span class="btn btn-xs btn-default password-button"
              data-content="{{ admin_password }}"
        ><i class="fa fa-eye"></i> {% trans "Reveal" %}</span>
    </div>
  </div>
</div>

<script type="text/javascript">
(window.$ || window.addHorizonLoadEvent)(function () {
    $('span.password-button').popover({
        trigger: 'click',
        placement: 'top'
    });
});
</script>
{% endblock %}

{% block deployment-buttons %}
  {{ block.super }}
<a
   href="{% url 'horizon:infrastructure:overview:scale_out' %}"
   class="btn ajax-modal btn-default"
>
   <i class="fa fa-lg fa-arrows-alt"></i> {% trans "Scale-out" %}
</a>

{% endblock %}

{% block deployment-overcloudrc %}
  <div class="clear"></div>
  <div class="deployment-icon">
      <i class="fa fa-key fa-3x fa-fw"></i>
  </div>
  <div class="deployment-box clearfix">
    <h4>{% trans "Overcloudrc Information" %}</h4><a data-toggle="collapse" href="#overcloudrc"  aria-expanded="false" aria-controls="overcloudrc" id="collapse-rc"><span class='overcloudrc'>{% trans "Show" %}<i class="fa fa-angle-down"></i></span></a>
    <div class="collapse" id="overcloudrc">
      <div class="row">
        <div class="col-xs-4">NOVA_VERSION:</div>
        <div class="col-xs-8">1.1</div>
      </div>
      <div class="row">
        <div class="col-xs-4">OS_USERNAME:</div>
        <div class="col-xs-8">admin</div>
      </div>
      <div class="row">
        <div class="col-xs-4">OS_PASSWORD:</div>
        <div class="col-xs-8">{{ admin_password }}</div>
      </div>
      <div class="row">
        <div class="col-xs-4">OS_AUTH_URL:</div>
        <div class="col-xs-8">{{ auth_url }}</div>
      </div>
      <div class="row">
        <div class="col-xs-4">OS_TENANT_NAME:</div>
        <div class="col-xs-8">admin</div>
      </div>
      <div class="row">
        <div class="col-xs-4">COMPUTE_API_VERSION:</div>
        <div class="col-xs-8">1.1</div>
      </div>
      <div class="row">
        <div class="col-xs-4">OS_NO_CACHE:</div>
        <div class="col-xs-8">True</div>
      </div>
      <div class="row">
        <div class="col-xs-4">no_proxy:</div>
        <div class="col-xs-8">{{ no_proxy }}</div>
      </div>
      <div class="row">
        <div class="col-xs-4">{% trans "Download" %}</div>
        <div class="col-xs-8">
          <a
             href="{% url 'horizon:infrastructure:overview:download_overcloudrc' %}"
             class="btn btn-default"
          >
            <i class="fa fa-lg fa-download"></i> {% trans "Download" %}
          </a>
        </div>
      </div>
    </div>
  </div>
{% endblock %}
