n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 18.3 kB
JavaScript
(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.16.1`}}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]=`c27946fa-12ef-45fb-a38e-104ac8aa4529`,e._sentryDebugIdIdentifier=`sentry-dbid-c27946fa-12ef-45fb-a38e-104ac8aa4529`)})()}catch{}import"./chunk-CACdhNlC.js";import{$ as e,A as t,C as n,E as r,Ft as i,K as a,N as o,S as s,Sn as c,T as l,Wt as u,X as d,_ as f,_n as p,at as m,c as h,gt as g,h as _,it as v,j as y,pt as b,q as x,rt as S,w as C,yt as w}from"./vue.runtime.esm-bundler-C3C09Zii.js";import{_ as T,at as E,ot as D}from"./core-Bz5WjPxS.js";import{Di as O,Ht as k,Lt as A,Mi as j,Qi as M,Ut as N,Wt as P,Xi as F,Zi as ee,ct as I,dt as L,gt as te,tt as R}from"./src-XqE2yCpG.js";import{t as z}from"./_plugin-vue_export-helper-CIL7EULb.js";import{In as B,Ln as ne,Pn as V,Rt as H,_ as U,fr as W,s as G,sr as K}from"./users.store-xP93bV7X.js";import{Bo as re,Qc as ie,Qo as ae,wo as q}from"./constants-DuQbSl-q.js";import{D as oe}from"./useRootStore-XEREVjMN.js";import{t as se}from"./settings.store-CAFiYCMH.js";import{t as ce}from"./usePageRedirectionHelper-CC6sh9o0.js";import{t as le}from"./executions.store-BkB9JOf7.js";import{t as J}from"./dateFormatter-uA6jMwOH.js";import{t as Y}from"./useExecutionHelpers-DaszaQT9.js";import{t as ue}from"./insights.store-i6LlshbL.js";import{r as de}from"./readyToRun.store-DUyOyjE3.js";import{t as fe}from"./AnimatedSpinner-B5MF-pS1.js";import{t as pe}from"./ProjectHeader-CZLMSWNr.js";import{t as X}from"./InsightsSummary-fRg21vR0.js";import{t as me}from"./SelectedItemsInfo-DkzLiY3j.js";import{i as he,n as ge,r as _e,t as Z}from"./ExecutionsTime-VvdTfRMo.js";var ve=z(o({__name:`GlobalExecutionsListItemQueuedTooltip`,props:{status:{},concurrencyCap:{},isCloudDeployment:{type:Boolean}},emits:[`goToUpgrade`],setup(n,{emit:r}){let i=n,a=r,o=E();return(n,r)=>(e(),C(u(O),{placement:`top`},{content:w(()=>[i.status===`waiting`?(e(),C(u(D),{key:0,keypath:`executionsList.statusTooltipText.theWorkflowIsWaitingIndefinitely`,scope:`global`})):l(``,!0),i.status===`new`?(e(),C(u(D),{key:1,keypath:`executionsList.statusTooltipText.waitingForConcurrencyCapacity`,scope:`global`},{instance:w(()=>[i.isCloudDeployment?(e(),C(u(D),{key:0,keypath:`executionsList.statusTooltipText.waitingForConcurrencyCapacity.cloud`,scope:`global`},{concurrencyCap:w(()=>[t(c(i.concurrencyCap),1)]),link:w(()=>[y(u(R),{bold:``,size:`small`,class:p(n.$style.link),onClick:r[0]||=e=>a(`goToUpgrade`)},{default:w(()=>[t(c(u(o).baseText(`generic.upgradeNow`)),1)]),_:1},8,[`class`])]),_:1})):(e(),C(u(D),{key:1,keypath:`executionsList.statusTooltipText.waitingForConcurrencyCapacity.self`,scope:`global`},{concurrencyCap:w(()=>[t(c(i.concurrencyCap),1)]),link:w(()=>[y(u(R),{class:p(n.$style.link),href:u(o).baseText(`executions.concurrency.docsLink`),target:`_blank`},{default:w(()=>[t(c(u(o).baseText(`generic.viewDocs`)),1)]),_:1},8,[`class`,`href`])]),_:1}))]),_:1})):l(``,!0)]),default:w(()=>[v(n.$slots,`default`)]),_:3}))}}),[[`__cssModules`,{$style:{link:`_link_1g7mx_125`}}]]),ye={"data-test-id":`execution-status`},be={"data-test-id":`execution-time`},Q={key:0},xe={key:1},Se={key:2},Ce=z(o({__name:`GlobalExecutionsListItem`,props:{execution:{},selected:{type:Boolean,default:!1},workflowName:{default:``},workflowPermissions:{},concurrencyCap:{},isCloudDeployment:{type:Boolean}},emits:[`stop`,`select`,`retrySaved`,`retryOriginal`,`delete`,`goToUpgrade`],setup(a,{emit:o}){let d=o,g=a,v=h(),b=E(),x=Y(),S=i(!1),T=s(()=>g.execution.status===`running`),D=s(()=>g.execution.waitTill?new Date(g.execution.waitTill).getTime()===q.getTime():!1),A=s(()=>x.isExecutionRetriable(g.execution)),I={CRASHED:`crashed`,ERROR:`error`,WAITING:`waiting`,SUCCESS:`success`,NEW:`new`,RUNNING:`running`,UNKNOWN:`unknown`,CANCELED:`canceled`},te={[I.CRASHED]:{icon:`status-error`,color:`danger`},[I.ERROR]:{icon:`status-error`,color:`danger`},[I.WAITING]:{icon:`status-waiting`,color:`secondary`},[I.SUCCESS]:{icon:`status-completed`,color:`success`},[I.NEW]:{icon:`status-new`,color:`foreground-xdark`},[I.RUNNING]:{icon:`spinner`,color:`secondary`},[I.UNKNOWN]:{icon:`status-unknown`,color:`foreground-xdark`},[I.CANCELED]:{icon:`status-canceled`,color:`foreground-xdark`}},R=[I.ERROR,I.CRASHED],z=s(()=>({[v.dangerBg]:R.includes(g.execution.status)})),B=s(()=>g.execution.startedAt?W(g.execution.startedAt):b.baseText(`executionsList.startingSoon`)),ne=s(()=>g.execution.waitTill?W(g.execution.waitTill):``),V=s(()=>g.execution.stoppedAt?b.displayTimer(new Date(g.execution.stoppedAt).getTime()-new Date(g.execution.startedAt??g.execution.createdAt).getTime(),!0):``);function H(e){return e===I.CRASHED?b.baseText(`executionsList.error`):b.baseText(`executionsList.${e}`)}let U=s(()=>({...te[g.execution.status],label:H(g.execution.status)}));function W(e){let{date:t,time:n}=J(e);return b.baseText(`executionsList.started`,{interpolate:{time:n,date:t}})}function G(){S.value=!0,d(`stop`,g.execution)}function K(){d(`select`,g.execution)}async function re(e){d(e,g.execution)}return(i,o)=>{let s=m(`RouterLink`);return e(),r(`tr`,{class:p(z.value)},[n(`td`,null,[y(u(L),{"model-value":a.selected,"data-test-id":`select-execution-checkbox`,disabled:!(a.execution.id&&a.execution.stoppedAt),class:`mb-0`,style:{marginTop:`-3px`},"onUpdate:modelValue":K},null,8,[`model-value`,`disabled`])]),n(`td`,null,[y(u(O),{content:a.execution.workflowName||a.workflowName,placement:`top`},{default:w(()=>[y(s,{to:{name:u(ae).EXECUTION_PREVIEW,params:{name:a.execution.workflowId,executionId:a.execution.id}},class:p(i.$style.workflowName),target:`_blank`},{default:w(()=>[t(c(a.execution.workflowName||a.workflowName),1)]),_:1},8,[`to`,`class`])]),_:1},8,[`content`])]),n(`td`,ye,[D.value||a.execution.status===I.NEW?(e(),C(ve,{key:0,status:g.execution.status,"concurrency-cap":g.concurrencyCap,"is-cloud-deployment":g.isCloudDeployment,onGoToUpgrade:o[0]||=e=>d(`goToUpgrade`)},{default:w(()=>[n(`div`,null,[y(u(M),{icon:U.value.icon,color:U.value.color,class:`mr-2xs`},null,8,[`icon`,`color`]),t(` `+c(U.value.label),1)])]),_:1},8,[`status`,`concurrency-cap`,`is-cloud-deployment`])):(e(),C(u(O),{key:1,disabled:a.execution.status!==I.WAITING,content:u(b).baseText(`executionsList.statusWaiting`,{interpolate:{status:a.execution.status,time:ne.value}})},{default:w(()=>[n(`div`,null,[a.execution.status===I.RUNNING?(e(),C(u(F),{key:0,color:`secondary`,class:`mr-2xs`},{default:w(()=>[y(fe)]),_:1})):(e(),C(u(M),{key:1,size:`medium`,icon:U.value.icon,color:U.value.color,class:`mr-2xs`},null,8,[`icon`,`color`])),t(` `+c(U.value.label),1)])]),_:1},8,[`disabled`,`content`]))]),n(`td`,null,c(B.value),1),n(`td`,be,[V.value?(e(),r(f,{key:0},[t(c(V.value),1)],64)):(e(),C(Z,{key:1,"start-time":a.execution.startedAt??a.execution.createdAt},null,8,[`start-time`]))]),n(`td`,null,[a.execution.id?(e(),r(`span`,Q,c(a.execution.id),1)):l(``,!0),a.execution.retryOf?(e(),r(`span`,xe,[o[1]||=n(`br`,null,null,-1),n(`small`,null,` (`+c(u(b).baseText(`executionsList.retryOf`))+` `+c(a.execution.retryOf)+`) `,1)])):a.execution.retrySuccessId?(e(),r(`span`,Se,[o[2]||=n(`br`,null,null,-1),n(`small`,null,` (`+c(u(b).baseText(`executionsList.successRetry`))+` `+c(a.execution.retrySuccessId)+`) `,1)])):l(``,!0)]),n(`td`,null,[a.execution.mode===`manual`?(e(),C(u(O),{key:0,content:`Manual Execution`,placement:`top`},{default:w(()=>[y(u(M),{icon:`flask-conical`})]),_:1})):a.execution.mode===`chat`?(e(),C(u(O),{key:1,content:`Chat Execution`,placement:`top`},{default:w(()=>[y(u(M),{icon:`messages-square`})]),_:1})):l(``,!0)]),n(`td`,null,[!a.execution.stoppedAt||a.execution.waitTill?(e(),C(u(ee),{key:0,variant:`ghost`,"data-test-id":`stop-execution-button`,loading:S.value,disabled:S.value,onClick:_(G,[`stop`])},{default:w(()=>[t(c(u(b).baseText(`executionsList.stop`)),1)]),_:1},8,[`loading`,`disabled`])):l(``,!0)]),n(`td`,null,[T.value?l(``,!0):(e(),C(u(k),{key:0,trigger:`click`,onCommand:re},{dropdown:w(()=>[y(u(P),{class:p({[i.$style.actions]:!0,[i.$style.deleteOnly]:!A.value})},{default:w(()=>[A.value?(e(),C(u(N),{key:0,"data-test-id":`execution-retry-saved-dropdown-item`,class:p(i.$style.retryAction),command:`retrySaved`,disabled:!a.workflowPermissions.execute},{default:w(()=>[t(c(u(b).baseText(`executionsList.retryWithCurrentlySavedWorkflow`)),1)]),_:1},8,[`class`,`disabled`])):l(``,!0),A.value?(e(),C(u(N),{key:1,"data-test-id":`execution-retry-original-dropdown-item`,class:p(i.$style.retryAction),command:`retryOriginal`,disabled:!a.workflowPermissions.execute},{default:w(()=>[t(c(u(b).baseText(`executionsList.retryWithOriginalWorkflow`)),1)]),_:1},8,[`class`,`disabled`])):l(``,!0),y(u(N),{"data-test-id":`execution-delete-dropdown-item`,class:p(i.$style.deleteAction),command:`delete`,disabled:!a.workflowPermissions.update},{default:w(()=>[t(c(u(b).baseText(`generic.delete`)),1)]),_:1},8,[`class`,`disabled`])]),_:1},8,[`class`])]),default:w(()=>[y(u(j),{variant:`subtle`,icon:`ellipsis-vertical`})]),_:1}))])],2)}}}),[[`__cssModules`,{$style:{dangerBg:`_dangerBg_11wla_125`,workflowName:`_workflowName_11wla_129`}}]]),we={key:0},Te={style:{width:`50px`}},Ee={colspan:`8`},De={style:{width:`50px`}},Oe={colspan:`9`,style:{"text-align":`center`}},ke={key:0,"data-test-id":`execution-list-empty`},Ae=z(o({__name:`GlobalExecutionsList`,props:{executions:{},filters:{},total:{default:0},concurrentTotal:{default:0},estimated:{type:Boolean,default:!1}},emits:[`update:filters`,`execution:stop`],setup(a,{emit:o}){let d=a,m=o,h=E(),_=W(),x=G(),D=K(),O=le(),k=se(),j=ce(),M=i(!1),N=i(!1),P=i({}),F=ne(),I=V(),R=s(()=>N.value?d.total:Object.keys(P.value).length),z=s(()=>[{id:`all`,name:h.baseText(`executionsList.allWorkflows`)},...D.allWorkflows]),B=s(()=>k.isEnterpriseFeatureEnabled[ie.AdvancedExecutionFilters]),H=s(()=>k.isConcurrencyEnabled&&!k.isQueueModeEnabled);g(()=>d.executions,()=>{d.executions.length===0&&Y(),ve()});function ae(){N.value=!N.value,M.value=!N.value,q()}function q(){M.value=!M.value,M.value?Z():(N.value=!1,P.value={})}function oe(e){let t=e.id;if(P.value[t]){let{[t]:e,...n}=P.value;P.value=n}else P.value={...P.value,[t]:!0};M.value=Object.keys(P.value).length===d.executions.length,N.value=Object.keys(P.value).length===d.total}async function J(){let e=[B.value&&h.baseText(`executionsList.confirmMessage.annotationsNote`),h.baseText(`executionsList.confirmMessage.message`,{interpolate:{count:R.value.toString()}})].filter(Boolean).join(` `);if(await F.confirm(e,h.baseText(`executionsList.confirmMessage.headline`),{type:`warning`,confirmButtonText:h.baseText(`executionsList.confirmMessage.confirmButtonText`),cancelButtonText:h.baseText(`executionsList.confirmMessage.cancelButtonText`)})===`confirm`){try{await O.deleteExecutions({filters:O.executionsFilters,...N.value?{deleteBefore:new Date}:{ids:Object.keys(P.value)}})}catch(e){I.showError(e,h.baseText(`executionsList.showError.handleDeleteSelected.title`));return}I.showMessage({title:h.baseText(`executionsList.showMessage.handleDeleteSelected.title`),type:`success`}),Y()}}function Y(){M.value=!1,N.value=!1,P.value={}}async function ue(e){m(`update:filters`,e),Y()}function de(e){return pe(e.workflowId??``)??h.baseText(`executionsList.unsavedWorkflow`)}function fe(e){return re(e.scopes).workflow}function pe(e){return z.value.find(t=>t.id===e)?.name}T(b(`loadMoreButton`),([e])=>{e?.isIntersecting&&X()});async function X(){if(O.filters.status===`running`)return;let e=d.executions.at(-1);try{await O.fetchExecutions(O.executionsFilters,e?.id)}catch(e){I.showError(e,h.baseText(`executionsList.showError.loadMore.title`))}}function Z(){d.executions.forEach(e=>{P.value[e.id]=!0})}function ve(){N.value&&(M.value=!0,Z())}async function ye(e){await Q(e,!0)}async function be(e){await Q(e,!1)}async function Q(e,t){try{let n=U((await O.retryExecution(e.id,t)).status);n&&I.showMessage(n)}catch(e){I.showError(e,h.baseText(`executionsList.showError.retryExecution.title`))}_.track(`User clicked retry execution button`,{workflow_id:x.workflowId,execution_id:e.id,retry_type:t?`current`:`original`})}async function xe(e){try{await O.stopCurrentExecution(e.id),I.showMessage({title:h.baseText(`executionsList.showMessage.stopExecution.title`),message:h.baseText(`executionsList.showMessage.stopExecution.message`,{interpolate:{activeExecutionId:e.id}}),type:`success`}),m(`execution:stop`)}catch(e){I.showError(e,h.baseText(`executionsList.showError.stopExecution.title`))}}async function Se(e){if(!(e.annotation&&(e.annotation.vote||e.annotation.tags.length>0)&&await F.confirm(h.baseText(`executionsList.confirmMessage.annotatedExecutionMessage`),h.baseText(`executionDetails.confirmMessage.headline`),{type:`warning`,confirmButtonText:h.baseText(`executionDetails.confirmMessage.confirmButtonText`),cancelButtonText:``})!==`confirm`))try{if(await O.deleteExecutions({ids:[e.id]}),M.value){let{[e.id]:t,...n}=P.value;P.value=n}}catch(e){I.showError(e,h.baseText(`executionsList.showError.handleDeleteSelected.title`))}}async function Ae(e){e?await O.startAutoRefreshInterval():O.stopAutoRefreshInterval()}let $=()=>{j.goToUpgrade(`concurrency`,`upgrade-concurrency`)};return(i,o)=>(e(),r(`div`,{class:p(i.$style.execListWrapper)},[v(i.$slots,`default`),n(`div`,{class:p(i.$style.execListHeaderControls)},[H.value?(e(),C(he,{key:0,"running-executions-count":a.concurrentTotal,"concurrency-cap":u(k).concurrency,"is-cloud-deployment":u(k).isCloudDeployment,onGoToUpgrade:$},null,8,[`running-executions-count`,`concurrency-cap`,`is-cloud-deployment`])):(e(),C(u(L),{key:1,modelValue:u(O).autoRefresh,"onUpdate:modelValue":[o[0]||=e=>u(O).autoRefresh=e,Ae],"data-test-id":`execution-auto-refresh-checkbox`,label:u(h).baseText(`executionsList.autoRefresh`)},null,8,[`modelValue`,`label`])),n(`div`,{class:p(i.$style.execHeaderRight)},[y(ge,{executions:d.executions},null,8,[`executions`]),y(_e,{workflows:z.value,class:`execFilter`,onFilterChanged:ue},null,8,[`workflows`])],2)],2),n(`div`,{class:p(i.$style.execList)},[n(`div`,{class:p(i.$style.execTable)},[y(u(te),null,{default:w(()=>[n(`thead`,null,[M.value&&a.total>0?(e(),r(`tr`,we,[n(`th`,Te,[y(u(L),{"model-value":N.value,"data-test-id":`select-all-executions-checkbox`,class:`mb-0`,"onUpdate:modelValue":ae},null,8,[`model-value`])]),n(`th`,Ee,c(u(h).baseText(`executionsList.selectAll`,{adjustToNumber:a.total,interpolate:{count:`${a.total}`}})),1)])):l(``,!0),n(`tr`,null,[n(`th`,De,[y(u(L),{"model-value":M.value,disabled:a.total<1,"data-test-id":`select-visible-executions-checkbox`,class:`mb-0`,"onUpdate:modelValue":q},null,8,[`model-value`,`disabled`])]),n(`th`,null,c(u(h).baseText(`generic.workflow`)),1),n(`th`,null,c(u(h).baseText(`executionsList.status`)),1),n(`th`,null,c(u(h).baseText(`executionsList.startedAt`)),1),n(`th`,null,c(u(h).baseText(`executionsList.runTime`)),1),n(`th`,null,c(u(h).baseText(`executionsList.id`)),1),o[2]||=n(`th`,null,null,-1),o[3]||=n(`th`,{style:{width:`69px`}},null,-1),o[4]||=n(`th`,{style:{width:`50px`}},null,-1)])]),n(`tbody`,null,[(e(!0),r(f,null,S(a.executions,t=>(e(),C(Ce,{key:t.id,execution:t,"workflow-name":de(t),"workflow-permissions":fe(t),selected:P.value[t.id]||N.value,"concurrency-cap":u(k).concurrency,"is-cloud-deployment":u(k).isCloudDeployment,"data-test-id":`global-execution-list-item`,onStop:xe,onDelete:Se,onSelect:oe,onRetrySaved:ye,onRetryOriginal:be,onGoToUpgrade:$},null,8,[`execution`,`workflow-name`,`workflow-permissions`,`selected`,`concurrency-cap`,`is-cloud-deployment`]))),128)),u(O).loading&&!a.executions.length?(e(!0),r(f,{key:0},S(u(O).itemsPerPage,t=>(e(),r(`tr`,{key:t},[(e(),r(f,null,S(9,e=>n(`td`,{key:e},[y(u(A))])),64))]))),128)):l(``,!0),n(`tr`,null,[n(`td`,Oe,[a.executions.length?a.total>a.executions.length||a.estimated?(e(),C(u(ee),{key:1,ref:`loadMoreButton`,icon:`refresh-cw`,title:u(h).baseText(`executionsList.loadMore`),label:u(h).baseText(`executionsList.loadMore`),loading:u(O).loading,"data-test-id":`load-more-button`,onClick:o[1]||=e=>X()},null,8,[`title`,`label`,`loading`])):(e(),r(f,{key:2},[t(c(u(h).baseText(`executionsList.loadedAll`)),1)],64)):(e(),r(`span`,ke,c(u(h).baseText(`executionsList.empty`)),1))])])])]),_:1})],2)],2),y(me,{"selected-count":R.value,onDeleteSelected:J,onClearSelection:Y},null,8,[`selected-count`])],2))}}),[[`__cssModules`,{$style:{execListWrapper:`_execListWrapper_5gyes_125`,execList:`_execList_5gyes_125`,execListHeaderControls:`_execListHeaderControls_5gyes_140`,execTable:`_execTable_5gyes_147`,execHeaderRight:`_execHeaderRight_5gyes_152`}}]]),$=o({__name:`ExecutionsView`,setup(t){let n=I(),r=E(),i=W(),o=B(),s=G(),c=K(),f=le(),p=ue(),m=H(),h=V(),g=de(),{executionsCount:_,executionsCountEstimated:v,concurrentExecutionsCount:b,filters:S,allExecutions:T}=oe(f);a(async()=>{await D(),o.run(`executionsList.openDialog`),i.track(`User opened Executions log`,{workflow_id:s.workflowId})}),d(async()=>{m.set(r.baseText(`executionsList.workflowExecutions`)),document.addEventListener(`visibilitychange`,O),await f.initialize()}),x(()=>{f.reset(),document.removeEventListener(`visibilitychange`,O)});async function D(){try{await c.fetchAllWorkflows(n.params?.projectId)}catch(e){h.showError(e,r.baseText(`executionsList.showError.loadWorkflows.title`))}}function O(){document.visibilityState===`hidden`?f.stopAutoRefreshInterval():f.startAutoRefreshInterval()}async function k(){try{await f.fetchExecutions()}catch(e){h.showError(e,r.baseText(`executionsList.showError.refreshData.title`))}}async function A(e){f.reset(),f.setFilters(e),await f.initialize()}async function j(){await k()}return(t,n)=>(e(),C(Ae,{executions:u(T),filters:u(S),total:u(_),"estimated-total":u(v),"concurrent-total":u(b),"onExecution:stop":j,"onUpdate:filters":A},{default:w(()=>[y(pe,null,{default:w(()=>[u(g).isOverviewSubPage&&u(p).isSummaryEnabled?(e(),C(X,{key:0,loading:u(p).weeklySummary.isLoading,summary:u(p).weeklySummary.state,"time-range":`week`},null,8,[`loading`,`summary`])):l(``,!0)]),_:1})]),_:1},8,[`executions`,`filters`,`total`,`estimated-total`,`concurrent-total`]))}});export{$ as default};
//# sourceMappingURL=ExecutionsView-C_CKxqnC.js.map