Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update task execution list #1997

Closed
wants to merge 9 commits into from
43 changes: 43 additions & 0 deletions ui/src/app/shared/model/task-execution.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface hrefObj {

interface TaskExecutionLinks {
'tasks/logs': hrefObj;
'tasks/definitions': hrefObj;
}

export class LaunchResponse {
Expand Down Expand Up @@ -106,6 +107,38 @@ export class TaskExecution {
}
}

export class TaskExecutionThin {
executionId: number;
parentExecutionId: number;
exitCode: number;
taskName: string;
startTime: DateTime;
endTime: DateTime;
exitMessage: string;
externalExecutionId: number;
errorMessage: string;
schemaTarget: string;
platformName: string;
_links: TaskExecutionLinks;

static parse(input: any): TaskExecution {
const execution = new TaskExecution();
execution.executionId = input?.executionId;
execution.exitCode = input?.exitCode;
execution.taskName = input?.taskName;
execution.startTime = input?.startTime ? DateTime.fromISO(input.startTime) : null;
execution.endTime = input?.endTime ? DateTime.fromISO(input.endTime) : null;
execution.exitMessage = input?.exitMessage;
execution.schemaTarget = input?.schemaTarget || 'boot2';
execution.errorMessage = input?.errorMessage;
execution.externalExecutionId = input?.externalExecutionId;
execution.parentExecutionId = input?.parentExecutionId;
execution._links = input?._links;
execution.schemaTarget = input?.schemaTarget;
return execution;
}
}

export class TaskExecutionPage extends Page<TaskExecution> {
static parse(input: any): Page<TaskExecution> {
const page = Page.fromJSON<TaskExecution>(input);
Expand All @@ -115,3 +148,13 @@ export class TaskExecutionPage extends Page<TaskExecution> {
return page;
}
}

export class TaskExecutionThinPage extends Page<TaskExecution> {
static parse(input: any): Page<TaskExecutionThin> {
const page = Page.fromJSON<TaskExecutionThin>(input);
if (input && input._embedded && input._embedded.taskExecutionResourceList) {
page.items = input._embedded.taskExecutionResourceList.map(TaskExecutionThin.parse);
}
return page;
}
}
Loading