mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-30 16:40:55 +03:00
Added the ability to view logs from the settings menu
This commit is contained in:
32
src/app/components/logs-viewer/logs-viewer.component.ts
Normal file
32
src/app/components/logs-viewer/logs-viewer.component.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { PostsService } from '../../posts.services';
|
||||
|
||||
@Component({
|
||||
selector: 'app-logs-viewer',
|
||||
templateUrl: './logs-viewer.component.html',
|
||||
styleUrls: ['./logs-viewer.component.scss']
|
||||
})
|
||||
export class LogsViewerComponent implements OnInit {
|
||||
|
||||
logs: string = null;
|
||||
|
||||
constructor(private postsService: PostsService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.getLogs();
|
||||
}
|
||||
|
||||
getLogs() {
|
||||
this.postsService.getLogs().subscribe(res => {
|
||||
if (res['logs']) {
|
||||
this.logs = res['logs'];
|
||||
} else {
|
||||
this.postsService.openSnackBar('Failed to retrieve logs!');
|
||||
}
|
||||
}, err => {
|
||||
console.error(err);
|
||||
this.postsService.openSnackBar('Failed to retrieve logs!');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user