{% extends "dashboard/base.html" %}
{% load static %}
{% load i18n %}
{% load render_table from django_tables2 %}

{% block title-page %}{% trans "Nodes" %}{% endblock %}

{% block content %}

<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="no-margin"><i class="fa fa-sitemap"></i> {% trans "Compute nodes" %}</h3>
      </div>
      <div id="table_container">
        <div id="rendered_table" class="panel-body">
          <div class="table-responsive">
            {% render_table table %}
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
        <div class="pull-right graph-buttons">
          {% include "dashboard/_graph-time-buttons.html" %}
        </div>
        <h3 class="no-margin"><i class="fa fa-area-chart"></i> {% trans "Graphs" %}</h3>
      </div>
      <div class="text-center graph-images">
        <img src="{% url "dashboard.views.node-list-graph" "alloc" graph_time %}"/>
        <img src="{% url "dashboard.views.node-list-graph" "vm" graph_time %}"/>
      </div>
    </div>
  </div><!-- -col-md-12 -->
</div><!-- .row -->

<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
        <a id="reschedule-now" class="btn btn-danger pull-right" href="{% url "dashboard.views.reschedule" %}">
          <i class="fa fa-magic"></i> {% trans "Reschedule now" %}
        </a>
        <h3 class="no-margin"><i class="fa fa-truck"></i> {% trans "Virtual machine auto migration" %}</h3>
      </div>
      <div id="node-list-auto-migration-body">
        <h1>Crontab</h1>
        <form>
          {{ auto_migration_form.as_p }}
        </form>
      </div>
    </div>
  </div><!-- -col-md-12 -->
</div><!-- .row -->

{% endblock %}
