Skip to content

Commit 799f2ee

Browse files
committed
Merge branch 'develop' into feature/admin-retheme
# Conflicts: # public/themes/pterodactyl/css/pterodactyl.css
2 parents b301b89 + 500cf7f commit 799f2ee

File tree

22 files changed

+10918
-523
lines changed

22 files changed

+10918
-523
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
/vendor
22
*.DS_Store*
33
.env
4+
.vagrant/*
5+
6+
composer.lock
7+
8+
Homestead.yaml
9+
Vagrantfile
10+
Vagrantfile
11+
12+
node_modules
13+
yarn.lock
414
node_modules

public/js/plugins/minecraft/eula.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
// SOFTWARE.
20-
$(window).load(function () {
20+
$(document).ready(function () {
2121
Socket.on('console', function (data) {
22-
if (data.line.indexOf('You need to agree to the EULA in order to run the server') > -1) {
22+
if (~data.line.indexOf('You need to agree to the EULA in order to run the server')) {
2323
swal({
2424
title: 'EULA Acceptance',
2525
text: 'By pressing \'I Accept\' below you are indicating your agreement to the <a href="https://account.mojang.com/documents/minecraft_eula" target="_blank">Mojang EULA</a>.',

public/themes/pterodactyl/css/pterodactyl.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,24 @@ span[aria-labelledby="select2-pUserId-container"] {
245245
.nav-tabs-custom.nav-tabs-floating > .nav-tabs > li:first-child.active > a {
246246
border-radius: 0 0 0 3px;
247247
}
248+
249+
.position-relative {
250+
position: relative;
251+
}
252+
253+
.terminal-notify {
254+
position: absolute;
255+
right: 10px;
256+
bottom: 10px;
257+
/* Browsers usually have a 17px scrollbar which is visible in the terminal */
258+
padding: 7px 24px 7px 7px;
259+
border-top-left-radius: 3px;
260+
background: white;
261+
color: black;
262+
opacity: .5;
263+
cursor: pointer;
264+
}
265+
266+
.terminal-notify:hover {
267+
opacity: .9;
268+
}

public/themes/pterodactyl/js/frontend/2fa-modal.js

Lines changed: 65 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -17,60 +17,75 @@
1717
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
// SOFTWARE.
20-
$(document).ready(function () {
21-
$('#close_reload').click(function () {
22-
location.reload();
23-
});
24-
$('#do_2fa').submit(function (event) {
25-
event.preventDefault();
2620

27-
$.ajax({
28-
type: 'PUT',
29-
url: Router.route('account.security.totp'),
30-
headers: {
31-
'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content'),
32-
}
33-
}).done(function (data) {
34-
var image = new Image();
35-
image.src = data.qrImage;
36-
$(image).load(function () {
37-
$('#hide_img_load').slideUp(function () {
38-
$('#qr_image_insert').attr('src', image.src).slideDown();
21+
var TwoFactorModal = (function () {
22+
23+
function bindListeners() {
24+
$(document).ready(function () {
25+
$('#close_reload').click(function () {
26+
location.reload();
27+
});
28+
$('#do_2fa').submit(function (event) {
29+
event.preventDefault();
30+
31+
$.ajax({
32+
type: 'PUT',
33+
url: Router.route('account.security.totp'),
34+
headers: {
35+
'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content'),
36+
}
37+
}).done(function (data) {
38+
var image = new Image();
39+
image.src = data.qrImage;
40+
$(image).load(function () {
41+
$('#hide_img_load').slideUp(function () {
42+
$('#qr_image_insert').attr('src', image.src).slideDown();
43+
});
44+
});
45+
$('#2fa_secret_insert').html(data.secret);
46+
$('#open2fa').modal('show');
47+
}).fail(function (jqXHR) {
48+
alert('An error occured while attempting to load the 2FA setup modal. Please try again.');
49+
console.error(jqXHR);
50+
});
51+
52+
});
53+
$('#2fa_token_verify').submit(function (event) {
54+
event.preventDefault();
55+
$('#submit_action').html('<i class="fa fa-spinner fa-spin"></i> Submit').addClass('disabled');
56+
57+
$.ajax({
58+
type: 'POST',
59+
url: Router.route('account.security.totp'),
60+
headers: {
61+
'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content'),
62+
},
63+
data: {
64+
token: $('#2fa_token').val()
65+
}
66+
}).done(function (data) {
67+
$('#notice_box_2fa').hide();
68+
if (data === 'true') {
69+
$('#notice_box_2fa').html('<div class="alert alert-success">2-Factor Authentication has been enabled on your account. Press \'Close\' below to reload the page.</div>').slideDown();
70+
} else {
71+
$('#notice_box_2fa').html('<div class="alert alert-danger">The token provided was invalid.</div>').slideDown();
72+
}
73+
}).fail(function (jqXHR) {
74+
$('#notice_box_2fa').html('<div class="alert alert-danger">There was an error while attempting to enable 2-Factor Authentication on this account.</div>').slideDown();
75+
console.error(jqXHR);
76+
}).always(function () {
77+
$('#submit_action').html('Submit').removeClass('disabled');
3978
});
4079
});
41-
$('#2fa_secret_insert').html(data.secret);
42-
$('#open2fa').modal('show');
43-
}).fail(function (jqXHR) {
44-
alert('An error occured while attempting to load the 2FA setup modal. Please try again.');
45-
console.error(jqXHR);
4680
});
81+
}
4782

48-
});
49-
$('#2fa_token_verify').submit(function (event) {
50-
event.preventDefault();
51-
$('#submit_action').html('<i class="fa fa-spinner fa-spin"></i> Submit').addClass('disabled');
83+
return {
84+
init: function () {
85+
bindListeners();
86+
}
87+
}
5288

53-
$.ajax({
54-
type: 'POST',
55-
url: Router.route('account.security.totp'),
56-
headers: {
57-
'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content'),
58-
},
59-
data: {
60-
token: $('#2fa_token').val()
61-
}
62-
}).done(function (data) {
63-
$('#notice_box_2fa').hide();
64-
if (data === 'true') {
65-
$('#notice_box_2fa').html('<div class="alert alert-success">2-Factor Authentication has been enabled on your account. Press \'Close\' below to reload the page.</div>').slideDown();
66-
} else {
67-
$('#notice_box_2fa').html('<div class="alert alert-danger">The token provided was invalid.</div>').slideDown();
68-
}
69-
}).fail(function (jqXHR) {
70-
$('#notice_box_2fa').html('<div class="alert alert-danger">There was an error while attempting to enable 2-Factor Authentication on this account.</div>').slideDown();
71-
console.error(jqXHR);
72-
}).always(function () {
73-
$('#submit_action').html('Submit').removeClass('disabled');
74-
});
75-
});
7689
});
90+
91+
TwoFactorModal.init();

0 commit comments

Comments
 (0)