summaryrefslogtreecommitdiff
path: root/src/api/logs.ts
diff options
context:
space:
mode:
authorLarvan2 <[email protected]>2026-04-18 14:18:28 +0800
committerLarvan2 <[email protected]>2026-04-18 14:18:28 +0800
commit2cf83223f6d4b551998e8cd8f74fcec5e7ffd8ae (patch)
tree9d9acd7e88ca8af2d34c9ef34b853b8d90f3c2ea /src/api/logs.ts
parentfd39af8af5e2e6ba88f8ba2ac3e6101aeda2b6c1 (diff)
fix(logs): improve log fetching and add log level selection
Diffstat (limited to 'src/api/logs.ts')
-rw-r--r--src/api/logs.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/api/logs.ts b/src/api/logs.ts
index db37bcd..fd08d56 100644
--- a/src/api/logs.ts
+++ b/src/api/logs.ts
@@ -107,7 +107,10 @@ export function fetchLogs(apiConfig: LogsAPIConfig, appendLog: AppendLogFn) {
}
export function stop() {
- ws.close();
+ if (ws) {
+ ws.close();
+ fetched = false;
+ }
if (controller) controller.abort();
}
@@ -146,6 +149,6 @@ function fetchLogsWithFetch(apiConfig: LogsAPIConfig, appendLog: AppendLogFn) {
// eslint-disable-next-line no-console
console.log('GET /logs error:', err.message);
- }
+ },
);
}