0e327658827eba93fb5e6c3f20dafc451ac5f87a
[osm/LW-UI.git] / instancehandler / template / instance_list_ns.html
1 {% load get %}
2 <div class="box">
3 <div class="box-header with-border">
4 <h3 class="box-title">{{ type|upper }} Instances</h3>
5
6 <div class="box-tools">
7
8 <button type="button" class="btn btn-default" data-container="body"
9 data-toggle="tooltip" data-placement="top" title="Instantiate NS"
10 onclick="javascript:openModalCreateNS({ 'project_id':'{{ project_id }}','vim_list_url': '{% url "vim:list" %}', 'nsd_list_url': '{% url "projects:list_descriptors" project_id=project_id descriptor_type='nsd' %}'})">
11 <i class="fa fa-paper-plane"></i> <span> New NS</span></button>
12
13 </div>
14
15 </div>
16 <div class="box-body">
17 <table id="instances_table" class="table table-bordered table-striped">
18 <thead>
19 <tr>
20 <th>Id</th>
21 <th>Name</th>
22 <th>Nsd name</th>
23 <th style="width:5%">Operational Status</th>
24 <th style="width:5%">Config Status</th>
25 <th>Detailed Status</th>
26 <th>Actions</th>
27 </tr>
28 </thead>
29 <tbody>
30 {% for i in instances %}
31 <tr>
32
33 <td>{{ i|get:"_id" }}</td>
34 <td>{{ i|get:"short-name" }}</td>
35 <td>{{ i|get:"nsd-name-ref" }}</td>
36
37 {% if i|get:"operational-status" == 'failed' %}
38 <td><span class="label label-danger">{{ i|get:"operational-status" }}</span></td>
39 {% elif i|get:"operational-status" == 'init' %}
40 <td><span class="label label-warning">{{ i|get:"operational-status" }}</span></td>
41 {% elif i|get:"operational-status" == 'running' %}
42 <td><span class="label label-success">{{ i|get:"operational-status" }}</span></td>
43 {% else %}
44 <td>{{ i|get:"operational-status" }}</td>
45 {% endif %}
46 {% if i|get:"config-status" == 'failed' %}
47 <td><span class="label label-danger">{{ i|get:"config-status" }}</span></td>
48 {% elif i|get:"config-status" == 'init' %}
49 <td><span class="label label-warning">{{ i|get:"config-status" }}</span></td>
50 {% elif i|get:"config-status" == 'running' %}
51 <td><span class="label label-success">{{ i|get:"config-status" }}</span></td>
52 {% elif i|get:"config-status" == 'configured' %}
53 <td><span class="label label-success">{{ i|get:"config-status" }}</span></td>
54 {% else %}
55 <td>{{ i|get:"config-status" }}</td>
56 {% endif %}
57 <td class="ellipsis" data-text="{{ i|get:"detailed-status" }}">{{ i|get:"detailed-status" }}</td>
58 <td>
59 <div class="btn-group">
60 <button type="button" class="btn btn-default"
61 onclick="javascript:showInstanceDetails('{% url 'projects:instances:show' instance_id=i|get:'_id' project_id=project_id type=type %}')"
62 data-toggle="tooltip" data-placement="top" data-container="body" title="Show Info">
63 <i
64 class="fa fa-info"></i>
65 </button>
66
67 <button type="button" class="btn btn-default"
68 onclick="javascript:deleteNs('{% url 'projects:instances:delete' instance_id=i|get:'_id' project_id=project_id type=type %}')"
69 data-toggle="tooltip" data-placement="top" data-container="body" title="Delete"><i
70 class="fa fa-trash-o"></i></button>
71
72 <button type="button" class="btn btn-default dropdown-toggle"
73 data-toggle="dropdown" aria-expanded="false">Actions
74 <span class="fa fa-caret-down"></span></button>
75 <ul class="dropdown-menu">
76 <li><a href="#"
77 onclick="javascript:performAction('{% url 'projects:instances:action' instance_id=i|get:'_id' project_id=project_id type=type %}')">
78 <i class="fa fa-magic"></i>Exec NS Primitive</a></li>
79 <li>
80 <a href="{% url 'projects:instances:ns_operations' project_id=project_id type=type instance_id=i|get:'_id' %}">
81 <i class="fa fa-list"></i>Active operations</a></li>
82 <li class="divider"></li>
83 <li>
84 <a href="javascript:deleteNs('{% url 'projects:instances:delete' instance_id=i|get:'_id' project_id=project_id type=type %}', true)">
85 <i class="fa fa-trash" style="color:red" ></i>Force delete</a></li>
86 </ul>
87
88
89 </div>
90
91 </td>
92
93
94 </tr>
95 {% endfor %}
96 </tbody>
97 </table>
98 </div>
99 </div>