mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'dev' into tweak/anti-lockout
This commit is contained in:
commit
c49258d573
@ -44,13 +44,17 @@ black:
|
||||
# Code Climate/Quality Checking [https://pylint.pycqa.org/en/latest/]
|
||||
pylint:
|
||||
stage: lint
|
||||
image: registry.gitlab.com/pipeline-components/pylint:0.21.1
|
||||
image: registry.gitlab.com/pipeline-components/pylint:latest
|
||||
tags:
|
||||
- docker
|
||||
rules:
|
||||
- if: "$CODE_QUALITY_DISABLED"
|
||||
when: never
|
||||
- if: "$CI_COMMIT_TAG || $CI_COMMIT_BRANCH"
|
||||
before_script:
|
||||
- apk update
|
||||
- apk add gcc python3-dev linux-headers build-base
|
||||
- pip3 install --no-cache-dir -r requirements.txt
|
||||
script:
|
||||
- pylint --exit-zero --load-plugins=pylint_gitlab --output-format=gitlab-codeclimate:codeclimate.json $(find -type f -name "*.py" ! -path "**/.venv/**" ! -path "**/app/migrations/**")
|
||||
artifacts:
|
||||
|
@ -7,6 +7,7 @@
|
||||
### Refactor
|
||||
- Refactor subpage perm checks ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/695))
|
||||
### Bug fixes
|
||||
- [`CVE-2024-1064`] Security-related fix to resolve an issue with the HTTP listener ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/704))
|
||||
- Fix bukkit and downstream fork MOTD crash ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/686))
|
||||
- Fix bug where invalid server Id leads to stack ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/690))
|
||||
- Fix indent on public status check box ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/691))
|
||||
@ -16,6 +17,11 @@
|
||||
### Tweaks
|
||||
- Refactor Forge server initialisation flow for newer versions ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/687))
|
||||
- Remove scroll bars from player management ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/693))
|
||||
- Add warning to wizard for unsupported mc ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/701))
|
||||
- Improve display for `th-TH` characters ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/703))
|
||||
- Improve display of white text on **wssErrors** ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/703))
|
||||
- Improve display of white text on **Buttons** ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/703))
|
||||
- Fix dashboard motd issue #322 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/705))
|
||||
### Lang
|
||||
- Update `zh_CN, pl_PL, nl_BE, lv_LV, he_IL, fr_FR, de_DE, lol_EN` translations for `4.2.3` ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/696))
|
||||
- New `uk_UA, tr_TR, th_TH` translations for `4.2.3` ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/696))
|
||||
|
@ -106,7 +106,7 @@ class BaseHandler(tornado.web.RequestHandler):
|
||||
if type(text) in self.nobleach:
|
||||
logger.debug("Auto-bleaching - bypass type")
|
||||
return text
|
||||
return nh3.clean(text)
|
||||
return nh3.clean(text) # pylint: disable=no-member
|
||||
|
||||
def get_argument(
|
||||
self,
|
||||
|
@ -17,7 +17,7 @@ class HTTPHandler(BaseHandler):
|
||||
url = "https://" + url
|
||||
db_port = self.helper.get_setting("https_port")
|
||||
try:
|
||||
resp = requests.get(url + ":" + str(port))
|
||||
resp = requests.head(url + ":" + str(port), timeout=(0.5, 5))
|
||||
resp.raise_for_status()
|
||||
except Exception:
|
||||
port = db_port
|
||||
@ -35,7 +35,7 @@ class HTTPHandlerPage(BaseHandler):
|
||||
url = "https://" + url
|
||||
db_port = self.helper.get_setting("https_port")
|
||||
try:
|
||||
resp = requests.get(url + ":" + str(port))
|
||||
resp = requests.head(url + ":" + str(port), timeout=(0.5, 5))
|
||||
resp.raise_for_status()
|
||||
except Exception:
|
||||
port = db_port
|
||||
|
@ -25,7 +25,7 @@ class HTTPHandlerPage(BaseHandler):
|
||||
backup_url = url + str(self.helper.get_setting("https_port"))
|
||||
|
||||
try:
|
||||
resp = requests.get(primary_url)
|
||||
resp = requests.head(primary_url, timeout=(0.5, 5))
|
||||
resp.raise_for_status()
|
||||
url = primary_url
|
||||
except Exception:
|
||||
|
@ -80,6 +80,7 @@ class PanelHandler(BaseHandler):
|
||||
) in self.controller.crafty_perms.list_defined_crafty_permissions():
|
||||
argument = int(
|
||||
float(
|
||||
# pylint: disable=no-member
|
||||
nh3.clean(self.get_argument(f"permission_{permission.name}", "0"))
|
||||
)
|
||||
)
|
||||
@ -89,7 +90,10 @@ class PanelHandler(BaseHandler):
|
||||
)
|
||||
|
||||
q_argument = int(
|
||||
float(nh3.clean(self.get_argument(f"quantity_{permission.name}", "0")))
|
||||
float(
|
||||
# pylint: disable=no-member
|
||||
nh3.clean(self.get_argument(f"quantity_{permission.name}", "0"))
|
||||
)
|
||||
)
|
||||
if q_argument:
|
||||
server_quantity[permission.name] = q_argument
|
||||
@ -503,7 +507,9 @@ class PanelHandler(BaseHandler):
|
||||
template = "panel/dashboard.html"
|
||||
|
||||
elif page == "server_detail":
|
||||
# pylint: disable=no-member
|
||||
subpage = nh3.clean(self.get_argument("subpage", ""))
|
||||
# pylint: enable=no-member
|
||||
|
||||
server_id = self.check_server_id()
|
||||
# load page the user was on last
|
||||
@ -1362,7 +1368,9 @@ class PanelHandler(BaseHandler):
|
||||
template = "panel/panel_edit_user_apikeys.html"
|
||||
|
||||
elif page == "remove_user":
|
||||
# pylint: disable=no-member
|
||||
user_id = nh3.clean(self.get_argument("id", None))
|
||||
# pylint: enable=no-member
|
||||
|
||||
if (
|
||||
not superuser
|
||||
|
@ -29,8 +29,10 @@ class PublicHandler(BaseHandler):
|
||||
# self.clear_cookie("user_data")
|
||||
|
||||
def get(self, page=None):
|
||||
# pylint: disable=no-member
|
||||
error = nh3.clean(self.get_argument("error", "Invalid Login!"))
|
||||
error_msg = nh3.clean(self.get_argument("error_msg", ""))
|
||||
# pylint: enable=no-member
|
||||
|
||||
page_data = {
|
||||
"version": self.helper.get_version_string(),
|
||||
@ -87,8 +89,10 @@ class PublicHandler(BaseHandler):
|
||||
)
|
||||
|
||||
def post(self, page=None):
|
||||
# pylint: disable=no-member
|
||||
error = nh3.clean(self.get_argument("error", "Invalid Login!"))
|
||||
error_msg = nh3.clean(self.get_argument("error_msg", ""))
|
||||
# pylint: enable=no-member
|
||||
|
||||
page_data = {
|
||||
"version": self.helper.get_version_string(),
|
||||
@ -108,10 +112,11 @@ class PublicHandler(BaseHandler):
|
||||
if self.request.query:
|
||||
next_page = "/login?" + self.request.query
|
||||
|
||||
# pylint: disable=no-member
|
||||
entered_username = nh3.clean(self.get_argument("username"))
|
||||
entered_password = self.get_argument("password")
|
||||
# pylint: enable=no-member
|
||||
|
||||
# pylint: disable=no-member
|
||||
try:
|
||||
user_id = HelperUsers.get_user_id_by_name(entered_username.lower())
|
||||
user_data = HelperUsers.get_user_model(user_id)
|
||||
|
@ -112,7 +112,7 @@ class Webserver:
|
||||
cookie_secret = self.helper.random_string_generator(32)
|
||||
HelpersManagement.set_cookie_secret(cookie_secret)
|
||||
|
||||
if not http_port:
|
||||
if not http_port and http_port != 0:
|
||||
http_port = 8000
|
||||
|
||||
if not https_port:
|
||||
@ -191,8 +191,11 @@ class Webserver:
|
||||
serve_traceback=debug_errors,
|
||||
)
|
||||
|
||||
self.http_server = tornado.httpserver.HTTPServer(http_app)
|
||||
self.http_server.listen(http_port)
|
||||
if http_port != 0:
|
||||
self.http_server = tornado.httpserver.HTTPServer(http_app)
|
||||
self.http_server.listen(http_port)
|
||||
else:
|
||||
logger.info("http port disabled by config")
|
||||
|
||||
self.https_server = tornado.httpserver.HTTPServer(app, ssl_options=cert_objects)
|
||||
self.https_server.listen(https_port)
|
||||
|
@ -37,16 +37,16 @@ nav.sidebar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 100%;
|
||||
border: 2px solid #fff;
|
||||
border: 2px solid var(--white);
|
||||
display: block;
|
||||
}
|
||||
|
||||
.toggle-handle {
|
||||
background-color: white !important;
|
||||
background-color: var(--white) !important;
|
||||
}
|
||||
|
||||
.toggle-on {
|
||||
color: black !important;
|
||||
color: var(--dark) !important;
|
||||
}
|
||||
|
||||
.toggle {
|
||||
@ -61,7 +61,7 @@ nav.sidebar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 100%;
|
||||
border: 2px solid #fff;
|
||||
border: 2px solid var(--white);
|
||||
display: block;
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ nav.sidebar {
|
||||
}
|
||||
|
||||
.scrollable-element {
|
||||
scrollbar-color: red yellow;
|
||||
scrollbar-color: var(--red) var(--yellow);
|
||||
}
|
||||
|
||||
.term-nav-item {
|
||||
@ -212,6 +212,14 @@ div>.input-group>.form-control {
|
||||
top: calc(-0.125rem + 1px);
|
||||
}
|
||||
|
||||
a.btn-primary {
|
||||
color: var(--white);
|
||||
}
|
||||
|
||||
button.btn-primary {
|
||||
color: var(--white);
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
/**************************************************************/
|
||||
@ -233,4 +241,30 @@ td.action .btn {
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
/**************************************************************/
|
||||
/* CSS for warnings Displays */
|
||||
/**************************************************************/
|
||||
div.warnings div.wssError {
|
||||
color: var(--white);
|
||||
}
|
||||
|
||||
div.warnings div.wssError a {
|
||||
color: var(--outline);
|
||||
}
|
||||
|
||||
div.warnings div.wssError a:hover {
|
||||
color: var(--white-smoke);
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
/**************************************************************/
|
||||
/* CSS for Fonts Displays */
|
||||
/**************************************************************/
|
||||
*:lang(th-TH) :not(.fa, .fas, .fab, .fa-solid) {
|
||||
font-family: 'Sarabun', 'roboto', sans-serif;
|
||||
}
|
||||
|
||||
/**************************************************************/
|
@ -96,7 +96,7 @@ function initParser(input, output) {
|
||||
var input = document.getElementById(input),
|
||||
output = document.getElementById(output);
|
||||
if (input != null && output != null) {
|
||||
var parsed = parseStyle(input.innerHTML);
|
||||
var parsed = parseStyle(input.innerText);
|
||||
output.innerHTML = '';
|
||||
output.appendChild(parsed);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@
|
||||
<link rel="stylesheet" href="/static/assets/vendors/ti-icons/css/themify-icons.css">
|
||||
<link rel="stylesheet" href="/static/assets/vendors/typicons/typicons.css">
|
||||
<link rel="stylesheet" href="/static/assets/vendors/fontawesome6/css/all.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Sarabun" media="screen">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/dt-1.10.22/fh-3.1.7/r-2.2.6/sc-2.0.3/sp-1.2.2/datatables.min.css" />
|
||||
<link rel="stylesheet" href="/static/assets/vendors/css/vendor.bundle.base.css">
|
||||
<link rel="stylesheet" href="/static/assets/css/crafty.css">
|
||||
@ -53,7 +54,6 @@
|
||||
<script src="../static/assets/vendors/js/chart.min.js"></script>
|
||||
<script src="../static/assets/vendors/js/hammer.min.js"></script>
|
||||
<script src="../static/assets/vendors/js/chartjs-plugin-zoom.min.js"></script>
|
||||
|
||||
<!-- End Bootstrap Toggle -->
|
||||
|
||||
</head>
|
||||
@ -395,7 +395,7 @@
|
||||
}
|
||||
},
|
||||
callback: function (result) {
|
||||
if (result){
|
||||
if (result) {
|
||||
location.href = "/panel/download_support_package";
|
||||
} else {
|
||||
bootbox.close();
|
||||
@ -489,8 +489,8 @@
|
||||
if (link) {
|
||||
let linkEl = document.createElement('a')
|
||||
linkEl.href = link;
|
||||
linkEl.innerHTML = link_msg;
|
||||
linkEl.style.color = 'white';
|
||||
linkEl.innerHTML = "See our documentation for details.";
|
||||
//linkEl.style.color = 'white';
|
||||
linkEl.style.textDecoration = 'underline';
|
||||
linkEl.target = "_blank";
|
||||
|
||||
@ -586,7 +586,7 @@
|
||||
'⚠️You are in a recovery account. Access is limited!',
|
||||
link='/logout',
|
||||
link_msg="Click here to log out after you change your password. ⚠️",
|
||||
className='anti-lockout',
|
||||
className='anti-lockout',
|
||||
bg_color='#6887dc'
|
||||
)
|
||||
}
|
||||
|
@ -287,8 +287,7 @@
|
||||
data['lang']) }} <br />
|
||||
|
||||
{% if server['stats']['desc'] != 'False' %}
|
||||
<div id="desc_id" style="overflow-wrap: break-word !important; max-width: 85px !important; overflow: scroll;">{{
|
||||
server['stats']['desc'] }}</div> <br />
|
||||
<div id="desc_id" style="overflow-wrap: break-word !important; max-width: 85px !important; overflow: scroll;">{{ translate('serverStats', 'loadingMotd', data['lang']) }}</div> <br />
|
||||
{% end %}
|
||||
|
||||
{% if server['stats']['version'] != 'False' %}
|
||||
@ -554,6 +553,7 @@
|
||||
display: none;
|
||||
/* for Chrome, Safari, and Opera */
|
||||
}
|
||||
|
||||
.gray {
|
||||
color: gray !important;
|
||||
}
|
||||
@ -736,11 +736,11 @@
|
||||
try {
|
||||
console.log(`#server_desc_${server.getAttribute("data-serverId")}`)
|
||||
$(`#server_desc_${server.getAttribute("data-serverId")}`).toggleClass("gray", server.getAttribute('data-count') === 'false')
|
||||
if (server.getAttribute('data-count') === 'true'){
|
||||
if (server.getAttribute('data-count') === 'true') {
|
||||
all_total_players += parseInt(server.getAttribute('data-players'));
|
||||
all_total_max_players += parseInt(server.getAttribute('data-max'));
|
||||
}
|
||||
} catch {
|
||||
} catch {
|
||||
console.log("Player totals are not of type int");
|
||||
}
|
||||
})
|
||||
@ -1006,24 +1006,24 @@
|
||||
async function sendOrder(id_string) {
|
||||
const token = getCookie("_xsrf")
|
||||
let res = await fetch(`/api/v2/users/@me`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'X-XSRFToken': token
|
||||
},
|
||||
body: JSON.stringify({
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'X-XSRFToken': token
|
||||
},
|
||||
body: JSON.stringify({
|
||||
server_order: id_string,
|
||||
}),
|
||||
});
|
||||
let responseData = await res.json();
|
||||
if (responseData.status === "ok") {
|
||||
return
|
||||
} else {
|
||||
|
||||
bootbox.alert({
|
||||
title: responseData.status,
|
||||
message: responseData.error
|
||||
});
|
||||
}
|
||||
let responseData = await res.json();
|
||||
if (responseData.status === "ok") {
|
||||
return
|
||||
} else {
|
||||
|
||||
bootbox.alert({
|
||||
title: responseData.status,
|
||||
message: responseData.error
|
||||
});
|
||||
}
|
||||
}
|
||||
// Inits the sortable
|
||||
$("table#servers_table tbody")
|
||||
|
@ -5,42 +5,27 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-4 mr-2">
|
||||
{% if data['server_stats']['running'] %}
|
||||
<b>{{ translate('serverStats', 'serverStatus', data['lang']) }}:</b> <span id="status"
|
||||
class="text-success">{{ translate('serverStats', 'online', data['lang']) }}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverStarted', data['lang']) }}:</b> <span id="started">{{
|
||||
data['server_stats']['started'] }}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverUptime', data['lang']) }}:</b> <span id="uptime">{{
|
||||
translate('serverStats', 'errorCalculatingUptime', data['lang']) }}</span>
|
||||
<b>{{ translate('serverStats', 'serverStatus', data['lang']) }}:</b> <span id="status" class="text-success">{{ translate('serverStats', 'online', data['lang']) }}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverStarted', data['lang']) }}:</b> <span id="started">{{ data['server_stats']['started'] }}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverUptime', data['lang']) }}:</b> <span id="uptime">{{ translate('serverStats', 'errorCalculatingUptime', data['lang']) }}</span>
|
||||
{% elif data['server_stats']['crashed'] %}
|
||||
<b>{{ translate('serverStats', 'serverStatus', data['lang']) }}:</b> <span id="status" class="text-danger">
|
||||
<i class="fas fa-exclamation-triangle"></i> {{ translate('dashboard', 'crashed', data['lang'])
|
||||
}}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverStarted', data['lang']) }}:</b> <span id="started"
|
||||
class="text-danger"> <i class="fas fa-exclamation-triangle"></i> {{ translate('dashboard', 'crashed',
|
||||
data['lang']) }}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverUptime', data['lang']) }}:</b> <span id="uptime" class="text-danger">
|
||||
<i class="fas fa-exclamation-triangle"></i> {{ translate('dashboard', 'crashed', data['lang']) }}</span>
|
||||
<b>{{ translate('serverStats', 'serverStatus', data['lang']) }}:</b> <span id="status" class="text-danger"> <i class="fas fa-exclamation-triangle"></i> {{ translate('dashboard', 'crashed', data['lang']) }}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverStarted', data['lang']) }}:</b> <span id="started" class="text-danger"> <i class="fas fa-exclamation-triangle"></i> {{ translate('dashboard', 'crashed',data['lang']) }}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverUptime', data['lang']) }}:</b> <span id="uptime" class="text-danger"> <i class="fas fa-exclamation-triangle"></i> {{ translate('dashboard', 'crashed', data['lang']) }}</span>
|
||||
{% else %}
|
||||
<b>{{ translate('serverStats', 'serverStatus', data['lang']) }}:</b> <span id="status"
|
||||
class="text-warning">{{ translate('serverStats', 'offline', data['lang']) }}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverStarted', data['lang']) }}:</b> <span id="started"
|
||||
class="text-warning">{{ translate('serverStats', 'offline', data['lang']) }}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverUptime', data['lang']) }}:</b> <span id="uptime"
|
||||
class="text-warning">{{ translate('serverStats', 'offline', data['lang']) }}</span>
|
||||
<b>{{ translate('serverStats', 'serverStatus', data['lang']) }}:</b> <span id="status" class="text-warning">{{ translate('serverStats', 'offline', data['lang']) }}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverStarted', data['lang']) }}:</b> <span id="started" class="text-warning">{{ translate('serverStats', 'offline', data['lang']) }}</span><br />
|
||||
<b>{{ translate('serverStats', 'serverUptime', data['lang']) }}:</b> <span id="uptime" class="text-warning">{{ translate('serverStats', 'offline', data['lang']) }}</span>
|
||||
{% end %}
|
||||
<br>
|
||||
<b>{{ translate('serverStats', 'serverTimeZone', data['lang']) }}:</b> <span class="text-info">{{
|
||||
data['serverTZ'] }}</span>
|
||||
<b>{{ translate('serverStats', 'serverTimeZone', data['lang']) }}:</b> <span class="text-info">{{ data['serverTZ'] }}</span>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3 mr-2">
|
||||
<b>{{ translate('serverStats', 'cpuUsage', data['lang']) }}:</b> <span id="cpu">{{
|
||||
data['server_stats']['cpu'] }}%</span> <br />
|
||||
<b>{{ translate('serverStats', 'memUsage', data['lang']) }}:</b> <span id="mem">{{
|
||||
data['server_stats']['mem'] }}</span> <br />
|
||||
<b>{{ translate('serverStats', 'cpuUsage', data['lang']) }}:</b> <span id="cpu">{{ data['server_stats']['cpu'] }}%</span> <br />
|
||||
<b>{{ translate('serverStats', 'memUsage', data['lang']) }}:</b> <span id="mem">{{ data['server_stats']['mem'] }}</span> <br />
|
||||
{% if data['server_stats']['int_ping_results'] %}
|
||||
<b>{{ translate('serverStats', 'players', data['lang']) }}:</b> <span id="players">{{
|
||||
data['server_stats']['online'] }} / {{ data['server_stats']['max'] }}</span><br />
|
||||
<b>{{ translate('serverStats', 'players', data['lang']) }}:</b> <span id="players">{{ data['server_stats']['online'] }} / {{ data['server_stats']['max'] }}</span><br />
|
||||
{% else %}
|
||||
<b>{{ translate('serverStats', 'players', data['lang']) }}:</b> <span id="players">0/0</span><br />
|
||||
{% end %}
|
||||
@ -48,17 +33,12 @@
|
||||
|
||||
<div class="col-sm-3 mr-2">
|
||||
{% if data['server_stats']['version'] != 'False' %}
|
||||
<b>{{ translate('serverStats', 'version', data['lang']) }}:</b> <span id="version">{{
|
||||
data['server_stats']['version'] }}</span><br />
|
||||
<b>{{ translate('serverStats', 'description', data['lang']) }}:</b> <span id="input_motd"
|
||||
style="max-width: 10px; max-height: 10px" class="input_motd">{{ data['server_stats']['desc'] }}</span>
|
||||
<b>{{ translate('serverStats', 'version', data['lang']) }}:</b> <span id="version">{{ data['server_stats']['version'] }}</span><br />
|
||||
<b>{{ translate('serverStats', 'description', data['lang']) }}:</b> <span id="input_motd" style="max-width: 10px; max-height: 10px" class="input_motd">{{ translate('serverStats', 'loadingMotd', data['lang']) }}</span>
|
||||
<br />
|
||||
{% else %}
|
||||
<b>{{ translate('serverStats', 'version', data['lang']) }}:</b> <span id="version">{{
|
||||
translate('serverStats', 'unableToConnect', data['lang']) }}</span> <br />
|
||||
<b>{{ translate('serverStats', 'description', data['lang']) }}:</b> <span
|
||||
style="max-width: 10px; max-height: 10px" id="input_motd" class="input_motd">{{ translate('serverStats',
|
||||
'unableToConnect', data['lang']) }}</span> <br />
|
||||
<b>{{ translate('serverStats', 'version', data['lang']) }}:</b> <span id="version">{{ translate('serverStats', 'unableToConnect', data['lang']) }}</span> <br />
|
||||
<b>{{ translate('serverStats', 'description', data['lang']) }}:</b> <span style="max-width: 10px; max-height: 10px" id="input_motd" class="input_motd">{{ translate('serverStats', 'unableToConnect', data['lang']) }}</span> <br />
|
||||
{% end %}
|
||||
<b>Server Type: <span class="text-info">{{data['server_stats']['server_type']}}</span></b>
|
||||
|
||||
@ -229,23 +209,23 @@
|
||||
|
||||
initParser('input_motd', 'input_motd');
|
||||
let text = ""
|
||||
let players = server.players_cache;
|
||||
for(let i=0; i < players.length; i++){
|
||||
text += `<tr id="playerItem-${ players[i]["name"] }" class="playerItem--" style="text-align: center;">`;
|
||||
text += `<td class="no-scroll" style="overflow: scroll;"><strong>${players[i]["name"]}</strong></td>`;
|
||||
if(players[i]["status"] === "Online"){
|
||||
text += `<td><span class="text-success"><i class="fas fa-signal"></i> ${ players[i]['status'] }</span></td>`
|
||||
}else{
|
||||
text += `<td><span class="text-warning"><i class="fa-regular fa-circle-xmark"></i><span class="offline-status"> ${ players[i]['status'] }</span><span class="conn-break"> Last connection :<br> ${ players[i]['last_seen'] }</span></td>`
|
||||
}
|
||||
if(server["running"]){
|
||||
text += `<td><button onclick="send_command_to_server('ban ${ players[i]['name'] }')" type="button" class="btn btn-danger controls">Ban</button><br class="mobile-break"><button onclick="send_command_to_server('kick ${ players[i]['name'] }')" type="button" class="btn btn-outline-danger controls">Kick</button><br><button onclick="send_command_to_server('op ${ players[i]['name'] }')" type="button" class="btn btn-warning controls">OP</button><br class="mobile-break"><button onclick="send_command_to_server('deop ${ players[i]['name'] }')" type="button" class="btn btn-outline-warning controls">De-OP</button></td>`
|
||||
}else{
|
||||
text += `<td><span> Unavailable<br> (Server Offline)</span></td>`
|
||||
}
|
||||
let players = server.players_cache;
|
||||
for (let i = 0; i < players.length; i++) {
|
||||
text += `<tr id="playerItem-${players[i]["name"]}" class="playerItem--" style="text-align: center;">`;
|
||||
text += `<td class="no-scroll" style="overflow: scroll;"><strong>${players[i]["name"]}</strong></td>`;
|
||||
if (players[i]["status"] === "Online") {
|
||||
text += `<td><span class="text-success"><i class="fas fa-signal"></i> ${players[i]['status']}</span></td>`
|
||||
} else {
|
||||
text += `<td><span class="text-warning"><i class="fa-regular fa-circle-xmark"></i><span class="offline-status"> ${players[i]['status']}</span><span class="conn-break"> Last connection :<br> ${players[i]['last_seen']}</span></td>`
|
||||
}
|
||||
if (server["running"]) {
|
||||
text += `<td><button onclick="send_command_to_server('ban ${players[i]['name']}')" type="button" class="btn btn-danger controls">Ban</button><br class="mobile-break"><button onclick="send_command_to_server('kick ${players[i]['name']}')" type="button" class="btn btn-outline-danger controls">Kick</button><br><button onclick="send_command_to_server('op ${players[i]['name']}')" type="button" class="btn btn-warning controls">OP</button><br class="mobile-break"><button onclick="send_command_to_server('deop ${players[i]['name']}')" type="button" class="btn btn-outline-warning controls">De-OP</button></td>`
|
||||
} else {
|
||||
text += `<td><span> Unavailable<br> (Server Offline)</span></td>`
|
||||
}
|
||||
|
||||
}
|
||||
$("#player-body").html(text);
|
||||
}
|
||||
$("#player-body").html(text);
|
||||
|
||||
}
|
||||
//used to get cookies from browser - this is part of tornados xsrf protection - it's for extra security
|
||||
@ -262,24 +242,24 @@
|
||||
add_server_name();
|
||||
//}
|
||||
});
|
||||
async function add_server_name(){
|
||||
async function add_server_name() {
|
||||
let res = await fetch(`/api/v2/servers/${serverId}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'X-XSRFToken': token
|
||||
},
|
||||
});
|
||||
let responseData = await res.json();
|
||||
if (responseData.status === "ok") {
|
||||
console.log(responseData)
|
||||
$("#server-name-nav").html(`${responseData.data['server_name']}`)
|
||||
$("#server-name-nav").show();
|
||||
} else {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'X-XSRFToken': token
|
||||
},
|
||||
});
|
||||
let responseData = await res.json();
|
||||
if (responseData.status === "ok") {
|
||||
console.log(responseData)
|
||||
$("#server-name-nav").html(`${responseData.data['server_name']}`)
|
||||
$("#server-name-nav").show();
|
||||
} else {
|
||||
|
||||
bootbox.alert({
|
||||
title: responseData.error,
|
||||
message: responseData.error_data
|
||||
});
|
||||
}
|
||||
bootbox.alert({
|
||||
title: responseData.error,
|
||||
message: responseData.error_data
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
@ -49,7 +49,7 @@
|
||||
<img src="/static/assets/images/pack.png" alt="icon" style="-webkit-filter:grayscale(100%); filter:grayscale(100%)" />
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span id="input_motd_{{ server['stats']['server_id']['server_id'] }}" class="input_motd">{{ server['stats']['desc'] }}</span>
|
||||
<span id="input_motd_{{ server['stats']['server_id']['server_id'] }}" class="input_motd">{{ translate('serverStats', 'loadingMotd', data['lang']) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
{% end %}
|
||||
@ -133,8 +133,7 @@
|
||||
<div class="media-body">
|
||||
{% if server['stats']['desc'] != 'False' %}
|
||||
<div id="m_server_motd_{{ server['stats']['server_id']['server_id'] }}">
|
||||
<span id="m_input_motd_{{ server['stats']['server_id']['server_id'] }}" class="input_motd">{{
|
||||
server['stats']['desc'] }}</span> <br />
|
||||
<span id="m_input_motd_{{ server['stats']['server_id']['server_id'] }}" class="input_motd">{{ translate('serverStats', 'loadingMotd', data['lang']) }}</span> <br />
|
||||
</div>
|
||||
{% end %}
|
||||
</div>
|
||||
|
@ -107,7 +107,8 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span data-html="true" class="version-hint text-center"
|
||||
data-content="⚠️ {{ translate('serverWizard', 'unsupported', data['lang']) }} ⚠️" , data-placement="right"></span>
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group">
|
||||
<label for="server_name">{{ translate('serverWizard', 'serverName', data['lang']) }}</label>
|
||||
@ -1233,6 +1234,20 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
$("#server").change(function (){
|
||||
let selected_version = $("#server :selected").text().split(".");
|
||||
if(parseInt(selected_version[0]) === 1 && parseInt(selected_version[1]) < 8 ){
|
||||
$('[data-toggle="popover"]').popover();
|
||||
if ($(window).width() < 1000) {
|
||||
$('.version-hint').attr("data-placement", "top")
|
||||
} else {
|
||||
$('.version-hint').attr("data-placement", "right")
|
||||
}
|
||||
$('.version-hint').popover("show");
|
||||
}else{
|
||||
$('.version-hint').popover("hide");
|
||||
}
|
||||
});
|
||||
|
||||
function serverJarChange(selectObj) {
|
||||
const type_select = document.getElementById('server_jar')
|
||||
|
@ -512,6 +512,7 @@
|
||||
"cpuUsage": "CPU-Nutzung",
|
||||
"description": "Beschreibung",
|
||||
"errorCalculatingUptime": "Fehler bei der Berechnung der Betriebszeit",
|
||||
"loadingMotd": "Nachricht des Tages lädt (MOTD)",
|
||||
"memUsage": "RAM/Speicherverbrauch",
|
||||
"offline": "Offline",
|
||||
"online": "Online",
|
||||
@ -579,6 +580,7 @@
|
||||
"serverUpload": "Als Zip-Datei Gepackten Server hochladen",
|
||||
"serverVersion": "Server Version",
|
||||
"sizeInGB": "Größe in GB",
|
||||
"unsupported": "Minecraft-Versionen vor 1.8 sind nicht vollständig auf Kompatibilität getestet. Bei einer Installation verhalten diese sich möglicherweise nicht wie erwartet.",
|
||||
"uploadButton": "Hochladen",
|
||||
"uploadZip": "Zip-Datei für Serverimport hochladen",
|
||||
"zipPath": "Server Pfad"
|
||||
|
@ -512,6 +512,7 @@
|
||||
"cpuUsage": "CPU Usage",
|
||||
"description": "Description",
|
||||
"errorCalculatingUptime": "Error Calculating Uptime",
|
||||
"loadingMotd": "Loading MOTD",
|
||||
"memUsage": "Memory Usage",
|
||||
"offline": "Offline",
|
||||
"online": "Online",
|
||||
@ -578,6 +579,7 @@
|
||||
"serverUpload": "Upload Zipped Server",
|
||||
"serverVersion": "Server Version",
|
||||
"sizeInGB": "Size in GB",
|
||||
"unsupported": "Minecraft versions lower than 1.8 are not supported by Crafty. You may still install it. Results will vary.",
|
||||
"uploadButton": "Upload",
|
||||
"uploadZip": "Upload Zip File For Server Import",
|
||||
"zipPath": "Server Path"
|
||||
|
@ -512,6 +512,7 @@
|
||||
"cpuUsage": "Utilisation CPU",
|
||||
"description": "Description",
|
||||
"errorCalculatingUptime": "Erreur de Calcul du Temps de Disponibilité",
|
||||
"loadingMotd": "Chargement MOTD",
|
||||
"memUsage": "Utilisation Mémoire",
|
||||
"offline": "Hors Ligne",
|
||||
"online": "En Ligne",
|
||||
@ -579,6 +580,7 @@
|
||||
"serverUpload": "Charger le fichier Zippé",
|
||||
"serverVersion": "Version du Serveur",
|
||||
"sizeInGB": "Taille en GB",
|
||||
"unsupported": "Les versions Minecraft inférieures à 1.8 ne sont pas supportées par Crafty. Elles peuvent être installées, mais leur fonctionnement peut varier.",
|
||||
"uploadButton": "Chargement",
|
||||
"uploadZip": "Charger le fichier pour l'importation du Serveur",
|
||||
"zipPath": "Chemin du Serveur"
|
||||
|
@ -512,6 +512,7 @@
|
||||
"cpuUsage": "שימוש במעבד",
|
||||
"description": "תיאור",
|
||||
"errorCalculatingUptime": "שגיאה בחישוב זמן פעולה",
|
||||
"loadingMotd": "טוען MOTD",
|
||||
"memUsage": "שימוש בזיכרון",
|
||||
"offline": "לא מקוון",
|
||||
"online": "פועל",
|
||||
@ -579,6 +580,7 @@
|
||||
"serverUpload": "העלה שרת מכווץ",
|
||||
"serverVersion": "גרסת השרת",
|
||||
"sizeInGB": "גודל ב-GB",
|
||||
"unsupported": "גרסאות מיינקראפט מתחת ל1.8 לא נתמכות על ידי קראפטי. אפשר להתקין אותם אבל הביצועים לא יהיו עקביים.",
|
||||
"uploadButton": "העלה",
|
||||
"uploadZip": "העלה קובץ Zip לייבוא שרת",
|
||||
"zipPath": "נתיב שרת"
|
||||
|
@ -512,6 +512,7 @@
|
||||
"cpuUsage": "CPU USAGE",
|
||||
"description": "DESCRIPSHUN",
|
||||
"errorCalculatingUptime": "I DUN GOOF'D WEN CALCULATIN TEH TEIM AWAEK!",
|
||||
"loadingMotd": "LOADIN' MEOWSSAGE OF DA DAY",
|
||||
"memUsage": "HOW HARD IZ THINKIN RN",
|
||||
"offline": "TURND OFF",
|
||||
"online": "TURND OAN",
|
||||
@ -579,6 +580,7 @@
|
||||
"serverUpload": "UPLOADZ ZIPPED SERVR",
|
||||
"serverVersion": "SERVR VERZHUN",
|
||||
"sizeInGB": "SIEZ IN GIGABITEZ",
|
||||
"unsupported": "MINECRAFTZ OLDR THAN 1.8 NOT FRENDS WIF CWAFTY. U CAN STILL TRY INSTALLIN'. IT MIGHT WORKS, MIGHT NOT.",
|
||||
"uploadButton": "UPLOADZ",
|
||||
"uploadZip": "UPLOADZ ZIP FISH FOR SERVR BRING IN",
|
||||
"zipPath": "WER IZ ZIP FISH (PETH)"
|
||||
|
@ -513,6 +513,7 @@
|
||||
"cpuUsage": "CPU Lietojums",
|
||||
"description": "Apraksts",
|
||||
"errorCalculatingUptime": "Kļūda aprēķinot darbības laiku",
|
||||
"loadingMotd": "Ielādē MOTD",
|
||||
"memUsage": "Atmiņas Lietojums",
|
||||
"offline": "Offlinā",
|
||||
"online": "Onlinā",
|
||||
@ -580,6 +581,7 @@
|
||||
"serverUpload": "Augšupielādē Saspiestu (Zipotu) Serveri",
|
||||
"serverVersion": "Servera Versija",
|
||||
"sizeInGB": "lielums, GB",
|
||||
"unsupported": "Minecraft versijas zem 1.8 netiek atbalstītas iekš Crafty. Jūs tāpat variet tās instalēt, bet rezultāti atškirsies.",
|
||||
"uploadButton": "Augšupielādēt",
|
||||
"uploadZip": "Augšupielādē Zip Failu Priekš Serveru Importa",
|
||||
"zipPath": "Servera Ceļš"
|
||||
|
@ -512,6 +512,7 @@
|
||||
"cpuUsage": "CPU gebruik",
|
||||
"description": "Beschrijving",
|
||||
"errorCalculatingUptime": "Fout bij berekenen van uptime",
|
||||
"loadingMotd": "MOTD laden",
|
||||
"memUsage": "Geheugengebruik",
|
||||
"offline": "Offline",
|
||||
"online": "Online",
|
||||
@ -579,6 +580,7 @@
|
||||
"serverUpload": "Gezipt bestand uploaden",
|
||||
"serverVersion": "Serverversie",
|
||||
"sizeInGB": "Grootte in GB",
|
||||
"unsupported": "Minecraft-versies lager dan 1.8 worden niet ondersteund door Crafty. Je kunt het nog steeds installeren. De resultaten kunnen variëren.",
|
||||
"uploadButton": "Uploaden",
|
||||
"uploadZip": "Upload zip-bestand voor serverimport",
|
||||
"zipPath": "Serverpad"
|
||||
|
@ -512,6 +512,7 @@
|
||||
"cpuUsage": "Użycie procesora",
|
||||
"description": "Opis",
|
||||
"errorCalculatingUptime": "Błąd obliczania czasu pracy",
|
||||
"loadingMotd": "Wczytywanie MOTD",
|
||||
"memUsage": "Użycie RAMu",
|
||||
"offline": "Wyłączony",
|
||||
"online": "Włączony",
|
||||
@ -578,6 +579,7 @@
|
||||
"serverUpload": "Wgraj ZIP Serwera",
|
||||
"serverVersion": "Wersja serwera",
|
||||
"sizeInGB": "Wielkość w GB",
|
||||
"unsupported": "Wersje Minecrafta poniżej 1.8 nie są wspierane przez Crafty. Mimo to możesz je zainstalować - jednakże nie jesteśmy w stanie zagwarantować ich działanie.",
|
||||
"uploadButton": "Wgraj",
|
||||
"uploadZip": "Wgraj plik Zip dla imprtowania serwera",
|
||||
"zipPath": "Server Path"
|
||||
|
@ -512,6 +512,7 @@
|
||||
"cpuUsage": "การใช้งานซีพียู",
|
||||
"description": "คำอธิบาย",
|
||||
"errorCalculatingUptime": "เกิดข้อผิดพลาดในการคำนวณสถานะการออนไลน์",
|
||||
"loadingMotd": "กำลังโหลด MOTD",
|
||||
"memUsage": "การใช้งานหน่วยความจำ",
|
||||
"offline": "ออฟไลน์",
|
||||
"online": "ออนไลน์",
|
||||
@ -578,6 +579,7 @@
|
||||
"serverUpload": "อัปโหลดเซิร์ฟเวอร์ซิป",
|
||||
"serverVersion": "เวอร์ชันเซิร์ฟเวอร์",
|
||||
"sizeInGB": "ขนาดเป็นกิกะไบต์",
|
||||
"unsupported": "Crafty ไม่รองรับ Minecraft เวอร์ชั่นต่ำกว่า 1.8 คุณยังสามารถติดตั้งได้ ผลลัพธ์จะแตกต่างกันออกไป",
|
||||
"uploadButton": "อัปโหลด",
|
||||
"uploadZip": "อัปโหลดไฟล์ซิปสำหรับการนำเข้าเซิร์ฟเวอร์",
|
||||
"zipPath": "เส้นทางเซิร์ฟเวอร์"
|
||||
|
@ -512,6 +512,7 @@
|
||||
"cpuUsage": "CPU Kullanımı",
|
||||
"description": "Açıklama",
|
||||
"errorCalculatingUptime": "Çalışma Süresi Hesaplanırken Hata",
|
||||
"loadingMotd": "MOTD yükleniyor",
|
||||
"memUsage": "Bellek Kullanımı",
|
||||
"offline": "Çevrimdışı",
|
||||
"online": "Çevrimiçi",
|
||||
@ -578,6 +579,7 @@
|
||||
"serverUpload": "Sıkıştırılmış Sunucu Yükle",
|
||||
"serverVersion": "Sunucu Sürümü",
|
||||
"sizeInGB": "GB cinsinden boyut",
|
||||
"unsupported": "Minecraft'ın 1.8'den eski sürümleri Crafty tarafından desteklenmemektedir. Yine de yükleyebilirsiniz. Sonuçlar değişkenlik gösterecektir.",
|
||||
"uploadButton": "Dosya Yükle",
|
||||
"uploadZip": "Sunucu İçe Aktarımı İçin Zip Dosyası Yükle",
|
||||
"zipPath": "Sunucu Konumu"
|
||||
|
@ -512,6 +512,7 @@
|
||||
"cpuUsage": "Використання Процесора",
|
||||
"description": "Опис",
|
||||
"errorCalculatingUptime": "Підрахунок помилок аптайму",
|
||||
"loadingMotd": "Завантаження MOTD",
|
||||
"memUsage": "Використання ОПЗ",
|
||||
"offline": "Оффлайн",
|
||||
"online": "Онлайн",
|
||||
@ -578,6 +579,7 @@
|
||||
"serverUpload": "Вивантажити архівований сервер",
|
||||
"serverVersion": "Версія сервера",
|
||||
"sizeInGB": "Об'єм пам'яті в ГБ",
|
||||
"unsupported": "Minecraft версії старіші ніж 1.8, не підтримуються Crafty. Ви все ще можете встановити їх, але результат буде непередбачуваний.",
|
||||
"uploadButton": "Вивантажити",
|
||||
"uploadZip": "Вивантажити архів(.zip) для імпорту сервера",
|
||||
"zipPath": "Шлях архіву сервера"
|
||||
|
@ -95,7 +95,7 @@
|
||||
"lastBackup": "上次:",
|
||||
"max": "最大",
|
||||
"memUsage": "内存使用率",
|
||||
"motd": "今日消息(MOTD)",
|
||||
"motd": "服务器描述(MOTD)",
|
||||
"newServer": "创建新服务器",
|
||||
"nextBackup": "下次:",
|
||||
"no-servers": "当前没有服务器。要开始,请点击",
|
||||
@ -512,6 +512,7 @@
|
||||
"cpuUsage": "CPU 使用率",
|
||||
"description": "简介",
|
||||
"errorCalculatingUptime": "计算正常运行时间时发生错误",
|
||||
"loadingMotd": "正在加载服务器描述(MOTD)",
|
||||
"memUsage": "内存使用率",
|
||||
"offline": "已停止",
|
||||
"online": "运行中",
|
||||
@ -579,6 +580,7 @@
|
||||
"serverUpload": "上传打包为 Zip 文件的服务器",
|
||||
"serverVersion": "服务器版本",
|
||||
"sizeInGB": "大小(以 GB 为单位)",
|
||||
"unsupported": "Crafty 不支持低于 1.8 的 Minecraft 版本。你仍可以安装,但结果无法保证。",
|
||||
"uploadButton": "上传",
|
||||
"uploadZip": "上传 Zip 文件以导入服务器",
|
||||
"zipPath": "服务器路径"
|
||||
|
Loading…
Reference in New Issue
Block a user