Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (2.5 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
        <div class="stats clearfix">
13
                <ul>
14
                        {% for rdata in resource_usage %}
15
            <li class="clearfix  {{ rdata.load_class }} {{ rdata.name|get_value_after_dot }}" 
16
                    data-resourcekey="{{ rdata.name }}" data-units="{{ rdata.unit }}">
17
                                         <div class="img-wrap">&nbsp;</div>
18
                    <div class="info" data-currvalue="{{ rdata.currValue }}"
19
                                      data-maxvalue="{{ rdata.maxValue }}">
20
                                                <h3>{{ rdata.report_desc }}</h3>
21
                                                <p>                                                        
22
                                                {% if rdata.unit == 'bytes' %}
23
                        <span class="currValue">
24
                            {{ rdata.currValue }}
25
                        </span> out of  
26
                        <span class="maxValue">
27
                            {{ rdata.maxValue }}
28
                        </span>
29
                        {% else %}
30
                        <span class="currValue">
31
                            <span class="value">{{ rdata.currValue }}</span>
32
                        </span>
33
                        out of  
34
                        <span class="maxValue">
35
                            <span class="value">{{ rdata.maxValue }}</span>
36
                            <span class="unit">{{ rdata.unit }}</span>
37
                        </span>
38
                                                {% endif %}
39
                        {% if rdata.is_abbreviation %}{{ rdata.verbose_name|upper }}{% else %}{{ rdata.verbose_name }}{% endif %}{% if rdata.maxValue|floatformat:"0" != "1" and not rdata.unit %}s {% endif  %}
40
                                                </p>
41
                                        </div>
42
                                        <div class="bar" data-steps="">
43
                                                <div>
44
                                                        <span style="width:{{ rdata.ratio_limited|floatformat }}%;">
45
                                <em data-value="{{ rdata.ratio }}" class="value {% if rdata.ratio > 18 %}hovered{% endif %}
46
">{{ rdata.ratio|floatformat }}&#37; &nbsp;&nbsp;</em>        
47
                                                        </span>
48
                                                </div>
49
                                        </div>
50
                                 </li>
51
                         {% endfor%}
52
                </ul>
53
                         
54
        </div>    
55
</div>
56
<script>
57
    $(document).ready(function(){
58
        var usageClient = new UsageClient({
59
            'url': '{% url resource_usage %}?json=1',
60
            'dataType': 'json',
61
            'container': 'div.stats'
62
        });
63
        
64
        window.setInterval(function() {
65
            usageClient.load();
66
        }, {{ usage_update_interval }});
67
        usageClient.load();
68
    })
69

    
70
</script>
71
{% endblock %}