mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Seperate refresh statistics for each server
Fixing Broken Things
This commit is contained in:
parent
d016e0a59a
commit
cb1679806e
@ -148,6 +148,8 @@ class Server:
|
||||
self.name = serverName
|
||||
self.settings = server_data_obj
|
||||
|
||||
self.record_server_stats()
|
||||
|
||||
# build our server run command
|
||||
|
||||
if server_data_obj['auto_start']:
|
||||
@ -858,7 +860,7 @@ class Server:
|
||||
self.reload_server_settings()
|
||||
|
||||
# world data
|
||||
server_name = server['server_name']
|
||||
world_name = server['server_name']
|
||||
server_path = server['path']
|
||||
|
||||
# process stats
|
||||
@ -867,7 +869,7 @@ class Server:
|
||||
# TODO: search server properties file for possible override of 127.0.0.1
|
||||
internal_ip = server['server_ip']
|
||||
server_port = server['server_port']
|
||||
server = server.get('server_name', f"ID#{server_id}")
|
||||
server_name = server.get('server_name', f"ID#{server_id}")
|
||||
|
||||
logger.debug("Pinging server '{server}' on {internal_ip}:{server_port}")
|
||||
if servers_helper.get_server_type_by_id(server_id) == 'minecraft-bedrock':
|
||||
@ -1002,7 +1004,7 @@ class Server:
|
||||
server_port = server_dt['server_port']
|
||||
|
||||
|
||||
logger.debug(f"Pinging server '{server.name}' on {internal_ip}:{server_port}")
|
||||
logger.debug(f"Pinging server '{self.name}' on {internal_ip}:{server_port}")
|
||||
if servers_helper.get_server_type_by_id(server_id) == 'minecraft-bedrock':
|
||||
int_mc_ping = ping_bedrock(internal_ip, int(server_port))
|
||||
else:
|
||||
|
@ -16,6 +16,10 @@ class StatusHandler(BaseHandler):
|
||||
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)
|
||||
srv['raw_ping_result']
|
||||
{
|
||||
'icon': False,
|
||||
}
|
||||
|
||||
template = 'public/status.html'
|
||||
|
||||
@ -31,6 +35,9 @@ class StatusHandler(BaseHandler):
|
||||
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)
|
||||
{
|
||||
'icon': False,
|
||||
}
|
||||
|
||||
template = 'public/status.html'
|
||||
|
||||
|
@ -155,9 +155,7 @@
|
||||
data['lang']) }}</i></a>
|
||||
{% elif server['stats']['waiting_start']%}
|
||||
<!-- WHAT HAPPENED HERE -->
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="" title={{
|
||||
translate('dashboard', 'delay-explained' , data['lang'])}}>{{ translate('dashboard', 'starting',
|
||||
data['lang']) }}</i></a>
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="" title={{ translate('dashboard', 'delay-explained' , data['lang'])}}>{{ translate('dashboard', 'starting', data['lang']) }}</i></a>
|
||||
{% else %}
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="play_button"
|
||||
data-toggle="tooltip" title="{{ translate('dashboard', 'start' , data['lang']) }}">
|
||||
@ -438,10 +436,7 @@
|
||||
}
|
||||
|
||||
function update_servers_status(data) {
|
||||
console.log(data);
|
||||
for (server of data) {
|
||||
update_one_server_status(server);
|
||||
}
|
||||
update_one_server_status(data[0]);
|
||||
display_motd();
|
||||
}
|
||||
|
||||
|
@ -143,9 +143,9 @@
|
||||
}
|
||||
|
||||
function update_servers_status(data) {
|
||||
//for (server of data) {
|
||||
console.log(data);
|
||||
update_one_server_status(data[0]);
|
||||
//}
|
||||
display_motd();
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
Loading…
Reference in New Issue
Block a user