Messed up path for resources

This commit is contained in:
Alex D. 2018-11-03 17:19:37 +01:00
parent 323005a8be
commit 3a0f95e106
27 changed files with 0 additions and 2257 deletions

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 749 B

After

Width:  |  Height:  |  Size: 749 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -1,6 +0,0 @@
// Hacky fix for browsers ignoring autocomplete="off"
$(document).ready(function() {
$('.form-autocomplete-stop').on('click', function () {
$(this).removeAttr('readonly').blur().focus();
});
});

View File

@ -1,121 +0,0 @@
/* global define, KeyboardEvent, module */
(function () {
var keyboardeventKeyPolyfill = {
polyfill: polyfill,
keys: {
3: 'Cancel',
6: 'Help',
8: 'Backspace',
9: 'Tab',
12: 'Clear',
13: 'Enter',
16: 'Shift',
17: 'Control',
18: 'Alt',
19: 'Pause',
20: 'CapsLock',
27: 'Escape',
28: 'Convert',
29: 'NonConvert',
30: 'Accept',
31: 'ModeChange',
32: ' ',
33: 'PageUp',
34: 'PageDown',
35: 'End',
36: 'Home',
37: 'ArrowLeft',
38: 'ArrowUp',
39: 'ArrowRight',
40: 'ArrowDown',
41: 'Select',
42: 'Print',
43: 'Execute',
44: 'PrintScreen',
45: 'Insert',
46: 'Delete',
48: ['0', ')'],
49: ['1', '!'],
50: ['2', '@'],
51: ['3', '#'],
52: ['4', '$'],
53: ['5', '%'],
54: ['6', '^'],
55: ['7', '&'],
56: ['8', '*'],
57: ['9', '('],
91: 'OS',
93: 'ContextMenu',
144: 'NumLock',
145: 'ScrollLock',
181: 'VolumeMute',
182: 'VolumeDown',
183: 'VolumeUp',
186: [';', ':'],
187: ['=', '+'],
188: [',', '<'],
189: ['-', '_'],
190: ['.', '>'],
191: ['/', '?'],
192: ['`', '~'],
219: ['[', '{'],
220: ['\\', '|'],
221: [']', '}'],
222: ["'", '"'],
224: 'Meta',
225: 'AltGraph',
246: 'Attn',
247: 'CrSel',
248: 'ExSel',
249: 'EraseEof',
250: 'Play',
251: 'ZoomOut'
}
};
// Function keys (F1-24).
var i;
for (i = 1; i < 25; i++) {
keyboardeventKeyPolyfill.keys[111 + i] = 'F' + i;
}
// Printable ASCII characters.
var letter = '';
for (i = 65; i < 91; i++) {
letter = String.fromCharCode(i);
keyboardeventKeyPolyfill.keys[i] = [letter.toLowerCase(), letter.toUpperCase()];
}
function polyfill () {
if (!('KeyboardEvent' in window) ||
'key' in KeyboardEvent.prototype) {
return false;
}
// Polyfill `key` on `KeyboardEvent`.
var proto = {
get: function (x) {
var key = keyboardeventKeyPolyfill.keys[this.which || this.keyCode];
if (Array.isArray(key)) {
key = key[+this.shiftKey];
}
return key;
}
};
Object.defineProperty(KeyboardEvent.prototype, 'key', proto);
return proto;
}
if (typeof define === 'function' && define.amd) {
define('keyboardevent-key-polyfill', keyboardeventKeyPolyfill);
} else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
module.exports = keyboardeventKeyPolyfill;
} else if (window) {
window.keyboardeventKeyPolyfill = keyboardeventKeyPolyfill;
}
})();

File diff suppressed because one or more lines are too long

View File

