fix(editor): Show correct status on canceled executions (#5813)

Co-authored-by: Milorad Filipovic <milorad@n8n.io>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-03-30 16:27:40 +02:00
committed by GitHub
parent 41cdee7bc7
commit d0788ee8e1
5 changed files with 23 additions and 26 deletions

View File

@@ -50,34 +50,26 @@ export const executionHelpers = mixins(genericHelpers).extend({
) {
status.name = 'running';
status.label = this.$locale.baseText('executionsList.running');
if (execution.startedAt) {
status.runningTime = this.displayTimer(
new Date().getTime() - new Date(execution.startedAt).getTime(),
true,
);
}
} else if (execution.status === 'success' || execution.finished) {
status.name = 'success';
status.label = this.$locale.baseText('executionsList.succeeded');
if (execution.stoppedAt) {
status.runningTime = this.displayTimer(
new Date(execution.stoppedAt).getTime() - new Date(execution.startedAt).getTime(),
true,
);
}
} else if (
execution.status === 'failed' ||
execution.status === 'crashed' ||
execution.stoppedAt !== null
) {
} else if (execution.status === 'failed' || execution.status === 'crashed') {
status.name = 'error';
status.label = this.$locale.baseText('executionsList.error');
if (execution.stoppedAt) {
status.runningTime = this.displayTimer(
new Date(execution.stoppedAt).getTime() - new Date(execution.startedAt).getTime(),
true,
);
}
} else if (execution.status === 'canceled') {
status.label = this.$locale.baseText('executionsList.canceled');
}
if (!execution.status) execution.status = 'unknown';
if (execution.startedAt && execution.stoppedAt) {
const stoppedAt = execution.stoppedAt
? new Date(execution.stoppedAt).getTime()
: Date.now();
status.runningTime = this.displayTimer(
stoppedAt - new Date(execution.startedAt).getTime(),
true,
);
}
return status;