show container ID for server in panel
Also shows the UID of the user to ease permissions setting closes #160
This commit is contained in:
parent
2ac734d595
commit
9ae716ee42
|
@ -123,9 +123,7 @@ class ServersController extends Controller
|
|||
{
|
||||
$server = Models\Server::withTrashed()->select(
|
||||
'servers.*',
|
||||
'nodes.name as a_nodeName',
|
||||
'users.email as a_ownerEmail',
|
||||
'locations.long as a_locationName',
|
||||
'services.name as a_serviceName',
|
||||
DB::raw('IFNULL(service_options.executable, services.executable) as a_serviceExecutable'),
|
||||
'service_options.docker_image',
|
||||
|
@ -135,7 +133,6 @@ class ServersController extends Controller
|
|||
'allocations.ip_alias'
|
||||
)->join('nodes', 'servers.node', '=', 'nodes.id')
|
||||
->join('users', 'servers.owner', '=', 'users.id')
|
||||
->join('locations', 'nodes.location', '=', 'locations.id')
|
||||
->join('services', 'servers.service', '=', 'services.id')
|
||||
->join('service_options', 'servers.option', '=', 'service_options.id')
|
||||
->join('allocations', 'servers.allocation', '=', 'allocations.id')
|
||||
|
@ -148,6 +145,12 @@ class ServersController extends Controller
|
|||
|
||||
return view('admin.servers.view', [
|
||||
'server' => $server,
|
||||
'node' => Models\Node::select(
|
||||
'nodes.*',
|
||||
'locations.long as a_locationName'
|
||||
)->join('locations', 'nodes.location', '=', 'locations.id')
|
||||
->where('nodes.id', $server->node)
|
||||
->first(),
|
||||
'assigned' => Models\Allocation::where('assigned_to', $id)->orderBy('ip', 'asc')->orderBy('port', 'asc')->get(),
|
||||
'unassigned' => Models\Allocation::where('node', $server->node)->whereNull('assigned_to')->orderBy('ip', 'asc')->orderBy('port', 'asc')->get(),
|
||||
'startup' => Models\ServiceVariables::select('service_variables.*', 'server_variables.variable_value as a_serverValue')
|
||||
|
|
|
@ -79,17 +79,25 @@
|
|||
<td>UUID</td>
|
||||
<td>{{ $server->uuid }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Docker Container ID</td>
|
||||
<td data-attr="container-id"><i class="fa fa-fw fa-refresh fa-spin"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Docker User ID</td>
|
||||
<td data-attr="container-user"><i class="fa fa-fw fa-refresh fa-spin"></i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Owner</td>
|
||||
<td><a href="{{ route('admin.users.view', $server->owner) }}">{{ $server->a_ownerEmail }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Location</td>
|
||||
<td><a href="{{ route('admin.locations') }}">{{ $server->a_locationName }}</a></td>
|
||||
<td><a href="{{ route('admin.locations') }}">{{ $node->a_locationName }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Node</td>
|
||||
<td><a href="{{ route('admin.nodes.view', $server->node) }}">{{ $server->a_nodeName }}</a></td>
|
||||
<td><a href="{{ route('admin.nodes.view', $server->node) }}">{{ $node->name }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Service</td>
|
||||
|
@ -553,6 +561,27 @@
|
|||
$(document).ready(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('#sidebar_links').find("a[href='/admin/servers']").addClass('active');
|
||||
(function checkServerInfo() {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-Access-Token': '{{ $server->daemonSecret }}',
|
||||
'X-Access-Server': '{{ $server->uuid }}'
|
||||
},
|
||||
url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/server',
|
||||
dataType: 'json',
|
||||
timeout: 5000,
|
||||
}).done(function (data) {
|
||||
$('td[data-attr="container-id"]').html('<code>' + data.container.id + '</code>');
|
||||
$('td[data-attr="container-user"]').html('<code>' + data.user + '</code>');
|
||||
}).fail(function (jqXHR) {
|
||||
$('td[data-attr="container-id"]').html('<code>error</code>');
|
||||
$('td[data-attr="container-user"]').html('<code>error</code>');
|
||||
console.error(jqXHR);
|
||||
}).always(function () {
|
||||
setTimeout(checkServerInfo, 60000);
|
||||
})
|
||||
})();
|
||||
$('input[name="default"]').on('change', function (event) {
|
||||
$('select[name="remove_additional[]"]').find('option:disabled').prop('disabled', false);
|
||||
$('select[name="remove_additional[]"]').find('option[value="' + $(this).val() + '"]').prop('disabled', true).prop('selected', false);
|
||||
|
|
Loading…
Reference in New Issue