crafty-4/app/frontend/templates/panel/server_logs.html

106 lines
2.5 KiB
HTML
Raw Normal View History

{% extends ../base.html %}
{% block meta %}
{% end %}
{% block title %}Crafty Controller - {{ translate('serverDetails', 'serverDetails', data['lang']) }}{% end %}
{% block content %}
<div class="content-wrapper">
2022-06-21 19:59:34 +00:00
<!-- Page Title Header Starts-->
<div class="row page-title-header">
<div class="col-12">
<div class="page-header">
<h4 class="page-title">
2022-06-21 19:59:34 +00:00
{{ translate('serverDetails', 'serverDetails', data['lang']) }} - {{
data['server_stats']['server_id']['server_name'] }}
<br />
<small>UUID: {{ data['server_stats']['server_id']['server_uuid'] }}</small>
</h4>
</div>
</div>
</div>
<!-- Page Title Header Ends-->
2022-06-21 19:59:34 +00:00
{% include "parts/details_stats.html" %}
<div class="row">
<div class="col-sm-12 grid-margin">
<div class="card">
<div class="card-body pt-0">
2022-06-21 19:59:34 +00:00
<span class="d-none d-sm-block">
{% include "parts/server_controls_list.html %}
</span>
<span class="d-block d-sm-none">
{% include "parts/m_server_controls_list.html %}
</span>
<div class="col-md-12">
<div class="input-group">
<div id="virt_console" class=""
style="font-size: .8em; padding: 5px 10px; border: 1px solid var(--outline); background-color:var(--card-banner-bg);height:500px; overflow: scroll;">
</div>
2022-06-21 19:59:34 +00:00
</div>
<br />
2022-06-21 19:59:34 +00:00
</div>
</div>
</div>
</div>
</div>
</div>
<!-- content-wrapper ends -->
{% end %}
{% block js %}
<script>
const serverId = new URLSearchParams(document.location.search).get('id')
2022-06-21 19:59:34 +00:00
function get_server_log() {
if (!$("#stop_scroll").is(':checked')) {
$.ajax({
type: 'GET',
url: '/ajax/server_log?id=' + serverId + '&full=1',
dataType: 'text',
success: function (data) {
console.log('Got Log From Server')
$('#virt_console').html(data);
scroll();
},
});
}
}
//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;
}
2022-06-21 19:59:34 +00:00
$(document).ready(function () {
console.log("ready!");
get_server_log()
});
2022-06-21 19:59:34 +00:00
function scroll() {
var logview = $('#virt_console');
2022-06-21 19:59:34 +00:00
if (logview.length)
logview.scrollTop(logview[0].scrollHeight - logview.height());
}
</script>
2022-06-21 19:59:34 +00:00
{% end %}