editslb.js 901 B

12345678910111213141516171819202122232425262728293031323334
  1. $(function()
  2. {
  3. var overtime = 30;
  4. var timerID = 0;
  5. $("#submitBtn").on('click', function()
  6. {
  7. $('#waiting').modal('show');
  8. timerID = setInterval(function()
  9. {
  10. $('#timer').text(overtime);
  11. overtime--;
  12. }, 1000);
  13. var slbData = {};
  14. slbData.ippool = $('#ippool').val();
  15. $.post(createLink('system', 'editSLB'), slbData).done(function(response)
  16. {
  17. $('#waiting').modal('hide');
  18. clearInterval(timerID);
  19. overtime = 30;
  20. var res = JSON.parse(response);
  21. if(res.result == 'success'){
  22. parent.window.location.href = res.locate;
  23. }else{
  24. bootbox.alert(
  25. {
  26. title: notices.fail,
  27. message: res.message,
  28. });
  29. }
  30. });
  31. });
  32. });