fix Bug 511
[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 {% if alert_error %}
18 <div class="alert alert-danger alert-dismissible fade in">
19 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
20 <h4><i class="icon fa fa-ban"></i> Error</h4>
21 {{alert_error}}
22 </div>
23 {% endif %}
24 <table id="instances_table" class="table table-bordered table-striped">
25 <thead>
26 <tr>
27 <th>Name</th>
28 <th>Identifier</th>
29 <th>Nsd name</th>
30 <th style="width:5%">Operational Status</th>
31 <th style="width:5%">Config Status</th>
32 <th>Detailed Status</th>
33 <th>Actions</th>
34 </tr>
35 </thead>
36 <tbody>
37 {% for i in instances %}
38 <tr>
39 <td>{{ i|get:"short-name" }}</td>
40 <td>{{ i|get:"_id" }}</td>
41
42 <td>{{ i|get:"nsd-name-ref" }}</td>
43
44 {% if i|get:"operational-status" == 'failed' %}
45 <td><span class="label label-danger">{{ i|get:"operational-status" }}</span></td>
46 {% elif i|get:"operational-status" == 'init' %}
47 <td><span class="label label-warning">{{ i|get:"operational-status" }}</span></td>
48 {% elif i|get:"operational-status" == 'running' %}
49 <td><span class="label label-success">{{ i|get:"operational-status" }}</span></td>
50 {% else %}
51 <td>{{ i|get:"operational-status" }}</td>
52 {% endif %}
53 {% if i|get:"config-status" == 'failed' %}
54 <td><span class="label label-danger">{{ i|get:"config-status" }}</span></td>
55 {% elif i|get:"config-status" == 'init' %}
56 <td><span class="label label-warning">{{ i|get:"config-status" }}</span></td>
57 {% elif i|get:"config-status" == 'running' %}
58 <td><span class="label label-success">{{ i|get:"config-status" }}</span></td>
59 {% elif i|get:"config-status" == 'configured' %}
60 <td><span class="label label-success">{{ i|get:"config-status" }}</span></td>
61 {% else %}
62 <td>{{ i|get:"config-status" }}</td>
63 {% endif %}
64 <td class="ellipsis" data-text="{{ i|get:"detailed-status" }}">{{ i|get:"detailed-status" }}</td>
65 <td>
66 <div class="btn-group">
67 <button type="button" class="btn btn-default"
68 onclick="javascript:showInstanceDetails('{% url 'instances:show' instance_id=i|get:'_id' type=type %}')"
69 data-toggle="tooltip" data-placement="top" data-container="body" title="Show Info">
70 <i class="fa fa-info"></i>
71 </button>
72 <!--
73 <button type="button" class="btn btn-default"
74 onclick="javascript:showInstanceTopology('{% url 'instances:show_topology' instance_id=i|get:'_id' type=type %}')"
75 data-toggle="tooltip" data-placement="top" data-container="body" title="Show Topology">
76 <i class="fa fa-sitemap"></i>
77 </button>
78 -->
79
80 <button type="button" class="btn btn-default"
81 onclick="javascript:deleteNs('{% url 'instances:delete' instance_id=i|get:'_id' type=type %}')"
82 data-toggle="tooltip" data-placement="top" data-container="body" title="Delete"><i
83 class="far fa-trash-alt"></i></button>
84
85 <button type="button" class="btn btn-default dropdown-toggle"
86 data-toggle="dropdown" aria-expanded="false">Actions
87 <span class="fa fa-caret-down"></span></button>
88 <ul class="dropdown-menu">
89 <li><a href="#"
90 onclick="javascript:performAction('{% url 'instances:action' instance_id=i|get:'_id' type=type %}')">
91 <i class="fa fa-magic"></i> Exec NS Primitive</a></li>
92 <li>
93 <a href="{% url 'instances:ns_operations' type=type instance_id=i|get:'_id' %}">
94 <i class="fa fa-list"></i> Active operations</a></li>
95 <li class="divider"></li>
96 <li><a href="#"
97 onclick="javascript:newAlarmNs('{% url 'instances:ns_create_alarm' instance_id=i|get:'_id' type=type %}')">
98 <i class="far fa-bell"></i> New Alarm</a></li>
99 <li><a href="#"
100 onclick="javascript:exportMetricNs('{% url 'instances:ns_export_metric' instance_id=i|get:'_id' type=type %}')">
101 <i class="far fa-chart-bar"></i> Export metric</a></li>
102 <li class="divider"></li>
103 <li>
104 <a href="javascript:deleteNs('{% url 'instances:delete' instance_id=i|get:'_id' type=type %}', true)">
105 <i class="far fa-trash-alt" style="color:red" ></i> Force delete</a></li>
106 </ul>
107
108
109 </div>
110
111 </td>
112
113
114 </tr>
115 {% endfor %}
116 </tbody>
117 </table>
118 </div>
119 </div>