6823c724b68893b2d5e93109d3a2234d09fd531c
[osm/LW-UI.git] / vimhandler / template / vim_list.html
1 {% extends "base.html" %}
2 {% load get %}
3 {% load staticfiles %}
4
5
6 {% block head_block %}
7 {{ block.super }}
8 <link rel="stylesheet" href="/static/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
9 {% endblock %}
10 {% block title_header_big %}
11 {{ block.super }}
12 {% endblock %}
13 {% block left_sidebar %}
14
15 {% include 'osm/osm_project_left_sidebar.html' %}
16
17 {% endblock %}
18
19
20 {% block breadcrumb_body %}
21 {{ block.super }}
22 <li><a href="{% url "vims:list" %}">VIMS</a></li>
23 {% endblock %}
24
25 {% block content_body %}
26 {{ block.super }}
27 {% include 'modal/vim_details.html' %}
28 {% csrf_token %}
29 <div class="row">
30 <div class="col-md-12">
31
32 <div class="box">
33 <div class="box-header with-border">
34 <h3 class="box-title">Registered VIM</h3>
35 <div class="box-tools">
36 <a href='{% url "vims:create" %}' class="btn btn-block btn-primary btn-sm"><i
37 class="fa fa-plus"></i><span> New VIM</span></a>
38 </div>
39 </div>
40 <div class="box-body">
41 <table id="vims_table" class="table table-bordered table-striped">
42 <thead>
43 <tr>
44 <th>Name</th>
45 <th>Identifier</th>
46 <th>Type</th>
47 <th>Operational State</th>
48 <th>Description</th>
49 <th>Actions</th>
50 </tr>
51 </thead>
52 <tbody>
53 {% for p in datacenters %}
54
55 <tr>
56 <td>{{ p|get:"name" }}</td>
57 <td>{{ p|get:"_id" }}</td>
58 <td>{{ p|get:"vim_type" }}</td>
59 <td>{{ p|get_sub:"_admin,operationalState"}}</td>
60 <td>{{ p|get_sub:"_admin,description" }}</td>
61
62
63 <td>
64 <div class="btn-group">
65 <button type="button" class="btn btn-default"
66 onclick="location.href='{% url "vims:show" vim_id=p|get:"_id" %}'" data-toggle="tooltip" data-placement="top" data-container="body" title="Show Info"><i
67 class="fa fa-info"></i></button>
68 <button type="button" class="btn btn-default"
69 onclick="javascript:deleteVim('{% url "vims:delete" vim_id=p|get:"_id" %}')" data-toggle="tooltip" data-placement="top" data-container="body" title="Delete"><i
70 class="far fa-trash-alt" ></i></button>
71 </div>
72 </td>
73
74 </tr>
75 {% endfor %}
76 </tbody>
77 </table>
78 </div>
79 </div>
80 </div>
81
82 </div>
83 {% endblock %}
84
85 {% block resource_block %}
86 {{ block.super }}
87 <script src="/static/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
88 <script src="/static/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
89 <script>
90 $(document).ready( function () {
91 $('#vims_table').DataTable();
92 } );
93 </script>
94 <script>
95
96 function deleteVim(url) {
97 bootbox.confirm("Are you sure want to delete?", function (result) {
98 if (result) {
99 location.href = url//'/vims/' + vim_uuid + '/delete'
100 }
101 })
102 }
103 </script>
104
105 {% endblock %}