node status in list, closes #124

This commit is contained in:
Dane Everitt 2016-10-07 15:15:04 -04:00
parent 06422b2055
commit 0fe0f750c4
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
5 changed files with 45 additions and 7 deletions

View file

@ -11,6 +11,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
* Support for setting custom `user_id` when using the API to create users. * Support for setting custom `user_id` when using the API to create users.
* Support for creating a new server through the API by passing a user ID rather than an email. * Support for creating a new server through the API by passing a user ID rather than an email.
* Passing `?daemon=true` flag to [`/api/servers/:id`](https://pterodactyl.readme.io/v0.5.0/reference#single-server) will return the daemon stats as well as the `daemon_token` if using HTTPS. * Passing `?daemon=true` flag to [`/api/servers/:id`](https://pterodactyl.readme.io/v0.5.0/reference#single-server) will return the daemon stats as well as the `daemon_token` if using HTTPS.
* Small check for current node status that shows up to the left of the name when viewing a listing of all nodes.
### Changed ### Changed
* Support for sub-folders within the `getJavascript()` route for servers. * Support for sub-folders within the `getJavascript()` route for servers.

View file

@ -44,6 +44,8 @@ D3.js - [license](https://github.com/mbostock/d3/blob/master/LICENSE) - [homepag
FontAwesome - [license](http://fontawesome.io/license/) - [homepage](http://fontawesome.io) FontAwesome - [license](http://fontawesome.io/license/) - [homepage](http://fontawesome.io)
FontAwesome Animations - [license](https://github.com/l-lin/font-awesome-animation#license) - [homepage](https://github.com/l-lin/font-awesome-animation)
FuelUX - [license](https://github.com/ExactTarget/fuelux/blob/master/LICENSE) - [homepage](http://getfuelux.com) FuelUX - [license](https://github.com/ExactTarget/fuelux/blob/master/LICENSE) - [homepage](http://getfuelux.com)
jQuery - [license](https://github.com/jquery/jquery/blob/master/LICENSE.txt) - [homepage](http://jquery.com) jQuery - [license](https://github.com/jquery/jquery/blob/master/LICENSE.txt) - [homepage](http://jquery.com)

File diff suppressed because one or more lines are too long

View file

@ -254,3 +254,12 @@ li.btn.btn-default.pill:active,li.btn.btn-default.pill:focus,li.btn.btn-default.
#fileOptionMenu > li.bg-default > a { #fileOptionMenu > li.bg-default > a {
padding-left: 5px !important; padding-left: 5px !important;
} }
.left-icon {
padding: 8px 2px !important;
border-right: 0 !important;
}
.left-icon + td {
border-left: 0px !important;
}

View file

@ -23,6 +23,11 @@
Node List Node List
@endsection @endsection
@section('scripts')
@parent
{!! Theme::css('css/vendor/fontawesome/animation.min.css') !!}
@endsection
@section('content') @section('content')
<div class="col-md-12"> <div class="col-md-12">
<ul class="breadcrumb"> <ul class="breadcrumb">
@ -33,27 +38,27 @@
<table class="table table-bordered table-hover"> <table class="table table-bordered table-hover">
<thead> <thead>
<tr> <tr>
<th></th>
<th>Name</th> <th>Name</th>
<th class="visible-lg">Location</th> <th>Location</th>
<th>FQDN</th>
<th class="hidden-xs">Memory</th> <th class="hidden-xs">Memory</th>
<th class="hidden-xs">Disk</th> <th class="hidden-xs">Disk</th>
<th class="text-center hidden-xs">Servers</th> <th class="text-center hidden-xs">Servers</th>
<th class="text-center">HTTPS</th> <th class="text-center">SSL</th>
<th class="text-center">Public</th> <th class="text-center hidden-xs">Public</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach ($nodes as $node) @foreach ($nodes as $node)
<tr> <tr>
<td class="text-center text-muted left-icon" data-action="ping" data-location="{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}"><i class="fa fa-fw fa-refresh fa-spin"></i></td>
<td><a href="/admin/nodes/view/{{ $node->id }}">{{ $node->name }}</td> <td><a href="/admin/nodes/view/{{ $node->id }}">{{ $node->name }}</td>
<td class="visible-lg">{{ $node->a_locationName }}</td> <td>{{ $node->a_locationName }}</td>
<td><code>{{ $node->fqdn }}</code></td>
<td class="hidden-xs">{{ $node->memory }} MB</td> <td class="hidden-xs">{{ $node->memory }} MB</td>
<td class="hidden-xs">{{ $node->disk }} MB</td> <td class="hidden-xs">{{ $node->disk }} MB</td>
<td class="text-center hidden-xs">{{ $node->a_serverCount }}</td> <td class="text-center hidden-xs">{{ $node->a_serverCount }}</td>
<td class="text-center" style="color:{{ ($node->scheme === 'https') ? '#50af51' : '#d9534f' }}"><i class="fa fa-{{ ($node->scheme === 'https') ? 'lock' : 'unlock' }}"></i></td> <td class="text-center" style="color:{{ ($node->scheme === 'https') ? '#50af51' : '#d9534f' }}"><i class="fa fa-{{ ($node->scheme === 'https') ? 'lock' : 'unlock' }}"></i></td>
<td class="text-center"><i class="fa fa-{{ ($node->public === 1) ? 'check' : 'times' }}"></i></td> <td class="text-center hidden-xs"><i class="fa fa-{{ ($node->public === 1) ? 'eye' : 'eye-slash' }}"></i></td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
@ -65,6 +70,21 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$('#sidebar_links').find("a[href='/admin/nodes']").addClass('active'); $('#sidebar_links').find("a[href='/admin/nodes']").addClass('active');
pingNodes();
setInterval(pingNodes, 10000);
}); });
function pingNodes() {
$('td[data-action="ping"]').each(function(i, element) {
elem = $(this);
$.ajax({
type: 'GET',
url: elem.data('location'),
}).done(function (data) {
elem.removeClass('text-muted').find('i').removeClass().addClass('fa fa-fw fa-heartbeat faa-pulse animated').css('color', '#50af51');
}).fail(function () {
elem.removeClass('text-muted').find('i').removeClass().addClass('fa fa-fw fa-heart-o').css('color', '#d9534f');
});
});
}
</script> </script>
@endsection @endsection