mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
124 lines
4.0 KiB
HTML
124 lines
4.0 KiB
HTML
{% extends ../base.html %}
|
|
|
|
{% block meta %}
|
|
<!-- <meta http-equiv="refresh" content="60">-->
|
|
{% end %}
|
|
|
|
{% block title %}Crafty Controller - Server Details{% end %}
|
|
|
|
{% 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">
|
|
Server Details - {{ data['server_stats'][0]['server_id']['server_name'] }}
|
|
<br />
|
|
<small>UUID: {{ data['server_stats'][0]['server_id']['server_uuid'] }}</small>
|
|
</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">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/panel/server_detail?id={{ data['server_stats'][0]['server_id']['server_id'] }}&subpage=term" role="tab" aria-selected="false">
|
|
<i class="fas fa-terminal"></i>Terminal</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link active" href="/panel/server_detail?id={{ data['server_stats'][0]['server_id']['server_id'] }}&subpage=logs" role="tab" aria-selected="true">
|
|
<i class="fas fa-file-signature"></i>Logs</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/panel/server_detail?id={{ data['server_stats'][0]['server_id']['server_id'] }}&subpage=tasks" role="tab" aria-selected="false">
|
|
<i class="fas fa-clock"></i>Schedule</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/panel/server_detail?id={{ data['server_stats'][0]['server_id']['server_id'] }}&subpage=backup" role="tab" aria-selected="false">
|
|
<i class="fas fa-save"></i>Backup</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/panel/server_detail?id={{ data['server_stats'][0]['server_id']['server_id'] }}&subpage=files" role="tab" aria-selected="false">
|
|
<i class="fas fa-folder-tree"></i>Files</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/panel/server_detail?id={{ data['server_stats'][0]['server_id']['server_id'] }}&subpage=config" role="tab" aria-selected="false">
|
|
<i class="fas fa-cogs"></i>Config</a>
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div class="col-md-12">
|
|
<div class="input-group">
|
|
<div id="virt_console" class="" style="font-size: .8em; padding: 5px 10px; border: 1px solid #383e5d; background-color:#2a2c44;height:500px; overflow: scroll;"></div>
|
|
</div>
|
|
<br />
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<!-- content-wrapper ends -->
|
|
|
|
{% end %}
|
|
|
|
{% block js %}
|
|
<script>
|
|
function get_server_log(){
|
|
if( !$("#stop_scroll").is(':checked')){
|
|
$.ajax({
|
|
type: 'GET',
|
|
url: '/ajax/server_log?id={{ data['server_stats'][0]['server_id']['server_id'] }}&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;
|
|
}
|
|
|
|
$( document ).ready(function() {
|
|
console.log( "ready!" );
|
|
get_server_log()
|
|
|
|
|
|
});
|
|
|
|
|
|
function scroll(){
|
|
var logview = $('#virt_console');
|
|
if(logview.length)
|
|
logview.scrollTop(logview[0].scrollHeight - logview.height());
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
{% end %} |