\
- ';
- $('#appendVariablesTo').append(dataAppend);
- });
-});
diff --git a/resources/themes/redxen/admin/public/themes/pterodactyl/js/admin/node/view-servers.js b/resources/themes/redxen/admin/public/themes/pterodactyl/js/admin/node/view-servers.js
deleted file mode 100644
index 512dbc7..0000000
--- a/resources/themes/redxen/admin/public/themes/pterodactyl/js/admin/node/view-servers.js
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (c) 2015 - 2017 Dane Everitt
-//
-// 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.
' + 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('Offline');
- break;
- case 1:
- element.find('[data-action="status"]').html('Online');
- break;
- case 2:
- element.find('[data-action="status"]').html('Starting');
- break;
- case 3:
- element.find('[data-action="status"]').html('Stopping');
- break;
- case 20:
- element.find('[data-action="status"]').html('Installing');
- break;
- case 30:
- element.find('[data-action="status"]').html('Suspended');
- 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('--');
- }
- });
- });
-})();
diff --git a/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/2fa-modal.js b/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/2fa-modal.js
deleted file mode 100644
index e69de29..0000000
diff --git a/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/editor.js b/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/editor.js
deleted file mode 100644
index 00ebab8..0000000
--- a/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/editor.js
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright (c) 2015 - 2017 Dane Everitt
-//
-// 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(' 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(' 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(' Save File').removeClass('disabled');
- });
- }
-})();
diff --git a/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/filemanager.min.js b/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/filemanager.min.js
deleted file mode 100644
index d9a9670..0000000
--- a/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/filemanager.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i\n \n ';nameBlock.html(attachEditor);var inputField=nameBlock.find('input');var inputLoader=nameBlock.find('.input-loader');inputField.focus();inputField.on('blur keydown',function(e){if(e.type==='keydown'&&e.which===27||e.type==='blur'||e.type==='keydown'&&e.which===13&¤tName===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();var 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(function(data){nameBlock.attr('data-name',inputField.val());if(!_.isEmpty(currentLink)){var 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(function(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(function(){nameBlock.removeClass('has-error').dequeue()});inputField.popover({animation:true,placement:'top',content:error,title:'Save Error'}).popover('show')}).always(function(){inputLoader.remove();ContextMenu.unbind().run()})})}},{key:'copy',value:function copy(){var nameBlock=$(this.element).find('td[data-identifier="name"]');var currentName=decodeURIComponent(nameBlock.attr('data-name'));var 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},function(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(function(data){swal({type:'success',title:'',text:'File successfully copied.'});Files.list()}).fail(function(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})})})}},{key:'download',value:function download(){var nameBlock=$(this.element).find('td[data-identifier="name"]');var fileName=decodeURIComponent(nameBlock.attr('data-name'));var filePath=decodeURIComponent(nameBlock.data('path'));window.location='/server/'+Pterodactyl.server.uuidShort+'/files/download/'+filePath+fileName}},{key:'delete',value:function _delete(){var nameBlock=$(this.element).find('td[data-identifier="name"]');var delPath=decodeURIComponent(nameBlock.data('path'));var delName=decodeURIComponent(nameBlock.data('name'));swal({type:'warning',title:'',text:'Are you sure you want to delete '+delName+'? There is no reversing this action.',html:true,showCancelButton:true,showConfirmButton:true,closeOnConfirm:false,showLoaderOnConfirm:true},function(){$.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(function(data){nameBlock.parent().addClass('warning').delay(200).fadeOut();swal({type:'success',title:'File Deleted'})}).fail(function(jqXHR){console.error(jqXHR);swal({type:'error',title:'Whoops!',html:true,text:'An error occured while attempting to delete this file. Please try again.'})})})}},{key:'decompress',value:function decompress(){var nameBlock=$(this.element).find('td[data-identifier="name"]');var compPath=decodeURIComponent(nameBlock.data('path'));var compName=decodeURIComponent(nameBlock.data('name'));swal({title:' 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(function(data){swal.close();Files.list(compPath)}).fail(function(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})})}},{key:'compress',value:function compress(){var nameBlock=$(this.element).find('td[data-identifier="name"]');var compPath=decodeURIComponent(nameBlock.data('path'));var 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(function(data){Files.list(compPath,function(err){if(err)return;var fileListing=$('#file_listing').find('[data-name="'+data.saved_as+'"]').parent();fileListing.addClass('success pulsate').delay(3000).queue(function(){fileListing.removeClass('success pulsate').dequeue()})})}).fail(function(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})})}}]);return ActionsClass}();
-'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i Rename
';
- 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;
diff --git a/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/src/index.js b/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/src/index.js
deleted file mode 100644
index 768cc2e..0000000
--- a/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/src/index.js
+++ /dev/null
@@ -1,98 +0,0 @@
-"use strict";
-
-// Copyright (c) 2015 - 2017 Dane Everitt
-//
-// 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;
diff --git a/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/upload.js b/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/upload.js
deleted file mode 100644
index 1206b70..0000000
--- a/resources/themes/redxen/admin/public/themes/pterodactyl/js/frontend/files/upload.js
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright (c) 2015 - 2017 Dane Everitt
-//
-// 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.
' + 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('
\
-
\
-
' + event.file.name + '
\
-
\
-
\
-
\
-
\
- \
-
\
-
\
-
\
- ');
- });
-
- 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: ' + event.message + '.',
- }, {
- type: 'danger',
- delay: 8000
- });
- });
-})();