Skip to content

Commit

Permalink
Use observer logs for download in landing-page
Browse files Browse the repository at this point in the history
  • Loading branch information
wendevlin committed Nov 20, 2024
1 parent 87ad9fd commit 1989850
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 2 additions & 10 deletions landing-page/src/components/landing-page-logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ import {
} from "../data/observer";
import { fireEvent } from "../../../src/common/dom/fire_event";
import { fileDownload } from "../../../src/util/file_download";
import {
getDownloadUrl,
getSupervisorLogs,
getSupervisorLogsFollow,
} from "../data/supervisor";
import { getSupervisorLogs, getSupervisorLogsFollow } from "../data/supervisor";

const ERROR_CHECK = /^[\d\s-:]+(ERROR|CRITICAL)(.*)/gm;
declare global {
Expand Down Expand Up @@ -267,12 +263,8 @@ class LandingPageLogs extends LitElement {

private _downloadLogs() {
const timeString = new Date().toISOString().replace(/:/g, "-");
const downloadUrl = this._observerFallback
? observerLogsDownloadUrl
: getDownloadUrl(this._logLinesCount);
const downloadName = `${this._observerFallback ? "observer" : "supervisor"}_${timeString}.log`;

fileDownload(downloadUrl, downloadName);
fileDownload(observerLogsDownloadUrl, `observer_${timeString}.log`);
}

static styles = [
Expand Down
4 changes: 0 additions & 4 deletions landing-page/src/data/supervisor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ export const ALTERNATIVE_DNS_SERVERS: {
},
];

export function getDownloadUrl(lines = 500) {
return `/supervisor/supervisor/logs?lines=${lines}`;
}

export async function getSupervisorLogs(lines = 100) {
return fetch(`/supervisor/supervisor/logs?lines=${lines}`, {
headers: {
Expand Down

0 comments on commit 1989850

Please sign in to comment.