Rest api
[myslice.git] / sla / templates / agreement_detail.html
1 <h2>Agreement detail</h2>
2
3 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
4     <div class="modal-dialog">
5         <div class="modal-content">
6             <div class="modal-header">
7                 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
8                 <h4 class="modal-title" id="myModalLabel">search result</h4>
9             </div>
10             <div class="modal-body">
11                 <div id="context">
12                     <dl class="dl-horizontal">
13                         {# Sanity default: if dd is empty, the values are permutated #}
14                         <dt>Agreement Id</dt>
15                         <dd>{{ agreement.agreement_id|default:"&nbsp;" }}</dd>
16                         <dt>Provider</dt>
17                         <dd>{{ agreement.context.provider|default:"&nbsp;" }}</dd>
18                         <dt>Consumer</dt>
19                         <dd>{{ agreement.context.consumer|default:"&nbsp;" }}</dd>
20                         <dt>Service</dt>
21                         <dd>{{ agreement.context.service_formatted|default:"&nbsp;" }}</dd>
22                         <dt>Expiration time</dt>
23                         <dd>{{ agreement.context.expirationtime|default:"&nbsp;" }}</dd>
24                     </dl>
25                 </div>
26
27                 <div id="properties_summary">
28
29                     <table class="table">
30                         <tr>
31                             <th>#</th>
32                             <th>Metric name</th>
33                             <th>Bounds</th>
34                             <th># violations</th>
35                         </tr>
36
37                         {% for tname, t in agreement.guaranteeterms.items %}
38                             <tr class="{{ t.statusclass }}">
39                                 <td>{{ forloop.counter }}</td>
40                                 <td>{{ t.servicelevelobjective.kpiname }}</td>
41                                 <td>({{ t.servicelevelobjective.bounds.0 }}, {{ t.servicelevelobjective.bounds.1 }})
42                                 </td>
43                                 <td>
44                                     <a href="{% url " agreement_term_violations " agreement.agreement_id t.name %}">{{ t.nviolations }}</a>
45                                 </td>
46                             </tr>
47                         {% empty %}
48                         {% endfor %}
49                     </table>
50                 </div>
51
52                 <div id="violations_summary_by_date">
53                     <table class="table">
54                         <tr>
55                             <th>#</th>
56                             <th>Date</th>
57                             <th># violations</th>
58                         </tr>
59
60                         {% for date, violations in violations_by_date %}
61                             <tr>
62                                 <td>{{ forloop.counter }}</td>
63                                 <td>{{ date|date }}</td>
64                                 <td>{{ violations|length }}</td>
65                             </tr>
66                         {% endfor %}
67                     </table>
68                 </div>
69
70
71                 <div class="modal-footer">
72                     <a href="{{ backurl }}" class="btn btn-default btn-back">Back</a>
73                 </div>
74             </div>
75         </div>
76     </div>
77 </div>