refactor: simplify loading logic for telemetry and network analysis sections by removing session storage checks

This commit is contained in:
2025-12-01 08:16:38 -05:00
parent db93de4b14
commit de0ae55d50

View File

@@ -101,25 +101,8 @@
<section
wire:poll.120s="stats"
x-data="{ loading: true }"
x-init="
(function () {
var serverId = {{ $server->id ?? 0 }};
var key = 'statsTelemetryLoaded_' + serverId;
if (window.sessionStorage && sessionStorage.getItem(key) === 'true') {
loading = false;
return;
}
setTimeout(function () {
loading = false;
try {
if (window.sessionStorage) {
sessionStorage.setItem(key, 'true');
}
} catch (e) {}
}, 4000);
})()
"
class="relative bg-background-secondary border border-neutral rounded-2xl p-6 space-y-6 shadow-sm"
x-init="setTimeout(() => loading = false, 4000)"
class="relative bg-background-secondary border border-neutral rounded-2xl p-6 space-y-6 shadow-sm overflow-hidden"
>
<!-- Blur overlay while telemetry data is loading -->
<div
@@ -1951,24 +1934,7 @@
style="width: 100%;"
wire:init="loadNetworkAnalysis"
x-data="{ loading: true }"
x-init="
(function () {
var serverId = {{ $server->id ?? 0 }};
var key = 'networkAnalysisLoaded_' + serverId;
if (window.sessionStorage && sessionStorage.getItem(key) === 'true') {
loading = false;
return;
}
setTimeout(function () {
loading = false;
try {
if (window.sessionStorage) {
sessionStorage.setItem(key, 'true');
}
} catch (e) {}
}, 4000);
})()
"
x-init="setTimeout(() => loading = false, 4000)"
>
<!-- Blur overlay while Network Analysis is loading -->
<div