1 line
No EOL
54 KiB
Text
1 line
No EOL
54 KiB
Text
{"version":3,"sources":["src/actions.js","src/contextmenu.js","src/index.js"],"names":[],"mappings":"AAAA,a,8oBAqBM,a,YACF,sBAAY,OAAZ,CAAqB,IAArB,CAA2B,oCACvB,KAAK,OAAL,CAAe,OAAf,CACA,KAAK,IAAL,CAAY,IACf,C,kEAES,CACN,KAAK,OAAL,CAAe,SAClB,C,wDAEe,K,CAAO,CACnB,MAAO,GAAE,OAAF,EAAW,IAAX,CAAgB,KAAhB,EAAuB,IAAvB,EACV,C,sCAEM,I,CAAM,CACT,GAAI,kBAAJ,CACA,GAAI,IAAJ,CAAU,CACN,WAAa,IAChB,CAFD,IAEO,CACH,GAAM,WAAY,EAAE,KAAK,OAAP,EAAgB,IAAhB,CAAqB,4BAArB,CAAlB,CACA,GAAM,aAAc,mBAAmB,UAAU,IAAV,CAAe,MAAf,CAAnB,CAApB,CACA,GAAM,aAAc,mBAAmB,UAAU,IAAV,CAAe,MAAf,CAAnB,CAApB,CAEA,GAAI,EAAE,KAAK,OAAP,EAAgB,IAAhB,CAAqB,MAArB,IAAiC,MAArC,CAA6C,CACzC,WAAa,WAChB,CAFD,IAEO,CACH,cAAgB,WAAhB,CAA8B,WAA9B,IACH,CACJ,CAED,KAAK,CACD,KAAM,OADL,CAED,MAAO,eAFN,CAGD,KAAM,8CAHL,CAID,iBAAkB,IAJjB,CAKD,kBAAmB,IALlB,CAMD,eAAgB,KANf,CAOD,oBAAqB,IAPpB,CAQD,WAAY,UARX,CAAL,CASG,SAAC,GAAD,CAAS,CACR,GAAI,MAAQ,KAAZ,CAAmB,CACf,MAAO,MACV,CAED,EAAE,IAAF,CAAO,CACH,KAAM,MADH,CAEH,QAAS,CACL,iBAAkB,YAAY,MAAZ,CAAmB,YADhC,CAEL,kBAAmB,YAAY,MAAZ,CAAmB,IAFjC,CAFN,CAMH,YAAa,iCANV,CAOH,IAAQ,YAAY,IAAZ,CAAiB,MAAzB,OAAqC,YAAY,IA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mC,KAAnC,CACH,CAED,GAAI,aAAJ,GAAmB,iBAAnB,EACH,CACJ,CAVD,CAWD,C,+CAEY,CACT,MAAO,oBAAmB,OAAO,QAAP,CAAgB,IAAhB,CAAqB,SAArB,CAA+B,CAA/B,CAAnB,CACV,C,0BAIL,OAAO,KAAP,CAAe,GAAI,YAAnB","file":"filemanager.min.js","sourcesContent":["\"use strict\";\r\n\r\n// Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>\r\n//\r\n// Permission is hereby granted, free of charge, to any person obtaining a copy\r\n// of this software and associated documentation files (the \"Software\"), to deal\r\n// in the Software without restriction, including without limitation the rights\r\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n// copies of the Software, and to permit persons to whom the Software is\r\n// furnished to do so, subject to the following conditions:\r\n//\r\n// The above copyright notice and this permission notice shall be included in all\r\n// copies or substantial portions of the Software.\r\n//\r\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n// SOFTWARE.\r\nclass ActionsClass {\r\n constructor(element, menu) {\r\n this.element = element;\r\n this.menu = menu;\r\n }\r\n\r\n destroy() {\r\n this.element = undefined;\r\n }\r\n\r\n sanitizedString(value) {\r\n return $('<div>').text(value).html();\r\n }\r\n\r\n folder(path) {\r\n let inputValue\r\n if (path) {\r\n inputValue = path\r\n } else {\r\n const nameBlock = $(this.element).find('td[data-identifier=\"name\"]');\r\n const currentName = decodeURIComponent(nameBlock.data('name'));\r\n const currentPath = decodeURIComponent(nameBlock.data('path'));\r\n\r\n if ($(this.element).data('type') === 'file') {\r\n inputValue = currentPath;\r\n } else {\r\n inputValue = `${currentPath}${currentName}/`;\r\n }\r\n }\r\n\r\n swal({\r\n type: 'input',\r\n title: 'Create Folder',\r\n text: 'Please enter the path and folder name below.',\r\n showCancelButton: true,\r\n showConfirmButton: true,\r\n closeOnConfirm: false,\r\n showLoaderOnConfirm: true,\r\n inputValue: inputValue\r\n }, (val) => {\r\n if (val === false) {\r\n return false;\r\n }\r\n\r\n $.ajax({\r\n type: 'POST',\r\n headers: {\r\n 'X-Access-Token': Pterodactyl.server.daemonSecret,\r\n 'X-Access-Server': Pterodactyl.server.uuid,\r\n },\r\n contentType: 'application/json; charset=utf-8',\r\n url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/folder`,\r\n timeout: 10000,\r\n data: JSON.stringify({\r\n path: val,\r\n }),\r\n }).done(data => {\r\n swal.close();\r\n Files.list();\r\n }).fail(jqXHR => {\r\n console.error(jqXHR);\r\n var error = 'An error occurred while trying to process this request.';\r\n if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {\r\n error = jqXHR.responseJSON.error;\r\n }\r\n swal({\r\n type: 'error',\r\n title: '',\r\n text: error,\r\n });\r\n });\r\n });\r\n }\r\n\r\n move() {\r\n const nameBlock = $(this.element).find('td[data-identifier=\"name\"]');\r\n const currentName = decodeURIComponent(nameBlock.attr('data-name'));\r\n const currentPath = decodeURIComponent(nameBlock.data('path'));\r\n\r\n swal({\r\n type: 'input',\r\n title: 'Move File',\r\n text: 'Please enter the new path for the file below.',\r\n showCancelButton: true,\r\n showConfirmButton: true,\r\n closeOnConfirm: false,\r\n showLoaderOnConfirm: true,\r\n inputValue: `${currentPath}${currentName}`,\r\n }, (val) => {\r\n if (val === false) {\r\n return false;\r\n }\r\n\r\n $.ajax({\r\n type: 'POST',\r\n headers: {\r\n 'X-Access-Token': Pterodactyl.server.daemonSecret,\r\n 'X-Access-Server': Pterodactyl.server.uuid,\r\n },\r\n contentType: 'application/json; charset=utf-8',\r\n url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/move`,\r\n timeout: 10000,\r\n data: JSON.stringify({\r\n from: `${currentPath}${currentName}`,\r\n to: `${val}`,\r\n }),\r\n }).done(data => {\r\n nameBlock.parent().addClass('warning').delay(200).fadeOut();\r\n swal.close();\r\n }).fail(jqXHR => {\r\n console.error(jqXHR);\r\n var error = 'An error occurred while trying to process this request.';\r\n if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {\r\n error = jqXHR.responseJSON.error;\r\n }\r\n swal({\r\n type: 'error',\r\n title: '',\r\n text: error,\r\n });\r\n });\r\n });\r\n\r\n }\r\n\r\n rename() {\r\n const nameBlock = $(this.element).find('td[data-identifier=\"name\"]');\r\n const currentLink = nameBlock.find('a');\r\n const currentName = decodeURIComponent(nameBlock.attr('data-name'));\r\n const attachEditor = `\r\n <input class=\"form-control input-sm\" type=\"text\" value=\"${currentName}\" />\r\n <span class=\"input-loader\"><i class=\"fa fa-refresh fa-spin fa-fw\"></i></span>\r\n `;\r\n\r\n nameBlock.html(attachEditor);\r\n const inputField = nameBlock.find('input');\r\n const inputLoader = nameBlock.find('.input-loader');\r\n\r\n inputField.focus();\r\n inputField.on('blur keydown', e => {\r\n // Save Field\r\n if (\r\n (e.type === 'keydown' && e.which === 27)\r\n || e.type === 'blur'\r\n || (e.type === 'keydown' && e.which === 13 && currentName === inputField.val())\r\n ) {\r\n if (!_.isEmpty(currentLink)) {\r\n nameBlock.html(currentLink);\r\n } else {\r\n nameBlock.html(currentName);\r\n }\r\n inputField.remove();\r\n ContextMenu.unbind().run();\r\n return;\r\n }\r\n\r\n if (e.type === 'keydown' && e.which !== 13) return;\r\n\r\n inputLoader.show();\r\n const currentPath = decodeURIComponent(nameBlock.data('path'));\r\n\r\n $.ajax({\r\n type: 'POST',\r\n headers: {\r\n 'X-Access-Token': Pterodactyl.server.daemonSecret,\r\n 'X-Access-Server': Pterodactyl.server.uuid,\r\n },\r\n contentType: 'application/json; charset=utf-8',\r\n url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/rename`,\r\n timeout: 10000,\r\n data: JSON.stringify({\r\n from: `${currentPath}${currentName}`,\r\n to: `${currentPath}${inputField.val()}`,\r\n }),\r\n }).done(data => {\r\n nameBlock.attr('data-name', inputField.val());\r\n if (!_.isEmpty(currentLink)) {\r\n let newLink = currentLink.attr('href');\r\n if (nameBlock.parent().data('type') !== 'folder') {\r\n newLink = newLink.substr(0, newLink.lastIndexOf('/')) + '/' + inputField.val();\r\n }\r\n currentLink.attr('href', newLink);\r\n nameBlock.html(\r\n currentLink.html(inputField.val())\r\n );\r\n } else {\r\n nameBlock.html(inputField.val());\r\n }\r\n inputField.remove();\r\n }).fail(jqXHR => {\r\n console.error(jqXHR);\r\n var error = 'An error occurred while trying to process this request.';\r\n if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {\r\n error = jqXHR.responseJSON.error;\r\n }\r\n nameBlock.addClass('has-error').delay(2000).queue(() => {\r\n nameBlock.removeClass('has-error').dequeue();\r\n });\r\n inputField.popover({\r\n animation: true,\r\n placement: 'top',\r\n content: error,\r\n title: 'Save Error'\r\n }).popover('show');\r\n }).always(() => {\r\n inputLoader.remove();\r\n ContextMenu.unbind().run();\r\n });\r\n });\r\n }\r\n\r\n copy() {\r\n const nameBlock = $(this.element).find('td[data-identifier=\"name\"]');\r\n const currentName = decodeURIComponent(nameBlock.attr('data-name'));\r\n const currentPath = decodeURIComponent(nameBlock.data('path'));\r\n\r\n swal({\r\n type: 'input',\r\n title: 'Copy File',\r\n text: 'Please enter the new path for the copied file below.',\r\n showCancelButton: true,\r\n showConfirmButton: true,\r\n closeOnConfirm: false,\r\n showLoaderOnConfirm: true,\r\n inputValue: `${currentPath}${currentName}`,\r\n }, (val) => {\r\n if (val === false) {\r\n return false;\r\n }\r\n\r\n $.ajax({\r\n type: 'POST',\r\n headers: {\r\n 'X-Access-Token': Pterodactyl.server.daemonSecret,\r\n 'X-Access-Server': Pterodactyl.server.uuid,\r\n },\r\n contentType: 'application/json; charset=utf-8',\r\n url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/copy`,\r\n timeout: 10000,\r\n data: JSON.stringify({\r\n from: `${currentPath}${currentName}`,\r\n to: `${val}`,\r\n }),\r\n }).done(data => {\r\n swal({\r\n type: 'success',\r\n title: '',\r\n text: 'File successfully copied.'\r\n });\r\n Files.list();\r\n }).fail(jqXHR => {\r\n console.error(jqXHR);\r\n var error = 'An error occurred while trying to process this request.';\r\n if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {\r\n error = jqXHR.responseJSON.error;\r\n }\r\n swal({\r\n type: 'error',\r\n title: '',\r\n text: error,\r\n });\r\n });\r\n });\r\n }\r\n\r\n download() {\r\n const nameBlock = $(this.element).find('td[data-identifier=\"name\"]');\r\n const fileName = decodeURIComponent(nameBlock.attr('data-name'));\r\n const filePath = decodeURIComponent(nameBlock.data('path'));\r\n\r\n window.location = `/server/${Pterodactyl.server.uuidShort}/files/download/${filePath}${fileName}`;\r\n }\r\n\r\n delete() {\r\n const nameBlock = $(this.element).find('td[data-identifier=\"name\"]');\r\n const delPath = decodeURIComponent(nameBlock.data('path'));\r\n const delName = decodeURIComponent(nameBlock.data('name'));\r\n\r\n swal({\r\n type: 'warning',\r\n title: '',\r\n text: 'Are you sure you want to delete <code>' + this.sanitizedString(delName) + '</code>?',\r\n html: true,\r\n showCancelButton: true,\r\n showConfirmButton: true,\r\n closeOnConfirm: false,\r\n showLoaderOnConfirm: true\r\n }, () => {\r\n $.ajax({\r\n type: 'POST',\r\n headers: {\r\n 'X-Access-Token': Pterodactyl.server.daemonSecret,\r\n 'X-Access-Server': Pterodactyl.server.uuid,\r\n },\r\n contentType: 'application/json; charset=utf-8',\r\n url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/delete`,\r\n timeout: 10000,\r\n data: JSON.stringify({\r\n items: [`${delPath}${delName}`]\r\n }),\r\n }).done(data => {\r\n nameBlock.parent().addClass('warning').delay(200).fadeOut();\r\n swal({\r\n type: 'success',\r\n title: 'File Deleted'\r\n });\r\n }).fail(jqXHR => {\r\n console.error(jqXHR);\r\n swal({\r\n type: 'error',\r\n title: 'Whoops!',\r\n html: true,\r\n text: 'An error occurred while attempting to delete this file. Please try again.',\r\n });\r\n });\r\n });\r\n }\r\n\r\n toggleMassActions() {\r\n if ($('#file_listing input[type=\"checkbox\"]:checked').length) {\r\n $('#mass_actions').removeClass('disabled');\r\n } else {\r\n $('#mass_actions').addClass('disabled');\r\n }\r\n }\r\n\r\n toggleHighlight(event) {\r\n const parent = $(event.currentTarget);\r\n const item = $(event.currentTarget).find('input');\r\n\r\n if($(item).is(':checked')) {\r\n $(item).prop('checked', false);\r\n parent.removeClass('warning').delay(200);\r\n } else {\r\n $(item).prop('checked', true);\r\n parent.addClass('warning').delay(200);\r\n }\r\n }\r\n\r\n highlightAll(event) {\r\n let parent;\r\n const item = $(event.currentTarget).find('input');\r\n\r\n if($(item).is(':checked')) {\r\n $('#file_listing input[type=checkbox]').prop('checked', false);\r\n $('#file_listing input[data-action=\"addSelection\"]').each(function() {\r\n parent = $(this).closest('tr');\r\n parent.removeClass('warning').delay(200);\r\n });\r\n } else {\r\n $('#file_listing input[type=checkbox]').prop('checked', true);\r\n $('#file_listing input[data-action=\"addSelection\"]').each(function() {\r\n parent = $(this).closest('tr');\r\n parent.addClass('warning').delay(200);\r\n });\r\n }\r\n }\r\n\r\n deleteSelected() {\r\n let selectedItems = [];\r\n let selectedItemsElements = [];\r\n let parent;\r\n let nameBlock;\r\n let delLocation;\r\n\r\n $('#file_listing input[data-action=\"addSelection\"]:checked').each(function() {\r\n parent = $(this).closest('tr');\r\n nameBlock = $(parent).find('td[data-identifier=\"name\"]');\r\n delLocation = decodeURIComponent(nameBlock.data('path')) + decodeURIComponent(nameBlock.data('name'));\r\n\r\n selectedItems.push(delLocation);\r\n selectedItemsElements.push(parent);\r\n });\r\n\r\n if (selectedItems.length != 0)\r\n {\r\n let formattedItems = \"\";\r\n let i = 0;\r\n let self = this;\r\n\r\n $.each(selectedItems, function(key, value) {\r\n formattedItems += (\"<code>\" + self.sanitizedString(value) + \"</code>, \");\r\n i++;\r\n return i < 5;\r\n });\r\n\r\n formattedItems = formattedItems.slice(0, -2);\r\n if (selectedItems.length > 5) {\r\n formattedItems += ', and ' + (selectedItems.length - 5) + ' other(s)';\r\n }\r\n\r\n swal({\r\n type: 'warning',\r\n title: '',\r\n text: 'Are you sure you want to delete the following files: ' + formattedItems + '?',\r\n html: true,\r\n showCancelButton: true,\r\n showConfirmButton: true,\r\n closeOnConfirm: false,\r\n showLoaderOnConfirm: true\r\n }, () => {\r\n $.ajax({\r\n type: 'POST',\r\n headers: {\r\n 'X-Access-Token': Pterodactyl.server.daemonSecret,\r\n 'X-Access-Server': Pterodactyl.server.uuid,\r\n },\r\n contentType: 'application/json; charset=utf-8',\r\n url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/delete`,\r\n timeout: 10000,\r\n data: JSON.stringify({\r\n items: selectedItems\r\n }),\r\n }).done(data => {\r\n $('#file_listing input:checked').each(function() {\r\n $(this).prop('checked', false);\r\n });\r\n\r\n $.each(selectedItemsElements, function() {\r\n $(this).addClass('warning').delay(200).fadeOut();\r\n })\r\n\r\n swal({\r\n type: 'success',\r\n title: 'Files Deleted'\r\n });\r\n }).fail(jqXHR => {\r\n console.error(jqXHR);\r\n swal({\r\n type: 'error',\r\n title: 'Whoops!',\r\n html: true,\r\n text: 'An error occurred while attempting to delete these files. Please try again.',\r\n });\r\n });\r\n });\r\n } else {\r\n swal({\r\n type: 'warning',\r\n title: '',\r\n text: 'Please select files/folders to delete.',\r\n });\r\n }\r\n }\r\n\r\n decompress() {\r\n const nameBlock = $(this.element).find('td[data-identifier=\"name\"]');\r\n const compPath = decodeURIComponent(nameBlock.data('path'));\r\n const compName = decodeURIComponent(nameBlock.data('name'));\r\n\r\n swal({\r\n title: '<i class=\"fa fa-refresh fa-spin\"></i> Decompressing...',\r\n text: 'This might take a few seconds to complete.',\r\n html: true,\r\n allowOutsideClick: false,\r\n allowEscapeKey: false,\r\n showConfirmButton: false,\r\n });\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/decompress`,\r\n headers: {\r\n 'X-Access-Token': Pterodactyl.server.daemonSecret,\r\n 'X-Access-Server': Pterodactyl.server.uuid,\r\n },\r\n contentType: 'application/json; charset=utf-8',\r\n data: JSON.stringify({\r\n files: `${compPath}${compName}`\r\n })\r\n }).done(data => {\r\n swal.close();\r\n Files.list(compPath);\r\n }).fail(jqXHR => {\r\n console.error(jqXHR);\r\n var error = 'An error occurred while trying to process this request.';\r\n if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {\r\n error = jqXHR.responseJSON.error;\r\n }\r\n swal({\r\n type: 'error',\r\n title: 'Whoops!',\r\n html: true,\r\n text: error\r\n });\r\n });\r\n }\r\n\r\n compress() {\r\n const nameBlock = $(this.element).find('td[data-identifier=\"name\"]');\r\n const compPath = decodeURIComponent(nameBlock.data('path'));\r\n const compName = decodeURIComponent(nameBlock.data('name'));\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: `${Pterodactyl.node.scheme}://${Pterodactyl.node.fqdn}:${Pterodactyl.node.daemonListen}/v1/server/file/compress`,\r\n headers: {\r\n 'X-Access-Token': Pterodactyl.server.daemonSecret,\r\n 'X-Access-Server': Pterodactyl.server.uuid,\r\n },\r\n contentType: 'application/json; charset=utf-8',\r\n data: JSON.stringify({\r\n files: `${compPath}${compName}`,\r\n to: compPath.toString()\r\n })\r\n }).done(data => {\r\n Files.list(compPath, err => {\r\n if (err) return;\r\n const fileListing = $('#file_listing').find(`[data-name=\"${data.saved_as}\"]`).parent();\r\n fileListing.addClass('success pulsate').delay(3000).queue(() => {\r\n fileListing.removeClass('success pulsate').dequeue();\r\n });\r\n });\r\n }).fail(jqXHR => {\r\n console.error(jqXHR);\r\n var error = 'An error occurred while trying to process this request.';\r\n if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {\r\n error = jqXHR.responseJSON.error;\r\n }\r\n swal({\r\n type: 'error',\r\n title: 'Whoops!',\r\n html: true,\r\n text: this.sanitizedString(error)\r\n });\r\n });\r\n }\r\n}\r\n","\"use strict\";\r\n\r\n// Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>\r\n//\r\n// Permission is hereby granted, free of charge, to any person obtaining a copy\r\n// of this software and associated documentation files (the \"Software\"), to deal\r\n// in the Software without restriction, including without limitation the rights\r\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n// copies of the Software, and to permit persons to whom the Software is\r\n// furnished to do so, subject to the following conditions:\r\n//\r\n// The above copyright notice and this permission notice shall be included in all\r\n// copies or substantial portions of the Software.\r\n//\r\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n// SOFTWARE.\r\nclass ContextMenuClass {\r\n constructor() {\r\n this.activeLine = null;\r\n }\r\n\r\n run() {\r\n this.directoryClick();\r\n this.rightClick();\r\n }\r\n\r\n makeMenu(parent) {\r\n $(document).find('#fileOptionMenu').remove();\r\n if (!_.isNull(this.activeLine)) this.activeLine.removeClass('active');\r\n\r\n let newFilePath = $('#file_listing').data('current-dir');\r\n if (parent.data('type') === 'folder') {\r\n const nameBlock = parent.find('td[data-identifier=\"name\"]');\r\n const currentName = decodeURIComponent(nameBlock.attr('data-name'));\r\n const currentPath = decodeURIComponent(nameBlock.data('path'));\r\n newFilePath = `${currentPath}${currentName}`;\r\n }\r\n\r\n let buildMenu = '<ul id=\"fileOptionMenu\" class=\"dropdown-menu\" role=\"menu\" style=\"display:none\" >';\r\n\r\n if (Pterodactyl.permissions.moveFiles) {\r\n buildMenu += '<li data-action=\"rename\"><a tabindex=\"-1\" href=\"#\"><i class=\"fa fa-fw fa-pencil-square-o\"></i> Rename</a></li> \\\r\n <li data-action=\"move\"><a tabindex=\"-1\" href=\"#\"><i class=\"fa fa-fw fa-arrow-right\"></i> Move</a></li>';\r\n }\r\n\r\n if (Pterodactyl.permissions.copyFiles) {\r\n buildMenu += '<li data-action=\"copy\"><a tabindex=\"-1\" href=\"#\"><i class=\"fa fa-fw fa-clone\"></i> Copy</a></li>';\r\n }\r\n\r\n if (Pterodactyl.permissions.compressFiles) {\r\n buildMenu += '<li data-action=\"compress\" class=\"hidden\"><a tabindex=\"-1\" href=\"#\"><i class=\"fa fa-fw fa-file-archive-o\"></i> Compress</a></li>';\r\n }\r\n\r\n if (Pterodactyl.permissions.decompressFiles) {\r\n buildMenu += '<li data-action=\"decompress\" class=\"hidden\"><a tabindex=\"-1\" href=\"#\"><i class=\"fa fa-fw fa-expand\"></i> Decompress</a></li>';\r\n }\r\n\r\n if (Pterodactyl.permissions.createFiles) {\r\n buildMenu += '<li class=\"divider\"></li> \\\r\n <li data-action=\"file\"><a href=\"/server/'+ Pterodactyl.server.uuidShort +'/files/add/?dir=' + $('<div>').text(newFilePath).html() + '\" class=\"text-muted\"><i class=\"fa fa-fw fa-plus\"></i> New File</a></li> \\\r\n <li data-action=\"folder\"><a tabindex=\"-1\" href=\"#\"><i class=\"fa fa-fw fa-folder\"></i> New Folder</a></li>';\r\n }\r\n\r\n if (Pterodactyl.permissions.downloadFiles || Pterodactyl.permissions.deleteFiles) {\r\n buildMenu += '<li class=\"divider\"></li>';\r\n }\r\n\r\n if (Pterodactyl.permissions.downloadFiles) {\r\n buildMenu += '<li data-action=\"download\" class=\"hidden\"><a tabindex=\"-1\" href=\"#\"><i class=\"fa fa-fw fa-download\"></i> Download</a></li>';\r\n }\r\n\r\n if (Pterodactyl.permissions.deleteFiles) {\r\n buildMenu += '<li data-action=\"delete\" class=\"bg-danger\"><a tabindex=\"-1\" href=\"#\"><i class=\"fa fa-fw fa-trash-o\"></i> Delete</a></li>';\r\n }\r\n\r\n buildMenu += '</ul>';\r\n return buildMenu;\r\n }\r\n\r\n rightClick() {\r\n $('[data-action=\"toggleMenu\"]').on('mousedown', event => {\r\n event.preventDefault();\r\n if ($(document).find('#fileOptionMenu').is(':visible')) {\r\n $('body').trigger('click');\r\n return;\r\n }\r\n this.showMenu(event);\r\n });\r\n $('#file_listing > tbody td').on('contextmenu', event => {\r\n this.showMenu(event);\r\n });\r\n }\r\n\r\n showMenu(event) {\r\n const parent = $(event.target).closest('tr');\r\n const menu = $(this.makeMenu(parent));\r\n\r\n if (parent.data('type') === 'disabled') return;\r\n event.preventDefault();\r\n\r\n $(menu).appendTo('body');\r\n $(menu).data('invokedOn', $(event.target)).show().css({\r\n position: 'absolute',\r\n left: event.pageX - 150,\r\n top: event.pageY,\r\n });\r\n\r\n this.activeLine = parent;\r\n this.activeLine.addClass('active');\r\n\r\n // Handle Events\r\n const Actions = new ActionsClass(parent, menu);\r\n if (Pterodactyl.permissions.moveFiles) {\r\n $(menu).find('li[data-action=\"move\"]').unbind().on('click', e => {\r\n e.preventDefault();\r\n Actions.move();\r\n });\r\n $(menu).find('li[data-action=\"rename\"]').unbind().on('click', e => {\r\n e.preventDefault();\r\n Actions.rename();\r\n });\r\n }\r\n\r\n if (Pterodactyl.permissions.copyFiles) {\r\n $(menu).find('li[data-action=\"copy\"]').unbind().on('click', e => {\r\n e.preventDefault();\r\n Actions.copy();\r\n });\r\n }\r\n\r\n if (Pterodactyl.permissions.compressFiles) {\r\n if (parent.data('type') === 'folder') {\r\n $(menu).find('li[data-action=\"compress\"]').removeClass('hidden');\r\n }\r\n $(menu).find('li[data-action=\"compress\"]').unbind().on('click', e => {\r\n e.preventDefault();\r\n Actions.compress();\r\n });\r\n }\r\n\r\n if (Pterodactyl.permissions.decompressFiles) {\r\n if (_.without(['application/zip', 'application/gzip', 'application/x-gzip'], parent.data('mime')).length < 3) {\r\n $(menu).find('li[data-action=\"decompress\"]').removeClass('hidden');\r\n }\r\n $(menu).find('li[data-action=\"decompress\"]').unbind().on('click', e => {\r\n e.preventDefault();\r\n Actions.decompress();\r\n });\r\n }\r\n\r\n if (Pterodactyl.permissions.createFiles) {\r\n $(menu).find('li[data-action=\"folder\"]').unbind().on('click', e => {\r\n e.preventDefault();\r\n Actions.folder();\r\n });\r\n }\r\n\r\n if (Pterodactyl.permissions.downloadFiles) {\r\n if (parent.data('type') === 'file') {\r\n $(menu).find('li[data-action=\"download\"]').removeClass('hidden');\r\n }\r\n $(menu).find('li[data-action=\"download\"]').unbind().on('click', e => {\r\n e.preventDefault();\r\n Actions.download();\r\n });\r\n }\r\n\r\n if (Pterodactyl.permissions.deleteFiles) {\r\n $(menu).find('li[data-action=\"delete\"]').unbind().on('click', e => {\r\n e.preventDefault();\r\n Actions.delete();\r\n });\r\n }\r\n\r\n $(window).unbind().on('click', event => {\r\n if($(event.target).is('.disable-menu-hide')) {\r\n event.preventDefault();\r\n return;\r\n }\r\n $(menu).unbind().remove();\r\n if(!_.isNull(this.activeLine)) this.activeLine.removeClass('active');\r\n });\r\n }\r\n\r\n directoryClick() {\r\n $('a[data-action=\"directory-view\"]').on('click', function (event) {\r\n event.preventDefault();\r\n\r\n const path = $(this).parent().data('path') || '';\r\n const name = $(this).parent().data('name') || '';\r\n\r\n window.location.hash = encodeURIComponent(path + name);\r\n Files.list();\r\n });\r\n }\r\n}\r\n\r\nwindow.ContextMenu = new ContextMenuClass;\r\n","\"use strict\";\r\n\r\n// Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>\r\n//\r\n// Permission is hereby granted, free of charge, to any person obtaining a copy\r\n// of this software and associated documentation files (the \"Software\"), to deal\r\n// in the Software without restriction, including without limitation the rights\r\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n// copies of the Software, and to permit persons to whom the Software is\r\n// furnished to do so, subject to the following conditions:\r\n//\r\n// The above copyright notice and this permission notice shall be included in all\r\n// copies or substantial portions of the Software.\r\n//\r\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n// SOFTWARE.\r\nclass FileManager {\r\n constructor() {\r\n this.list(this.decodeHash());\r\n }\r\n\r\n list(path, next) {\r\n if (_.isUndefined(path)) {\r\n path = this.decodeHash();\r\n }\r\n\r\n this.loader(true);\r\n $.ajax({\r\n type: 'POST',\r\n url: Pterodactyl.meta.directoryList,\r\n headers: {\r\n 'X-CSRF-Token': Pterodactyl.meta.csrftoken,\r\n },\r\n data: {\r\n directory: path,\r\n },\r\n }).done(data => {\r\n this.loader(false);\r\n $('#load_files').slideUp(10).html(data).slideDown(10, () => {\r\n ContextMenu.run();\r\n this.reloadFilesButton();\r\n this.addFolderButton();\r\n this.selectItem();\r\n this.selectAll();\r\n this.selectiveDeletion();\r\n this.selectRow();\r\n if (_.isFunction(next)) {\r\n return next();\r\n }\r\n });\r\n $('#internal_alert').slideUp();\r\n\r\n if (typeof Siofu === 'object') {\r\n Siofu.listenOnInput(document.getElementById(\"files_touch_target\"));\r\n }\r\n }).fail(jqXHR => {\r\n this.loader(false);\r\n if (_.isFunction(next)) {\r\n return next(new Error('Failed to load file listing.'));\r\n }\r\n\r\n if ((path !== '' && path !== '/') && jqXHR.status === 404) {\r\n return this.list('', next);\r\n }\r\n\r\n swal({\r\n type: 'error',\r\n title: 'File Error',\r\n text: jqXHR.responseJSON.errors[0].detail || 'An error occurred while attempting to process this request. Please try again.',\r\n });\r\n console.error(jqXHR);\r\n });\r\n }\r\n\r\n loader(show) {\r\n if (show){\r\n $('.file-overlay').fadeIn(100);\r\n } else {\r\n $('.file-overlay').fadeOut(100);\r\n }\r\n }\r\n\r\n reloadFilesButton() {\r\n $('i[data-action=\"reload-files\"]').unbind().on('click', () => {\r\n $('i[data-action=\"reload-files\"]').addClass('fa-spin');\r\n this.list();\r\n });\r\n }\r\n\r\n selectItem() {\r\n $('[data-action=\"addSelection\"]').on('click', event => {\r\n event.preventDefault();\r\n });\r\n }\r\n\r\n selectAll() {\r\n $('[data-action=\"selectAll\"]').on('click', event => {\r\n event.preventDefault();\r\n });\r\n }\r\n\r\n selectiveDeletion() {\r\n $('[data-action=\"selective-deletion\"]').on('mousedown', event => {\r\n new ActionsClass().deleteSelected();\r\n });\r\n }\r\n\r\n addFolderButton() {\r\n $('[data-action=\"add-folder\"]').unbind().on('click', () => {\r\n new ActionsClass().folder($('#file_listing').data('current-dir') || '/');\r\n });\r\n }\r\n\r\n selectRow() {\r\n $('#file_listing tr').on('mousedown', event => {\r\n if (event.which === 1) {\r\n if ($(event.target).is('th') || $(event.target).is('input[data-action=\"selectAll\"]')) {\r\n new ActionsClass().highlightAll(event);\r\n } else if ($(event.target).is('td') || $(event.target).is('input[data-action=\"addSelection\"]')) {\r\n new ActionsClass().toggleHighlight(event);\r\n }\r\n\r\n new ActionsClass().toggleMassActions();\r\n }\r\n });\r\n }\r\n\r\n decodeHash() {\r\n return decodeURIComponent(window.location.hash.substring(1));\r\n }\r\n\r\n}\r\n\r\nwindow.Files = new FileManager;\r\n"]} |