2021-03-05 08:58:38 +00:00
|
|
|
{% extends ../base.html %}
|
|
|
|
|
|
|
|
{% block meta %}
|
|
|
|
<!-- <meta http-equiv="refresh" content="60">-->
|
|
|
|
{% end %}
|
|
|
|
|
2021-03-26 13:57:50 +00:00
|
|
|
{% block title %}Crafty Controller - {{ translate('serverDetails', 'serverDetails') }}{% end %}
|
2021-03-05 08:58:38 +00:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
<div class="content-wrapper">
|
|
|
|
|
|
|
|
<!-- Page Title Header Starts-->
|
|
|
|
<div class="row page-title-header">
|
|
|
|
<div class="col-12">
|
|
|
|
<div class="page-header">
|
|
|
|
<h4 class="page-title">
|
2021-03-26 13:57:50 +00:00
|
|
|
{{ translate('serverDetails', 'serverDetails') }} - {{ data['server_stats']['server_id']['server_name'] }}
|
2021-03-05 08:58:38 +00:00
|
|
|
<br />
|
2021-03-22 04:02:18 +00:00
|
|
|
<small>UUID: {{ data['server_stats']['server_id']['server_uuid'] }}</small>
|
2021-03-05 08:58:38 +00:00
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!-- Page Title Header Ends-->
|
|
|
|
|
|
|
|
{% include "parts/details_stats.html %}
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-sm-12 grid-margin">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-body pt-0">
|
|
|
|
<ul class="nav nav-tabs col-md-12 tab-simple-styled " role="tablist">
|
2021-04-04 18:34:14 +00:00
|
|
|
<li class="nav-item term-nav-item">
|
2021-03-22 04:02:18 +00:00
|
|
|
<a class="nav-link" href="/panel/server_detail?id={{ data['server_stats']['server_id']['server_id'] }}&subpage=term" role="tab" aria-selected="false">
|
2021-03-26 13:57:50 +00:00
|
|
|
<i class="fas fa-file-signature"></i>{{ translate('serverDetails', 'terminal') }}</a>
|
2021-03-05 08:58:38 +00:00
|
|
|
</li>
|
2021-04-04 18:34:14 +00:00
|
|
|
<li class="nav-item term-nav-item">
|
2021-03-22 04:02:18 +00:00
|
|
|
<a class="nav-link" href="/panel/server_detail?id={{ data['server_stats']['server_id']['server_id'] }}&subpage=logs" role="tab" aria-selected="false">
|
2021-03-26 13:57:50 +00:00
|
|
|
<i class="fas fa-file-signature"></i>{{ translate('serverDetails', 'logs') }}</a>
|
2021-03-05 08:58:38 +00:00
|
|
|
</li>
|
2021-04-04 18:34:14 +00:00
|
|
|
<li class="nav-item term-nav-item">
|
2021-03-22 04:02:18 +00:00
|
|
|
<a class="nav-link" href="/panel/server_detail?id={{ data['server_stats']['server_id']['server_id'] }}&subpage=tasks" role="tab" aria-selected="false">
|
2021-03-26 13:57:50 +00:00
|
|
|
<i class="fas fa-clock"></i>{{ translate('serverDetails', 'schedule') }}</a>
|
2021-03-05 08:58:38 +00:00
|
|
|
</li>
|
2021-04-04 18:34:14 +00:00
|
|
|
<li class="nav-item term-nav-item">
|
2021-03-22 04:02:18 +00:00
|
|
|
<a class="nav-link" href="/panel/server_detail?id={{ data['server_stats']['server_id']['server_id'] }}&subpage=backup" role="tab" aria-selected="false">
|
2021-03-26 13:57:50 +00:00
|
|
|
<i class="fas fa-save"></i>{{ translate('serverDetails', 'backup') }}</a>
|
2021-03-05 08:58:38 +00:00
|
|
|
</li>
|
2021-04-04 18:34:14 +00:00
|
|
|
<li class="nav-item term-nav-item">
|
2021-03-22 04:02:18 +00:00
|
|
|
<a class="nav-link" href="/panel/server_detail?id={{ data['server_stats']['server_id']['server_id'] }}&subpage=files" role="tab" aria-selected="false">
|
2021-03-26 13:57:50 +00:00
|
|
|
<i class="fas fa-folder-tree"></i>{{ translate('serverDetails', 'files') }}</a>
|
2021-03-05 08:58:38 +00:00
|
|
|
</li>
|
2021-04-04 18:34:14 +00:00
|
|
|
<li class="nav-item term-nav-item">
|
2021-03-22 04:02:18 +00:00
|
|
|
<a class="nav-link" href="/panel/server_detail?id={{ data['server_stats']['server_id']['server_id'] }}&subpage=config" role="tab" aria-selected="true">
|
2021-03-26 13:57:50 +00:00
|
|
|
<i class="fas fa-cogs"></i>{{ translate('serverDetails', 'config') }}</a>
|
2021-03-05 08:58:38 +00:00
|
|
|
</li>
|
2021-04-04 18:34:14 +00:00
|
|
|
<li class="nav-item term-nav-item">
|
2021-03-22 04:02:18 +00:00
|
|
|
<a class="nav-link active" href="/panel/server_detail?id={{ data['server_stats']['server_id']['server_id'] }}&subpage=admin_controls" role="tab" aria-selected="true">
|
2021-03-26 13:57:50 +00:00
|
|
|
<i class="fas fa-users"></i>{{ translate('serverDetails', 'playerControls') }}</a>
|
2021-03-05 08:58:38 +00:00
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6 col-sm-12">
|
|
|
|
<style>
|
|
|
|
.playerItem {
|
|
|
|
background: #1c1e2f;
|
|
|
|
padding: 1rem;
|
|
|
|
display: flex;
|
|
|
|
flex-flow: row wrap;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
margin: 1rem 0px 1rem 0px;
|
|
|
|
}
|
|
|
|
.playerItem h3 {
|
|
|
|
vertical-align: middle;
|
|
|
|
padding: 0px;
|
|
|
|
margin: 0px;
|
|
|
|
margin-right: 1.5rem;
|
|
|
|
}
|
|
|
|
.playerItem button {
|
|
|
|
vertical-align: middle;
|
|
|
|
margin: 0.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.playerUnban {
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.banned span {
|
|
|
|
font-size: 1.1rem;
|
|
|
|
}
|
|
|
|
</style>
|
2021-03-26 13:57:50 +00:00
|
|
|
<h2>{{ translate('serverPlayerManagement', 'players') }}:</h2>
|
2021-03-05 08:58:38 +00:00
|
|
|
<ul style="list-style: none;padding: 0px;margin: 0px; margin-bottom: 1rem;gap: 1rem;">
|
|
|
|
{% for player in data['get_players']() %}
|
|
|
|
<li class="playerItem">
|
|
|
|
<h3>{{ player }}</h3>
|
|
|
|
<div class="buttons">
|
|
|
|
<button onclick="send_command_to_server('ban {{ player }}')" type="button" class="btn btn-danger">Ban</button>
|
|
|
|
<button onclick="send_command_to_server('kick {{ player }}')" type="button" class="btn btn-outline-danger">Kick</button>
|
|
|
|
<button onclick="send_command_to_server('op {{ player }}')" type="button" class="btn btn-warning">OP</button>
|
|
|
|
<button onclick="send_command_to_server('deop {{ player }}')" type="button" class="btn btn-outline-warning">De-OP</button>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
{% end %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6 col-sm-12">
|
2021-03-26 13:57:50 +00:00
|
|
|
<h2>{{ translate('serverPlayerManagement', 'bannedPlayers') }}:</h2>
|
2021-03-05 08:58:38 +00:00
|
|
|
<ul id="bannedPlayers" style="list-style: none;padding: 0px;margin: 0px; margin-bottom: 1rem;gap: 1rem;">
|
|
|
|
<li class="playerItem banned">
|
2021-03-26 13:57:50 +00:00
|
|
|
<h3>{{ translate('serverPlayerManagement', 'loadingBannedPlayers') }}</h3>
|
2021-03-05 08:58:38 +00:00
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!-- content-wrapper ends -->
|
|
|
|
|
|
|
|
{% end %}
|
|
|
|
|
|
|
|
{% block js %}
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
|
|
//used to get cookies from browser - this is part of tornados xsrf protection - it's for extra security
|
|
|
|
function getCookie(name) {
|
|
|
|
var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");
|
|
|
|
return r ? r[1] : undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
function htmlDecode(input){
|
|
|
|
var e = document.createElement('textarea');
|
|
|
|
e.innerHTML = input;
|
|
|
|
// handle case of empty input
|
|
|
|
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$( document ).ready(function() {
|
|
|
|
console.log( "ready!" );
|
|
|
|
|
|
|
|
var bannedPlayers = `{{ data['banned_players'] }}`;
|
|
|
|
|
|
|
|
var bannedPlayersDecoded = htmlDecode(bannedPlayers);
|
|
|
|
|
|
|
|
$("#bannedPlayers").html(bannedPlayersDecoded)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
function send_command_to_server (command) {
|
|
|
|
console.log(command)
|
|
|
|
var token = getCookie("_xsrf")
|
|
|
|
console.log('sending command: ' + command)
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
headers: {'X-XSRFToken': token},
|
|
|
|
url: '/ajax/send_command?id=1',
|
|
|
|
data: { command },
|
|
|
|
success: function(data){
|
|
|
|
console.log("got response:");
|
|
|
|
console.log(data);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{% end %}
|