@ -1,232 +0,0 @@
/**
* Bootsnip - "Bootstrap Checkboxes/Radios"
* Bootstrap 3.2.0 Snippet by i-heart-php <http://bootsnipp.com/i-heart-php>
*
* Copyright (c) 2013 Bootsnipp.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
.checkbox {
padding-left: 20px;
}
.checkbox label {
display: inline-block;
position: relative;
padding-left: 5px;
}
.checkbox label::before {
content: "";
display: inline-block;
position: absolute;
width: 17px;
height: 17px;
left: 0;
top: 2.5px;
margin-left: -20px;
border: 1px solid #cccccc;
border-radius: 3px;
background-color: #fff;
-webkit-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
-o-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
}
.checkbox label::after {
display: inline-block;
position: absolute;
width: 16px;
height: 16px;
left: 0;
top: 2.5px;
margin-left: -20px;
padding-left: 3px;
padding-top: 1px;
font-size: 11px;
color: #555555;
}
.checkbox input[type="checkbox"] {
opacity: 0;
}
.checkbox input[type="checkbox"]:focus + label::before {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.checkbox input[type="checkbox"]:checked + label::after {
font-family: 'FontAwesome';
content: "\f00c";
}
.checkbox input[type="checkbox"]:disabled + label {
opacity: 0.65;
}
.checkbox input[type="checkbox"]:disabled + label::before {
background-color: #eeeeee;
cursor: not-allowed;
}
.checkbox.checkbox-circle label::before {
border-radius: 50%;
}
.checkbox.checkbox-inline {
margin-top: 0;
}
.checkbox-primary input[type="checkbox"]:checked + label::before {
background-color: #428bca;
border-color: #428bca;
}
.checkbox-primary input[type="checkbox"]:checked + label::after {
color: #fff;
}
.checkbox-danger input[type="checkbox"]:checked + label::before {
background-color: #d9534f;
border-color: #d9534f;
}
.checkbox-danger input[type="checkbox"]:checked + label::after {
color: #fff;
}
.checkbox-info input[type="checkbox"]:checked + label::before {
background-color: #5bc0de;
border-color: #5bc0de;
}
.checkbox-info input[type="checkbox"]:checked + label::after {
color: #fff;
}
.checkbox-warning input[type="checkbox"]:checked + label::before {
background-color: #f0ad4e;
border-color: #f0ad4e;
}
.checkbox-warning input[type="checkbox"]:checked + label::after {
color: #fff;
}
.checkbox-success input[type="checkbox"]:checked + label::before {
background-color: #5cb85c;
border-color: #5cb85c;
}
.checkbox-success input[type="checkbox"]:checked + label::after {
color: #fff;
}
.radio {
padding-left: 20px;
}
.radio label {
display: inline-block;
position: relative;
padding-left: 5px;
}
.radio label::before {
content: "";
display: inline-block;
position: absolute;
width: 17px;
height: 17px;
left: 0;
margin-left: -20px;
border: 1px solid #cccccc;
border-radius: 50%;
background-color: #fff;
-webkit-transition: border 0.15s ease-in-out;
-o-transition: border 0.15s ease-in-out;
transition: border 0.15s ease-in-out;
}
.radio label::after {
display: inline-block;
position: absolute;
content: " ";
width: 11px;
height: 11px;
left: 3px;
top: 3px;
margin-left: -20px;
border-radius: 50%;
background-color: #555555;
-webkit-transform: scale(0, 0);
-ms-transform: scale(0, 0);
-o-transform: scale(0, 0);
transform: scale(0, 0);
-webkit-transition: -webkit-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
-moz-transition: -moz-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
-o-transition: -o-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
}
.radio input[type="radio"] {
opacity: 0;
}
.radio input[type="radio"]:focus + label::before {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.radio input[type="radio"]:checked + label::after {
-webkit-transform: scale(1, 1);
-ms-transform: scale(1, 1);
-o-transform: scale(1, 1);
transform: scale(1, 1);
}
.radio input[type="radio"]:disabled + label {
opacity: 0.65;
}
.radio input[type="radio"]:disabled + label::before {
cursor: not-allowed;
}
.radio.radio-inline {
margin-top: 0;
}
.radio-primary input[type="radio"] + label::after {
background-color: #428bca;
}
.radio-primary input[type="radio"]:checked + label::before {
border-color: #428bca;
}
.radio-primary input[type="radio"]:checked + label::after {
background-color: #428bca;
}
.radio-danger input[type="radio"] + label::after {
background-color: #d9534f;
}
.radio-danger input[type="radio"]:checked + label::before {
border-color: #d9534f;
}
.radio-danger input[type="radio"]:checked + label::after {
background-color: #d9534f;
}
.radio-info input[type="radio"] + label::after {
background-color: #5bc0de;
}
.radio-info input[type="radio"]:checked + label::before {
border-color: #5bc0de;
}
.radio-info input[type="radio"]:checked + label::after {
background-color: #5bc0de;
}
.radio-warning input[type="radio"] + label::after {
background-color: #f0ad4e;
}
.radio-warning input[type="radio"]:checked + label::before {
border-color: #f0ad4e;
}
.radio-warning input[type="radio"]:checked + label::after {
background-color: #f0ad4e;
}
.radio-success input[type="radio"] + label::after {
background-color: #5cb85c;
}
.radio-success input[type="radio"]:checked + label::before {
border-color: #5cb85c;
}
.radio-success input[type="radio"]:checked + label::after {
background-color: #5cb85c;
}

View File

@ -1,297 +0,0 @@
/**
* Pterodactyl - Panel
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
@import 'checkbox.css';
.login-page {
height: auto;
}
.login-box, .register-box {
width: 40%;
max-width: 500px;
margin: 7% auto;
}
@media (max-width:768px) {
.login-box, .register-box {
width: 90%;
margin-top: 20px
}
}
.weight-100 {
font-weight: 100;
}
.weight-300 {
font-weight: 300;
}
.btn-clear {
background: transparent;
}
.user-panel > .info {
position: relative;
left: 0;
}
code {
font-size: 85%;
}
.control-sidebar-dark .control-sidebar-menu > li > a.active {
background: #1e282c;
}
.callout-nomargin {
margin: 0;
}
.table {
font-size: 14px !important;
}
.middle, .align-middle {
vertical-align: middle !important;
}
#fileOptionMenu.dropdown-menu > li > a {
padding:3px 6px;
}
.hasFileHover {
border: 2px dashed #0087F7;
border-top: 0 !important;
border-radius: 5px;
margin: 0;
opacity: 0.5;
}
.hasFileHover * {
pointer-events: none !important;
}
td.has-progress {
padding: 0px !important;
border-top: 0px !important;
}
.progress.progress-table-bottom {
margin: 0 !important;
height:5px !important;
padding:0;
border:0;
}
.muted {
filter: alpha(opacity=20);
opacity: 0.2;
}
.muted-hover:hover {
filter: alpha(opacity=100);
opacity: 1;
}
.use-pointer {
cursor: pointer !important;
}
.input-loader {
display: none;
position:relative;
top: -25px;
float: right;
right: 5px;
color: #cccccc;
height: 0;
}
.box-header > .form-group {
margin-bottom: 0;
}
.box-header > .form-group > div > p.small {
margin: 0;
}
.no-margin {
margin: 0 !important;
}
li.select2-results__option--highlighted[aria-selected="false"] > .user-block > .username > a {
color: #fff;
}
li.select2-results__option--highlighted[aria-selected="false"] > .user-block > .description {
color: #eee;
}
.select2-selection.select2-selection--multiple {
min-height: 36px !important;
}
.select2-search--inline .select2-search__field:focus {
outline: none;
border: 0 !important;
}
.img-bordered-xs {
border: 1px solid #d2d6de;
padding: 1px;
}
span[aria-labelledby="select2-pUserId-container"] {
padding-left: 2px !important;
}
.callout-slim a {
color: #555 !important;
}
.callout.callout-info.callout-slim {
border: 1px solid #0097bc !important;
border-left: 5px solid #0097bc !important;
border-right: 5px solid #0097bc !important;
color: #777 !important;
background: transparent !important;
}
.callout.callout-danger.callout-slim {
border: 1px solid #c23321 !important;
border-left: 5px solid #c23321 !important;
border-right: 5px solid #c23321 !important;
color: #777 !important;
background: transparent !important;
}
.callout.callout-warning.callout-slim {
border: 1px solid #c87f0a !important;
border-left: 5px solid #c87f0a !important;
border-right: 5px solid #c87f0a !important;
color: #777 !important;
background: transparent !important;
}
.callout.callout-success.callout-slim {
border: 1px solid #00733e !important;
border-left: 5px solid #00733e !important;
border-right: 5px solid #00733e !important;
color: #777 !important;
background: transparent !important;
}
.callout.callout-default.callout-slim {
border: 1px solid #eee !important;
border-left: 5px solid #eee !important;
border-right: 5px solid #eee !important;
color: #777 !important;
background: transparent !important;
}
.tab-pane .box-footer {
margin: 0 -10px -10px;
}
.select2-container{ width: 100% !important; }
.nav-tabs-custom > .nav-tabs > li:hover {
border-top-color:#3c8dbc;
}
.nav-tabs-custom > .nav-tabs > li.active.tab-danger, .nav-tabs-custom > .nav-tabs > li.tab-danger:hover {
border-top-color: #c23321;
}
.nav-tabs-custom > .nav-tabs > li.active.tab-success, .nav-tabs-custom > .nav-tabs > li.tab-success:hover {
border-top-color: #00733e;
}
.nav-tabs-custom > .nav-tabs > li.active.tab-info, .nav-tabs-custom > .nav-tabs > li.tab-info:hover {
border-top-color: #0097bc;
}
.nav-tabs-custom > .nav-tabs > li.active.tab-warning, .nav-tabs-custom > .nav-tabs > li.tab-warning:hover {
border-top-color: #c87f0a;
}
.nav-tabs-custom.nav-tabs-floating > .nav-tabs {
border-bottom: 0px !important;
}
.nav-tabs-custom.nav-tabs-floating > .nav-tabs > li {
margin-bottom: 0px !important;
}
.nav-tabs-custom.nav-tabs-floating > .nav-tabs > li:first-child.active,
.nav-tabs-custom.nav-tabs-floating > .nav-tabs > li:first-child:hover {
border-radius: 3px 0 0 0;
}
.nav-tabs-custom.nav-tabs-floating > .nav-tabs > li:first-child.active > a {
border-radius: 0 0 0 3px;
}
.position-relative {
position: relative;
}
.no-margin-bottom {
margin-bottom: 0 !important;
}
.btn-icon > i.fa {
line-height: 1.5;
}
.strong {
font-weight: bold !important;
}
.server-description > td {
padding-top: 0 !important;
border-top: 0 !important;
}
tr:hover + tr.server-description {
background-color: #f5f5f5 !important;
}
.login-corner-info {
position: absolute;
bottom: 5px;
right: 10px;
}
input.form-autocomplete-stop[readonly] {
background: inherit;
cursor: text;
}
/* fix Google Recaptcha badge */
.grecaptcha-badge {
bottom: 54px !important;
background: white;
box-shadow: none !important;
}

