import { OnInit, EventEmitter } from '@angular/core';
import { Router } from '@angular/router';
import 'rxjs/add/operator/takeUntil';
import { TranslateService } from '@ngx-translate/core';
import { SomaStringUtils } from '../../services/utils/string-utils.service';
import { JobDataService } from '../../services/data-services/job-data.service';
import { Job } from '../../model/job';
/**
* List and monitoring jobs request of a project.
*
* __HTML__
* ```html
*
*
* ```
*
* __Typescript__
*
* ```typescript
* jobsFilter ( job: Job ): boolean {
* if( job.description ) return true;
* return false;
* }
*
* private columnFactory = [];
*
* ngOnInit(){
* this.columnFactory = [{
* titleI18nKey: "example.monitoring.action1.title",
* linkI18nKey: "example.monitoring.action1.link",
* actionId: "action1"
* }
* ,{
* titleI18nKey: "example.monitoring.action2.title",
* faIconClass: "fa fa-chart-line",
* tooltipI18nKey: "example.monitoring.action2.tooltip",
* actionId: "action2",
* onlyFinished: true
* }
* ]
* }
*
* actionCallback(value: any){
* console.log( 'action id', value.actionId);
* console.log( 'job', value.job);
* if( 'action1' == value.actionId) {
* console.log( 'execute action 1');
* }
* if( 'action2' == value.actionId) {
* console.log( 'execute action 2');
* }
* }
*
* monitoringRouter(){
* return {
* 'external' : true,
* 'url' : 'https://eras.tecgraf.puc-rio.br/workingarea/#!/project/{{projectId}}/dashboard/{{jobId}}'
* }
* }
*
* ```
* ___see also___: [Job]{@link Job}
*/
export declare class MonitoringJobsComponent implements OnInit {
private jobDataService;
private translateService;
private strUtil;
private router;
showAlgorithmName: boolean;
projectId: string;
/**
* Filter the job list
* __returns__ true if can show job, false if Otherwise
*
* to make sure that it is scoped correctly, you should bind using javascript _bind_ function, like:
* ```html
*
* ```
*/
filter: (job: Job) => boolean;
/**
* Emmit a event of type:
*
* ```typescript
* {
* actionId: string,
* job: Job
* }
* ```
* __actionId__: Id of column action. Configured in columnFactory input param.
* __job__: Job selected.
*
*/
callback: EventEmitter<{
actionId: string;
job: Job;
}>;
/**
*
* ```typescript
* columnFactory: {
* titleI18nKey: string,
* faIconClass?: string,
* iconPath?: String,
* linkI18nKey?: string,
* tooltipI18nKey?: string,
* actionId: string,
* onlyFinished: boolean
* }[]
* ```
*
* __titleI18nKey__: i18n hey of title. Will be use like this: {{ titleI18nKey | translate }}
*
* __linkI18nKey__: i18n Key of link. Will be use like this: {{ linkI18nKey | translate }}. It can not be null if __iconPath__ and faIconClass are. Otherwise may be.
*
* __faIconClass__: FontAwesome class. It can not be null if linkI18nKey and iconPath are. Otherwise may be.
*
* __iconPath__: Path to icon. Will renderize in image tag. If this is not null, faIconClass or linki18nKey will be ignored. It can not be null if linkI18nKey and faIconClass are. Otherwise may be.
*
* __tooltipI18nKey__: i18n key of tooltip of link or icon. Will be use like this: {{ tooltipI18nKey | translate }}
*
* __actionId__: id of action that will be emmiter in callback output.
*
* __onlyFinished__: if true, just apear icons or link if job status is finished. if false apear always. Default false.
*
*/
columnFactory: {
titleI18nKey: string;
faIconClass?: string;
iconPath?: string;
linkI18nKey?: string;
tooltipI18nKey?: string;
actionId: string;
onlyFinished?: boolean;
}[];
/**
* ```typescript
* {
* url: string,
* external: boolean;
* }
* ```
*
* __url__: URL to be oppened. in the URL "{{projectId}}" and "{{jobId}} is necessary, and will be replaced by objects id. Example:
* `https://eras.tecgraf.puc-rio.br/workingarea/#!/project/{{projectId}}/dashboard/{{jobId}}`
*
* __external__: if true, will be open a new tab. If false, will be used angular router service.
*
*/
monitoringRouter: {
url: string;
external: boolean;
};
private ngUnsubscribe;
private sholdFetchData;
jobs: Job[];
selectedId: string;
constructor(jobDataService: JobDataService, translateService: TranslateService, strUtil: SomaStringUtils, router: Router);
private clickTable(job);
private selected();
ngOnInit(): void;
ngOnDestroy(): void;
cancelJob(): void;
private monitoring();
private pull(lastProcessingDate);
private updateJobsAfterPull(newJobs, calback?);
private validateFactory(factory);
private customColumnAction(event, job, actionId);
private isDisabled(factory, job);
}