feat: preload statistics tab content for improved server page loading experience
This commit is contained in:
@@ -143,6 +143,25 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($view !== 'statistics')
|
||||
<!-- Preload Statistics tab content when entering the server page -->
|
||||
<div
|
||||
x-init="
|
||||
if (window.fetch) {
|
||||
setTimeout(function () {
|
||||
try {
|
||||
fetch('{{ route('proxmox.server.statistics', ['server' => $server->id]) }}', {
|
||||
credentials: 'same-origin',
|
||||
headers: { 'X-Proxmox-Preload': 'true' },
|
||||
});
|
||||
} catch (e) {}
|
||||
}, 500);
|
||||
}
|
||||
"
|
||||
class="hidden"
|
||||
></div>
|
||||
@endif
|
||||
|
||||
@php
|
||||
$tabs = [
|
||||
['label' => 'Overview', 'view' => 'overview', 'route' => route('proxmox.server.overview', ['server' => $server->id])],
|
||||
|
||||
Reference in New Issue
Block a user