From ad6a14fa50e4a482230c42a3b9c82904bd952842 Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 24 Feb 2021 08:45:53 +0000 Subject: [PATCH] Added generateWgKey() --- app/js/custom.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/js/custom.js b/app/js/custom.js index 28609abe..817256a1 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -348,6 +348,19 @@ function updateBlocklist() { function clearBlocklistStatus() { $('#cbxblocklist-status').removeClass('check-updated').addClass('check-hidden'); } + +// Handler for the wireguard generate key button +function generateWgKey() { + var entity = $('#wg-srvpubkey').attr('name'); + console.log(entity); + $.post('ajax/networking/get_wgkey.php',{'entity':entity },function(data){ + var jsonData = JSON.parse(data); + console.log(jsonData); + $('#wg-srvpubkey').val(jsonData); + $('#wg-srvpubkey-status').removeClass('check-hidden').addClass('check-updated').delay(500).animate({ opacity: 1 }, 700); + }) +} + // Static Array method Array.range = (start, end) => Array.from({length: (end - start)}, (v, k) => k + start);