mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
First commit for unloaded server. Working Frontend
This commit is contained in:
parent
ad318296dc
commit
b039eec857
@ -146,6 +146,7 @@ class ServersController(metaclass=Singleton):
|
||||
def init_all_servers(self):
|
||||
|
||||
servers = self.get_all_defined_servers()
|
||||
self.failed_servers = []
|
||||
|
||||
for server in servers:
|
||||
server_id = server.get("server_id")
|
||||
@ -169,6 +170,7 @@ class ServersController(metaclass=Singleton):
|
||||
f"{server['server_name']} at path {server['path']}. "
|
||||
f"Skipping this server"
|
||||
)
|
||||
self.failed_servers.append(server)
|
||||
continue
|
||||
|
||||
temp_server_dict = {
|
||||
|
@ -287,6 +287,7 @@ class PanelHandler(BaseHandler):
|
||||
"update_available": self.helper.update_available,
|
||||
"serverTZ": tz,
|
||||
"version_data": self.helper.get_version_string(),
|
||||
"failed_servers": self.controller.servers.failed_servers,
|
||||
"user_data": exec_user,
|
||||
"user_role": exec_user_role,
|
||||
"user_crafty_permissions": exec_user_crafty_permissions,
|
||||
|
@ -125,7 +125,7 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
{% if len(data['servers']) == 0%}
|
||||
{% if len(data['servers']) == 0 and len(data['failed_servers']) == 0 %}
|
||||
<div style="text-align: center; color: grey;">
|
||||
<h1>{{ translate('dashboard', 'welcome', data['lang']) }}</h1>
|
||||
<br>
|
||||
@ -134,7 +134,7 @@
|
||||
</div>
|
||||
|
||||
{% end %}
|
||||
{% if len(data['servers']) > 0 %}
|
||||
{% if len(data['servers']) > 0 or len(data['failed_servers']) > 0 %}
|
||||
<!-- View for Large screen -->
|
||||
<div class="table-responsive d-none d-sm-block">
|
||||
<table id="servers_table" class="table table-hover">
|
||||
@ -290,6 +290,19 @@
|
||||
data-players="{{ server['stats']['online']}}" data-max="{{ server['stats']['max'] }}"></span>
|
||||
</tr>
|
||||
{% end %}
|
||||
{% for server in data['failed_servers'] %}
|
||||
<tr id="{{server['server_id']}}" draggable="false">
|
||||
<td class="text-warning"><i class="fas fa-server"></i> <a class="text-warning"
|
||||
href="/panel/server_detail?id={{server['server_id']}}&subpage=config">{{server['server_name']}}</a>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><i class="fas fa-cloud"></i> Unloaded</td>
|
||||
</tr>
|
||||
{% end %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user