9
9
@filterUpdated =" onFilterUpdated"
10
10
@loadMore =" loadMore"
11
11
@retryExecution =" onRetryExecution"
12
+ @refresh =" loadAutoRefresh"
12
13
/>
13
14
<div :class =" $style.content" v-if =" !hidePreview" >
14
15
<router-view name =" executionPreview" @deleteCurrentExecution =" onDeleteCurrentExecution" @retryExecution =" onRetryExecution" />
25
26
import ExecutionsSidebar from ' @/components/ExecutionsView/ExecutionsSidebar.vue' ;
26
27
import { MODAL_CANCEL , MODAL_CLOSE , MODAL_CONFIRMED , PLACEHOLDER_EMPTY_WORKFLOW_ID , VIEWS , WEBHOOK_NODE_TYPE } from ' @/constants' ;
27
28
import { IExecutionsListResponse , IExecutionsSummary , INodeUi , ITag , IWorkflowDb } from ' @/Interface' ;
28
- import { IConnection , IConnections , IDataObject , INodeTypeDescription , INodeTypeNameVersion , NodeHelpers } from ' n8n-workflow' ;
29
+ import { IConnection , IConnections , IDataObject , INodeTypeDescription , INodeTypeNameVersion , IWorkflowSettings , NodeHelpers } from ' n8n-workflow' ;
29
30
import mixins from ' vue-typed-mixins' ;
30
31
import { restApi } from ' ../mixins/restApi' ;
31
32
import { showMessage } from ' ../mixins/showMessage' ;
@@ -73,6 +74,11 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo
73
74
totalFinishedExecutionsCount(): number {
74
75
return this .$store .getters [' workflows/getTotalFinishedExecutionsCount' ];
75
76
},
77
+ isWorkflowSavingManualExecutions(): boolean {
78
+ const workflowSettings: IWorkflowSettings = this .$store .getters .workflowSettings ;
79
+ const saveManualExecutionsDefault = this .$store .getters .saveManualExecutions ;
80
+ return workflowSettings .saveManualExecutions === undefined ? saveManualExecutionsDefault : workflowSettings .saveManualExecutions as boolean ;
81
+ },
76
82
},
77
83
watch:{
78
84
$route (to : Route , from : Route ) {
@@ -242,6 +248,7 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo
242
248
const alreadyPresentExecutionIds = existingExecutions .map (exec => parseInt (exec .id , 10 ));
243
249
let lastId = 0 ;
244
250
const gaps = [] as number [];
251
+ let updatedActiveExecution = null ;
245
252
246
253
for (let i = fetchedExecutions .length - 1 ; i >= 0 ; i -- ) {
247
254
const currentItem = fetchedExecutions [i ];
@@ -262,6 +269,9 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo
262
269
263
270
if (existingStillRunning && currentFinished ) {
264
271
existingExecutions [executionIndex ] = currentItem ;
272
+ if (currentItem .id === this .activeExecution .id ) {
273
+ updatedActiveExecution = currentItem ;
274
+ }
265
275
}
266
276
continue ;
267
277
}
@@ -280,6 +290,9 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo
280
290
281
291
existingExecutions = existingExecutions .filter (execution => ! gaps .includes (parseInt (execution .id , 10 )) && lastId >= parseInt (execution .id , 10 ));
282
292
this .$store .commit (' workflows/setCurrentWorkflowExecutions' , existingExecutions );
293
+ if (updatedActiveExecution !== null ) {
294
+ this .$store .commit (' workflows/setActiveWorkflowExecution' , updatedActiveExecution );
295
+ }
283
296
},
284
297
async loadExecutions(): Promise <IExecutionsSummary []> {
285
298
if (! this .currentWorkflow ) {
@@ -288,6 +301,11 @@ export default mixins(restApi, showMessage, executionHelpers, debounceHelper, wo
288
301
try {
289
302
const executions: IExecutionsSummary [] =
290
303
await this .$store .dispatch (' workflows/loadCurrentWorkflowExecutions' , this .filter );
304
+
305
+ // Don't show running manual executions if workflow is set up not to save them
306
+ if (! this .isWorkflowSavingManualExecutions ) {
307
+ return executions .filter (ex => ex .finished === true || ex .mode !== ' manual' );
308
+ }
291
309
return executions ;
292
310
} catch (error ) {
293
311
this .$showError (
0 commit comments