v0.36.1
This commit is contained in:
1 parent
672c84bc13
commit
6f52ac3d00
38 files changed
+1183
-221
No files matched your search
@@ -59,6 +59,7 @@ function translate() {
|
||||
$("connection-label").textContent = t(connected ? "connected" : "disconnected");
|
||||
if (envelope) renderConfig(); renderConfigStorage(); if (latestStatus) { renderFooter(latestStatus); renderDiagnostics(latestStatus, false); window.rustProxyVhosts?.renderStatus(latestStatus); window.rustProxyDocker?.renderStatus(latestStatus); window.rustProxyStreams?.renderStatus(latestStatus); window.rustProxyStreamDashboard?.render(latestStatus); window.rustProxyBackendDashboard?.render(latestStatus, null, false); window.rustProxyExtraOverview?.render(latestStatus, false); window.rustProxyWideOverview?.render(latestStatus, false); window.rustProxyWebOverview?.render(latestStatus, false); } if (lastLogs) renderLogs(lastLogs);
|
||||
syncSettingsDirtyIndicators();
|
||||
window.rustProxyIcons?.refresh?.();
|
||||
}
|
||||
function hideToast() { const node = $("toast"); if (typeof node.hidePopover === "function" && node.matches(":popover-open")) node.hidePopover(); node.hidden = true; }
|
||||
function raiseToast() {
|
||||
@@ -379,13 +380,9 @@ function renderFooter(s) {
|
||||
}
|
||||
let lastLogs = null;
|
||||
function renderLogs(data) { lastLogs = data; window.rustProxyLogs?.render(data); }
|
||||
async function refresh(force = false, includeLogs = false) {
|
||||
async function refresh(force = false) {
|
||||
if (!authenticated) return;
|
||||
if (force) {
|
||||
const tasks = [rustProxyRefresh.manual("status-full")];
|
||||
if (includeLogs) tasks.push(rustProxyRefresh.manual("logs-fallback"));
|
||||
return Promise.all(tasks);
|
||||
}
|
||||
if (force) return rustProxyRefresh.manual("status-full");
|
||||
return rustProxyRefresh.manual("status-fallback");
|
||||
}
|
||||
function renderLiveStatus(value) { renderStatus(value); }
|
||||
@@ -399,15 +396,16 @@ function startLive() {
|
||||
if (liveEvents && liveInterval === seconds) return;
|
||||
stopLive();
|
||||
liveInterval = seconds;
|
||||
const epoch = authEpoch, stream = new EventSource(`/api/events?interval=${seconds}`);
|
||||
const epoch = authEpoch, stream = new EventSource(`/api/events?interval=${seconds}&logs=false`);
|
||||
liveEvents = stream;
|
||||
stream.addEventListener("snapshot", event => {
|
||||
if (!authenticated || epoch !== authEpoch || stream !== liveEvents) return;
|
||||
try {
|
||||
const payload = JSON.parse(event.data);
|
||||
if (!payload.status || !payload.logs) throw new Error("Invalid SSE payload");
|
||||
if (!payload.status) throw new Error("Invalid SSE payload");
|
||||
liveConnected = true; liveFallback = false;
|
||||
renderLiveStatus(payload.status); renderLogs(payload.logs);
|
||||
renderLiveStatus(payload.status);
|
||||
if (payload.logs) renderLogs(payload.logs);
|
||||
window.rustProxyRefresh?.sync();
|
||||
} catch (error) { liveConnected = false; liveFallback = true; window.rustProxyRefresh?.sync(); }
|
||||
});
|
||||
@@ -529,7 +527,7 @@ async function activate(info) {
|
||||
void window.rustProxyApiTokens?.refresh?.();
|
||||
window.rustProxySettings?.scrollToApiTokens?.();
|
||||
}
|
||||
void refresh(true, true).catch(error => {
|
||||
void refresh(true).catch(error => {
|
||||
if (authenticated && epoch === authEpoch && error?.status !== 401) toast(error.message, true);
|
||||
});
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user