Add some quick daemon information when viewing nodes

This commit is contained in:
Dane Everitt 2016-11-26 18:23:10 -05:00
parent d93f88f471
commit edaae40df9
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 50 additions and 17 deletions

View file

@ -69,6 +69,18 @@
<div class="panel-body">
<table class="table table-striped" style="margin-bottom:0;">
<tbody>
<tr>
<td>Daemon Version</td>
<td><code data-attr="info-version"><i class="fa fa-refresh fa-fw fa-spin"></i></code></td>
</tr>
<tr>
<td>System Information</td>
<td data-attr="info-system"><i class="fa fa-refresh fa-fw fa-spin"></i></td>
</tr>
<tr>
<td>Total CPU Cores</td>
<td data-attr="info-cpus"><i class="fa fa-refresh fa-fw fa-spin"></i></td>
</tr>
<tr>
<td>Total Servers</td>
<td>{{ count($servers) }}</td>
@ -777,6 +789,24 @@ $(document).ready(function () {
element.parent().removeClass('has-error has-success');
}
(function getInformation() {
$.ajax({
method: 'GET',
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}',
timeout: 5000,
headers: {
'X-Access-Token': '{{ $node->daemonSecret }}'
},
}).done(function (data) {
$('[data-attr="info-version"]').html(data.version);
$('[data-attr="info-system"]').html(data.system.type + '(' + data.system.arch + ') <code>' + data.system.release + '</code>');
$('[data-attr="info-cpus"]').html(data.system.cpus);
}).fail(function (jqXHR) {
}).always(function() {
setTimeout(getInformation, 10000);
});
})();
});
</script>
@endsection