diff --git a/app/classes/shared/helpers.py b/app/classes/shared/helpers.py index 167576ce..e99a73c3 100644 --- a/app/classes/shared/helpers.py +++ b/app/classes/shared/helpers.py @@ -440,9 +440,7 @@ class Helpers: full_root_path = temp_dir for item in os.listdir(full_root_path): - print(item) if os.path.isdir(os.path.join(full_root_path, item)): - print("dir") try: FileHelpers.move_dir( os.path.join(full_root_path, item), @@ -459,7 +457,7 @@ class Helpers: except Exception as ex: logger.error(f"ERROR IN ZIP IMPORT: {ex}") except Exception as ex: - print(ex) + Console.error(ex) else: return "false" return diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index bbd2178c..8ac55bb1 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -1115,6 +1115,7 @@ class ServerInstance: + ". Check log file for details.", ) logger.error("Executable download failed.") + self.stats_helper.set_update(False) # ********************************************************************************** # Minecraft Servers Statistics diff --git a/app/classes/web/file_handler.py b/app/classes/web/file_handler.py index bac3b02c..d82c21a1 100644 --- a/app/classes/web/file_handler.py +++ b/app/classes/web/file_handler.py @@ -223,6 +223,8 @@ class FileHandler(BaseHandler): self.redirect("/panel/error?error=Unauthorized access to Files") return path = Helpers.get_os_understandable_path(self.get_argument("path", None)) + if Helpers.is_os_windows(): + path = Helpers.wtol_path(path) Helpers.unzip_file(path) self.redirect(f"/panel/server_detail?id={server_id}&subpage=files") return diff --git a/app/frontend/templates/panel/dashboard.html b/app/frontend/templates/panel/dashboard.html index dacf2fdc..afc886b2 100644 --- a/app/frontend/templates/panel/dashboard.html +++ b/app/frontend/templates/panel/dashboard.html @@ -601,17 +601,19 @@ server_players.setAttribute('data-players', server.online); server_players.setAttribute('data-max', server.max); - let servers = document.getElementsByClassName("server-player-totals"); + let servers = Array.from(document.getElementsByClassName("server-player-totals")); let all_total_players = 0; let all_total_max_players = 0; - for (let i = 0; i < servers.length; i++) { + + servers.forEach(server => { try { - all_total_players += parseInt(servers[i].getAttribute('data-players')); - all_total_max_players += parseInt(servers[i].getAttribute('data-max')); + all_total_players += parseInt(server.getAttribute('data-players')); + all_total_max_players += parseInt(server.getAttribute('data-max')); } catch { console.log("Player totals are not of type int"); } - } + }) + total_players.innerHTML = all_total_players; document.getElementById('max_players').innerHTML = all_total_max_players; document.getElementById('sync').innerHTML = ''; diff --git a/app/frontend/templates/panel/server_files.html b/app/frontend/templates/panel/server_files.html index 27fb29b3..66ed9c86 100644 --- a/app/frontend/templates/panel/server_files.html +++ b/app/frontend/templates/panel/server_files.html @@ -450,9 +450,7 @@ var ctxmenuName = e.target.getAttribute('data-name'); document.getElementById('context-title').innerHTML = ctxmenuName; - console.log(ctxmenuName); if (!ctxmenuPath) { - console.log({ 'event.target': e.target, ctxmenuPath }); return; } $('#renameItem').show(); @@ -466,7 +464,6 @@ var isFile = e.target.classList.contains('tree-file'); $('#deleteFile').toggle(isFile); $('#downloadFile').toggle(isFile); - console.log({ 'event.target': e.target, isDir, isFile }); if (e.target.classList.contains('root-dir')) { $('#createFile').show(); @@ -479,7 +476,6 @@ } if (e.target.textContent.endsWith('.zip')) { $('#unzip').show(); - console.log(e.target.textContent) } else { $('#unzip').hide(); } @@ -502,7 +498,6 @@ } document.getElementById("files-tree-nav").style.top = clientY + 'px'; document.getElementById("files-tree-nav").style.left = clientX + 'px'; - console.log(window.innerHeight) timer = null; }; } @@ -585,7 +580,6 @@ console.log("got response:"); document.getElementById("save_status").innerHTML = ''; document.getElementById('save_status').style.color = '#2fb689'; - console.log(data); }, }); } @@ -602,7 +596,6 @@ }, success: function (data) { console.log("got response:"); - console.log(data); callback(); }, }); @@ -620,7 +613,6 @@ }, success: function (data) { console.log("got response:"); - console.log(data); callback(); }, }); @@ -638,7 +630,6 @@ }, success: function (data) { console.log("got response:"); - console.log(data); callback(); }, }); @@ -656,7 +647,6 @@ }, success: function (data) { console.log("got response:"); - console.log(data); callback(); }, }); @@ -673,13 +663,13 @@ }, success: function (data) { console.log("got response:"); - console.log(data); callback(); }, }); } function unZip(path, callback) { + console.log('path: ', path) var token = getCookie("_xsrf") $.ajax({ type: "POST", @@ -731,7 +721,6 @@ function uploadFilesE(event) { path = event.target.parentElement.getAttribute('data-path'); - console.log("PATH: " + path); $(function () { var uploadHtml = "
" + '
' + "
- +
@@ -367,7 +367,7 @@ function hide(event) { }catch{ document.getElementById('files-tree').innerHTML = text; } - + document.getElementsByClassName('files-tree-title')[0].setAttribute('data-path', serverDir); document.getElementsByClassName('files-tree-title')[0].setAttribute('data-name', 'Files'); @@ -382,7 +382,7 @@ function hide(event) { document.getElementById(path+"span").classList.toggle("tree-caret-down"); document.getElementById(path+"span").classList.toggle("tree-caret"); } - + function getDirView(event) { path = event.target.parentElement.getAttribute('data-path'); @@ -417,7 +417,7 @@ function hide(event) { } var toggler = document.getElementById(path); - + if (toggler.classList.contains('files-tree-title')){ document.getElementById(path+"span").addEventListener("click", function caretListener() { document.getElementById(path+"ul").classList.toggle("d-block"); @@ -442,27 +442,10 @@ function hide(event) { document.getElementById('main-tree-input').setAttribute('value', data.path) getTreeView(data.path); show_file_tree(); - + }, 5000); }); } - -{% end %} \ No newline at end of file +{% end %} diff --git a/app/frontend/templates/server/wizard.html b/app/frontend/templates/server/wizard.html index 113ba2f1..ee9669e2 100644 --- a/app/frontend/templates/server/wizard.html +++ b/app/frontend/templates/server/wizard.html @@ -522,13 +522,16 @@ event.target.parentElement.children[1].classList.remove("d-none"); document.getElementById("overlay").classList.remove("d-none"); } + function hide(event) { var items = document.getElementsByClassName('menu'); - for (let i = 0; i < items.length; i++) { - items[i].classList.add("d-none"); - } + items.forEach(item => { + item.classList.add("d-none"); + }) + document.getElementById("overlay").classList.add("d-none"); } + $(document).ready(function () { console.log('ready'); var forms = $('form.server-wizard'); @@ -672,24 +675,8 @@ - {% end %} \ No newline at end of file + {% end %}