1 {% extends
"base.html" %}
8 <link rel=
"stylesheet" href=
"/static/node_modules/datatables.net-bs/css/dataTables.bootstrap.min.css">
10 {% block title_header_big %}
13 {% block left_sidebar %}
15 {% include 'osm/osm_project_left_sidebar.html' %}
20 {% block breadcrumb_body %}
22 <li><a href=
"{% url "vims:list
" %}">VIMS
</a></li>
25 {% block content_body %}
27 {% include 'modal/vim_details.html' %}
30 <div class=
"col-md-12">
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>
40 <div class=
"box-body">
41 <table id=
"vims_table" class=
"table table-bordered table-striped">
47 <th>Operational State
</th>
63 {% block resource_block %}
65 <script src=
"/static/node_modules/datatables.net/js/jquery.dataTables.min.js"></script>
66 <script src=
"/static/node_modules/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
68 $(document).ready( function () {
69 var table = $('#vims_table').DataTable({
73 "dataSrc": function (json) {
74 return json['datacenters'];
78 console.log(
"no auth");
79 moveToLogin(window.location.pathname);
82 "error": function (hxr, error, thrown) {
91 "render": function (data, type, row) {
97 "render": function (data, type, row) {
103 "render": function (data, type, row) {
104 return row[
"vim_type"];
109 "render": function (data, type, row) {
110 return row[
"_admin"]['operationalState'];
115 "render": function (data, type, row) {
116 return row[
"_admin"]['description'] || '';
121 "render": function (data, type, row) {
122 return '
<div class=
"btn-group"><button type=
"button" class=
"btn btn-default" ' +
123 '
onclick=
"location.href=\'/vims/'+row['_id']+'\'" data-toggle=
"tooltip" data-placement=
"top" data-container=
"body" title=
"Show Info">' +
124 '
<i class=
"fa fa-info"></i>' +
126 '
<button type=
"button" class=
"btn btn-default"' +
127 '
onclick=
"javascript:deleteVim(\''+row['_id']+'\', \''+ row["name
"] +'\')" data-toggle=
"tooltip" data-placement=
"top" data-container=
"body" title=
"Delete">' +
128 '
<i class=
"far fa-trash-alt" ></i></button></div>';
136 setInterval(function () {
143 function deleteVim(vim_id, vim_name) {
144 var url =
"/vims/"+vim_id+
"/delete";
145 bootbox.confirm(
"Are you sure want to delete " + vim_name +
"?", function (result) {
147 var dialog = bootbox.dialog({
148 message: '
<div class=
"text-center"><i class=
"fa fa-spin fa-spinner"></i> Loading...
</div>',
155 contentType:
"application/json;charset=utf-8",
156 success: function (result) {
157 if (result['error'] == true) {
158 dialog.modal('hide');
159 bootbox.alert(
"An error occurred.");
162 dialog.modal('hide');
166 error: function (error) {
167 dialog.modal('hide');
168 bootbox.alert(
"An error occurred.");