1 function deleteSDN(sdn_uuid
, name
) {
2 bootbox
.confirm("Are you sure want to delete " + name
+"?", function (result
) {
4 var dialog
= bootbox
.dialog({
5 message
: '<div class="text-center"><i class="fa fa-spin fa-spinner"></i> Loading...</div>',
9 url
: '/sdn/' + sdn_uuid
+ '/delete',
12 contentType
: "application/json;charset=utf-8",
13 success: function (result
) {
14 if (result
['error'] == true){
16 bootbox
.alert("An error occurred.");
23 error: function (error
) {
25 bootbox
.alert("An error occurred.");
32 function showSDN(sdn_uuid
) {
33 var dialog
= bootbox
.dialog({
34 message
: '<div class="text-center"><i class="fa fa-spin fa-spinner"></i> Loading...</div>',
39 url
: '/sdn/' + sdn_uuid
,
42 contentType
: "application/json;charset=utf-8",
43 success: function (result
) {
44 //$('#modal_show_vim_body').empty();
47 $('#modal_show_sdn_body').find('span').text('-');
49 $('#' + k
).text(sdn
[k
])
52 for (var i
in sdn
['_admin']) {
53 if (i
=== 'modified' || i
=== 'created') {
54 //$('#' + i).text(new Date(sdn['_admin'][i]* 1000).toUTCString());
55 $('#' + i
).text(moment(sdn
['_admin'][i
] * 1000).format('DD/MM/YY hh:mm:ss'));
57 else if (i
=== 'deployed') {
58 $('#' + i
).text(JSON
.stringify(sdn
['_admin'][i
]))
61 $('#' + i
).text(sdn
['_admin'][i
])
65 $('#modal_show_sdn').modal('show');
69 bootbox
.alert("An error occurred while retrieving the SDN controller info.");
73 error: function (result
) {
75 bootbox
.alert("An error occurred while retrieving the SDN controller info.");