Merge branch 'tweak/server-port-explained' into 'dev'

Add popover to server port to explain it's purpose

See merge request crafty-controller/crafty-4!514
This commit is contained in:
Iain Powrie 2022-12-21 16:15:54 +00:00
commit af10353119
4 changed files with 24 additions and 3 deletions

View File

@ -14,6 +14,7 @@ TBD
- Fix window path escape on java override ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/513))
### Tweaks
- 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
TBD
<br><br>

View File

@ -22155,7 +22155,7 @@ ul li {
}
.popover .popover-body {
color: #000;
color: var(--base-text);
background: var(--card-banner-bg);
}

View File

@ -158,7 +158,6 @@
<input type="text" class="form-control" name="server_ip" id="server_ip"
value="{{ data['server_stats']['server_id']['server_ip'] }}" required>
</div>
<div class="form-group">
<label for="server_port">{{ translate('serverConfig', 'serverPort', data['lang']) }} <small
class="text-muted ml-1"> - {{ translate('serverConfig', 'serverPortDesc', data['lang']) }}
@ -166,6 +165,11 @@
<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"
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>
{% end %}
@ -523,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 () {
webSocket.on('remove_spinner', function () {
document.getElementById("update-spinner").style.visibility = "hidden";

View File

@ -340,7 +340,9 @@
"yesDeleteFiles": "Yes, delete files",
"shutdownTimeout": "Shutdown Timeout",
"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": {
"desc": "Here is where you can change the configuration of your server",