UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 4.31 kB
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.16.1"}}catch(e){}}(),System.register(["./vue.runtime.esm-bundler-legacy-BW6xDdqj.js","./users.store-legacy-azRUgFdP.js","./useRootStore-legacy-CC08el-l.js","./settings.store-legacy-I6rZOvfF.js"],(function(e,t){var n,o,u,a,i,r,s,c,l,d;return{setters:[function(e){n=e.Ft,o=e.S},function(e){u=e.S,a=e.ai,i=e.g,r=e.v},function(e){s=e.T,c=e.c,l=e.t},function(e){d=e.t}],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]="6e29b59a-c974-4b24-a2e8-b9bf999fe94c",t._sentryDebugIdIdentifier="sentry-dbid-6e29b59a-c974-4b24-a2e8-b9bf999fe94c")}catch(t){}var t,f;e("t",s("executions",(()=>{const e=l(),t=a(),s=d(),f=n(!1),w=n(10),v=n(null),y=n(r()),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}:{}}))),g=n(!0),E=n(null),b=n(4e3),p=n({}),T=n(0),A=n(!1),m=n(0),h=o((()=>{const e=Object.values(p.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(),S=s.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(S),e})),P=o((()=>j.value.reduce(((e,t)=>(e[t.workflowId]||(e[t.workflowId]=[]),e[t.workflowId].push(t),e)),{}))),R=o((()=>[...j.value,...h.value]));function O(e){p.value={...p.value,[e.id]:{...e,mode:e.mode}}}function B(e){const{[e]:t,...n}=p.value;p.value=n}async function _(t=x.value,n,o){f.value=!0;try{const u=await c(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):O(e)})),T.value=u.count,A.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}:{}};E.value=setTimeout((async()=>{g.value&&(await _(t),F(e))}),b.value)}(e)}function $(){E.value&&(clearTimeout(E.value),E.value=null)}function W(){p.value={},C.value={},T.value=0,A.value=!1,m.value=0}return{loading:f,annotateExecution:async function(t,n){const o=await c(e.restApiContext,"PATCH",`/executions/${t}`,n);O(o),o.id===v.value?.id&&(v.value=o)},executionsById:p,executions:h,executionsCount:T,executionsCountEstimated:A,concurrentExecutionsCount:m,executionsByWorkflowId:k,currentExecutions:j,currentExecutionsByWorkflowId:P,activeExecution:v,fetchExecutions:_,fetchExecution:async function(t,n){const o=await c(e.restApiContext,"GET",`/executions/${t}`,n);return o?u(o):void 0},autoRefresh:g,autoRefreshTimeout:E,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:R,stopCurrentExecution:async function(t){return await c(e.restApiContext,"POST",`/executions/${t}/stop`)},retryExecution:async function(t,n){return await c(e.restApiContext,"POST",`/executions/${t}/retry`,n?{loadWorkflow:!0}:void 0)},deleteExecutions:async function(t){if(await c(e.restApiContext,"POST","/executions/delete",t),t.ids&&t.ids.forEach(B),t.deleteBefore){const e=new Date(t.deleteBefore);R.value.forEach((t=>{new Date(t.startedAt??t.createdAt)<e&&B(t.id)}))}},addExecution:O,resetData:W,reset:function(){w.value=10,y.value=r(),g.value=!0,W(),$()},itemsPerPage:w,stopManyExecutions:async function(t){return await c(e.restApiContext,"POST","/executions/stopMany",{filter:{...t,workflowId:y.value.workflowId}})}}})))}}})); //# sourceMappingURL=executions.store-legacy-Cfatr-ks.js.map