Improve error notifications.

Fix remove server jar logo on error
This commit is contained in:
amcmanu3 2023-05-17 12:51:45 -04:00
parent 9d62477b0b
commit 03db0c5850
4 changed files with 59 additions and 14 deletions

View File

@ -166,7 +166,9 @@ class ServerHandler(BaseHandler):
"not a server creator or server limit reached" "not a server creator or server limit reached"
) )
return return
page_data["server_api"] = self.helper.check_address_status(
"https://minecraft.net/en-us/download/server/bedrock/"
)
template = "server/bedrock_wizard.html" template = "server/bedrock_wizard.html"
self.render( self.render(

View File

@ -17,7 +17,6 @@
</ul> </ul>
<div class="d-none" id="overlay" onclick="hide(event)"></div> <div class="d-none" id="overlay" onclick="hide(event)"></div>
<div class="row"> <div class="row">
{% if data['online'] %}
<div class="col-sm-6 grid-margin stretch-card"> <div class="col-sm-6 grid-margin stretch-card">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
@ -27,6 +26,35 @@
<p class="card-description"> <p class="card-description">
<form method="post" name="create_server" class="server-wizard" onSubmit="wait_msg()"> <form method="post" name="create_server" class="server-wizard" onSubmit="wait_msg()">
{% if data["server_api"] and data["online"] %}
<fieldset>
{% else %}
<fieldset disabled="disabled">
<style>
.api-alert{
position:absolute;
top:-5px;
left:0;
font-size: 50px !important;
color:#fff;
background:rgb(127, 133, 133);
opacity:.4;
width:100%;
height:100%;
z-index: 100;
}
.api-alert p {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
text-align: center;
font-size: 20px;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
</style>
{% end %}
{% raw xsrf_form_html() %} {% raw xsrf_form_html() %}
<div class="row"> <div class="row">
@ -72,12 +100,22 @@
data['lang']) }}</button> data['lang']) }}</button>
<button type="reset" class="btn btn-danger mr-2">{{ translate('serverWizard', 'resetForm', data['lang']) <button type="reset" class="btn btn-danger mr-2">{{ translate('serverWizard', 'resetForm', data['lang'])
}}</button> }}</button>
</fieldset>
{% if not data["server_api"] and data["online"] %}
<div class="api-alert" style="position: absolute; top: -5px; z-index: 100; opacity: .99;">
<p style="color: white !important;"><i class="fas fa-exclamation-triangle" style="color: red;"></i>&nbsp;{{ translate('error', 'bedrockError', data['lang']) }}<a style="color: red;"; href="https://status.craftycontrol.com/status/craftycontrol"
target="_blank">&nbsp;{{ translate('error', 'craftyStatus', data['lang']) }}</a>
&nbsp;{{ translate('error', 'serverJars2', data['lang']) }}</p></div>
{% end %}
{% if not data["online"] %}
<div class="api-alert" style="position: absolute; top: -5px; z-index: 100; opacity: .99;">
<p style="color: white !important;"><i class="fas fa-exclamation-triangle" style="color: red;"></i>&nbsp;{{ translate('error', 'noInternet', data['lang']) }}</p></div>
{% end %}
</div> </div>
</form> </form>
</p> </p>
</div> </div>
</div> </div>
{% end %}
<div class="col-sm-6 grid-margin stretch-card"> <div class="col-sm-6 grid-margin stretch-card">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">

View File

