
<!-- Copyright 2014 Intel Corporation, All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the"License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied. See the License for the
 specific language governing permissions and limitations
 under the License.
 --> 

{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "PG Status" %}{% endblock %}

{% block page_header %}
  {% include "horizon/common/_page_header.html" with title=cluster.title %}
   <link href="{{ STATIC_URL }}dashboard/css/pgstatus.css" rel="stylesheet">
{% endblock page_header %}

{% block main %}
    <div class="vsm-summary"  >
        <h3 class="table_title">{% trans "Object Summary" %}</h3>
        <div class = "vsm-summary-content">
          <div class="form-group">
            <label class="control-label">{% trans "Degraded Objects" %}</label>
            <label id ="lblDegradedObjects" class="control-label">--</label>
          </div>
          <div class="form-group">
            <label class="control-label">{% trans "Degraded Totals" %}</label>
            <label id ="lblDegradedTotal" class="control-label">--</label>
          </div>
          <div class="form-group">
            <label class="control-label">{% trans "Degraded Ratio" %}</label>
            <label id ="lblDegradedRatio" class="control-label">--</label>
          </div>
          <div class="form-group">
            <label class="control-label">{% trans "Unfound Objects" %}</label>
            <label id ="lblUnfoundObjects" class="control-label">--</label>
          </div>
          <div class="form-group">
            <label class="control-label">{% trans "Unfound Totals" %}</label>
            <label id ="lblUnfoundTotals" class="control-label">--</label>
          </div>
           <div class="form-group">
            <label class="control-label">{% trans "Unfound Ratio" %}</label>
            <label id ="lblUnfoundRatio" class="control-label">--</label>
          </div>
    </div>
  </div>  


    <div class="vsm-summary" >
        <h3 class="table_title">{% trans "Performance Summary" %}</h3>
        <div class = "vsm-summary-content">
          <div class="form-group">
            <label class="control-label">{% trans "Read" %}</label>
            <label id ="lblRead" class="control-label">--</label>
          </div>
          <div class="form-group">
            <label class="control-label">{% trans "Write" %}</label>
            <label id ="lblWrite" class="control-label">--</label>
          </div>
          <div class="form-group">
            <label class="control-label">{% trans "Operation" %}</label>
            <label id ="lblOperation" class="control-label">--</label>
          </div>
    </div>
  </div>  


  <div class="vsm-summary"    >
        <h3 class="table_title">{% trans "PG Summary" %}</h3>
        <div class = "vsm-summary-content">
          <div class="form-group">
            <label class="control-label">{% trans "PG Map Version" %}</label>
            <label id ="lblPGMapVersion" class="control-label">--</label>
          </div>
          <div class="form-group">
            <label class="control-label">{% trans "Total PGs" %}</label>
            <label id ="lblTotalPGs" class="control-label">--</label>
          </div>
          <div class="form-group">
            <label class="control-label">{% trans "Update" %}</label>
            <label id ="lblUpdate" class="control-label">--</label>
          </div>
    </div>
  </div>  



  <div class="vsm-summary"    >
        <h3 class="table_title">{% trans "Capacity Summary" %}</h3>
        <div class = "vsm-summary-content">
          <div class="form-group">
            <label class="control-label">{% trans "Data Capacity Used" %}</label>
            <label id ="lblDataCapacityUsed" class="control-label">--</label>
          </div>
          <div class="form-group">
            <label class="control-label">{% trans "Total Capacity Used" %} </label>
            <label id ="lblTotalCapacityUsed" class="control-label">--</label>
          </div>
          <div class="form-group">
            <label class="control-label">{% trans "Capacity Available" %}</label>
            <label id ="lblCapacityAvailable" class="control-label">--</label>
          </div>
          <div class="form-group">
            <label class="control-label">{% trans "Capacity Total" %}</label>
            <label id ="lblCapacityTotal" class="control-label">--</label>
          </div>
    </div>
  </div>  




    {{ table.render }}
{% endblock %}

{% block js %}
    {{ block.super }}
        <script src="{{ STATIC_URL }}lib/echarts.js"></script>
         <script src='{{ STATIC_URL }}dashboard/js/pgstatus.js' type='text/javascript' charset='utf-8'></script>   
        <script type="text/javascript">
            function searchToObject(){
                var pairs = window.location.search.substring(1).split("&");
                var obj = {};
                var pair, i;
                for(i in pairs){
                    if(paris[i] === "")continue;
                    pair = pairs[i].split("=");
                    obj[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
                }
                return obj;
            }
            var back = "";
            if(window.location.search){
                document.body.scrollTop = 500;
                //var search = searchToObject();
                back = "<a href='javascript:history.back(-1)'>previous</a>&nbsp;&nbsp;";
            }
            var marker = $('#pg_list tbody tr').last().find('td').first().html();
            var next_page_url = location.pathname + "?marker=" + marker;
            $("tfoot tr td").append("<div class='page'>"+back+"<a href='"+next_page_url+"'>next</a></div>");
        </script>
{% endblock %}

