SLA code updated and new image for SmartSantander Application Service added
[unfold.git] / sla / templates / slice-tab-sla.html
1
2 <div class="col-md-2">
3 </div>
4
5  <div class="col-md-9">
6    <div class="row" id="agreements">
7     <table class="table dataTable" id="sla_table" >
8         <thead>
9         <tr class="header">
10             <th colspan="2">Provider</th>
11             <!-- <th>Testbed</th>
12             <th>Slice_Id</th>
13             <th>Agreement</th>
14             <th>Metric</th>
15             <th>Violations</th>
16             <th>Result</th> -->
17         </tr>
18         </thead>
19         <tbody>
20         
21        <tr class="header">
22                 <td><span class="glyphicon glyphicon-chevron-down"></span></td>
23                 <td>iMinds</td>
24        </tr>
25        
26        
27         {% for a in agreements %}
28
29
30 <!-- Modal - columns selector -->
31 <div class="modal fade" id="agreementModal{{a.agreement_id}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
32                         
33 <style type="text/css" scoped>
34         .modal-lg {
35           width: 50%;
36         }
37 </style>
38                         
39         <div class="modal-dialog modal-lg">
40                 <div class="modal-content">
41                         <div class="modal-header">
42                                 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
43                                 <h4 class="modal-title" id="myModalAgreement">Agreement details</h4>
44                         </div>
45                         <div class="modal-body">
46
47                  <dt>Agreement Id</dt>
48                  <dd>{{ a.agreement_id|default:"&nbsp;" }}</dd>
49                  <dt>Provider</dt>
50                  <dd>{{ a.context.provider|default:"&nbsp;" }}</dd>
51                  <dt>Experimenter</dt>
52                  <dd>{{ a.context.consumer|default:"&nbsp;" }}</dd>
53                  <dt>Service</dt>
54                  <dd>Testbed guarantees 0.99 Uptime rate for 0.99 rate of the resources during the sliver lifetime</dd>
55                  <dt>Testbed</dt>
56                  <dd>{{ a.context.testbed_formatted }}</dd>
57                  <dt>Accepted on:</dt>
58                  <dd>{{ a.context.time_formatted|default:"&nbsp;" }}</dd>
59                         </div>
60                         <div class="modal-footer">
61                                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
62                         </div>
63                 </div>
64         </div>
65 </div>
66        
67        <tr>
68                 {% if a.guaranteestatus == "VIOLATED" %}
69                 <td class="glyphicon glyphicon-remove-sign" style="color:red;"></td>
70                 {% elif a.guaranteestatus == "FULFILLED" %}
71                 <td class="glyphicon glyphicon-ok-sign" style="color:green;"></td>
72           {% else %}
73           <td></td>
74                 {% endif %}
75                   <td>{{ a.context.template_id }}</td>
76           <td>{{ a.context.time_formatted }}</td>
77           
78           {% with a.agreement_id as key %}
79           
80           <td>
81               <!-- <a class="agreement-detail" href="{% url "agreement_details" a.agreement_id %}" data-toggle="modal" data-target="#agreementModal">View Agreement</a> -->
82               <!-- <a class="agreement-detail" href="#" data-agreement="{{ a.agreement_id }}">View Agreement</a> -->
83               <a class="agreement-detail" data-toggle="modal" data-target="#agreementModal{{a.agreement_id}}">View Agreement</a>
84           </td>
85
86           {% for k,v in enforcements.items %}
87             {% if key == k %}
88               <td>
89               {% if v == "ACTIVE" %}
90                 In progress
91               {% elif v == "UNACTIVE" %}
92                 Disabled
93               {% endif %}
94               </td>
95
96               {% if a.guaranteestatus == "VIOLATED" and v == "UNACTIVE" %}
97               <td style="font-weight: bold">
98                 Result: 99% uptime for
99                 {% for vi, value in last_violation_list.items %}
100                   {% if a.agreement_id == vi %}
101                       {{ value }}%
102                   {% endif %}
103                 {% endfor %}
104                 resources
105               </td>
106               {% elif a.guaranteestatus == "FULFILLED" and v == "UNACTIVE" %}
107               <td style="font-weight: bold">
108                 Result: 99% uptime for
109                 {% for vi, value in last_violation_list.items %}
110                   {% if a.agreement_id == vi %}
111                       {{ value }}%
112                   {% endif %}
113                 {% endfor %}
114                 resources
115               </td>
116               {% endif %}
117             {% endif %}
118
119           {% endfor %}
120           
121           <!-- <td>{{slicename}}</td> -->
122
123           
124
125           
126               
127
128             {% endwith %}
129             <!-- {% for tname,t in a.guaranteeterms.items %}
130             <td> {{ t.servicelevelobjective.kpiname }}</td>
131             <td>
132                 {% if t.status == "VIOLATED" %}
133
134                   <a class="violation-detail" href="{% url "agreement_term_violations" a.agreement_id t.name %}" data-toggle="modal" data-target="#violationModal">View Violations</a>
135                   <a class="violation-detail" href="#"
136                                         data-agreement="{{ a.agreement_id }}" 
137                                         data-violation="{{ t.name }}">View Violations</a>
138                   <a class="violation-detail" href="#" data-agreement="{{ a.agreement_id }}" data-violation="{{ t.name }}">{{last_violation_list}}</a>
139                   {{ t.name }}
140
141                 {% endif %}
142             </td>
143             <td id="status" style="display:none;">
144                 {{ a.statusclass }}
145             </td>
146             {% endfor %} -->
147
148
149             
150         </tr>
151         
152         
153         {% endfor %}
154         </tbody>
155
156 </table>
157 </div>
158 </div>
159 <!-- <div class="row" style="float:right;">
160     <button id="showEvaluations" type="button" class="btn btn-default"  onclick="displayDate()"><span class="glyphicon"></span>Show Evaluations</button>
161 </div> -->
162
163 <script>
164 $(document).ready(function() {
165         $('a.violation-detail').click(function () {
166                 var a = $(this).data('agreement');
167                 var v = $(this).data('violation');
168                 $("#sla").load('/sla/agreements/' + a + '/guarantees/' + v + '/violations', {'slicename': '{{ slicename }}'});
169         });
170         
171         // $('a.agreement-detail').click(function () {
172         //      var a = $(this).data('agreement');
173         //      $("#sla").load('/sla/agreements/' + a + '/detail');
174         // });
175
176         $('tr.header').click(function(){
177                 $(this).nextUntil('tr.header').toggle('fast');
178                 $('.header .glyphicon').toggleClass('glyphicon-chevron-down glyphicon-chevron-right');
179         });
180 });
181
182 </script>