mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'lukas-development' into 'master'
Lukas Development See merge request crafty-controller/crafty-commander!7
This commit is contained in:
commit
bd91cc4138
@ -87,6 +87,10 @@ class Controller:
|
|||||||
s['auto_start_delay']
|
s['auto_start_delay']
|
||||||
))
|
))
|
||||||
|
|
||||||
|
def refresh_server_settings(self, server_id: int):
|
||||||
|
server_obj = self.get_server_obj(server_id)
|
||||||
|
server_obj.reload_server_settings()
|
||||||
|
|
||||||
def get_server_obj(self, server_id):
|
def get_server_obj(self, server_id):
|
||||||
|
|
||||||
for s in self.servers_list:
|
for s in self.servers_list:
|
||||||
|
@ -13,7 +13,7 @@ import logging.config
|
|||||||
|
|
||||||
from app.classes.shared.helpers import helper
|
from app.classes.shared.helpers import helper
|
||||||
from app.classes.shared.console import console
|
from app.classes.shared.console import console
|
||||||
|
from app.classes.shared.models import db_helper, Servers
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -45,6 +45,10 @@ class Server:
|
|||||||
self.is_crashed = False
|
self.is_crashed = False
|
||||||
self.restart_count = 0
|
self.restart_count = 0
|
||||||
|
|
||||||
|
def reload_server_settings(self):
|
||||||
|
server_data = db_helper.get_server_data_by_id(self.server_id)
|
||||||
|
self.settings = server_data
|
||||||
|
|
||||||
def do_server_setup(self, server_data_obj):
|
def do_server_setup(self, server_data_obj):
|
||||||
logger.info('Creating Server object: {} | Server Name: {} | Auto Start: {}'.format(
|
logger.info('Creating Server object: {} | Server Name: {} | Auto Start: {}'.format(
|
||||||
server_data_obj['server_id'],
|
server_data_obj['server_id'],
|
||||||
|
@ -161,6 +161,8 @@ class PanelHandler(BaseHandler):
|
|||||||
Servers.crash_detection: crash_detection,
|
Servers.crash_detection: crash_detection,
|
||||||
}).where(Servers.server_id == server_id).execute()
|
}).where(Servers.server_id == server_id).execute()
|
||||||
|
|
||||||
|
controller.refresh_server_settings(server_id)
|
||||||
|
|
||||||
user_data = json.loads(self.get_secure_cookie("user_data"))
|
user_data = json.loads(self.get_secure_cookie("user_data"))
|
||||||
|
|
||||||
db_helper.add_to_audit_log(user_data['user_id'],
|
db_helper.add_to_audit_log(user_data['user_id'],
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"last_refreshed": "09/21/2020, 21:59:31",
|
"last_refreshed": "10/07/2020, 09:09:10",
|
||||||
"servers": {
|
"servers": {
|
||||||
"nukkitx": [
|
"nukkitx": [
|
||||||
"1.14"
|
"1.14"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"major": 4,
|
"major": 4,
|
||||||
"minor": 0,
|
"minor": 0,
|
||||||
"sub": "Alpha 1"
|
"sub": "Alpha 2"
|
||||||
}
|
}
|
@ -62,4 +62,21 @@
|
|||||||
}
|
}
|
||||||
.term-nav-item {
|
.term-nav-item {
|
||||||
padding: 1%;
|
padding: 1%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fix body scrollbar color */
|
||||||
|
body { background-color: var(--dark) !important; /* Firefox */ }
|
||||||
|
|
||||||
|
/* Webkit */
|
||||||
|
/* Didn't really work out
|
||||||
|
::-webkit-scrollbar { background-color: #202538; }
|
||||||
|
::-webkit-scrollbar-button { background-color: #1D212F; }
|
||||||
|
::-webkit-scrollbar-thumb { background-color: #777A86; }
|
||||||
|
::-webkit-scrollbar-thumb:hover { background-color: #646773; }
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track { background-color: #202538; }
|
||||||
|
::-webkit-scrollbar-corner { background-color: #202538; }*/
|
||||||
|
|
||||||
|
.actions_serverlist > a > i {
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
@ -4,7 +4,7 @@
|
|||||||
<!-- <meta http-equiv="refresh" content="60">-->
|
<!-- <meta http-equiv="refresh" content="60">-->
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
{% block title %}Crafty Controller - Blank Page{% end %}
|
{% block title %}Crafty Controller - Contribute{% end %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@
|
|||||||
|
|
||||||
<div class="wrapper d-flex align-items-start pt-3">
|
<div class="wrapper d-flex align-items-start pt-3">
|
||||||
Hi, my name is Tim, and I'm a huge fan of linux.
|
Hi, my name is Tim, and I'm a huge fan of linux.
|
||||||
I'm often gaming and occasionally coding some java
|
I'm often gaming and occasionally coding.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -124,7 +124,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td class="actions_serverlist">
|
||||||
|
|
||||||
{% if server['stats'][0]['running'] %}
|
{% if server['stats'][0]['running'] %}
|
||||||
<a class="stop_button" data-id="{{server['server_data']['server_id']}}"> <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>
|
||||||
@ -136,7 +136,7 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<div class="progress" data-toggle="tooltip" data-placement="top" title="{{server['stats'][0]['cpu']}}">
|
<div class="progress mb-1" data-toggle="tooltip" data-placement="top" title="{{server['stats'][0]['cpu']}}">
|
||||||
<div class="progress-bar
|
<div class="progress-bar
|
||||||
{% if server['stats'][0]['cpu'] <= 33 %}
|
{% if server['stats'][0]['cpu'] <= 33 %}
|
||||||
bg-success
|
bg-success
|
||||||
@ -151,7 +151,7 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<div class="progress" data-toggle="tooltip" data-placement="top" title="{{server['stats'][0]['mem']}}">
|
<div class="progress mb-1" data-toggle="tooltip" data-placement="top" title="{{server['stats'][0]['mem']}}">
|
||||||
<div class="progress-bar
|
<div class="progress-bar
|
||||||
{% if server['stats'][0]['mem_percent'] <= 33 %}
|
{% if server['stats'][0]['mem_percent'] <= 33 %}
|
||||||
bg-success
|
bg-success
|
||||||
|
Loading…
Reference in New Issue
Block a user