@ -17,7 +17,6 @@
</ul> </ul>
<div class="d-none" id="overlay" onclick="hide(event)"></div> <div class="d-none" id="overlay" onclick="hide(event)"></div>
<div class="row"> <div class="row">
{% if data['online'] %}
<div class="col-sm-6 grid-margin stretch-card"> <div class="col-sm-6 grid-margin stretch-card">
<div class="card" id="creation_wizard"> <div class="card" id="creation_wizard">
<div class="card-body"> <div class="card-body">
@ -27,21 +26,18 @@
<p class="card-description"> <p class="card-description">
<form method="post" class="server-wizard" onSubmit="wait_msg()"> <form method="post" class="server-wizard" onSubmit="wait_msg()">
{% if data["server_api"] %} {% if data["server_api"] and data["online"] %}
<fieldset> <fieldset>
{% else %} {% else %}
<fieldset disabled="disabled"> <fieldset disabled="disabled">
<style> <style>
#creation_wizard {
-webkit-filter: grayscale(1);
}
.api-alert{ .api-alert{
position:absolute; position:absolute;
top:-5px; top:-5px;
left:0; left:0;
font-size: 50px !important; font-size: 50px !important;
color:#fff; color:#fff;
background:rgb(0,170,170); background: rgb(127, 133, 133);
opacity:.4; opacity:.4;
width:100%; width:100%;
height:100%; height:100%;
@ -73,9 +69,11 @@
onchange="serverJarChange(this)"> onchange="serverJarChange(this)">
{% end %} {% end %}
<option value="None">{{ translate('serverWizard', 'selectType', data['lang']) }}</option> <option value="None">{{ translate('serverWizard', 'selectType', data['lang']) }}</option>
{% if data["online"] %}
{% for s in data['server_types'] %} {% for s in data['server_types'] %}
<option value="{{ s }}">{{ s.capitalize() }}</option> <option value="{{ s }}">{{ s.capitalize() }}</option>
{% end %} {% end %}
{% end %}
</select> </select>
{% if data['super_user'] %} {% if data['super_user'] %}
&nbsp;&nbsp;<i onclick="refreshCache()" id="refresh-cache" class="refresh-class fas fa-sync"></i> &nbsp;&nbsp;<i onclick="refreshCache()" id="refresh-cache" class="refresh-class fas fa-sync"></i>
@ -178,17 +176,22 @@
<button type="reset" class="btn btn-danger mr-2">{{ translate('serverWizard', 'resetForm', data['lang']) <button type="reset" class="btn btn-danger mr-2">{{ translate('serverWizard', 'resetForm', data['lang'])
}}</button> }}</button>
</fieldset> </fieldset>
{% if not data["server_api"] %} {% if not data["server_api"] and data["online"] %}
<div class="api-alert" style="position: absolute; top: -5px; z-index: 100; opacity: .99;"> <div class="api-alert" style="position: absolute; top: -5px; z-index: 100; opacity: .99;">
<p style="color: white !important;"><i class="fas fa-exclamation-triangle" style="color: white;"></i>&nbsp;{{ translate('error', 'serverJars1', data['lang']) }}<a style="color: red;"; href="https://status.craftycontrol.com/status/craftycontrol" <p style="color: white !important;"><i class="fas fa-exclamation-triangle" style="color: red;"></i>&nbsp;{{ translate('error', 'serverJars1', data['lang']) }}<a style="color: red;"; href="https://status.craftycontrol.com/status/craftycontrol"
target="_blank">&nbsp;{{ translate('error', 'craftyStatus', data['lang']) }}</a> target="_blank">&nbsp;{{ translate('error', 'craftyStatus', data['lang']) }}</a>
&nbsp;{{ translate('error', 'serverJars2', data['lang']) }}</p></div> &nbsp;{{ translate('error', 'serverJars2', data['lang']) }}</p></div>
{% end %} {% end %}
{% if not data["online"] %}
<div class="api-alert" style="position: absolute; top: -5px; z-index: 100; opacity: .99;">
<p style="color: white !important;"><i class="fas fa-exclamation-triangle" style="color: red;"></i>&nbsp;{{ translate('error', 'noInternet', data['lang']) }}</p></div>
{% end %}
</div> </div>
{% if data["server_api"] and data["online"] %}
<a href="https://serverjars.com" target="_blank" style="text-align: center;"><img src="../../static/assets/images/powered-by-serverjars.svg" alt="Powered by serverjars.com" width="40%"></a> <a href="https://serverjars.com" target="_blank" style="text-align: center;"><img src="../../static/assets/images/powered-by-serverjars.svg" alt="Powered by serverjars.com" width="40%"></a>
{% end %}
</div> </div>
</form> </form>
{% end %}
</div> </div>
<div class="col-sm-6 grid-margin stretch-card"> <div class="col-sm-6 grid-margin stretch-card">

View File

@ -188,9 +188,11 @@
"fileError": "File type must be an image.", "fileError": "File type must be an image.",
"migration": "Crafty's main server storage is being mirgated to a new location. All server starts have been suspended during this time. Please wait while we finish this migration", "migration": "Crafty's main server storage is being mirgated to a new location. All server starts have been suspended during this time. Please wait while we finish this migration",
"serverJars1": "Server JARs API unreachable. Please check", "serverJars1": "Server JARs API unreachable. Please check",
"bedrockError": "Bedrock downloads unavailable. Please check",
"craftyStatus": "Crafty's status page", "craftyStatus": "Crafty's status page",
"serverJars2": "for the most up to date information.", "serverJars2": "for the most up to date information.",
"cronFormat": "Invalid Cron format detected" "cronFormat": "Invalid Cron format detected",
"noInternet": "Crafty is having trouble accessing the internet. Server Creation has been disabled. Please check your internet connection and refresh this page."
}, },
"footer": { "footer": {
"allRightsReserved": "All rights reserved", "allRightsReserved": "All rights reserved",
@ -623,4 +625,4 @@
"manager": "Manager", "manager": "Manager",
"selectManager": "Select Manager for User" "selectManager": "Select Manager for User"
} }
} }