Add user feedback for wrong unzip path

This commit is contained in:
Andrew 2022-03-01 13:27:41 -05:00
parent 22d519b4df
commit 11bf44b35e
2 changed files with 15 additions and 2 deletions

View File

@ -5,9 +5,12 @@ import logging
import tornado.web
import tornado.escape
import bleach
import time
from app.classes.shared.console import console
from app.classes.shared.helpers import helper
from app.classes.web.websocket_helper import websocket_helper
from app.classes.shared.translation import translation
from app.classes.shared.server import ServerOutBuf
from app.classes.web.base_handler import BaseHandler
@ -331,7 +334,16 @@ class AjaxHandler(BaseHandler):
elif page == "unzip_server":
path = self.get_argument('path', None)
helper.unzipServer(path, exec_user['user_id'])
if helper.check_file_exists(path):
helper.unzipServer(path, exec_user['user_id'])
else:
user_id = exec_user['user_id']
if user_id:
time.sleep(5)
user_lang = self.controller.users.get_user_lang_by_id(user_id)
websocket_helper.broadcast_user(user_id, 'send_start_error',{
'error': translation.translate('error', 'no-file', user_lang)
})
return
elif page == "backup_select":

View File

@ -18,7 +18,8 @@
"eulaMsg": "You must agree to the EULA. A copy of the Mojang EULA is linked under this message.",
"eulaAgree": "Do you agree?",
"noJava": "Server {} failed to start with error code: We have detected Java is not installed. Please install java then start the server.",
"not-downloaded": "We can't seem to find your executable file. Has it finished downloading? Are the permissions set to executable?"
"not-downloaded": "We can't seem to find your executable file. Has it finished downloading? Are the permissions set to executable?",
"no-file": "We can't seem to locate the requested file. Double check the path. Does Crafty have proper permissions?"
},
"404": {
"contact": "Contact Crafty Control Support via Discord",