Adds support for a friendlier splashscreen when no servers are created.

Users can go to an empty dashboard instead of a wall of text.
This commit is contained in:
Andrew 2021-09-25 15:07:39 -04:00
parent 28f46a6f01
commit 74f4bf748e
5 changed files with 19 additions and 14 deletions

View File

@ -71,16 +71,6 @@ class PanelHandler(BaseHandler):
}
page_data['super_user'] = exec_user['superuser']
# if no servers defined, let's go to the build server area
if page_data['server_stats']['total'] == 0 and page != "error" and page != "credits" and page != "contribute":
if Enum_Permissions_Crafty.Server_Creation not in exec_user_crafty_permissions and len(defined_servers) == 0:
logger.warning("User '" + exec_user['username'] + "#" + str(exec_user_id) + "' has access to 0 servers and is not a server creator")
else:
self.set_status(301)
self.redirect("/server/step1")
return
if page == 'unauthorized':
template = "panel/denied.html"

View File

@ -101,6 +101,15 @@
<div class="card-body">
<div class="table-responsive">
{% if len(data['servers']) == 0%}
<div style="text-align: center; color: grey;">
<h1>{{ translate('dashboard', 'welcome') }}</h1>
<br>
<h7>{{ translate('dashboard', 'no-servers') }} {{ translate('dashboard', 'newServer') }}.</h7>
</div>
{% end %}
{% if len(data['servers']) > 0 %}
<table class="table table-hover">
<thead>
<tr class="rounded">
@ -205,6 +214,7 @@
</tbody>
</table>
{% end %}
</div>
</div>
</div>
@ -212,7 +222,6 @@
</div>
</div>
<!-- content-wrapper ends -->

View File

@ -100,7 +100,9 @@
"restart": "Restart",
"killing": "Killing process...",
"starting": "Delayed-Start",
"delay-explained": "The service/agent has recently started and is delaying the start of the minecraft server instance"
"delay-explained": "The service/agent has recently started and is delaying the start of the minecraft server instance",
"no-servers": "There are currently no servers. To get started, click",
"welcome": "Welcome to Crafty Controller"
},
"accessDenied": {
"accessDenied": "Access Denied",

View File

@ -100,7 +100,9 @@
"restart": "Uudelleenkäynnistää",
"killing": "Tappamisprosessi ...",
"starting": "Myöhästynyt lähtö",
"delay-explained": "Palvelu/agentti on äskettäin aloittanut ja viivästyttää minecraft -palvelimen ilmentymän alkua"
"delay-explained": "Palvelu/agentti on äskettäin aloittanut ja viivästyttää minecraft -palvelimen ilmentymän alkua",
"no-servers": "Palvelimia ei tällä hetkellä ole. Aloita napsauttamalla",
"welcome": "Tervetuloa Crafty Controller"
},
"accessDenied": {
"accessDenied": "Käyttö estetty",

View File

@ -100,7 +100,9 @@
"restart": "Redémarrage",
"killing": "Processus de mise à mort...",
"starting": "Démarrage retardé",
"delay-explained": "Le service/agent a récemment démarré et retarde le démarrage de l'instance du serveur minecraft"
"delay-explained": "Le service/agent a récemment démarré et retarde le démarrage de l'instance du serveur minecraft",
"no-servers": "Il n'y a actuellement aucun serveur. Pour commencer, cliquez sur",
"welcome": "Bienvenue à Crafty Controller"
},
"accessDenied": {
"accessDenied": "Accès Interdit",