View File

@ -1,102 +0,0 @@
/*Design for Terminal*/
@import url('https://fonts.googleapis.com/css?family=Source+Code+Pro');
#terminal-body {
background: rgb(26, 26, 26);
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
#terminal {
font-family: 'Source Code Pro', monospace;
color: rgb(223, 223, 223);
background: rgb(26, 26, 26);
font-size: 12px;
line-height: 14px;
padding: 10px 10px 0;
box-sizing: border-box;
height: 500px;
max-height: 500px;
overflow-y: auto;
overflow-x: hidden;
border-radius: 5px 5px 0 0;
}
#terminal > .cmd {
padding: 1px 0;
}
#terminal_input {
width: 100%;
background: rgb(26, 26, 26);
border-radius: 0 0 5px 5px;
padding: 0 0 0 10px !important;
}
.terminal_input--input, .terminal_input--prompt {
font-family: 'Source Code Pro', monospace;
margin-bottom: 0;
border: 0 !important;
background: transparent !important;
color: rgb(223, 223, 223);
font-size: 12px;
padding: 1px 0 4px !important;
}
.terminal_input--input {
margin-left: 6px;
line-height: 1;
outline: none !important;
}
.terminal-notify {
position: absolute;
right: 30px;
bottom: 30px;
padding: 3.5px 7px;
border-radius: 3px;
background: #fff;
color: #000;
opacity: .5;
font-size: 16px;
cursor: pointer;
}
.terminal-notify:hover {
opacity: .9;
}
.ansi-black-fg { color: rgb(0, 0, 0); }
.ansi-red-fg { color: rgb(166, 0, 44); }
.ansi-green-fg { color: rgb(55, 106, 27); }
.ansi-yellow-fg { color: rgb(241, 133, 24); }
.ansi-blue-fg { color: rgb(17, 56, 163); }
.ansi-magenta-fg { color: rgb(67, 0, 117); }
.ansi-cyan-fg { color: rgb(18, 95, 105); }
.ansi-white-fg { color: rgb(255, 255, 255); }
.ansi-bright-black-fg { color: rgb(51, 51, 51); }
.ansi-bright-red-fg { color: rgb(223, 45, 39); }
.ansi-bright-green-fg { color: rgb(105, 175, 45); }
.ansi-bright-yellow-fg { color: rgb(254, 232, 57); }
.ansi-bright-blue-fg { color: rgb(68, 145, 240); }
.ansi-bright-magenta-fg { color: rgb(151, 50, 174); }
.ansi-bright-cyan-fg{ color: rgb(37, 173, 98); }
.ansi-bright-white-fg { color: rgb(208, 208, 208); }
.ansi-black-bg { background: rgb(0, 0, 0); }
.ansi-red-bg { background: rgb(166, 0, 44); }
.ansi-green-bg { background: rgb(55, 106, 27); }
.ansi-yellow-bg { background: rgb(241, 133, 24); }
.ansi-blue-bg { background: rgb(17, 56, 163); }
.ansi-magenta-bg { background: rgb(67, 0, 117); }
.ansi-cyan-bg { background: rgb(18, 95, 105); }
.ansi-white-bg { background: rgb(255, 255, 255); }
.ansi-bright-black-bg { background: rgb(51, 51, 51); }
.ansi-bright-red-bg { background: rgb(223, 45, 39); }
.ansi-bright-green-bg { background: rgb(105, 175, 45); }
.ansi-bright-yellow-bg { background: rgb(254, 232, 57); }
.ansi-bright-blue-bg { background: rgb(68, 145, 240); }
.ansi-bright-magenta-bg { background: rgb(151, 50, 174); }
.ansi-bright-cyan-bg { background: rgb(37, 173, 98); }
.ansi-bright-white-bg { background: rgb(208, 208, 208); }

View File

@ -1,23 +0,0 @@
// Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
$.urlParam=function(name){var results=new RegExp("[\\?&]"+name+"=([^&#]*)").exec(decodeURIComponent(window.location.href));if(results==null){return null}else{return results[1]||0}};function getPageName(url){var index=url.lastIndexOf("/")+1;var filenameWithExtension=url.substr(index);var filename=filenameWithExtension.split(".")[0];return filename}
// Remeber Active Tab and Navigate to it on Reload
for(var queryParameters={},queryString=location.search.substring(1),re=/([^&=]+)=([^&]*)/g,m;m=re.exec(queryString);)queryParameters[decodeURIComponent(m[1])]=decodeURIComponent(m[2]);$("a[data-toggle='tab']").click(function(){queryParameters.tab=$(this).attr("href").substring(1),window.history.pushState(null,null,location.pathname+"?"+$.param(queryParameters))});
if($.urlParam('tab') != null){$('.nav.nav-tabs a[href="#' + $.urlParam('tab') + '"]').tab('show');}

