fix(editor): Remove 'crashed' status from filter (#5524)

* fix(editor): remove 'crashed' status from filter

* fix(editor): remove 'crashed' and 'new' status from filter

* fix(editor): add 'status' to response

* fix(editor): create request filter for workflow level execution filtering

* fix(editor): update filters

* fix(editor): simplify condition

* fix(editor): update filters

* fix(editor): optimizing data loading flow

* fix(editor): always load past executions
This commit is contained in:
Csaba Tuncsik
2023-02-23 11:13:21 +01:00
committed by GitHub
parent 4998ab2350
commit 7c517cb530
9 changed files with 82 additions and 106 deletions

View File

@@ -43,13 +43,19 @@ export const executionHelpers = mixins(genericHelpers).extend({
if (execution.status === 'waiting' || execution.waitTill) {
status.name = 'waiting';
status.label = this.$locale.baseText('executionsList.waiting');
} else if (execution.status === 'running' || execution.stoppedAt === undefined) {
} else if (
execution.status === 'running' ||
execution.status === 'new' ||
execution.stoppedAt === undefined
) {
status.name = 'running';
status.label = this.$locale.baseText('executionsList.running');
status.runningTime = this.displayTimer(
new Date().getTime() - new Date(execution.startedAt).getTime(),
true,
);
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');
@@ -59,21 +65,9 @@ export const executionHelpers = mixins(genericHelpers).extend({
true,
);
}
} else if (execution.status === 'crashed') {
status.name = 'crashed';
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 === 'new') {
status.name = 'new';
status.label = this.$locale.baseText('executionsList.new');
} else if (
execution.status === 'error' ||
execution.status === 'failed' ||
execution.status === 'crashed' ||
execution.stoppedAt !== null
) {
status.name = 'error';

View File

@@ -77,7 +77,9 @@ export const restApi = Vue.extend({
getActivationError: (id: string): Promise<IActivationError | undefined> => {
return self.restApi().makeRestApiRequest('GET', `/active/error/${id}`);
},
getCurrentExecutions: (filter: object): Promise<IExecutionsCurrentSummaryExtended[]> => {
getCurrentExecutions: (
filter: IDataObject,
): Promise<IExecutionsCurrentSummaryExtended[]> => {
let sendData = {};
if (filter) {
sendData = {
@@ -179,7 +181,7 @@ export const restApi = Vue.extend({
// Returns all saved executions
// TODO: For sure needs some kind of default filter like last day, with max 10 results, ...
getPastExecutions: (
filter: object,
filter: IDataObject,
limit: number,
lastId?: string,
firstId?: string,