import { Component } from '@angular/core';
import { DetailsComponentBase } from '@objects-view/details-component-base';
import { IPeriodicTaskLogModel } from '@fleio-api/logger/model/periodic-task-log.model';
import { PeriodicTaskLogApiService } from '@fleio-api/logger/periodic-task-log-api.service';

@Component({
  selector: 'app-periodic-task-log-details-logfile',
  templateUrl: './periodic-task-log-details-logfile.component.html',
  styleUrls: ['./periodic-task-log-details-logfile.component.scss']
})
export class PeriodicTaskLogDetailsLogfileComponent extends DetailsComponentBase<IPeriodicTaskLogModel> {
  log: string;
  constructor(private periodicTaskLogApiService: PeriodicTaskLogApiService) {
    super();
  }

  protected initTabData() {
    this.periodicTaskLogApiService.getLog(this.object.id).subscribe(log => this.log = log);
  }
}