View File

@ -1,190 +0,0 @@
// Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
$(document).ready(function() {
$('#pServiceId').select2({
placeholder: 'Select a Service',
}).change();
$('#pOptionId').select2({
placeholder: 'Select a Service Option',
});
$('#pPackId').select2({
placeholder: 'Select a Service Pack',
});
$('#pLocationId').select2({
placeholder: 'Select a Location',
}).change();
$('#pNodeId').select2({
placeholder: 'Select a Node',
});
$('#pAllocation').select2({
placeholder: 'Select a Default Allocation',
});
$('#pAllocationAdditional').select2({
placeholder: 'Select Additional Allocations',
});
$('#pUserId').select2({
ajax: {
url: Router.route('admin.users.json'),
dataType: 'json',
delay: 250,
data: function (params) {
return {
q: params.term, // search term
page: params.page,
};
},
processResults: function (data, params) {
return { results: data };
},
cache: true,
},
escapeMarkup: function (markup) { return markup; },
minimumInputLength: 2,
templateResult: function (data) {
if (data.loading) return data.text;
return '<div class="user-block"> \
<img class="img-circle img-bordered-xs" src="https://www.gravatar.com/avatar/' + data.md5 + '?s=120" alt="User Image"> \
<span class="username"> \
<a href="#">' + data.name_first + ' ' + data.name_last +'</a> \
</span> \
<span class="description"><strong>' + data.email + '</strong> - ' + data.username + '</span> \
</div>';
},
templateSelection: function (data) {
return '<div> \
<span> \
<img class="img-rounded img-bordered-xs" src="https://www.gravatar.com/avatar/' + data.md5 + '?s=120" style="height:28px;margin-top:-4px;" alt="User Image"> \
</span> \
<span style="padding-left:5px;"> \
' + data.name_first + ' ' + data.name_last + ' (<strong>' + data.email + '</strong>) \
</span> \
</div>';
}
});
});
function hideLoader() {
$('#allocationLoader').hide();
}
function showLoader() {
$('#allocationLoader').show();
}
var lastActiveBox = null;
$(document).on('click', function (event) {
if (lastActiveBox !== null) {
lastActiveBox.removeClass('box-primary');
}
lastActiveBox = $(event.target).closest('.box');
lastActiveBox.addClass('box-primary');
});
var currentLocation = null;
var curentNode = null;
var NodeData = [];
$('#pLocationId').on('change', function (event) {
showLoader();
currentLocation = $(this).val();
currentNode = null;
$.ajax({
method: 'POST',
url: Router.route('admin.servers.new.nodes'),
headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') },
data: { location: currentLocation },
}).done(function (data) {
NodeData = data;
$('#pNodeId').html('').select2({data: data}).change();
}).fail(function (jqXHR) {
cosole.error(jqXHR);
currentLocation = null;
}).always(hideLoader);
});
$('#pNodeId').on('change', function (event) {
currentNode = $(this).val();
$.each(NodeData, function (i, v) {
if (v.id == currentNode) {
$('#pAllocation').html('').select2({
data: v.allocations,
placeholder: 'Select a Default Allocation',
});
$('#pAllocationAdditional').html('').select2({
data: v.allocations,
placeholder: 'Select Additional Allocations',
})
}
});
});
$('#pServiceId').on('change', function (event) {
$('#pOptionId').html('').select2({
data: $.map(_.get(Pterodactyl.services, $(this).val() + '.options', []), function (item) {
return {
id: item.id,
text: item.name,
};
}),
}).change();
});
$('#pOptionId').on('change', function (event) {
var parentChain = _.get(Pterodactyl.services, $('#pServiceId').val(), null);
var objectChain = _.get(parentChain, 'options.' + $(this).val(), null);
$('#pDefaultContainer').val(_.get(objectChain, 'docker_image', 'not defined!'));
if (!_.get(objectChain, 'startup', false)) {
$('#pStartup').val(_.get(parentChain, 'startup', 'ERROR: Startup Not Defined!'));
} else {
$('#pStartup').val(_.get(objectChain, 'startup'));
}
$('#pPackId').html('').select2({
data: [{ id: 0, text: 'No Service Pack' }].concat(
$.map(_.get(objectChain, 'packs', []), function (item, i) {
return {
id: item.id,
text: item.name + ' (' + item.version + ')',
};
})
),
});
$('#appendVariablesTo').html('');
$.each(_.get(objectChain, 'variables', []), function (i, item) {
var isRequired = (item.required === 1) ? '<span class="label label-danger">Required</span> ' : '';
var dataAppend = ' \
<div class="form-group col-sm-6"> \
<label for="var_ref_' + item.id + '" class="control-label">' + isRequired + item.name + '</label> \
<input type="text" id="var_ref_' + item.id + '" autocomplete="off" name="env_' + item.env_variable + '" class="form-control" value="' + item.default_value + '" /> \
<p class="text-muted small">' + item.description + '<br /> \
<strong>Access in Startup:</strong> <code>{{' + item.env_variable + '}}</code><br /> \
<strong>Validation Rules:</strong> <code>' + item.rules + '</code></small></p> \
</div> \
';
$('#appendVariablesTo').append(dataAppend);
});
});

View File

