v0.26.2 http sink backlog for late streams, web updates

This commit is contained in:
lixen committed 2026-10-05 02:48:00 -04:00
1 parent cdd4fc01a7
commit d745a128a2
14 files changed
+115 -37

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
<svg viewBox="1 1 98 98" xmlns="http://www.w3.org/2000/svg">
<!-- The wisps of logwisp-logo.svg, broadened to read at 16 px -->
<defs>
<path id="wisp" d="M50,50 C50,37 59.2,27 71,25.8 C83.5,24.6 92,33.5 97.2,48
A3.6,3.6 0 0 1 90.6,51.8 C86.6,46.2 80.6,43.6 74,43.9 C65.5,44.3 57,46.6 50,50 Z"/>
</defs>
<use href="#wisp" fill="#E0409A"/>
<use href="#wisp" fill="#D4640A" transform="rotate(72 50 50)"/>
<use href="#wisp" fill="#169B58" transform="rotate(144 50 50)"/>
<use href="#wisp" fill="#0891B2" transform="rotate(216 50 50)"/>
<use href="#wisp" fill="#8E5CF0" transform="rotate(288 50 50)"/>
</svg>

After

Width:  |  Height:  |  Size: 630 B

+1
View File
@@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>LogWisp sign-in</title>
<link rel="stylesheet" href="style.css">
<link rel="icon" href="favicon.svg" type="image/svg+xml">
<script type="module" src="login.js"></script>
</head>
<body>
+1
View File
@@ -7,6 +7,7 @@
<meta name="logwisp-status" content="status">
<meta name="logwisp-login" content="scram">
<link rel="stylesheet" href="style.css">
<link rel="icon" href="favicon.svg" type="image/svg+xml">
<script type="module" src="view.js"></script>
</head>
<body class="viewer">
+8 -3
View File
@@ -36,8 +36,9 @@ function append(line) {
if (atBottom) log.scrollTop = log.scrollHeight;
}
// The status answer names the stream path; its 401 is the only way to tell an
// ended session apart, since EventSource hides the status of a failure.
// The status answer names the stream path and whether the stream has room; its
// 401 is the only way to tell an ended session apart, since EventSource hides
// the status of a failure.
async function connect() {
if (tokenMode && !token) return showLogin("");
let res;
@@ -52,10 +53,14 @@ async function connect() {
// An open page has no session to end: a 401 there is a proxy's, so it retries
if (res.status === 401 && !open) return sessionEnded();
fresh = false;
const path = res.ok ? (await res.json().catch(() => ({})))?.endpoints?.stream : null;
const body = res.ok ? await res.json().catch(() => ({})) : {};
const path = body?.endpoints?.stream;
if (typeof path !== "string" || !path.startsWith("/")) {
return retry(`status unavailable (${res.status})`);
}
// The stream would answer 503, which EventSource hides
const { active_clients: active, max_connections: max } = body?.server ?? {};
if (max > 0 && active >= max) return retry(`server full (${active} of ${max} streams)`);
// Stream paths are absolute in logwisp; the proxy may mount it under a prefix
const url = new URL("./" + path.replace(/^\/+/, ""), base);
if (tokenMode) streamWithToken(url);