diff --git a/static/js/main.js b/static/js/main.js index 189b443..274b9e6 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1,6 +1,12 @@ jQuery(function($){ + + var status = $('#status'), + btn = $('.btn-primary'); + $('form#connect').submit(function(event) { event.preventDefault(); + status.text(''); + btn.prop('disabled', true); var form = $(this), url = form.attr('action'), @@ -22,7 +28,10 @@ jQuery(function($){ function callback(msg) { // console.log(msg); if (msg.status) { - $('#status').text(msg.status); + status.text(msg.status); + setTimeout(function(){ + btn.prop('disabled', false); + }, 3000); return; } diff --git a/templates/index.html b/templates/index.html index 2f5ffb8..c0f5abc 100644 --- a/templates/index.html +++ b/templates/index.html @@ -58,7 +58,7 @@
-
+