forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.blade.php
More file actions
98 lines (86 loc) · 3.83 KB
/
index.blade.php
File metadata and controls
98 lines (86 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@extends('layouts.master')
@section('title', 'Your Servers')
@section('sidebar-server')
@endsection
@section('content')
<div class="col-md-9">
@foreach (Alert::getMessages() as $type => $messages)
@foreach ($messages as $message)
<div class="alert alert-{{ $type }} alert-dismissable" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
{{ $message }}
</div>
@endforeach
@endforeach
@if (Auth::user()->root_admin == 1)
<div class="alert alert-info">{{ trans('base.view_as_admin') }}</div>
@endif
@if (!$servers->isEmpty())
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
@if (Auth::user()->root_admin == 1)
<th></th>
@endif
<th>{{ trans('base.server_name') }}</th>
<th>{{ trans('strings.location') }}</th>
<th>{{ trans('strings.node') }}</th>
<th>{{ trans('strings.connection') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach ($servers as $server)
<tr class="dynUpdate" id="{{ $server->uuidShort }}">
@if (Auth::user()->root_admin == 1)
<td style="width:26px;">
@if ($server->owner === Auth::user()->id)
<i class="fa fa-circle" style="color:#008cba;"></i>
@else
<i class="fa fa-circle" style="color:#ddd;"></i>
@endif
</td>
@endif
<td><a href="/server/{{ $server->uuidShort }}">{{ $server->name }}</a></td>
<td>{{ $server->location }}</td>
<td>{{ $server->nodeName }}</td>
<td><code>{{ $server->ip }}:{{ $server->port }}</code></td>
<td style="width:26px;"><i class="fa fa-circle-o-notch fa-spinner fa-spin applyUpdate"></i></td>
</tr>
@endforeach
</tbody>
</table>
@else
<div class="alert alert-info">{{ trans('base.no_servers') }}</div>
@endif
</div>
<script>
$(window).load(function () {
$('#sidebar_links').find('a[href=\'/\']').addClass('active');
function updateServerStatus () {
$('.dynUpdate').each(function (index, data) {
var element = $(this);
var serverShortUUID = $(this).attr('id');
var updateElement = $(this).find('.applyUpdate');
updateElement.removeClass('fa-check-circle fa-times-circle').css({ color: '#000' });
updateElement.addClass('fa-circle-o-notch fa-spinner fa-spin');
$.ajax({
type: 'GET',
url: '/server/' + serverShortUUID + '/ajax/status',
timeout: 10000
}).done(function (data) {
var selector = (data == 'true') ? 'fa-check-circle' : 'fa-times-circle';
var selectorColor = (data == 'true') ? 'rgb(83, 179, 12)' : 'rgb(227, 50, 0)';
updateElement.removeClass('fa-circle-o-notch fa-spinner fa-spin');
updateElement.addClass(selector).css({ color: selectorColor });
}).fail(function (jqXHR) {
updateElement.removeClass('fa-circle-o-notch fa-spinner fa-spin');
updateElement.addClass('fa-question-circle').css({ color: 'rgb(227, 50, 0)' });
});
});
}
updateServerStatus();
setInterval(updateServerStatus, 30000);
});
</script>
@endsection