SLA and Service Directory code added
[unfold.git] / sla / templates / agreement_detail.html
diff --git a/sla/templates/agreement_detail.html b/sla/templates/agreement_detail.html
new file mode 100755 (executable)
index 0000000..32cdeb5
--- /dev/null
@@ -0,0 +1,77 @@
+<h2>Agreement detail</h2>
+
+<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+                <h4 class="modal-title" id="myModalLabel">search result</h4>
+            </div>
+            <div class="modal-body">
+                <div id="context">
+                    <dl class="dl-horizontal">
+                        {# Sanity default: if dd is empty, the values are permutated #}
+                        <dt>Agreement Id</dt>
+                        <dd>{{ agreement.agreement_id|default:"&nbsp;" }}</dd>
+                        <dt>Provider</dt>
+                        <dd>{{ agreement.context.provider|default:"&nbsp;" }}</dd>
+                        <dt>Consumer</dt>
+                        <dd>{{ agreement.context.consumer|default:"&nbsp;" }}</dd>
+                        <dt>Service</dt>
+                        <dd>{{ agreement.context.service_formatted|default:"&nbsp;" }}</dd>
+                        <dt>Expiration time</dt>
+                        <dd>{{ agreement.context.expirationtime|default:"&nbsp;" }}</dd>
+                    </dl>
+                </div>
+
+                <div id="properties_summary">
+
+                    <table class="table">
+                        <tr>
+                            <th>#</th>
+                            <th>Metric name</th>
+                            <th>Bounds</th>
+                            <th># violations</th>
+                        </tr>
+
+                        {% for tname, t in agreement.guaranteeterms.items %}
+                            <tr class="{{ t.statusclass }}">
+                                <td>{{ forloop.counter }}</td>
+                                <td>{{ t.servicelevelobjective.kpiname }}</td>
+                                <td>({{ t.servicelevelobjective.bounds.0 }}, {{ t.servicelevelobjective.bounds.1 }})
+                                </td>
+                                <td>
+                                    <a href="{% url " agreement_term_violations " agreement.agreement_id t.name %}">{{ t.nviolations }}</a>
+                                </td>
+                            </tr>
+                        {% empty %}
+                        {% endfor %}
+                    </table>
+                </div>
+
+                <div id="violations_summary_by_date">
+                    <table class="table">
+                        <tr>
+                            <th>#</th>
+                            <th>Date</th>
+                            <th># violations</th>
+                        </tr>
+
+                        {% for date, violations in violations_by_date %}
+                            <tr>
+                                <td>{{ forloop.counter }}</td>
+                                <td>{{ date|date }}</td>
+                                <td>{{ violations|length }}</td>
+                            </tr>
+                        {% endfor %}
+                    </table>
+                </div>
+
+
+                <div class="modal-footer">
+                    <a href="{{ backurl }}" class="btn btn-default btn-back">Back</a>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
\ No newline at end of file