mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 09:45:28 +01:00
Merge branch 'enhancement/backup-failure-alert' into 'dev'
Enhancement/backup failure alert See merge request crafty-controller/crafty-4!377
This commit is contained in:
commit
4cef251a1c
@ -12,6 +12,7 @@
|
||||
### Tweaks
|
||||
- Spelling mistake fixed in German lang file ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/370))
|
||||
- Backup failure warning (Tab text goes red) ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/373))
|
||||
- - ([Merge Request 2](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/377))
|
||||
- Rework server list on dashboard display for use on small screens ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/372))
|
||||
- File handling enhancements ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/362))
|
||||
<br><br>
|
||||
|
@ -483,6 +483,14 @@ class PanelHandler(BaseHandler):
|
||||
if str(server_id) not in server_ids[:]:
|
||||
user_order.remove(server_id)
|
||||
page_data["servers"] = page_servers
|
||||
for server in page_data["servers"]:
|
||||
server_obj = self.controller.servers.get_server_instance_by_id(
|
||||
server["server_data"]["server_id"]
|
||||
)
|
||||
alert = False
|
||||
if server_obj.last_backup_status():
|
||||
alert = True
|
||||
server["alert"] = alert
|
||||
|
||||
# num players is set to zero here. If we poll all servers while
|
||||
# dashboard is loading it takes FOREVER. We leave this to the
|
||||
|
@ -154,9 +154,16 @@
|
||||
<tr id="{{server['server_data']['server_id']}}" draggable="true">
|
||||
<td draggable="false">
|
||||
<i class="fas fa-server"></i>
|
||||
{% if server['alert'] %}
|
||||
<a style="color: red !important;" draggable="false"
|
||||
href="/panel/server_detail?id={{server['server_data']['server_id']}}">
|
||||
{{ server['server_data']['server_name'] }} <i class="fas fa-exclamation-triangle"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<a draggable="false" href="/panel/server_detail?id={{server['server_data']['server_id']}}">
|
||||
{{ server['server_data']['server_name'] }}
|
||||
</a>
|
||||
{% end %}
|
||||
</td>
|
||||
|
||||
<td draggable="false" id="controls{{server['server_data']['server_id']}}" class="actions_serverlist">
|
||||
@ -297,23 +304,35 @@
|
||||
<h2 class="mb-0 container overflow-hidden">
|
||||
<div class="row">
|
||||
<div class="col-10 col-lg-3 mx-0 px-0">
|
||||
<a class="btn btn-link d-flex justify-content-start" type="button" href="/panel/server_detail?id={{server['server_data']['server_id']}}">
|
||||
{% if server['alert'] %}
|
||||
<a style="color: red !important" class="btn btn-link d-flex justify-content-start" type="button"
|
||||
href="/panel/server_detail?id={{server['server_data']['server_id']}}">
|
||||
<i class="fas fa-server"></i> {{ server['server_data']['server_name'] }} <i
|
||||
class="fas fa-exclamation-triangle"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<a class="btn btn-link d-flex justify-content-start" type="button"
|
||||
href="/panel/server_detail?id={{server['server_data']['server_id']}}">
|
||||
<i class="fas fa-server"></i> {{ server['server_data']['server_name'] }}
|
||||
</a>
|
||||
{% end %}
|
||||
</div>
|
||||
<div class="col-2 col-lg-3 mx-0 px-0">
|
||||
<a class="btn btn-link d-flex justify-content-center" type="button" data-toggle="collapse" data-target="#collapse-{{server['server_data']['server_id']}}"
|
||||
aria-expanded="false" aria-controls="collapse-{{server['server_data']['server_id']}}">
|
||||
<a class="btn btn-link d-flex justify-content-center" type="button" data-toggle="collapse"
|
||||
data-target="#collapse-{{server['server_data']['server_id']}}" aria-expanded="false"
|
||||
aria-controls="collapse-{{server['server_data']['server_id']}}">
|
||||
<i class="fas fa-chart-bar"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-4 col-lg-3 mx-0 px-0">
|
||||
<a id="m_server_running_status_{{server['server_data']['server_id']}}" class="btn btn-link d-flex justify-content-start" type="button">
|
||||
<a id="m_server_running_status_{{server['server_data']['server_id']}}"
|
||||
class="btn btn-link d-flex justify-content-start" type="button">
|
||||
{% if server['stats']['running'] %}
|
||||
<span class="text-success"><i class="fas fa-signal"></i> {{ translate('dashboard', 'online',
|
||||
data['lang']) }}</span>
|
||||
{% elif server['stats']['crashed'] %}
|
||||
<span class="text-danger"><i class="fas fa-exclamation-triangle"></i> {{ translate('dashboard',
|
||||
<span class="text-danger"><i class="fas fa-exclamation-triangle"></i> {{
|
||||
translate('dashboard',
|
||||
'crashed',
|
||||
data['lang']) }}</span>
|
||||
{% else %}
|
||||
@ -328,19 +347,22 @@
|
||||
{% if server['stats']['running'] %}
|
||||
<div class="row">
|
||||
<div class="col-4 px-0">
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="btn btn-link stop_button actions_serveritem" data-toggle="tooltip"
|
||||
<a data-id="{{server['server_data']['server_id']}}"
|
||||
class="btn btn-link stop_button actions_serveritem" data-toggle="tooltip"
|
||||
title="{{ translate('dashboard', 'stop' , data['lang']) }}">
|
||||
<i class="fas fa-stop"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-4 px-0">
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="btn btn-link restart_button actions_serveritem" data-toggle="tooltip"
|
||||
<a data-id="{{server['server_data']['server_id']}}"
|
||||
class="btn btn-link restart_button actions_serveritem" data-toggle="tooltip"
|
||||
title="{{ translate('dashboard', 'restart' , data['lang']) }}">
|
||||
<i class="fas fa-sync"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-4 px-0">
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="btn btn-link kill_button actions_serveritem" data-toggle="tooltip"
|
||||
<a data-id="{{server['server_data']['server_id']}}"
|
||||
class="btn btn-link kill_button actions_serveritem" data-toggle="tooltip"
|
||||
title="{{ translate('dashboard', 'kill' , data['lang']) }}">
|
||||
<i class="fas fa-skull"></i>
|
||||
</a>
|
||||
@ -350,7 +372,8 @@
|
||||
<!-- WHAT HAPPENED HERE -->
|
||||
<div class="row">
|
||||
<div class="col-12 px-0">
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="btn btn-link">{{ translate('serverTerm', 'updating',
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="btn btn-link">{{
|
||||
translate('serverTerm', 'updating',
|
||||
data['lang']) }}</i></a>
|
||||
</div>
|
||||
</div>
|
||||
@ -366,26 +389,30 @@
|
||||
{% elif server['stats']['downloading']%}
|
||||
<div class="row">
|
||||
<div class="col-12 px-0">
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="btn btn-link"><i class="fa fa-spinner fa-spin"></i>
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="btn btn-link"><i
|
||||
class="fa fa-spinner fa-spin"></i>
|
||||
{{ translate('serverTerm', 'downloading', data['lang']) }}</a>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="row">
|
||||
<div class="col-4 px-0">
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="btn play_button actions_serveritem" data-toggle="tooltip"
|
||||
<a data-id="{{server['server_data']['server_id']}}"
|
||||
class="btn play_button actions_serveritem" data-toggle="tooltip"
|
||||
title="{{ translate('dashboard', 'start' , data['lang']) }}">
|
||||
<i class="fas fa-play"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-4 px-0">
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="btn clone_button actions_serveritem" data-toggle="tooltip"
|
||||
<a data-id="{{server['server_data']['server_id']}}"
|
||||
class="btn clone_button actions_serveritem" data-toggle="tooltip"
|
||||
title="{{ translate('dashboard', 'clone' , data['lang']) }}">
|
||||
<i class="fas fa-clone"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-4 px-0">
|
||||
<a data-id="{{server['server_data']['server_id']}}" class="btn kill_button actions_serveritem" data-toggle="tooltip"
|
||||
<a data-id="{{server['server_data']['server_id']}}"
|
||||
class="btn kill_button actions_serveritem" data-toggle="tooltip"
|
||||
title="{{ translate('dashboard', 'kill' , data['lang']) }}">
|
||||
<i class="fas fa-skull"></i></a>
|
||||
</div>
|
||||
@ -398,7 +425,8 @@
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="collapse-{{server['server_data']['server_id']}}" class="collapse" aria-labelledby="heading-{{server['server_data']['server_id']}}" data-parent="#accordionServers">
|
||||
<div id="collapse-{{server['server_data']['server_id']}}" class="collapse"
|
||||
aria-labelledby="heading-{{server['server_data']['server_id']}}" data-parent="#accordionServers">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
@ -414,8 +442,8 @@
|
||||
{% else %}
|
||||
bg-danger
|
||||
{% end %}
|
||||
" role="progressbar" style="width: {{server['stats']['cpu']}}%" aria-valuenow="0"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
" role="progressbar" style="width: {{server['stats']['cpu']}}%" aria-valuenow="0" aria-valuemin="0"
|
||||
aria-valuemax="100"></div>
|
||||
</div>
|
||||
{{server['stats']['cpu']}}%
|
||||
</div>
|
||||
|
@ -15,8 +15,12 @@
|
||||
<a class="dropdown-item {% if data['active_link'] == 'schedules' %}active{% end %}" href="/panel/server_detail?id={{ data['server_stats']['server_id']['server_id'] }}&subpage=schedules" role="tab" aria-selected="false"><i class="fas fa-clock"></i> {{ translate('serverDetails', 'schedule', data['lang']) }}</a>
|
||||
{% end %}
|
||||
{% if data['permissions']['Backup'] in data['user_permissions'] %}
|
||||
{% if data['backup_failed'] %}
|
||||
<a style="color: red !important;" class="dropdown-item {% if data['active_link'] == 'backup' %}active{% end %}" href="/panel/server_detail?id={{ data['server_stats']['server_id']['server_id'] }}&subpage=backup" role="tab" aria-selected="false"><i class="fas fa-save"></i> {{ translate('serverDetails', 'backup', data['lang']) }} <i class="fas fa-exclamation-triangle"> </i></a>
|
||||
{% else %}
|
||||
<a class="dropdown-item {% if data['active_link'] == 'backup' %}active{% end %}" href="/panel/server_detail?id={{ data['server_stats']['server_id']['server_id'] }}&subpage=backup" role="tab" aria-selected="false"><i class="fas fa-save"></i> {{ translate('serverDetails', 'backup', data['lang']) }}</a>
|
||||
{% end %}
|
||||
{% end %}
|
||||
{% if data['permissions']['Files'] in data['user_permissions'] %}
|
||||
<a class="dropdown-item {% if data['active_link'] == 'files' %}active{% end %}" href="/panel/server_detail?id={{ data['server_stats']['server_id']['server_id'] }}&subpage=files" role="tab" aria-selected="false"><i class="fas fa-folder-tree"></i> {{ translate('serverDetails', 'files', data['lang']) }}</a>
|
||||
{% end %}
|
||||
|
@ -32,7 +32,12 @@
|
||||
<div class="col-sm-12 grid-margin">
|
||||
<div class="card">
|
||||
<div class="card-body pt-0">
|
||||
{% include "parts/server_controls_list.html" %}
|
||||
<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="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
@ -82,7 +87,8 @@
|
||||
{% if data['server_stats']['server_type'] == "minecraft-java" %}
|
||||
<div class="form-group">
|
||||
<label for="java_selection">{{ translate('serverConfig', 'javaVersion', data['lang']) }}
|
||||
<small class="text-muted ml-1">{{ translate('serverConfig', 'javaVersionDesc', data['lang']) }}</small>
|
||||
<small class="text-muted ml-1">{{ translate('serverConfig', 'javaVersionDesc', data['lang'])
|
||||
}}</small>
|
||||
</label>
|
||||
<select class="form-select form-control form-control-lg select-css" id="java_selection"
|
||||
name="java_selection" form="config_form">
|
||||
|
@ -32,7 +32,12 @@
|
||||
<div class="col-sm-12 grid-margin">
|
||||
<div class="card">
|
||||
<div class="card-body pt-0">
|
||||
{% include "parts/server_controls_list.html" %}
|
||||
<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="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
@ -212,7 +217,9 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
html, body, body > .container-scroller {
|
||||
html,
|
||||
body,
|
||||
body>.container-scroller {
|
||||
overflow: initial;
|
||||
}
|
||||
|
||||
@ -285,7 +292,7 @@
|
||||
mac: 'Command-S',
|
||||
sender: 'editor|cli'
|
||||
},
|
||||
exec: function(env, args, request) {
|
||||
exec: function (env, args, request) {
|
||||
save()
|
||||
}
|
||||
});
|
||||
@ -1097,7 +1104,7 @@
|
||||
if (handlerName == 'null') handlerName = null;
|
||||
editor.setKeyboardHandler(handlerName, () => {
|
||||
if (handlerName == 'ace/keyboard/vim') {
|
||||
require("ace/keyboard/vim").Vim.defineEx('write', 'w', function() {
|
||||
require("ace/keyboard/vim").Vim.defineEx('write', 'w', function () {
|
||||
save();
|
||||
});
|
||||
}
|
||||
|
@ -14,7 +14,8 @@
|
||||
<div class="col-12">
|
||||
<div class="page-header">
|
||||
<h4 class="page-title">
|
||||
{{ translate('serverDetails', 'serverDetails', data['lang']) }} - {{ data['server_stats']['server_id']['server_name'] }}
|
||||
{{ translate('serverDetails', 'serverDetails', data['lang']) }} - {{
|
||||
data['server_stats']['server_id']['server_name'] }}
|
||||
<br />
|
||||
<small>UUID: {{ data['server_stats']['server_id']['server_uuid'] }}</small>
|
||||
</h4>
|
||||
@ -31,11 +32,18 @@
|
||||
<div class="col-sm-12 grid-margin">
|
||||
<div class="card">
|
||||
<div class="card-body pt-0">
|
||||
{% include "parts/server_controls_list.html" %}
|
||||
<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 #383e5d; background-color:#2a2c44;height:500px; overflow: scroll;"></div>
|
||||
<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 />
|
||||
|
||||
@ -57,8 +65,8 @@
|
||||
<script>
|
||||
|
||||
const serverId = new URLSearchParams(document.location.search).get('id')
|
||||
function get_server_log(){
|
||||
if( !$("#stop_scroll").is(':checked')){
|
||||
function get_server_log() {
|
||||
if (!$("#stop_scroll").is(':checked')) {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/ajax/server_log?id=' + serverId + '&full=1',
|
||||
@ -78,17 +86,17 @@
|
||||
return r ? r[1] : undefined;
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
console.log( "ready!" );
|
||||
$(document).ready(function () {
|
||||
console.log("ready!");
|
||||
get_server_log()
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function scroll(){
|
||||
function scroll() {
|
||||
var logview = $('#virt_console');
|
||||
if(logview.length)
|
||||
if (logview.length)
|
||||
logview.scrollTop(logview[0].scrollHeight - logview.height());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user