Ingest live 3proxy traffic from access logs

This commit is contained in:
2026-04-02 02:03:37 +03:00
parent 1141622f86
commit 9a3785deb9
10 changed files with 408 additions and 37 deletions

View File

@@ -640,30 +640,38 @@ export default function App() {
}
let cancelled = false;
let intervalId: number | null = null;
const refreshSnapshot = async () => {
try {
const payload = await requestSnapshot(() =>
fetch('/api/state', {
headers: buildAuthHeaders(session.token),
}),
);
void requestSnapshot(() =>
fetch('/api/state', {
headers: buildAuthHeaders(session.token),
}),
)
.then((payload) => {
if (!cancelled && payload) {
setSnapshot(payload);
}
})
.catch((error) => {
} catch (error) {
if (error instanceof SessionExpiredError) {
if (!cancelled) {
resetSession();
}
return;
}
}
};
// Keep fallback snapshot for local UI and tests when backend is not running.
});
void refreshSnapshot();
intervalId = window.setInterval(() => {
void refreshSnapshot();
}, 5000);
return () => {
cancelled = true;
if (intervalId !== null) {
window.clearInterval(intervalId);
}
};
}, [session]);