UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 4.25 kB
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.13.4"}}catch(e){}}(),System.register(["./vue.runtime.esm-bundler-legacy-IafOlCW8.js","./users.store-legacy-OKuN0qAC.js","./_baseOrderBy-legacy-PsQY_Pvh.js"],(function(e,t){var n,o,u,a,r,i,s,l,c,d;return{setters:[function(e){n=e.Ft,o=e.S},function(e){u=e.As,a=e.Ft,r=e.S,i=e.g,s=e.v},function(e){l=e.d,c=e.j,d=e.r}],execute:function(){try{t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(f=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="1d326e09-d665-4711-95fa-26fe51e29e4f",t._sentryDebugIdIdentifier="sentry-dbid-1d326e09-d665-4711-95fa-26fe51e29e4f")}catch(t){}var t,f;e("t",c("executions",(()=>{const e=d(),t=a(),c=u(),f=n(!1),w=n(10),v=n(null),y=n(s()),x=o((()=>{const e=i(y.value);return t.currentProjectId&&(e.projectId=t.currentProjectId),e})),I=o((()=>({..."all"!==y.value.workflowId?{workflowId:y.value.workflowId}:{}}))),E=n(!0),g=n(null),p=n(4e3),A=n({}),T=n(0),b=n(!1),m=n(0),h=o((()=>{const e=Object.values(A.value);return e.sort(((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())),e})),k=o((()=>h.value.reduce(((e,t)=>(e[t.workflowId]||(e[t.workflowId]=[]),e[t.workflowId].push(t),e)),{}))),C=n({}),D=(e,t)=>new Date(t.startedAt??t.createdAt).getTime()-new Date(e.startedAt??e.createdAt).getTime(),P=c.isConcurrencyEnabled?(e,t)=>{if(e.status&&t.status){const n={running:1,new:2},o=n[e.status]-n[t.status];if(0!==o)return o}return D(e,t)}:D,j=o((()=>{const e=Object.values(C.value);return e.sort(P),e})),S=o((()=>j.value.reduce(((e,t)=>(e[t.workflowId]||(e[t.workflowId]=[]),e[t.workflowId].push(t),e)),{}))),O=o((()=>[...j.value,...h.value]));function B(e){A.value={...A.value,[e.id]:{...e,mode:e.mode}}}function R(e){const{[e]:t,...n}=A.value;A.value=n}async function _(t=x.value,n,o){f.value=!0;try{const u=await l(e.restApiContext,"GET","/executions",{...t?{filter:t}:{},...o?{firstId:o}:{},...n?{lastId:n}:{},limit:w.value});return C.value={},u.results.forEach((e=>{["new","running"].includes(e.status)?function(e){C.value[e.id]={...e,mode:e.mode}}(e):B(e)})),T.value=u.count,b.value=u.estimated,m.value=u.concurrentExecutionsCount,u}finally{f.value=!1}}async function F(e){$(),await async function(e){const t={...x.value,...e?{workflowId:e}:{}};g.value=setTimeout((async()=>{E.value&&(await _(t),F(e))}),p.value)}(e)}function $(){g.value&&(clearTimeout(g.value),g.value=null)}function W(){A.value={},C.value={},T.value=0,b.value=!1,m.value=0}return{loading:f,annotateExecution:async function(t,n){const o=await l(e.restApiContext,"PATCH",`/executions/${t}`,n);B(o),o.id===v.value?.id&&(v.value=o)},executionsById:A,executions:h,executionsCount:T,executionsCountEstimated:b,concurrentExecutionsCount:m,executionsByWorkflowId:k,currentExecutions:j,currentExecutionsByWorkflowId:S,activeExecution:v,fetchExecutions:_,fetchExecution:async function(t){const n=await l(e.restApiContext,"GET",`/executions/${t}`);return n?r(n):void 0},autoRefresh:E,autoRefreshTimeout:g,startAutoRefreshInterval:F,stopAutoRefreshInterval:$,initialize:async function(e){e&&(y.value.workflowId=e),await _(),await F(e)},filters:y,setFilters:function(e){y.value=e},executionsFilters:x,currentExecutionsFilters:I,allExecutions:O,stopCurrentExecution:async function(t){return await l(e.restApiContext,"POST",`/executions/${t}/stop`)},retryExecution:async function(t,n){return await l(e.restApiContext,"POST",`/executions/${t}/retry`,n?{loadWorkflow:!0}:void 0)},deleteExecutions:async function(t){if(await l(e.restApiContext,"POST","/executions/delete",t),t.ids&&t.ids.forEach(R),t.deleteBefore){const e=new Date(t.deleteBefore);O.value.forEach((t=>{new Date(t.startedAt??t.createdAt)<e&&R(t.id)}))}},addExecution:B,resetData:W,reset:function(){w.value=10,y.value=s(),E.value=!0,W(),$()},itemsPerPage:w,stopManyExecutions:async function(t){return await l(e.restApiContext,"POST","/executions/stopMany",{filter:{...t,workflowId:y.value.workflowId}})}}})))}}})); //# sourceMappingURL=executions.store-legacy-z6ytCHo9.js.map