give name to logs file (#1833)

* give name to logs file
This commit is contained in:
Matt Hill
2022-09-26 15:40:38 -06:00
committed by GitHub
parent 18336e4d0a
commit 8cf84a6cf2
4 changed files with 5 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ export class LogsComponent {
params: RR.FollowServerLogsReq,
) => Promise<RR.FollowServerLogsRes>
@Input() fetchLogs!: (params: ServerLogsReq) => Promise<LogsRes>
@Input() context!: string
@Input() defaultBack!: string
@Input() title!: string
@@ -151,7 +152,7 @@ export class LogsComponent {
}
const html = this.convertToAnsi(entries)
this.downloadHtml.download('logs.html', html, styles)
this.downloadHtml.download(`${this.context}-logs.html`, html, styles)
} catch (e: any) {
this.errToast.present(e)
} finally {

View File

@@ -2,6 +2,7 @@
[fetchLogs]="fetchLogs()"
[followLogs]="followLogs()"
[defaultBack]="'/services/' + pkgId"
[context]="pkgId"
title="Service Logs"
class="ion-page"
></logs>

View File

@@ -1,6 +1,7 @@
<logs
[fetchLogs]="fetchLogs()"
[followLogs]="followLogs()"
context="kernel"
defaultBack="embassy"
title="Kernel Logs"
class="ion-page"

View File

@@ -1,6 +1,7 @@
<logs
[fetchLogs]="fetchLogs()"
[followLogs]="followLogs()"
context="eos"
defaultBack="embassy"
title="OS Logs"
class="ion-page"