2481d875d61bbf944e30dee178bfd2c399f775f9
[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 "vims:list" %}', 'nsd_list_url': '{% url "projects:list_descriptors" 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 'instances:show' instance_id=i|get:'_id' type=type %}')"
62 data-toggle="tooltip" data-placement="top" data-container="body" title="Show Info">
63 <i class="fa fa-info"></i>
64 </button>
65 <!--
66 <button type="button" class="btn btn-default"
67 onclick="javascript:showInstanceTopology('{% url 'instances:show_topology' instance_id=i|get:'_id' type=type %}')"
68 data-toggle="tooltip" data-placement="top" data-container="body" title="Show Topology">
69 <i class="fa fa-sitemap"></i>
70 </button>
71 -->
72
73 <button type="button" class="btn btn-default"
74 onclick="javascript:deleteNs('{% url 'instances:delete' instance_id=i|get:'_id' type=type %}')"
75 data-toggle="tooltip" data-placement="top" data-container="body" title="Delete"><i
76 class="far fa-trash-alt"></i></button>
77
78 <button type="button" class="btn btn-default dropdown-toggle"
79 data-toggle="dropdown" aria-expanded="false">Actions
80 <span class="fa fa-caret-down"></span></button>
81 <ul class="dropdown-menu">
82 <li><a href="#"
83 onclick="javascript:performAction('{% url 'instances:action' instance_id=i|get:'_id' type=type %}')">
84 <i class="fa fa-magic"></i> Exec NS Primitive</a></li>
85 <li>
86 <a href="{% url 'instances:ns_operations' type=type instance_id=i|get:'_id' %}">
87 <i class="fa fa-list"></i> Active operations</a></li>
88 <li class="divider"></li>
89 <li><a href="#"
90 onclick="javascript:newAlarmNs('{% url 'instances:ns_create_alarm' instance_id=i|get:'_id' type=type %}')">
91 <i class="far fa-bell"></i> New Alarm</a></li>
92 <li><a href="#"
93 onclick="javascript:exportMetricNs('{% url 'instances:ns_export_metric' instance_id=i|get:'_id' type=type %}')">
94 <i class="far fa-chart-bar"></i> Export metric</a></li>
95 <li class="divider"></li>
96 <li>
97 <a href="javascript:deleteNs('{% url 'instances:delete' instance_id=i|get:'_id' type=type %}', true)">
98 <i class="far fa-trash-alt" style="color:red" ></i> Force delete</a></li>
99 </ul>
100
101
102 </div>
103
104 </td>
105
106
107 </tr>
108 {% endfor %}
109 </tbody>
110 </table>
111 </div>
112 </div>