Skip to content

Commit 61facdd

Browse files
committed
use a swal() loader to show test-in-progress state to user
1 parent 006832d commit 61facdd

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

resources/themes/pterodactyl/admin/settings/mail.blade.php

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,27 @@ function saveSettings() {
137137
}
138138
139139
function testSettings() {
140-
return $.ajax({
141-
method: 'GET',
142-
url: Router.route('admin.settings.mail.test'),
143-
headers: { 'X-CSRF-Token': $('input[name="_token"]').val() }
144-
}).fail(function (jqXHR) {
145-
showErrorDialog(jqXHR, 'test');
146-
}).done(function () {
147-
swal({
148-
title: 'Success',
149-
text: 'The test message was sent successfully.',
150-
type: 'success'
140+
swal({
141+
type: 'info',
142+
title: 'Test Mail Settings',
143+
text: 'Click "Test" to begin the test.',
144+
showCancelButton: true,
145+
confirmButtonText: 'Test',
146+
closeOnConfirm: false,
147+
showLoaderOnConfirm: true
148+
}, function () {
149+
$.ajax({
150+
method: 'GET',
151+
url: Router.route('admin.settings.mail.test'),
152+
headers: { 'X-CSRF-Token': $('input[name="_token"]').val() }
153+
}).fail(function (jqXHR) {
154+
showErrorDialog(jqXHR, 'test');
155+
}).done(function () {
156+
swal({
157+
title: 'Success',
158+
text: 'The test message was sent successfully.',
159+
type: 'success'
160+
});
151161
});
152162
});
153163
}

0 commit comments

Comments
 (0)