mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
fixed server id not being correct for stop/restart on dashboard
This commit is contained in:
parent
f0618b073b
commit
c7e28e5b77
@ -8,6 +8,7 @@ from app.classes.minecraft.controller import controller
|
|||||||
from app.classes.shared.models import db_helper, Servers
|
from app.classes.shared.models import db_helper, Servers
|
||||||
from app.classes.minecraft.serverjars import server_jar_obj
|
from app.classes.minecraft.serverjars import server_jar_obj
|
||||||
from app.classes.minecraft.stats import stats
|
from app.classes.minecraft.stats import stats
|
||||||
|
from app.classes.shared.helpers import helper
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -44,6 +45,7 @@ class ServerHandler(BaseHandler):
|
|||||||
},
|
},
|
||||||
'hosts_data': db_helper.get_latest_hosts_stats(),
|
'hosts_data': db_helper.get_latest_hosts_stats(),
|
||||||
'menu_servers': defined_servers,
|
'menu_servers': defined_servers,
|
||||||
|
'show_contribute': helper.get_setting("show_contribute_link", True)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,6 +68,7 @@ class ServerHandler(BaseHandler):
|
|||||||
page_data = {
|
page_data = {
|
||||||
'version_data': "version_data_here",
|
'version_data': "version_data_here",
|
||||||
'user_data': user_data,
|
'user_data': user_data,
|
||||||
|
'show_contribute': helper.get_setting("show_contribute_link", True)
|
||||||
}
|
}
|
||||||
|
|
||||||
if page == "command":
|
if page == "command":
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
},
|
},
|
||||||
"tornado_access": {
|
"tornado_access": {
|
||||||
"format": "%(asctime)s - [Tornado] - [Access] - %(levelname)s - %(message)s"
|
"format": "%(asctime)s - [Tornado] - [Access] - %(levelname)s - %(message)s"
|
||||||
|
},
|
||||||
|
"schedule": {
|
||||||
|
"format": "%(asctime)s - [Schedules] - %(levelname)s - %(message)s"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -39,6 +42,14 @@
|
|||||||
"maxBytes": 10485760,
|
"maxBytes": 10485760,
|
||||||
"backupCount": 20,
|
"backupCount": 20,
|
||||||
"encoding": "utf8"
|
"encoding": "utf8"
|
||||||
|
},
|
||||||
|
"schedule_file_handler": {
|
||||||
|
"class": "logging.handlers.RotatingFileHandler",
|
||||||
|
"formatter": "schedule",
|
||||||
|
"filename": "logs/schedule.log",
|
||||||
|
"maxBytes": 10485760,
|
||||||
|
"backupCount": 20,
|
||||||
|
"encoding": "utf8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -52,6 +63,11 @@
|
|||||||
"level": "INFO",
|
"level": "INFO",
|
||||||
"handlers": ["tornado_access_file_handler"],
|
"handlers": ["tornado_access_file_handler"],
|
||||||
"propagate": false
|
"propagate": false
|
||||||
|
},
|
||||||
|
"schedule": {
|
||||||
|
"level": "INFO",
|
||||||
|
"handlers": ["schedule_file_handler"],
|
||||||
|
"propagate": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"last_refreshed": "08/28/2020, 13:57:47",
|
"last_refreshed": "08/31/2020, 11:13:52",
|
||||||
"servers": {
|
"servers": {
|
||||||
"nukkitx": [
|
"nukkitx": [
|
||||||
"1.14"
|
"1.14"
|
||||||
|
@ -127,8 +127,8 @@
|
|||||||
<td>
|
<td>
|
||||||
|
|
||||||
{% if server['stats'][0]['running'] %}
|
{% if server['stats'][0]['running'] %}
|
||||||
<a class="stop_button" data-id="{{server['server_data']}}"> <i class="fas fa-stop"></i></a>
|
<a class="stop_button" data-id="{{server['server_data']['server_id']}}"> <i class="fas fa-stop"></i></a>
|
||||||
<a class="restart_button" data-id="{{server['server_data']}}"> <i class="fas fa-sync"></i></a>
|
<a class="restart_button" data-id="{{server['server_data']['server_id']}}"> <i class="fas fa-sync"></i></a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a data-id="{{server['server_data']['server_id']}}" class="play_button"><i class="fas fa-play"></i></a>
|
<a data-id="{{server['server_data']['server_id']}}" class="play_button"><i class="fas fa-play"></i></a>
|
||||||
{% end %}
|
{% end %}
|
||||||
|
@ -9,5 +9,5 @@
|
|||||||
"history_max_age": 7,
|
"history_max_age": 7,
|
||||||
"stats_update_frequency": 5,
|
"stats_update_frequency": 5,
|
||||||
"delete_default_json": false,
|
"delete_default_json": false,
|
||||||
"show_contribute_link": true
|
"show_contribute_link": false
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user