diff --git a/app/js/custom.js b/app/js/custom.js index b1f445ce..dcb05797 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -249,22 +249,14 @@ $('#configureClientModal').on('shown.bs.modal', function (e) { }); $('#ovpn-confirm-delete').on('click', '.btn-delete', function (e) { - var modalDiv = $(e.delegateTarget); var cfg_id = $(this).data('recordId'); - console.log(cfg_id); - //console.log(modalDiv.parent().find('.js-remove-openvpn-client').attr('data-record-id')); - //console.log(modalDiv.parent().find( - $.post('ajax/openvpn/del_ovpncfg.php',{'cfg_id':cfg_id},function(data){ jsonData = JSON.parse(data); - console.log(jsonData); - //$(this).closest('js-openvpn-client-row').fadeOut(300); $("#ovpn-confirm-delete").modal('hide'); - if(jsonData['return'] == 0) { - // do something - } else if(jsonData['return'] == 2) { - // something else - } + var row = $(document.getElementById("openvpn-client-row-" + cfg_id)); + row.fadeOut( "slow", function() { + row.remove(); + }); }); }); diff --git a/templates/openvpn/configs.php b/templates/openvpn/configs.php index 1839c675..6f8056fd 100644 --- a/templates/openvpn/configs.php +++ b/templates/openvpn/configs.php @@ -1,33 +1,32 @@
-
+


openvpn-client service.") ?>

- -
-
+ +
+
-
+
-
+
-
+