'+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' + delName + '
? There is no reversing this action.',\n html: true,\n showCancelButton: true,\n showConfirmButton: true,\n closeOnConfirm: false,\n showLoaderOnConfirm: true\n }, () => {\n $.ajax({\n type: 'DELETE',\n url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/f/${delPath}${delName}`,\n headers: {\n 'X-Access-Token': Pterodactyl.server.daemonSecret,\n 'X-Access-Server': Pterodactyl.server.uuid,\n }\n }).done(data => {\n nameBlock.parent().addClass('warning').delay(200).fadeOut();\n swal({\n type: 'success',\n title: 'File Deleted'\n });\n }).fail(jqXHR => {\n console.error(jqXHR);\n swal({\n type: 'error',\n title: 'Whoops!',\n html: true,\n text: 'An error occured while attempting to delete this file. Please try again.',\n });\n });\n });\n }\n\n decompress() {\n const nameBlock = $(this.element).find('td[data-identifier=\"name\"]');\n const compPath = decodeURIComponent(nameBlock.data('path'));\n const compName = decodeURIComponent(nameBlock.data('name'));\n\n swal({\n title: ' Decompressing...',\n text: 'This might take a few seconds to complete.',\n html: true,\n allowOutsideClick: false,\n allowEscapeKey: false,\n showConfirmButton: false,\n });\n\n $.ajax({\n type: 'POST',\n url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/decompress`,\n headers: {\n 'X-Access-Token': Pterodactyl.server.daemonSecret,\n 'X-Access-Server': Pterodactyl.server.uuid,\n },\n contentType: 'application/json; charset=utf-8',\n data: JSON.stringify({\n files: `${compPath}${compName}`\n })\n }).done(data => {\n swal.close();\n Files.list(compPath);\n }).fail(jqXHR => {\n console.error(jqXHR);\n var error = 'An error occured while trying to process this request.';\n if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {\n error = jqXHR.responseJSON.error;\n }\n swal({\n type: 'error',\n title: 'Whoops!',\n html: true,\n text: error\n });\n });\n }\n\n compress() {\n const nameBlock = $(this.element).find('td[data-identifier=\"name\"]');\n const compPath = decodeURIComponent(nameBlock.data('path'));\n const compName = decodeURIComponent(nameBlock.data('name'));\n\n $.ajax({\n type: 'POST',\n url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/server/file/compress`,\n headers: {\n 'X-Access-Token': Pterodactyl.server.daemonSecret,\n 'X-Access-Server': Pterodactyl.server.uuid,\n },\n contentType: 'application/json; charset=utf-8',\n data: JSON.stringify({\n files: `${compPath}${compName}`,\n to: compPath.toString()\n })\n }).done(data => {\n Files.list(compPath, err => {\n if (err) return;\n const fileListing = $('#file_listing').find(`[data-name=\"${data.saved_as}\"]`).parent();\n fileListing.addClass('success pulsate').delay(3000).queue(() => {\n fileListing.removeClass('success pulsate').dequeue();\n });\n });\n }).fail(jqXHR => {\n console.error(jqXHR);\n var error = 'An error occured while trying to process this request.';\n if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {\n error = jqXHR.responseJSON.error;\n }\n swal({\n type: 'error',\n title: 'Whoops!',\n html: true,\n text: error\n });\n });\n }\n}\n","\"use strict\";\n\n// Copyright (c) 2015 - 2016 Dane Everitt ' + delName + '
? There is no 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: ' 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
+ });
+ });
+ }
+}
diff --git a/resources/views/server/js/filemanager/contextmenu.blade.php b/public/js/files/contextmenu.js
similarity index 64%
rename from resources/views/server/js/filemanager/contextmenu.blade.php
rename to public/js/files/contextmenu.js
index e396b50aa..f61b7bb28 100644
--- a/resources/views/server/js/filemanager/contextmenu.blade.php
+++ b/public/js/files/contextmenu.js
@@ -40,19 +40,46 @@ class ContextMenuClass {
const currentPath = decodeURIComponent(nameBlock.data('path'));
newFilePath = `${currentPath}${currentName}`;
}
- return ' ';
+
+ let buildMenu = ' ';
+ return buildMenu;
}
rightClick() {
@@ -82,79 +109,69 @@ class ContextMenuClass {
this.activeLine = parent;
this.activeLine.addClass('active');
- @can('download-files', $server)
- if (parent.data('type') === 'file') {
- $(menu).find('li[data-action="download"]').removeClass('hidden');
- }
- @endcan
-
- @can('compress-files', $server)
- if (parent.data('type') === 'folder') {
- $(menu).find('li[data-action="compress"]').removeClass('hidden');
- }
- @endcan
-
- @can('decompress-files', $server)
- if (_.without(['application/zip', 'application/gzip', 'application/x-gzip'], parent.data('mime')).length < 3) {
- $(menu).find('li[data-action="decompress"]').removeClass('hidden');
- }
- @endcan
-
// Handle Events
const Actions = new ActionsClass(parent, menu);
- @can('move-files', $server)
+ if (Pterodactyl.permissions.moveFiles) {
$(menu).find('li[data-action="move"]').unbind().on('click', e => {
e.preventDefault();
Actions.move();
});
- @endcan
-
- @can('copy-files', $server)
- $(menu).find('li[data-action="copy"]').unbind().on('click', e => {
- e.preventDefault();
- Actions.copy();
- });
- @endcan
-
- @can('move-files', $server)
$(menu).find('li[data-action="rename"]').unbind().on('click', e => {
e.preventDefault();
Actions.rename();
});
- @endcan
+ }
- @can('compress-files', $server)
+ 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();
});
- @endcan
+ }
- @can('decompress-files', $server)
+ 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();
});
- @endcan
+ }
- @can('create-files', $server)
+ if (Pterodactyl.permissions.createFiles) {
$(menu).find('li[data-action="folder"]').unbind().on('click', e => {
e.preventDefault();
Actions.folder();
});
- @endcan
+ }
- @can('download-files', $server)
+ 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();
});
- @endcan
+ }
- $(menu).find('li[data-action="delete"]').unbind().on('click', e => {
- e.preventDefault();
- Actions.delete();
- });
+ if (Pterodactyl.permissions.deleteFiles) {
+ $(menu).find('li[data-action="delete"]').unbind().on('click', e => {
+ e.preventDefault();
+ Actions.delete();
+ });
+ }
$(window).on('click', () => {
$(menu).remove();
diff --git a/resources/views/server/js/filemanager/index.blade.php b/public/js/files/index.js
similarity index 95%
rename from resources/views/server/js/filemanager/index.blade.php
rename to public/js/files/index.js
index a89b4114f..a8142123f 100644
--- a/resources/views/server/js/filemanager/index.blade.php
+++ b/public/js/files/index.js
@@ -32,9 +32,9 @@ class FileManager {
this.loader(true);
$.ajax({
type: 'POST',
- url: '{{ route('server.files.directory-list', $server->uuidShort) }}',
+ url: Pterodactyl.meta.directoryList,
headers: {
- 'X-CSRF-Token': '{{ csrf_token() }}',
+ 'X-CSRF-Token': Pterodactyl.meta.csrftoken,
},
data: {
directory: path,
diff --git a/resources/views/server/js/minecraft/eula.blade.php b/public/js/plugins/minecraft/eula.js
similarity index 55%
rename from resources/views/server/js/minecraft/eula.blade.php
rename to public/js/plugins/minecraft/eula.js
index 5eefb11f7..28fe082e0 100644
--- a/resources/views/server/js/minecraft/eula.blade.php
+++ b/public/js/plugins/minecraft/eula.js
@@ -1,22 +1,22 @@
-{{-- Copyright (c) 2015 - 2016 Dane Everitt auto-installer
or auto-updater
to setup the daemon.
{
- "web": {
- "host": "0.0.0.0",
- "listen": {{ $node->daemonListen }},
- "ssl": {
- "enabled": {{ $node->scheme === 'https' ? 'true' : 'false' }},
- "certificate": "/etc/letsencrypt/live/{{ $node->fqdn }}/fullchain.pem",
- "key": "/etc/letsencrypt/live/{{ $node->fqdn }}/privkey.pem"
- }
- },
- "docker": {
- "socket": "/var/run/docker.sock",
- "autoupdate_images": true
- },
- "sftp": {
- "path": "{{ $node->daemonBase }}",
- "port": {{ $node->daemonSFTP }},
- "container": "ptdl-sftp"
- },
- "query": {
- "kill_on_fail": true,
- "fail_limit": 5
- },
- "logger": {
- "path": "logs/",
- "src": false,
- "level": "info",
- "period": "1d",
- "count": 3
- },
- "remote": {
- "base": "{{ config('app.url') }}",
- "download": "{{ route('remote.download') }}",
- "installed": "{{ route('remote.install') }}"
- },
- "uploads": {
- "size_limit": {{ $node->upload_size }}
- },
- "keys": [
- "{{ $node->daemonSecret }}"
- ]
-}
+ To simplify the configuration of nodes it is possible to fetch the config from the panel. A token is required for this process. The button below will generate a token and provide you with the commands necessary for automatic configuration of the node. Be aware that these tokens are only valid for 5 minutes.
++ +
+{{ $node->getConfigurationAsJson(true) }}
'+data.token+'
To auto-configure your node runnpm run configure -- --panel-url '+window.location.protocol+'//{{ config('app.url') }} --token '+data.token+'
Character limits: a-zA-Z0-9_-
and [Space]
(max 35 characters)
Character limits: a-z A-Z 0-9 _ - .
and [Space]
(max 200 characters).
If you do not want to limit CPU usage set the value to 0
. To determine a value, take the number physical cores and multiply it by 100. For example, on a quad core system (4 * 100 = 400)
there is 400%
available. To limit a server to using half of a single core, you would set the value to 50
. To allow a server to use up to two physical cores, set the value to 200
. BlockIO should be a value between 10
and 1000
. Please see this documentation for more information about it.
+
If you do not want to limit CPU usage set the value to 0
. To determine a value, take the number physical cores and multiply it by 100. For example, on a quad core system (4 * 100 = 400)
there is 400%
available. To limit a server to using half of a single core, you would set the value to 50
. To allow a server to use up to two physical cores, set the value to 200
. BlockIO should be a value between 10
and 1000
. Please see this documentation for more information about it.