Add sync symbol to status page

This commit is contained in:
amcmanu3 2022-03-07 19:57:52 -05:00
parent ff3da27333
commit f2cc0e89fb
2 changed files with 9 additions and 1 deletions

View File

@ -10,13 +10,18 @@ class StatusHandler(BaseHandler):
page_data = {}
page_data['lang'] = helper.get_setting('language')
page_data['servers'] = self.controller.servers.get_all_servers_stats()
running = 0
for srv in page_data['servers']:
if srv['stats']['running']:
running += 1
server_data = srv.get('server_data', False)
server_id = server_data.get('server_id', False)
srv['raw_ping_result'] = self.controller.servers.get_server_stats_by_id(server_id)
if 'icon' not in srv['raw_ping_result']:
srv['raw_ping_result']['icon'] = False
page_data['running'] = running
template = 'public/status.html'
self.render(

View File

@ -21,6 +21,9 @@
</tr>
</thead>
<tbody>
{% if data['running'] != 0 %}
<span id="sync" style="margin-left: 5px;"><i class="fas fa-sync fa-spin"></i></span></h4>
{% end %}
{% for server in data['servers'] %}
<tr>
<td id="server_name_{{ server['stats']['server_id']['server_id'] }}">
@ -94,7 +97,7 @@
/* TODO Update each element */
if (server.int_ping_results) {
document.getElementById('sync').innerHTML='';
/* Update Players */
if (server.players)
{