mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'dev' into refactor/config-json
This commit is contained in:
commit
3c0330de38
@ -10,8 +10,11 @@ TBD
|
|||||||
- Be sure a user cannot server import crafty dir. ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/506))
|
- Be sure a user cannot server import crafty dir. ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/506))
|
||||||
- Remove Pathlib from sub path check ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/507))
|
- Remove Pathlib from sub path check ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/507))
|
||||||
- Fix root dir selection in Upload Zip Import ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/508))
|
- Fix root dir selection in Upload Zip Import ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/508))
|
||||||
|
- Fix stats error on mac M1 chips ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/512))
|
||||||
|
- Fix window path escape on java override ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/513))
|
||||||
### Tweaks
|
### Tweaks
|
||||||
TBD
|
- Make server directories non-configurable ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/511))
|
||||||
|
- Add popover to server port to detail it's purpose ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/514))
|
||||||
### Lang
|
### Lang
|
||||||
TBD
|
TBD
|
||||||
<br><br>
|
<br><br>
|
||||||
|
@ -86,7 +86,7 @@ class Stats:
|
|||||||
def get_node_stats(self) -> NodeStatsReturnDict:
|
def get_node_stats(self) -> NodeStatsReturnDict:
|
||||||
try:
|
try:
|
||||||
cpu_freq = psutil.cpu_freq()
|
cpu_freq = psutil.cpu_freq()
|
||||||
except NotImplementedError:
|
except (NotImplementedError, FileNotFoundError):
|
||||||
cpu_freq = None
|
cpu_freq = None
|
||||||
if cpu_freq is None:
|
if cpu_freq is None:
|
||||||
cpu_freq = psutil._common.scpufreq(current=-1, min=-1, max=-1)
|
cpu_freq = psutil._common.scpufreq(current=-1, min=-1, max=-1)
|
||||||
|
@ -808,9 +808,15 @@ class PanelHandler(BaseHandler):
|
|||||||
user_roles_list = self.controller.users.get_user_roles_names(
|
user_roles_list = self.controller.users.get_user_roles_names(
|
||||||
user.user_id
|
user.user_id
|
||||||
)
|
)
|
||||||
|
try:
|
||||||
user_servers = self.controller.servers.get_authorized_servers(
|
user_servers = self.controller.servers.get_authorized_servers(
|
||||||
user.user_id
|
user.user_id
|
||||||
)
|
)
|
||||||
|
except:
|
||||||
|
return self.redirect(
|
||||||
|
"/panel/error?error=Cannot load panel config"
|
||||||
|
" while servers are unloaded"
|
||||||
|
)
|
||||||
servers = []
|
servers = []
|
||||||
for server in user_servers:
|
for server in user_servers:
|
||||||
if server.name not in servers:
|
if server.name not in servers:
|
||||||
@ -1554,7 +1560,10 @@ class PanelHandler(BaseHandler):
|
|||||||
return
|
return
|
||||||
if java_selection:
|
if java_selection:
|
||||||
try:
|
try:
|
||||||
execution_list = shlex.split(execution_command)
|
if self.helper.is_os_windows():
|
||||||
|
execution_list = shlex.split(execution_command, posix=False)
|
||||||
|
else:
|
||||||
|
execution_list = shlex.split(execution_command, posix=True)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.redirect(
|
self.redirect(
|
||||||
"/panel/error?error=Invalid execution command. Java path"
|
"/panel/error?error=Invalid execution command. Java path"
|
||||||
@ -1606,7 +1615,6 @@ class PanelHandler(BaseHandler):
|
|||||||
if Helpers.validate_traversal(
|
if Helpers.validate_traversal(
|
||||||
self.helper.get_servers_root_dir(), server_path
|
self.helper.get_servers_root_dir(), server_path
|
||||||
):
|
):
|
||||||
server_obj.path = server_path
|
|
||||||
server_obj.log_path = log_path
|
server_obj.log_path = log_path
|
||||||
if Helpers.validate_traversal(
|
if Helpers.validate_traversal(
|
||||||
self.helper.get_servers_root_dir(), executable
|
self.helper.get_servers_root_dir(), executable
|
||||||
@ -1618,7 +1626,6 @@ class PanelHandler(BaseHandler):
|
|||||||
server_obj.executable_update_url = executable_update_url
|
server_obj.executable_update_url = executable_update_url
|
||||||
server_obj.show_status = show_status
|
server_obj.show_status = show_status
|
||||||
else:
|
else:
|
||||||
server_obj.path = server_obj.path
|
|
||||||
server_obj.log_path = server_obj.log_path
|
server_obj.log_path = server_obj.log_path
|
||||||
server_obj.executable = server_obj.executable
|
server_obj.executable = server_obj.executable
|
||||||
server_obj.execution_command = execution_command
|
server_obj.execution_command = execution_command
|
||||||
|
@ -90,6 +90,7 @@ class ApiServersServerIndexHandler(BaseApiHandler):
|
|||||||
server_obj = self.controller.servers.get_server_obj(server_id)
|
server_obj = self.controller.servers.get_server_obj(server_id)
|
||||||
for key in data:
|
for key in data:
|
||||||
# If we don't validate the input there could be security issues
|
# If we don't validate the input there could be security issues
|
||||||
|
if key != "path":
|
||||||
setattr(server_obj, key, data[key])
|
setattr(server_obj, key, data[key])
|
||||||
self.controller.servers.update_server(server_obj)
|
self.controller.servers.update_server(server_obj)
|
||||||
|
|
||||||
|
@ -22155,7 +22155,7 @@ ul li {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.popover .popover-body {
|
.popover .popover-body {
|
||||||
color: #000;
|
color: var(--base-text);
|
||||||
background: var(--card-banner-bg);
|
background: var(--card-banner-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,9 +62,10 @@
|
|||||||
<label for="server_path">{{ translate('serverConfig', 'serverPath', data['lang']) }} <small
|
<label for="server_path">{{ translate('serverConfig', 'serverPath', data['lang']) }} <small
|
||||||
class="text-muted ml-1"> - {{ translate('serverConfig', 'serverPathDesc', data['lang']) }}</small>
|
class="text-muted ml-1"> - {{ translate('serverConfig', 'serverPathDesc', data['lang']) }}</small>
|
||||||
</label>
|
</label>
|
||||||
<input type="text" class="form-control" name="server_path" id="server_path"
|
<div class="card-header header-sm d-flex justify-content-between align-items-center">
|
||||||
value="{{ data['server_stats']['server_id']['path'] }}"
|
<span style="color: gray; font-size: 12px;">{{ data['server_stats']['server_id']['path'] }}</span>
|
||||||
placeholder="{{ translate('serverConfig', 'serverPath', data['lang']) }}" required>
|
🔒
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% if data['server_stats']['server_type'] != "minecraft-bedrock" %}
|
{% if data['server_stats']['server_type'] != "minecraft-bedrock" %}
|
||||||
@ -157,7 +158,6 @@
|
|||||||
<input type="text" class="form-control" name="server_ip" id="server_ip"
|
<input type="text" class="form-control" name="server_ip" id="server_ip"
|
||||||
value="{{ data['server_stats']['server_id']['server_ip'] }}" required>
|
value="{{ data['server_stats']['server_id']['server_ip'] }}" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="server_port">{{ translate('serverConfig', 'serverPort', data['lang']) }} <small
|
<label for="server_port">{{ translate('serverConfig', 'serverPort', data['lang']) }} <small
|
||||||
class="text-muted ml-1"> - {{ translate('serverConfig', 'serverPortDesc', data['lang']) }}
|
class="text-muted ml-1"> - {{ translate('serverConfig', 'serverPortDesc', data['lang']) }}
|
||||||
@ -165,6 +165,11 @@
|
|||||||
<input type="number" class="form-control" name="server_port" id="server_port"
|
<input type="number" class="form-control" name="server_port" id="server_port"
|
||||||
value="{{ data['server_stats']['server_id']['server_port'] }}" step="1" max="65566" min="1"
|
value="{{ data['server_stats']['server_id']['server_port'] }}" step="1" max="65566" min="1"
|
||||||
required>
|
required>
|
||||||
|
<span data-html="true" class="port-hint text-center"
|
||||||
|
title="<i class='fal fa-exclamation-triangle'></i> " ,
|
||||||
|
data-content="{{
|
||||||
|
translate('serverConfig', 'statsHint1' , data['lang'])}} <br> <br> <strong>{{ translate('serverConfig', 'statsHint2', data['lang'])}}</strong>" ,
|
||||||
|
data-placement="right"></span>
|
||||||
</div>
|
</div>
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
@ -522,6 +527,20 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#server_port").focus(function () {
|
||||||
|
|
||||||
|
$('[data-toggle="popover"]').popover();
|
||||||
|
if ($(window).width() < 1000) {
|
||||||
|
$('.port-hint').attr("data-placement", "top")
|
||||||
|
} else {
|
||||||
|
$('.port-hint').attr("data-placement", "right")
|
||||||
|
}
|
||||||
|
$('.port-hint').popover("show");
|
||||||
|
});
|
||||||
|
$("#server_port").focusout(function () {
|
||||||
|
$('.port-hint').popover("hide");
|
||||||
|
});
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
webSocket.on('remove_spinner', function () {
|
webSocket.on('remove_spinner', function () {
|
||||||
document.getElementById("update-spinner").style.visibility = "hidden";
|
document.getElementById("update-spinner").style.visibility = "hidden";
|
||||||
|
@ -340,7 +340,9 @@
|
|||||||
"yesDeleteFiles": "Yes, delete files",
|
"yesDeleteFiles": "Yes, delete files",
|
||||||
"shutdownTimeout": "Shutdown Timeout",
|
"shutdownTimeout": "Shutdown Timeout",
|
||||||
"timeoutExplain1": "How long Crafty will wait for your server to shutdown after executing the",
|
"timeoutExplain1": "How long Crafty will wait for your server to shutdown after executing the",
|
||||||
"timeoutExplain2": "command before it forces the process down."
|
"timeoutExplain2": "command before it forces the process down.",
|
||||||
|
"statsHint1": "The port your server is running on should go here. This is just how Crafty opens a connection to your server for stats.",
|
||||||
|
"statsHint2": "This does not change the port of your server. You must still change the port in your server config file."
|
||||||
},
|
},
|
||||||
"serverConfigHelp": {
|
"serverConfigHelp": {
|
||||||
"desc": "Here is where you can change the configuration of your server",
|
"desc": "Here is where you can change the configuration of your server",
|
||||||
|
Loading…
Reference in New Issue
Block a user