+ <script src="/static/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
+ <script src="/static/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
+ <script>
+ $(document).ready( function () {
+ var table = $('#vims_table').DataTable({
+ responsive: true,
+ "ajax": {
+ "url": "/vims/list/",
+ "dataSrc": function (json) {
+ return json['datacenters'];
+ },
+ statusCode: {
+ 401: function () {
+ console.log("no auth");
+ moveToLogin(window.location.pathname);
+ }
+ },
+ "error": function (hxr, error, thrown) {
+ console.log(hxr)
+ console.log(thrown)
+ console.log(error);
+ }
+
+ },
+ "columns": [
+ {
+ "render": function (data, type, row) {
+ return row["name"];
+ },
+ "targets": 0
+ },
+ {
+ "render": function (data, type, row) {
+ return row['_id'];
+ },
+ "targets": 1
+ },
+ {
+ "render": function (data, type, row) {
+ return row["vim_type"];
+ },
+ "targets": 2
+ },
+ {
+ "render": function (data, type, row) {
+ return row["_admin"]['operationalState'];
+ },
+ "targets": 3
+ },
+ {
+ "render": function (data, type, row) {
+ return row["_admin"]['description'] || '';
+ },
+ "targets": 4
+ },
+ {
+ "render": function (data, type, row) {
+ return '<div class="btn-group"><button type="button" class="btn btn-default" ' +
+ 'onclick="location.href=\'/vims/'+row['_id']+'\'" data-toggle="tooltip" data-placement="top" data-container="body" title="Show Info">' +
+ '<i class="fa fa-info"></i>' +
+ '</button> ' +
+ '<button type="button" class="btn btn-default"' +
+ 'onclick="javascript:deleteVim(\''+row['_id']+'\', \''+ row["name"] +'\')" data-toggle="tooltip" data-placement="top" data-container="body" title="Delete">' +
+ '<i class="far fa-trash-alt" ></i></button></div>';
+ },
+ "targets": 5,
+ "orderable": false
+ }
+ ]
+ });