@ -1,111 +0,0 @@
// Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
(function initSocket() {
if (typeof $.notifyDefaults !== 'function') {
console.error('Notify does not appear to be loaded.');
return;
}
if (typeof io !== 'function') {
console.error('Socket.io is reqired to use this panel.');
return;
}
$.notifyDefaults({
placement: {
from: 'bottom',
align: 'right'
},
newest_on_top: true,
delay: 2000,
animate: {
enter: 'animated zoomInDown',
exit: 'animated zoomOutDown'
}
});
var notifySocketError = false;
// Main Socket Object
window.Socket = io(Pterodactyl.node.scheme + '://' + Pterodactyl.node.fqdn + ':' + Pterodactyl.node.daemonListen + '/stats/', {
'query': 'token=' + Pterodactyl.node.daemonSecret,
});
// Socket Failed to Connect
Socket.io.on('connect_error', function (err) {
if(typeof notifySocketError !== 'object') {
notifySocketError = $.notify({
message: 'There was an error attempting to establish a WebSocket connection to the Daemon. This panel will not work as expected.<br /><br />' + err,
}, {
type: 'danger',
delay: 0
});
}
});
// Connected to Socket Successfully
Socket.on('connect', function () {
if (notifySocketError !== false) {
notifySocketError.close();
notifySocketError = false;
}
});
Socket.on('error', function (err) {
console.error('There was an error while attemping to connect to the websocket: ' + err + '\n\nPlease try loading this page again.');
});
Socket.on('live-stats', function (data) {
$.each(data.servers, function (uuid, info) {
var element = $('tr[data-server="' + uuid + '"]');
switch (info.status) {
case 0:
element.find('[data-action="status"]').html('<span class="label label-danger">Offline</span>');
break;
case 1:
element.find('[data-action="status"]').html('<span class="label label-success">Online</span>');
break;
case 2:
element.find('[data-action="status"]').html('<span class="label label-info">Starting</span>');
break;
case 3:
element.find('[data-action="status"]').html('<span class="label label-info">Stopping</span>');
break;
case 20:
element.find('[data-action="status"]').html('<span class="label label-warning">Installing</span>');
break;
case 30:
element.find('[data-action="status"]').html('<span class="label label-warning">Suspended</span>');
break;
}
if (info.status !== 0) {
var cpuMax = element.find('[data-action="cpu"]').data('cpumax');
var currentCpu = info.proc.cpu.total;
if (cpuMax !== 0) {
currentCpu = parseFloat(((info.proc.cpu.total / cpuMax) * 100).toFixed(2).toString());
}
element.find('[data-action="memory"]').html(parseInt(info.proc.memory.total / (1024 * 1024)));
element.find('[data-action="cpu"]').html(currentCpu);
} else {
element.find('[data-action="memory"]').html('--');
element.find('[data-action="cpu"]').html('--');
}
});
});
})();

View File

@ -1,131 +0,0 @@
// Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
(function () {
window.Editor = ace.edit('editor');
var Whitespace = ace.require('ace/ext/whitespace');
var Modelist = ace.require('ace/ext/modelist');
Editor.setTheme('ace/theme/terminal');
Editor.getSession().setUseWrapMode(true);
Editor.setShowPrintMargin(false);
if (typeof Pterodactyl !== 'undefined') {
if(typeof Pterodactyl.stat !== 'undefined') {
Editor.getSession().setMode(Modelist.getModeForPath(Pterodactyl.stat.name).mode);
}
}
Editor.commands.addCommand({
name: 'save',
bindKey: {win: 'Ctrl-S', mac: 'Command-S'},
exec: function(editor) {
if ($('#save_file').length) {
save();
} else if ($('#create_file').length) {
create();
}
},
readOnly: false
});
Editor.commands.addCommands(Whitespace.commands);
Whitespace.detectIndentation(Editor.session);
$('#save_file').on('click', function (e) {
e.preventDefault();
save();
});
$('#create_file').on('click', function (e) {
e.preventDefault();
create();
});
$('#aceMode').on('change', event => {
Editor.getSession().setMode('ace/mode/' + $('#aceMode').val());
});
function create() {
if (_.isEmpty($('#file_name').val())) {
$.notify({
message: 'No filename was passed.'
}, {
type: 'danger'
});
return;
}
$('#create_file').html('<i class="fa fa-spinner fa fa-spin"></i> Creating File').addClass('disabled');
$.ajax({
type: 'POST',
url: Router.route('server.files.save', { server: Pterodactyl.server.uuidShort }),
headers: {
'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content'),
},
data: {
file: $('#file_name').val(),
contents: Editor.getValue()
}
}).done(function (data) {
window.location.replace(Router.route('server.files.edit', {
server: Pterodactyl.server.uuidShort,
file: $('#file_name').val(),
}));
}).fail(function (jqXHR) {
$.notify({
message: jqXHR.responseText
}, {
type: 'danger'
});
}).always(function () {
$('#create_file').html('Create File').removeClass('disabled');
});
}
function save() {
var fileName = $('input[name="file"]').val();
$('#save_file').html('<i class="fa fw-fw fa-spinner fa-spin"></i> Saving File').addClass('disabled');
$.ajax({
type: 'POST',
url: Router.route('server.files.save', { server: Pterodactyl.server.uuidShort }),
headers: {
'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content'),
},
data: {
file: fileName,
contents: Editor.getValue()
}
}).done(function (data) {
$.notify({
message: 'File was successfully saved.'
}, {
type: 'success'
});
}).fail(function (jqXHR) {
$.notify({
message: jqXHR.responseText
}, {
type: 'danger'
});
}).always(function () {
$('#save_file').html('<i class="fa fa-fw fa-save"></i> &nbsp;Save File').removeClass('disabled');
});
}
})();

File diff suppressed because one or more lines are too long

View File

