Added Disk to overview (issue:1547) (#1569)

This commit is contained in:
AreYouScared 2019-07-26 11:14:27 -04:00 committed by Dane Everitt
parent 4f54b18ce1
commit c68ca0c773
5 changed files with 13 additions and 6 deletions

View file

@ -101,11 +101,13 @@
currentCpu = parseFloat(((info.proc.cpu.total / cpuMax) * 100).toFixed(2).toString());
}
element.find('[data-action="memory"]').html(parseInt(info.proc.memory.total / (1024 * 1024)));
element.find('[data-action="disk"]').html(parseInt(info.proc.disk.used));
element.find('[data-action="cpu"]').html(currentCpu);
} else {
element.find('[data-action="memory"]').html('--');
element.find('[data-action="disk"]').html('--');
element.find('[data-action="cpu"]').html('--');
}
});
});
})();
})();

View file

@ -74,9 +74,11 @@
}
element.find('[data-action="memory"]').html(parseInt(data.proc.memory.total / (1024 * 1024)));
element.find('[data-action="cpu"]').html(currentCpu);
element.find('[data-action="disk"]').html(parseInt(data.proc.disk.used));
} else {
element.find('[data-action="memory"]').html('--');
element.find('[data-action="cpu"]').html('--');
element.find('[data-action="disk"]').html('--');
}
}
}).fail(function (jqXHR) {

View file

@ -14,6 +14,7 @@ return [
'connection' => 'Connection',
'memory' => 'Memory',
'cpu' => 'CPU',
'disk' => 'Disk',
'status' => 'Status',
'search' => 'Search',
'suspended' => 'Suspended',

View file

@ -57,10 +57,10 @@
<td><a href="{{ route('admin.servers.view', $server->id) }}">{{ $server->name }}</a></td>
<td><a href="{{ route('admin.users.view', $server->owner_id) }}">{{ $server->user->username }}</a></td>
<td>{{ $server->nest->name }} ({{ $server->egg->name }})</td>
<td class="text-center"><span data-action="memory">NaN</span> / {{ $server->memory === 0 ? '∞' : $server->memory }} MB</td>
<td class="text-center">{{ $server->disk }} MB</td>
<td class="text-center"><span data-action="cpu" data-cpumax="{{ $server->cpu }}">NaN</span> %</td>
<td class="text-center" data-action="status">NaN</td>
<td class="text-center"><span data-action="memory">--</span> / {{ $server->memory === 0 ? '∞' : $server->memory }} MB</td>
<td class="text-center"><span data-action="disk">--</span> / {{ $server->disk === 0 ? '∞' : $server->disk }} MB </td>
<td class="text-center"><span data-action="cpu" data-cpumax="{{ $server->cpu }}">--</span> %</td>
<td class="text-center" data-action="status">--</td>
</tr>
@endforeach
</table>
@ -78,4 +78,4 @@
@section('footer-scripts')
@parent
{!! Theme::js('js/admin/node/view-servers.js') !!}
@endsection
@endsection

View file

@ -44,6 +44,7 @@
<th>@lang('strings.connection')</th>
<th class="text-center hidden-sm hidden-xs">@lang('strings.memory')</th>
<th class="text-center hidden-sm hidden-xs">@lang('strings.cpu')</th>
<th class="text-center hidden-sm hidden-xs">@lang('strings.disk')</th>
<th class="text-center">@lang('strings.relation')</th>
<th class="text-center">@lang('strings.status')</th>
</tr>
@ -55,6 +56,7 @@
<td><code>{{ $server->getRelation('allocation')->alias }}:{{ $server->getRelation('allocation')->port }}</code></td>
<td class="text-center hidden-sm hidden-xs"><span data-action="memory">--</span> / {{ $server->memory === 0 ? '∞' : $server->memory }} MB</td>
<td class="text-center hidden-sm hidden-xs"><span data-action="cpu" data-cpumax="{{ $server->cpu }}">--</span> %</td>
<td class="text-center hidden-sm hidden-xs"><span data-action="disk">--</span> / {{ $server->disk === 0 ? '∞' : $server->disk }} MB </td>
<td class="text-center">
@if($server->user->id === Auth::user()->id)
<span class="label bg-purple">@lang('strings.owner')</span>