feat: preload statistics tab content for improved server page loading experience

This commit is contained in:
2025-12-01 08:47:12 -05:00
parent 5827163ada
commit 1634320cb9

View File

@@ -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])],