UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 2.58 kB
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`n8n@2.13.4`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`678dc2b2-409e-4dfc-b27b-ffe77d13db34`,e._sentryDebugIdIdentifier=`sentry-dbid-678dc2b2-409e-4dfc-b27b-ffe77d13db34`)})()}catch{}import{bt as e}from"./_MapCache-CUJwh2qp.js";import{_t as t}from"./src-wni2AGA3.js";import{en as n}from"./users.store-BHWXXawf.js";import{ms as r}from"./constants-CIP7tKq1.js";import{t as i}from"./dateFormatter-aoRZizgK.js";function a(){let a=e(),o=t(),s=n();function c(e){let t={name:`unknown`,createdAt:e.createdAt?.toString()??``,startTime:l(e.startedAt??e.createdAt),label:`Status unknown`,runningTime:``,showTimestamp:!0,tags:e.annotation?.tags??[]};if(e.status===`new`?(t.name=`new`,t.label=a.baseText(`executionsList.new`),t.showTimestamp=!1):e.status===`waiting`?(t.name=`waiting`,t.label=a.baseText(`executionsList.waiting`),t.showTimestamp=!1):e.status===`canceled`?t.label=a.baseText(`executionsList.canceled`):e.status===`running`?(t.name=`running`,t.label=a.baseText(`executionsList.running`)):e.status===`success`?(t.name=`success`,t.label=a.baseText(`executionsList.succeeded`)):(e.status===`error`||e.status===`crashed`)&&(t.name=`error`,t.label=a.baseText(`executionsList.error`)),e.status||=`unknown`,e.startedAt&&e.stoppedAt){let n=e.stoppedAt?new Date(e.stoppedAt).getTime():Date.now();t.runningTime=a.displayTimer(n-new Date(e.startedAt).getTime(),!0)}return t}function l(e){let{date:t,time:n}=i(e);return a.baseText(`executionsList.started`,{interpolate:{time:n,date:t}})}function u(e){return[`crashed`,`error`].includes(e.status)&&!e.retrySuccessId}function d(e,t){let n=o.resolve({name:r.EXECUTION_PREVIEW,params:{name:t,executionId:e}});window.open(n.href,`_blank`)}function f(e){let t=e.parentExecution||e.subExecution;if(!t)return``;let{workflowId:n,executionId:i}=t;return o.resolve({name:r.EXECUTION_PREVIEW,params:{name:n,executionId:i}}).fullPath}function p(e,t){(e.parentExecution||e.subExecution)&&s.track(e.parentExecution?`User clicked parent execution button`:`User clicked inspect sub-workflow`,{view:t})}return{getUIDetails:c,formatDate:l,isExecutionRetriable:u,openExecutionInNewTab:d,trackOpeningRelatedExecution:p,resolveRelatedExecutionUrl:f}}export{a as t}; //# sourceMappingURL=useExecutionHelpers-D8SD8Eej.js.map