@ -1,401 +0,0 @@
"use strict";
// Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
class ActionsClass {
constructor(element, menu) {
this.element = element;
this.menu = menu;
}
destroy() {
this.element = undefined;
}
folder(path) {
let inputValue
if (path) {
inputValue = path
} else {
const nameBlock = $(this.element).find('td[data-identifier="name"]');
const currentName = decodeURIComponent(nameBlock.data('name'));
const currentPath = decodeURIComponent(nameBlock.data('path'));
if ($(this.element).data('type') === 'file') {
inputValue = currentPath;
} else {
inputValue = `${currentPath}${currentName}/`;
}
}
swal({
type: 'input',
title: 'Create Folder',
text: 'Please enter the path and folder name below.',
showCancelButton: true,
showConfirmButton: true,
closeOnConfirm: false,
showLoaderOnConfirm: true,
inputValue: inputValue
}, (val) => {
$.ajax({
type: 'POST',
headers: {
'X-Access-Token': Pterodactyl.server.daemonSecret,
'X-Access-Server': Pterodactyl.server.uuid,
},
contentType: 'application/json; charset=utf-8',
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/folder`,
timeout: 10000,
data: JSON.stringify({
path: val,
}),
}).done(data => {
swal.close();
Files.list();
}).fail(jqXHR => {
console.error(jqXHR);
var error = 'An error occured while trying to process this request.';
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
error = jqXHR.responseJSON.error;
}
swal({
type: 'error',
title: '',
text: error,
});
});
});
}
move() {
const nameBlock = $(this.element).find('td[data-identifier="name"]');
const currentName = decodeURIComponent(nameBlock.attr('data-name'));
const currentPath = decodeURIComponent(nameBlock.data('path'));
swal({
type: 'input',
title: 'Move File',
text: 'Please enter the new path for the file below.',
showCancelButton: true,
showConfirmButton: true,
closeOnConfirm: false,
showLoaderOnConfirm: true,
inputValue: `${currentPath}${currentName}`,
}, (val) => {
$.ajax({
type: 'POST',
headers: {
'X-Access-Token': Pterodactyl.server.daemonSecret,
'X-Access-Server': Pterodactyl.server.uuid,
},
contentType: 'application/json; charset=utf-8',
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/move`,
timeout: 10000,
data: JSON.stringify({
from: `${currentPath}${currentName}`,
to: `${val}`,
}),
}).done(data => {
nameBlock.parent().addClass('warning').delay(200).fadeOut();
swal.close();
}).fail(jqXHR => {
console.error(jqXHR);
var error = 'An error occured while trying to process this request.';
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
error = jqXHR.responseJSON.error;
}
swal({
type: 'error',
title: '',
text: error,
});
});
});
}
rename() {
const nameBlock = $(this.element).find('td[data-identifier="name"]');
const currentLink = nameBlock.find('a');
const currentName = decodeURIComponent(nameBlock.attr('data-name'));
const attachEditor = `
<input class="form-control input-sm" type="text" value="${currentName}" />
<span class="input-loader"><i class="fa fa-refresh fa-spin fa-fw"></i></span>
`;
nameBlock.html(attachEditor);
const inputField = nameBlock.find('input');
const inputLoader = nameBlock.find('.input-loader');
inputField.focus();
inputField.on('blur keydown', e => {
// Save Field
if (
(e.type === 'keydown' && e.which === 27)
|| e.type === 'blur'
|| (e.type === 'keydown' && e.which === 13 && currentName === inputField.val())
) {
if (!_.isEmpty(currentLink)) {
nameBlock.html(currentLink);
} else {
nameBlock.html(currentName);
}
inputField.remove();
ContextMenu.unbind().run();
return;
}
if (e.type === 'keydown' && e.which !== 13) return;
inputLoader.show();
const currentPath = decodeURIComponent(nameBlock.data('path'));
$.ajax({
type: 'POST',
headers: {
'X-Access-Token': Pterodactyl.server.daemonSecret,
'X-Access-Server': Pterodactyl.server.uuid,
},
contentType: 'application/json; charset=utf-8',
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/rename`,
timeout: 10000,
data: JSON.stringify({
from: `${currentPath}${currentName}`,
to: `${currentPath}${inputField.val()}`,
}),
}).done(data => {
nameBlock.attr('data-name', inputField.val());
if (!_.isEmpty(currentLink)) {
let newLink = currentLink.attr('href');
if (nameBlock.parent().data('type') !== 'folder') {
newLink = newLink.substr(0, newLink.lastIndexOf('/')) + '/' + inputField.val();
}
currentLink.attr('href', newLink);
nameBlock.html(
currentLink.html(inputField.val())
);
} else {
nameBlock.html(inputField.val());
}
inputField.remove();
}).fail(jqXHR => {
console.error(jqXHR);
var error = 'An error occured while trying to process this request.';
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
error = jqXHR.responseJSON.error;
}
nameBlock.addClass('has-error').delay(2000).queue(() => {
nameBlock.removeClass('has-error').dequeue();
});
inputField.popover({
animation: true,
placement: 'top',
content: error,
title: 'Save Error'
}).popover('show');
}).always(() => {
inputLoader.remove();
ContextMenu.unbind().run();
});
});
}
copy() {
const nameBlock = $(this.element).find('td[data-identifier="name"]');
const currentName = decodeURIComponent(nameBlock.attr('data-name'));
const currentPath = decodeURIComponent(nameBlock.data('path'));
swal({
type: 'input',
title: 'Copy File',
text: 'Please enter the new path for the copied file below.',
showCancelButton: true,
showConfirmButton: true,
closeOnConfirm: false,
showLoaderOnConfirm: true,
inputValue: `${currentPath}${currentName}`,
}, (val) => {
$.ajax({
type: 'POST',
headers: {
'X-Access-Token': Pterodactyl.server.daemonSecret,
'X-Access-Server': Pterodactyl.server.uuid,
},
contentType: 'application/json; charset=utf-8',
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/copy`,
timeout: 10000,
data: JSON.stringify({
from: `${currentPath}${currentName}`,
to: `${val}`,
}),
}).done(data => {
swal({
type: 'success',
title: '',
text: 'File successfully copied.'
});
Files.list();
}).fail(jqXHR => {
console.error(jqXHR);
var error = 'An error occured while trying to process this request.';
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
error = jqXHR.responseJSON.error;
}
swal({
type: 'error',
title: '',
text: error,
});
});
});
}
download() {
const nameBlock = $(this.element).find('td[data-identifier="name"]');
const fileName = decodeURIComponent(nameBlock.attr('data-name'));
const filePath = decodeURIComponent(nameBlock.data('path'));
window.location = `/server/${Pterodactyl.server.uuidShort}/files/download/${filePath}${fileName}`;
}
delete() {
const nameBlock = $(this.element).find('td[data-identifier="name"]');
const delPath = decodeURIComponent(nameBlock.data('path'));
const delName = decodeURIComponent(nameBlock.data('name'));
swal({
type: 'warning',
title: '',
text: 'Are you sure you want to delete <code>' + delName + '</code>? There is <strong>no</strong> reversing this action.',
html: true,
showCancelButton: true,
showConfirmButton: true,
closeOnConfirm: false,
showLoaderOnConfirm: true
}, () => {
$.ajax({
type: 'DELETE',
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/f/${delPath}${delName}`,
headers: {
'X-Access-Token': Pterodactyl.server.daemonSecret,
'X-Access-Server': Pterodactyl.server.uuid,
}
}).done(data => {
nameBlock.parent().addClass('warning').delay(200).fadeOut();
swal({
type: 'success',
title: 'File Deleted'
});
}).fail(jqXHR => {
console.error(jqXHR);
swal({
type: 'error',
title: 'Whoops!',
html: true,
text: 'An error occured while attempting to delete this file. Please try again.',
});
});
});
}
decompress() {
const nameBlock = $(this.element).find('td[data-identifier="name"]');
const compPath = decodeURIComponent(nameBlock.data('path'));
const compName = decodeURIComponent(nameBlock.data('name'));
swal({
title: '<i class="fa fa-refresh fa-spin"></i> Decompressing...',
text: 'This might take a few seconds to complete.',
html: true,
allowOutsideClick: false,
allowEscapeKey: false,
showConfirmButton: false,
});
$.ajax({
type: 'POST',
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/decompress`,
headers: {
'X-Access-Token': Pterodactyl.server.daemonSecret,
'X-Access-Server': Pterodactyl.server.uuid,
},
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({
files: `${compPath}${compName}`
})
}).done(data => {
swal.close();
Files.list(compPath);
}).fail(jqXHR => {
console.error(jqXHR);
var error = 'An error occured while trying to process this request.';
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
error = jqXHR.responseJSON.error;
}
swal({
type: 'error',
title: 'Whoops!',
html: true,
text: error
});
});
}
compress() {
const nameBlock = $(this.element).find('td[data-identifier="name"]');
const compPath = decodeURIComponent(nameBlock.data('path'));
const compName = decodeURIComponent(nameBlock.data('name'));
$.ajax({
type: 'POST',
url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/compress`,
headers: {
'X-Access-Token': Pterodactyl.server.daemonSecret,
'X-Access-Server': Pterodactyl.server.uuid,
},
contentType: 'application/json; charset=utf-8',
data: JSON.stringify({
files: `${compPath}${compName}`,
to: compPath.toString()
})
}).done(data => {
Files.list(compPath, err => {
if (err) return;
const fileListing = $('#file_listing').find(`[data-name="${data.saved_as}"]`).parent();
fileListing.addClass('success pulsate').delay(3000).queue(() => {
fileListing.removeClass('success pulsate').dequeue();
});
});
}).fail(jqXHR => {
console.error(jqXHR);
var error = 'An error occured while trying to process this request.';
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
error = jqXHR.responseJSON.error;
}
swal({
type: 'error',
title: 'Whoops!',
html: true,
text: error
});
});
}
}

View File

@ -1,203 +0,0 @@
"use strict";
// Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
class ContextMenuClass {
constructor() {
this.activeLine = null;
}
run() {
this.directoryClick();
this.rightClick();
}
makeMenu(parent) {
$(document).find('#fileOptionMenu').remove();
if (!_.isNull(this.activeLine)) this.activeLine.removeClass('active');
let newFilePath = $('#file_listing').data('current-dir');
if (parent.data('type') === 'folder') {
const nameBlock = parent.find('td[data-identifier="name"]');
const currentName = decodeURIComponent(nameBlock.attr('data-name'));
const currentPath = decodeURIComponent(nameBlock.data('path'));
newFilePath = `${currentPath}${currentName}`;
}
let buildMenu = '<ul id="fileOptionMenu" class="dropdown-menu" role="menu" style="display:none" >';
if (Pterodactyl.permissions.moveFiles) {
buildMenu += '<li data-action="rename"><a tabindex="-1" href="#"><i class="fa fa-fw fa-pencil-square-o"></i> Rename</a></li> \
<li data-action="move"><a tabindex="-1" href="#"><i class="fa fa-fw fa-arrow-right"></i> Move</a></li>';
}
if (Pterodactyl.permissions.copyFiles) {
buildMenu += '<li data-action="copy"><a tabindex="-1" href="#"><i class="fa fa-fw fa-clone"></i> Copy</a></li>';
}
if (Pterodactyl.permissions.compressFiles) {
buildMenu += '<li data-action="compress" class="hidden"><a tabindex="-1" href="#"><i class="fa fa-fw fa-file-archive-o"></i> Compress</a></li>';
}
if (Pterodactyl.permissions.decompressFiles) {
buildMenu += '<li data-action="decompress" class="hidden"><a tabindex="-1" href="#"><i class="fa fa-fw fa-expand"></i> Decompress</a></li>';
}
if (Pterodactyl.permissions.createFiles) {
buildMenu += '<li class="divider"></li> \
<li data-action="file"><a href="/server/'+ Pterodactyl.server.uuidShort +'/files/add/?dir=' + newFilePath + '" class="text-muted"><i class="fa fa-fw fa-plus"></i> New File</a></li> \
<li data-action="folder"><a tabindex="-1" href="#"><i class="fa fa-fw fa-folder"></i> New Folder</a></li>';
}
if (Pterodactyl.permissions.downloadFiles || Pterodactyl.permissions.deleteFiles) {
buildMenu += '<li class="divider"></li>';
}
if (Pterodactyl.permissions.downloadFiles) {
buildMenu += '<li data-action="download" class="hidden"><a tabindex="-1" href="#"><i class="fa fa-fw fa-download"></i> Download</a></li>';
}
if (Pterodactyl.permissions.deleteFiles) {
buildMenu += '<li data-action="delete" class="bg-danger"><a tabindex="-1" href="#"><i class="fa fa-fw fa-trash-o"></i> Delete</a></li>';
}
buildMenu += '</ul>';
return buildMenu;
}
rightClick() {
$('[data-action="toggleMenu"]').on('mousedown', event => {
event.preventDefault();
if ($(document).find('#fileOptionMenu').is(':visible')) {
$('body').trigger('click');
return;
}
this.showMenu(event);
});
$('#file_listing > tbody td').on('contextmenu', event => {
this.showMenu(event);
});
}
showMenu(event) {
const parent = $(event.target).closest('tr');
const menu = $(this.makeMenu(parent));
if (parent.data('type') === 'disabled') return;
event.preventDefault();
$(menu).appendTo('body');
$(menu).data('invokedOn', $(event.target)).show().css({
position: 'absolute',
left: event.pageX - 150,
top: event.pageY,
});
this.activeLine = parent;
this.activeLine.addClass('active');
// Handle Events
const Actions = new ActionsClass(parent, menu);
if (Pterodactyl.permissions.moveFiles) {
$(menu).find('li[data-action="move"]').unbind().on('click', e => {
e.preventDefault();
Actions.move();
});
$(menu).find('li[data-action="rename"]').unbind().on('click', e => {
e.preventDefault();
Actions.rename();
});
}
if (Pterodactyl.permissions.copyFiles) {
$(menu).find('li[data-action="copy"]').unbind().on('click', e => {
e.preventDefault();
Actions.copy();
});
}
if (Pterodactyl.permissions.compressFiles) {
if (parent.data('type') === 'folder') {
$(menu).find('li[data-action="compress"]').removeClass('hidden');
}
$(menu).find('li[data-action="compress"]').unbind().on('click', e => {
e.preventDefault();
Actions.compress();
});
}
if (Pterodactyl.permissions.decompressFiles) {
if (_.without(['application/zip', 'application/gzip', 'application/x-gzip'], parent.data('mime')).length < 3) {
$(menu).find('li[data-action="decompress"]').removeClass('hidden');
}
$(menu).find('li[data-action="decompress"]').unbind().on('click', e => {
e.preventDefault();
Actions.decompress();
});
}
if (Pterodactyl.permissions.createFiles) {
$(menu).find('li[data-action="folder"]').unbind().on('click', e => {
e.preventDefault();
Actions.folder();
});
}
if (Pterodactyl.permissions.downloadFiles) {
if (parent.data('type') === 'file') {
$(menu).find('li[data-action="download"]').removeClass('hidden');
}
$(menu).find('li[data-action="download"]').unbind().on('click', e => {
e.preventDefault();
Actions.download();
});
}
if (Pterodactyl.permissions.deleteFiles) {
$(menu).find('li[data-action="delete"]').unbind().on('click', e => {
e.preventDefault();
Actions.delete();
});
}
$(window).unbind().on('click', event => {
if($(event.target).is('.disable-menu-hide')) {
event.preventDefault();
return;
}
$(menu).unbind().remove();
if(!_.isNull(this.activeLine)) this.activeLine.removeClass('active');
});
}
directoryClick() {
$('a[data-action="directory-view"]').on('click', function (event) {
event.preventDefault();
const path = $(this).parent().data('path') || '';
const name = $(this).parent().data('name') || '';
window.location.hash = encodeURIComponent(path + name);
Files.list();
});
}
}
window.ContextMenu = new ContextMenuClass;

View File

@ -1,98 +0,0 @@
"use strict";
// Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
class FileManager {
constructor() {
this.list(this.decodeHash());
}
list(path, next) {
if (_.isUndefined(path)) {
path = this.decodeHash();
}
this.loader(true);
$.ajax({
type: 'POST',
url: Pterodactyl.meta.directoryList,
headers: {
'X-CSRF-Token': Pterodactyl.meta.csrftoken,
},
data: {
directory: path,
},
}).done(data => {
this.loader(false);
$('#load_files').slideUp(10).html(data).slideDown(10, () => {
ContextMenu.run();
this.reloadFilesButton();
this.addFolderButton();
if (_.isFunction(next)) {
return next();
}
});
$('#internal_alert').slideUp();
if (typeof Siofu === 'object') {
Siofu.listenOnInput(document.getElementById("files_touch_target"));
}
}).fail(jqXHR => {
this.loader(false);
if (_.isFunction(next)) {
return next(new Error('Failed to load file listing.'));
}
swal({
type: 'error',
title: 'File Error',
text: jqXHR.responseText || 'An error occured while attempting to process this request. Please try again.',
});
console.error(jqXHR);
});
}
loader(show) {
if (show){
$('.file-overlay').fadeIn(100);
} else {
$('.file-overlay').fadeOut(100);
}
}
reloadFilesButton() {
$('i[data-action="reload-files"]').unbind().on('click', () => {
$('i[data-action="reload-files"]').addClass('fa-spin');
this.list();
});
}
addFolderButton() {
$('[data-action="add-folder"]').unbind().on('click', () => {
new ActionsClass().folder($('#file_listing').data('current-dir') || '/');
})
}
decodeHash() {
return decodeURIComponent(window.location.hash.substring(1));
}
}
window.Files = new FileManager;

View File

@ -1,141 +0,0 @@
// Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
(function initUploader() {
var notifyUploadSocketError = false;
uploadSocket = io(Pterodactyl.node.scheme + '://' + Pterodactyl.node.fqdn + ':' + Pterodactyl.node.daemonListen + '/upload/' + Pterodactyl.server.uuid, {
'query': 'token=' + Pterodactyl.server.daemonSecret,
});
uploadSocket.io.on('connect_error', function (err) {
if(typeof notifyUploadSocketError !== 'object') {
notifyUploadSocketError = $.notify({
message: 'There was an error attempting to establish a connection to the uploader endpoint.<br /><br />' + err,
}, {
type: 'danger',
delay: 0
});
}
});
uploadSocket.on('error', err => {
Siofu.destroy();
console.error(err);
});
uploadSocket.on('connect', function () {
if (notifyUploadSocketError !== false) {
notifyUploadSocketError.close();
notifyUploadSocketError = false;
}
});
window.Siofu = new SocketIOFileUpload(uploadSocket);
Siofu.listenOnDrop(document.getElementById("load_files"));
if (document.getElementById("files_touch_target")) {
Siofu.listenOnInput(document.getElementById("files_touch_target"));
}
window.addEventListener('dragover', function (event) {
event.preventDefault();
}, false);
window.addEventListener('drop', function (event) {
event.preventDefault();
}, false);
var dropCounter = 0;
$('#load_files').bind({
dragenter: function (event) {
event.preventDefault();
dropCounter++;
$(this).addClass('hasFileHover');
},
dragleave: function (event) {
dropCounter--;
if (dropCounter === 0) {
$(this).removeClass('hasFileHover');
}
},
drop: function (event) {
dropCounter = 0;
$(this).removeClass('hasFileHover');
}
});
Siofu.addEventListener('start', function (event) {
window.onbeforeunload = function () {
return 'A file upload in in progress, are you sure you want to continue?';
};
event.file.meta.path = $('#file_listing').data('current-dir');
event.file.meta.identifier = Math.random().toString(36).slice(2);
$('#append_files_to').append('<tr id="file-upload-' + event.file.meta.identifier +'"> \
<td><i class="fa fa-file-text-o" style="margin-left: 2px;"></i></td> \
<td>' + event.file.name + '</td> \
<td colspan=2">&nbsp;</td> \
</tr><tr> \
<td colspan="5" class="has-progress"> \
<div class="progress progress-table-bottom active"> \
<div class="progress-bar progress-bar-info prog-bar-' + event.file.meta.identifier +'" style="width: 0%"></div> \
</div> \
</td> \
</tr>\
');
});
Siofu.addEventListener('progress', function(event) {
window.onbeforeunload = function () {
return 'A file upload in in progress, are you sure you want to continue?';
};
var percent = event.bytesLoaded / event.file.size * 100;
if (percent >= 100) {
$('.prog-bar-' + event.file.meta.identifier).css('width', '100%').removeClass('progress-bar-info').addClass('progress-bar-success').parent().removeClass('active');
} else {
$('.prog-bar-' + event.file.meta.identifier).css('width', percent + '%');
}
});
// Do something when a file is uploaded:
Siofu.addEventListener('complete', function(event) {
window.onbeforeunload = function () {};
if (!event.success) {
$('.prog-bar-' + event.file.meta.identifier).css('width', '100%').removeClass('progress-bar-info').addClass('progress-bar-danger');
$.notify({
message: 'An error was encountered while attempting to upload this file.'
}, {
type: 'danger',
delay: 5000
});
}
});
Siofu.addEventListener('error', function(event) {
window.onbeforeunload = function () {};
console.error(event);
$('.prog-bar-' + event.file.meta.identifier).css('width', '100%').removeClass('progress-bar-info').addClass('progress-bar-danger');
$.notify({
message: 'An error was encountered while attempting to upload this file: <strong>' + event.message + '.</strong>',
}, {
type: 'danger',
delay: 8000
});
});
})();