{% load i18n sizeformat %}

<h3>{% trans "Instance Overview" %}</h3>

<div class="status row detail">
  <h4>{% trans "Info" %}</h4>
  <hr class="header_rule">
  <dl>
    <dt>{% trans "Name" %}</dt>
    <dd>{{ instance.name }}</dd>
    <dt>{% trans "ID" %}</dt>
    <dd>{{ instance.id }}</dd>
    <dt>{% trans "Datastore" %}</dt>
    <dd>{{ instance.datastore.type }}</dd>
    <dt>{% trans "Datastore Version" %}</dt>
    <dd>{{ instance.datastore.version }}</dd>
    <dt>{% trans "Status" %}</dt>
    <dd>{{ instance.status|title }}</dd>
  </dl>
</div>

<div class="specs row-fluid detail">
  <h4>{% trans "Specs" %}</h4>
  <hr class="header_rule">
  <dl>
    <dt>{% trans "Flavor" %}</dt>
    <dd>{{ instance.full_flavor.name }}</dd>
    <dt>{% trans "RAM" %}</dt>
    <dd>{{ instance.full_flavor.ram|mbformat }}</dd>
    {% if instance.volume %}
        <dt>{% trans "Volume Size" %}</dt>
        <dd>{{ instance.volume.size|diskgbformat }}</dd>
    {% endif %}
    <dt>{% trans "Created" %}</dt>
    <dd>{{ instance.created|parse_isotime }}</dd>
    <dt>{% trans "Updated" %}</dt>
    <dd>{{ instance.updated|parse_isotime }}</dd>
  </dl>
</div>

{% block connection_info %}
{% endblock %}
<div class="addresses row detail">
  <h4>{% trans "Connection Info" %}</h4>
  <hr class="header_rule">
  <dl>
    {% with instance.host as host %}
    <dt>{% trans "Host" %}</dt>
    <dd>{{ host }}</dd>
    <dt>{% trans "Database Port" %}</dt>
    <dd>3306</dd> {# TODO: This should be a config #}
    <dt>{% trans "Connection Examples" %}</dt>
    <dd>mysql -h {{ host }} -u USERNAME -p</dd>
    <dd>mysql://USERNAME:PASSWORD@{{ host }}:3306/DATABASE</dd>
    {% endwith %}
  </dl>
</div>
