Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / templates / im / resource_usage.html @ d6ea9b3d

History | View | Annotate | Download (2.7 kB)

1
{% extends "im/account_base.html" %}
2

    
3
{% load filters %}
4

    
5
{% block headjs %}
6
{{ block.super }}
7
<script src="{{ IM_STATIC_URL }}js/usage.js"></script>        
8
{% endblock %}
9

    
10
{% block page.body %}
11
<div class="maincol {% block innerpage.class %}{% endblock %}"> 
12
        <h2>RESOURCE USAGE</h2>
13
        <div class="stats clearfix">
14
                <ul>
15
                        {% for rdata in resource_usage %}
16
            <li class="clearfix  {{ rdata.load_class }} {{ rdata.name|get_value_after_dot }}" 
17
                    data-resourcekey="{{ rdata.name }}" data-units="{{ rdata.unit }}">
18
                                         <div class="img-wrap">&nbsp;</div>
19
                    <div class="info" data-currvalue="{{ rdata.currValue }}"
20
                                      data-maxvalue="{{ rdata.maxValue }}">
21
                                                <h3>{{ rdata.report_desc }}</h3>
22
                                                <p>                                                        
23
                                                {% if rdata.unit == 'bytes' %}
24
                        <span class="currValue">
25
                            {{ rdata.currValue }}
26
                        </span> out of  
27
                        <span class="maxValue">
28
                            {{ rdata.maxValue }}
29
                        </span>
30
                        {% else %}
31
                        <span class="currValue">
32
                            <span class="value">{{ rdata.currValue }}</span>
33
                        </span>
34
                        out of  
35
                        <span class="maxValue">
36
                            <span class="value">{{ rdata.maxValue }}</span>
37
                            <span class="unit">{{ rdata.unit }}</span>
38
                        </span>
39
                                                {% endif %}
40
                        {{rdata.pluralized_display_name}}
41
                                                </p>
42
                                        </div>
43
                                        <div class="bar" data-steps="">
44
                                                <div>
45
                                                        {% if rdata.ratio > 18 %}
46
                                                        <span style="width:{{ rdata.ratio_limited|floatformat }}%;" class="hovered">
47
                                <em data-value="{{ rdata.ratio }}" class="value">{{ rdata.ratio|floatformat }}&#37; &nbsp;&nbsp;</em>        
48
                                                        </span>
49
                                                        {% else %}
50
                                                        <span style="width:{{ rdata.ratio_limited|floatformat }}%;">
51
                                        &nbsp;
52
                                                        </span>
53
                                                        <em data-value="{{ rdata.ratio }}" class="value">
54
                                        {{ rdata.ratio|floatformat }}&#37; &nbsp;&nbsp;
55
                                </em>
56
                                                        {% endif %}
57
                                                </div>
58
                                        </div>
59
                                 </li>
60
                         {% endfor%}
61
                </ul>
62
                         
63
        </div>    
64
</div>
65
<script>
66
    $(document).ready(function(){
67
        var usageClient = new UsageClient({
68
            'url': '{% url resource_usage %}?json=1',
69
            'dataType': 'json',
70
            'container': 'div.stats'
71
        });
72
        
73
        window.setInterval(function() {
74
            usageClient.load();
75
        }, {{ usage_update_interval }});
76
        usageClient.load();
77
    })
78

    
79
</script>
80
{% endblock %}