Skip to content

Commit

Permalink
Merge pull request #335 from fdm-monster/fix/334-log-dump-is-empty
Browse files Browse the repository at this point in the history
Fix/334 log dump is empty
  • Loading branch information
davidzwa authored Jul 5, 2023
2 parents 098c01a + aba873a commit 5f22e3a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fdm-monster/client",
"version": "1.2.6",
"version": "1.2.7",
"private": false,
"author": "David Zwart",
"license": "AGPL-3.0-or-later",
Expand Down
5 changes: 1 addition & 4 deletions src/backend/server-private.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ export class ServerPrivateService extends BaseService {

public static async downloadLogDump() {
const response = await this.postApi("api/server/dump-fdm-monster-logs");
await downloadFileByBlob(
(response as any).data as any,
"logs-fdm-monster-" + Date.now() + ".zip"
);
await downloadFileByBlob(response as any as any, "logs-fdm-monster-" + Date.now() + ".zip");
}
}
3 changes: 3 additions & 0 deletions src/utils/download-file.util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { apiBase } from "../backend/base.service";

export function downloadFileByBlob(data: ArrayBuffer, fileName: string) {
if (!data) {
throw new Error("No data to download");
}
const blob = new Blob([data], { type: "text" });
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
Expand Down

0 comments on commit 5f22e3a

Please sign in to comment.