Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/resources/views/admin/nodes/index.blade.php
7460 views
1
@extends('layouts.admin')
2
3
@section('title')
4
List Nodes
5
@endsection
6
7
@section('scripts')
8
@parent
9
{!! Theme::css('vendor/fontawesome/animation.min.css') !!}
10
@endsection
11
12
@section('content-header')
13
<h1>Nodes<small>All nodes available on the system.</small></h1>
14
<ol class="breadcrumb">
15
<li><a href="{{ route('admin.index') }}">Admin</a></li>
16
<li class="active">Nodes</li>
17
</ol>
18
@endsection
19
20
@section('content')
21
<div class="row">
22
<div class="col-xs-12">
23
<div class="box box-primary">
24
<div class="box-header with-border">
25
<h3 class="box-title">Node List</h3>
26
<div class="box-tools search01">
27
<form action="{{ route('admin.nodes') }}" method="GET">
28
<div class="input-group input-group-sm">
29
<input type="text" name="filter[name]" class="form-control pull-right" value="{{ request()->input('filter.name') }}" placeholder="Search Nodes">
30
<div class="input-group-btn">
31
<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
32
<a href="{{ route('admin.nodes.new') }}"><button type="button" class="btn btn-sm btn-primary" style="border-radius: 0 3px 3px 0;margin-left:-1px;">Create New</button></a>
33
</div>
34
</div>
35
</form>
36
</div>
37
</div>
38
<div class="box-body table-responsive no-padding">
39
<table class="table table-hover">
40
<tbody>
41
<tr>
42
<th></th>
43
<th>Name</th>
44
<th>Location</th>
45
<th>Memory</th>
46
<th>Disk</th>
47
<th class="text-center">Servers</th>
48
<th class="text-center">SSL</th>
49
<th class="text-center">Public</th>
50
</tr>
51
@foreach ($nodes as $node)
52
<tr>
53
<td class="text-center text-muted left-icon" data-action="ping" data-secret="{{ $node->getDecryptedKey() }}" data-location="{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/api/system"><i class="fa fa-fw fa-refresh fa-spin"></i></td>
54
<td>{!! $node->maintenance_mode ? '<span class="label label-warning"><i class="fa fa-wrench"></i></span> ' : '' !!}<a href="{{ route('admin.nodes.view', $node->id) }}">{{ $node->name }}</a></td>
55
<td>{{ $node->location->short }}</td>
56
<td>{{ $node->memory }} MiB</td>
57
<td>{{ $node->disk }} MiB</td>
58
<td class="text-center">{{ $node->servers_count }}</td>
59
<td class="text-center" style="color:{{ ($node->scheme === 'https') ? '#50af51' : '#d9534f' }}"><i class="fa fa-{{ ($node->scheme === 'https') ? 'lock' : 'unlock' }}"></i></td>
60
<td class="text-center"><i class="fa fa-{{ ($node->public) ? 'eye' : 'eye-slash' }}"></i></td>
61
</tr>
62
@endforeach
63
</tbody>
64
</table>
65
</div>
66
@if($nodes->hasPages())
67
<div class="box-footer with-border">
68
<div class="col-md-12 text-center">{!! $nodes->appends(['query' => Request::input('query')])->render() !!}</div>
69
</div>
70
@endif
71
</div>
72
</div>
73
</div>
74
@endsection
75
76
@section('footer-scripts')
77
@parent
78
<script>
79
(function pingNodes() {
80
$('td[data-action="ping"]').each(function(i, element) {
81
$.ajax({
82
type: 'GET',
83
url: $(element).data('location'),
84
headers: {
85
'Authorization': 'Bearer ' + $(element).data('secret'),
86
},
87
timeout: 5000
88
}).done(function (data) {
89
$(element).find('i').tooltip({
90
title: 'v' + data.version,
91
});
92
$(element).removeClass('text-muted').find('i').removeClass().addClass('fa fa-fw fa-heartbeat faa-pulse animated').css('color', '#50af51');
93
}).fail(function (error) {
94
var errorText = 'Error connecting to node! Check browser console for details.';
95
try {
96
errorText = error.responseJSON.errors[0].detail || errorText;
97
} catch (ex) {}
98
99
$(element).removeClass('text-muted').find('i').removeClass().addClass('fa fa-fw fa-heart-o').css('color', '#d9534f');
100
$(element).find('i').tooltip({ title: errorText });
101
});
102
}).promise().done(function () {
103
setTimeout(pingNodes, 10000);
104
});
105
})();
106
</script>
107
@endsection
108
109