From c073d18133a4b103d1f83129ad1a8877d8433ddd Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 7 Feb 2021 18:51:21 +0000 Subject: [PATCH] Cleanup + fadeOut deleted cfg --- app/js/custom.js | 16 ++++------------ templates/openvpn/configs.php | 31 +++++++++++++++---------------- 2 files changed, 19 insertions(+), 28 deletions(-) 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.") ?>

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