{% extends 'layouts/base.html' %}

{% block title %} Tables {% endblock title %}

{% block content %}

  <div class="header bg-primary pb-6">
    <div class="container-fluid">
      <div class="header-body">
        <div class="row align-items-center py-4">
          <div class="col-lg-6 col-7">
            <h6 class="h2 text-white d-inline-block mb-0">Machine Statistics</h6>
            <nav aria-label="breadcrumb" class="d-none d-md-inline-block ml-md-4">
              <ol class="breadcrumb breadcrumb-links breadcrumb-dark">
                <li class="breadcrumb-item"><a href="#"><i class="fas fa-home"></i></a></li>
                <li class="breadcrumb-item"><a href="#">Dashboard</a></li>
                <li class="breadcrumb-item active" aria-current="page">Machine Statistics</li>
              </ol>
            </nav>
          </div>
          <div class="col-lg-6 col-5 text-right">
            <a href="#" class="btn btn-sm btn-neutral">New</a>
            <a href="#" class="btn btn-sm btn-neutral">Filters</a>
          </div>
        </div>
      </div>
      <div class="row">
        {% for key,value in active_data.items() %}
        <div class="col-xl-3 col-md-6">
          <div class="card card-stats">
            <!-- Card body -->
            <div class="card-body">
              <div class="row">
                <div class="col">
                  <h5 class="card-title text-uppercase text-muted mb-0">{{key}}</h5>
                  <span class="h2 font-weight-bold mb-0">{{value}}</span>
                </div>
                <div class="col-auto">
                  <div class="icon icon-shape bg-gradient-red text-white rounded-circle shadow">
                    <i class="ni ni-active-40"></i>
                  </div>
                </div>
              </div>
              <p class="mt-3 mb-0 text-sm">
                <span class="text-success mr-2"><i class="fa fa-arrow-up"></i> 3.48%</span>
                <span class="text-nowrap">Since last month</span>
              </p>
            </div>
          </div>
        </div>
        {% endfor %}
      </div>
    </div>
  </div>
  
  <!-- Page content -->
  <div class="container-fluid mt--6">
    <div class="row">
      <div class="col">
        <div class="card">
          <!-- Card header -->
          <div class="card-header border-0">
            <h3 class="mb-0">Details</h3>
          </div>
          <!-- Light table -->
          <div class="table-responsive">
            <table class="table align-items-center table-flush">
              <thead class="thead-light">
                <tr>
                  <th scope="col" class="sort" data-sort="name">HostName</th>
                  <th scope="col" class="sort" data-sort="name">DateTime</th>
                  <th scope="col" class="sort" data-sort="budget">Total Phy Mem</th>
                  <th scope="col" class="sort" data-sort="status">Used Phy Mem</th>
                  <th scope="col" class="sort" data-sort="status">Free Phy Mem</th>
                  <th scope="col" class="sort" data-sort="status">Swap Memory</th>
                  <th scope="col" class="sort" data-sort="status">Cores</th>
                  <th scope="col" class="sort" data-sort="status">Total System Space</th>
                  <th scope="col" class="sort" data-sort="status">Usable Space</th>
                  <th scope="col" class="sort" data-sort="status">/parablu</th>
                </tr>
              </thead>
              <tbody class="list">
                {% for customer in datas %}
                <tr>
                  <th scope="row">
                    <div class="media align-items-center">
                      <a href="#" class="avatar rounded-circle mr-3">
                        <img alt="Image placeholder" src="/static/assets/img/theme/react.jpg">
                      </a>
                      <div class="media-body">
                        <span class="name mb-0 text-sm">{{customer['HostName']}}</span>
                      </div>
                    </div>
                  </th>
                  <td class="budget">
                    {{customer['DateTime']}}
                  </td>
                  <td>
                    <span class="badge badge-dot mr-4">
                      <i class="bg-info"></i>
                      <span class="status">{{customer['Total_Physical_Memory']}}</span>
                    </span>
                  </td>
                  <td class="budget">
                    {{customer['Used_Phy_Mem']}}
                  </td>
                  <td class="budget">
                    {{customer['Free_Phy_Mem']}}
                  </td>
                  <td class="budget">
                    {{customer['Swap_Mem']}}
                  </td>
                  <td class="budget">
                    {{customer['Cores']}}
                  </td>
                  <td class="budget">
                    {{customer['System_Space']}}
                  </td>
                  <td class="budget">
                    {{customer['Usable_Space']}}
                  </td>
                  <td class="budget">
                    {{customer['parablu']}}
                  </td>
                </tr>
                {% endfor %}
              </tbody>
            </table>
          </div>
          <!-- Card footer -->
          <div class="card-footer py-4">
            <nav aria-label="...">
              <ul class="pagination justify-content-end mb-0">
                <li class="page-item disabled">
                  <a class="page-link" href="#" tabindex="-1">
                    <i class="fas fa-angle-left"></i>
                    <span class="sr-only">Previous</span>
                  </a>
                </li>
                <li class="page-item active">
                  <a class="page-link" href="#">1</a>
                </li>
                <li class="page-item">
                  <a class="page-link" href="#">2 <span class="sr-only">(current)</span></a>
                </li>
                <li class="page-item"><a class="page-link" href="#">3</a></li>
                <li class="page-item">
                  <a class="page-link" href="#">
                    <i class="fas fa-angle-right"></i>
                    <span class="sr-only">Next</span>
                  </a>
                </li>
              </ul>
            </nav>
          </div>
        </div>
      </div>
    </div>

    {% include "includes/footer.html" %}

  </div>

{% endblock content %}

<!-- Specific JS goes HERE --> 
{% block javascripts %}{% endblock javascripts %}
