UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 23.6 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","./_MapCache-legacy-DwgdC8YO.js","./src-legacy-Dwzr7bD0.js","./_plugin-vue_export-helper-legacy-DEZAmQqp.js","./sanitize-html-legacy-ChR3ikxn.js","./date-picker-legacy-uAA3gY1d.js","./users.store-legacy-OKuN0qAC.js","./constants-legacy-DNCca_FT.js","./merge-legacy-uu1aGqHK.js","./_baseOrderBy-legacy-PsQY_Pvh.js","./dateformat-legacy-BxdD_OP7.js","./useDebounce-legacy-CT3oYGrC.js","./versions.store-legacy-BoVYiMEK.js","./usePageRedirectionHelper-legacy-dYzA8Va8.js","./executions.store-legacy-z6ytCHo9.js","./useInjectWorkflowId-legacy-Bqd7CF__.js","./dateFormatter-legacy-CmupnmDm.js","./useExecutionHelpers-legacy-L8nz8vaT.js","./TagsDropdown-legacy-gwnXmOWc.js","./WorkflowTagsDropdown-legacy-CBAdc9l0.js","./WorkflowExecutionsInfoAccordion-legacy-DsoIat58.js","./AnnotationTagsDropdown.ee-legacy-D4sPlYie.js","./ExecutionsTime-legacy-CAfxGDXd.js","./useIntersectionObserver-legacy-yv2hSUny.js"],(function(e,t){var o,n,i,a,r,s,c,l,u,d,_,v,x,m,f,g,p,y,w,b,k,h,z,E,C,W,L,T,j,I,$,R,M,S,D,A,U,O,B,F,q,P,V,H,X,G,N,Y,Z,J,K,Q,ee,te,oe,ne,ie,ae,re,se,ce,le,ue,de,_e,ve,xe,me,fe,ge,pe,ye;return{setters:[function(e){o=e.$,n=e.A,i=e.C,a=e.E,r=e.Ft,s=e.N,c=e.S,l=e.Sn,u=e.T,d=e.Wt,_=e.X,v=e._,x=e._n,m=e.at,f=e.gt,g=e.j,p=e.q,y=e.r,w=e.rt,b=e.w,k=e.yt},function(e){h=e.bt},function(e){z=e.$i,E=e.Bt,C=e.Mi,W=e.P,L=e.R,T=e.Yi,j=e.Zi,I=e._t,$=e.gt,R=e.ht,M=e.yt,S=e.zt},function(e){D=e.t},function(e){},function(e){},function(e){A=e.As,U=e.Gr,O=e.Tr,B=e.Un,F=e.Xr,q=e._,P=e.en,V=e.s,H=e.yn},function(e){X=e.is,G=e.ms,N=e.pl,Y=e.ps},function(e){},function(e){e.s},function(e){},function(e){Z=e.t},function(e){},function(e){J=e.t},function(e){K=e.t},function(e){Q=e.t},function(e){ee=e.a,te=e.i},function(e){oe=e.t},function(e){},function(e){},function(e){ne=e.t},function(e){},function(e){ie=e.i,ae=e.n,re=e.r,se=e.t},function(e){ce=e.t}],execute:function(){(le=document.createElement("style")).textContent="._WorkflowExecutionsCard_m24vz_125{--execution-list-item--color--background:var(--execution-card--color--background);--execution-list-item--color--background--highlight:var(--color--warning--tint-1);padding-right:var(--spacing--md);flex-direction:column;display:flex}._WorkflowExecutionsCard_m24vz_125._active_m24vz_132{border-left:var(--spacing--4xs)var(--border-style)transparent!important}._WorkflowExecutionsCard_m24vz_125._active_m24vz_132 ._executionStatus_m24vz_135{color:var(--color--text--shade-1)!important}._WorkflowExecutionsCard_m24vz_125:hover ._executionLink_m24vz_138,._WorkflowExecutionsCard_m24vz_125._active_m24vz_132 ._executionLink_m24vz_138{--execution-list-item--color--background:var(--execution-card--color--background--hover)}._WorkflowExecutionsCard_m24vz_125._new_m24vz_141 ._spinner_m24vz_141,._WorkflowExecutionsCard_m24vz_125._running_m24vz_141 ._spinner_m24vz_141{position:relative;top:1px}._WorkflowExecutionsCard_m24vz_125._new_m24vz_141,._WorkflowExecutionsCard_m24vz_125._new_m24vz_141 ._executionLink_m24vz_138,._WorkflowExecutionsCard_m24vz_125._running_m24vz_141,._WorkflowExecutionsCard_m24vz_125._running_m24vz_141 ._executionLink_m24vz_138{border-left:var(--spacing--4xs)var(--border-style)var(--execution-card--border-color--running)}._WorkflowExecutionsCard_m24vz_125._new_m24vz_141 ._statusLabel_m24vz_148,._WorkflowExecutionsCard_m24vz_125._new_m24vz_141 ._spinner_m24vz_141,._WorkflowExecutionsCard_m24vz_125._running_m24vz_141 ._statusLabel_m24vz_148,._WorkflowExecutionsCard_m24vz_125._running_m24vz_141 ._spinner_m24vz_141{color:var(--color--warning)}._WorkflowExecutionsCard_m24vz_125._success_m24vz_153,._WorkflowExecutionsCard_m24vz_125._success_m24vz_153 ._executionLink_m24vz_138{border-left:var(--spacing--4xs)var(--border-style)var(--execution-card--border-color--success)}._WorkflowExecutionsCard_m24vz_125._new_m24vz_141,._WorkflowExecutionsCard_m24vz_125._new_m24vz_141 ._executionLink_m24vz_138{border-left:var(--spacing--4xs)var(--border-style)var(--execution-card--border-color--waiting)}._WorkflowExecutionsCard_m24vz_125._new_m24vz_141 ._statusLabel_m24vz_148{color:var(--execution-card--color--text--waiting)}._WorkflowExecutionsCard_m24vz_125._waiting_m24vz_162,._WorkflowExecutionsCard_m24vz_125._waiting_m24vz_162 ._executionLink_m24vz_138{border-left:var(--spacing--4xs)var(--border-style)var(--execution-card--border-color--waiting)}._WorkflowExecutionsCard_m24vz_125._waiting_m24vz_162 ._statusLabel_m24vz_148{color:var(--color--secondary)}._WorkflowExecutionsCard_m24vz_125._error_m24vz_168,._WorkflowExecutionsCard_m24vz_125._error_m24vz_168 ._executionLink_m24vz_138{border-left:var(--spacing--4xs)var(--border-style)var(--execution-card--border-color--error)}._WorkflowExecutionsCard_m24vz_125._error_m24vz_168 ._statusLabel_m24vz_148{color:var(--color--danger)}._WorkflowExecutionsCard_m24vz_125._unknown_m24vz_174,._WorkflowExecutionsCard_m24vz_125._unknown_m24vz_174 ._executionLink_m24vz_138{border-left:var(--spacing--4xs)var(--border-style)var(--execution-card--border-color--unknown)}._WorkflowExecutionsCard_m24vz_125 ._annotation_m24vz_177{gap:var(--spacing--3xs);margin:var(--spacing--4xs)0 0;flex-direction:row;align-items:center;display:flex}._WorkflowExecutionsCard_m24vz_125 ._annotation_m24vz_177 ._ratingIcon_m24vz_184 ._up_m24vz_184{color:var(--color--success)}._WorkflowExecutionsCard_m24vz_125 ._annotation_m24vz_177 ._ratingIcon_m24vz_184 ._down_m24vz_187{color:var(--color--danger)}._executionLink_m24vz_138{background:var(--execution-list-item--color--background);width:100%;color:var(--color--text);font-size:var(--font-size--xs);padding:var(--spacing--xs);padding-right:var(--spacing--sm);left:calc(-1*var(--spacing--4xs));justify-content:space-between;align-items:center;display:flex;position:relative}._executionLink_m24vz_138:active ._icon_m24vz_204,._executionLink_m24vz_138:active ._statusLabel_m24vz_148{color:var(--color--text)}._icons_m24vz_209{align-items:center;display:flex}._icon_m24vz_204{font-size:var(--font-size--sm)}._icon_m24vz_204._retry_m24vz_217 svg{color:var(--color--primary)}._icon_m24vz_204._manual_m24vz_220{position:relative;top:1px}._icon_m24vz_204+._icon_m24vz_204{margin-left:var(--spacing--2xs)}._showGap_m24vz_228{margin-bottom:var(--spacing--2xs)}._showGap_m24vz_228 ._executionLink_m24vz_138{border-bottom:1px solid var(--color--foreground--shade-1)}._container_1nvjo_125{background-color:var(--color--background--light-3);border-right:var(--border);padding:var(--spacing--lg)0 var(--spacing--lg)var(--spacing--lg);z-index:1;flex-direction:column;flex:0 0 310px;display:flex;position:relative;overflow:hidden}._heading_1nvjo_137{padding-right:var(--spacing--md);justify-content:space-between;align-items:center;display:flex}._controls_1nvjo_144{padding-top:var(--spacing--sm);padding-right:var(--spacing--md);justify-content:space-between;align-items:center;display:flex}._executionList_1nvjo_152{margin-bottom:var(--spacing--md);flex:1;overflow:auto;background-color:var(--color--background--light-3)!important}._executionList_1nvjo_152:before{z-index:999;background:linear-gradient(#fbfbfb 0%,rgba(251,251,251,0) 100%);width:270px;height:6px;display:block;position:absolute}._executionList_1nvjo_152>div:first-child{margin-top:3px}._infoAccordion_1nvjo_170{margin-left:calc(-1*var(--spacing--lg));border-top:var(--border);width:100%;position:absolute;bottom:0}._infoAccordion_1nvjo_170>div{background-color:var(--color--background--light-2);width:100%;margin-top:0!important}._noResultsContainer_1nvjo_183{width:100%;margin-top:var(--spacing--2xl);text-align:center}.executions-sidebar[data-v-b9def645] .el-skeleton__item{border-radius:0;height:60px}._container_pd7qp_125{width:100%;height:100%;display:flex}._content_pd7qp_131{flex:1}@media screen and (max-width:991px){._container_pd7qp_125{flex-direction:column}._content_pd7qp_131{flex:50%}}\n/*$vite$:1*/",document.head.appendChild(le);try{t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(we=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[we]="b7759306-3b64-4d9a-a832-19bd2c8420f3",t._sentryDebugIdIdentifier="sentry-dbid-b7759306-3b64-4d9a-a832-19bd2c8420f3")}catch(t){}var t,we;ue={key:2},de=s({__name:"WorkflowExecutionsCard",props:{execution:{},highlight:{type:Boolean},showGap:{type:Boolean},workflowPermissions:{}},emits:["retryExecution","mounted"],setup(e,{emit:t}){const r=e,s=t,v=$(),f=h(),p=oe(),y=A(),w=c((()=>y.isEnterpriseFeatureEnabled[N.AdvancedExecutionFilters])),T=c((()=>w.value)),I=Q(),R=c((()=>[{id:"current-workflow",label:f.baseText("executionsList.retryWithCurrentlySavedWorkflow")},{id:"original-workflow",label:f.baseText("executionsList.retryWithOriginalWorkflow")}])),M=c((()=>p.getUIDetails(r.execution))),S=c((()=>r.execution.id===v.params.executionId)),D=c((()=>p.isExecutionRetriable(r.execution)));function U(e){s("retryExecution",{execution:r.execution,command:e})}return _((()=>{s("mounted",r.execution.id)})),(t,r)=>{const s=m("RouterLink");return o(),a("div",{class:x({"execution-card":!0,[t.$style.WorkflowExecutionsCard]:!0,[t.$style.active]:S.value,[t.$style[M.value.name]]:!0,[t.$style.highlight]:e.highlight,[t.$style.showGap]:e.showGap})},[g(s,{class:x(t.$style.executionLink),to:{name:d(G).EXECUTION_PREVIEW,params:{name:d(I),executionId:e.execution.id},query:d(v).query},"data-test-execution-status":M.value.name},{default:k((()=>[i("div",{class:x(t.$style.description)},["new"===M.value.name?(o(),b(d(j),{key:0,color:"text-dark",bold:!0,size:"medium","data-test-id":"execution-time"},{default:k((()=>[n(l(d(te)(M.value.createdAt))+" - "+l(d(f).baseText("executionDetails.startingSoon")),1)])),_:1})):(o(),b(d(j),{key:1,color:"text-dark",bold:!0,size:"medium","data-test-id":"execution-time"},{default:k((()=>[n(l(M.value.startTime),1)])),_:1})),i("div",{class:x(t.$style.executionStatus)},["running"===M.value.name?(o(),b(d(L),{key:0,size:"small",class:x([t.$style.spinner,"mr-4xs"])},null,8,["class"])):u("",!0),g(d(j),{class:x(t.$style.statusLabel),size:"small"},{default:k((()=>[n(l(M.value.label),1)])),_:1},8,["class"]),r[0]||(r[0]=n(" "+l(" ")+" ",-1)),"running"!==M.value.name||e.execution.stoppedAt?u("",!0):(o(),b(d(j),{key:1,color:S.value?"text-dark":"text-base",size:"small","data-test-id":"execution-time-in-status"},{default:k((()=>[n(l(d(f).baseText("executionDetails.runningTimeRunning"))+" ",1),g(se,{"start-time":e.execution.startedAt??e.execution.createdAt},null,8,["start-time"])])),_:1},8,["color"])),"new"===M.value.name&&e.execution.createdAt?(o(),b(d(j),{key:2,color:S.value?"text-dark":"text-base",size:"small"},{default:k((()=>[i("span",null,l(d(f).baseText("executionDetails.at"))+" "+l(d(ee)(e.execution.createdAt)),1)])),_:1},8,["color"])):""!==M.value.runningTime?(o(),b(d(j),{key:3,color:S.value?"text-dark":"text-base",size:"small"},{default:k((()=>[n(l(d(f).baseText("executionDetails.runningTimeFinished",{interpolate:{time:M.value?.runningTime}})),1)])),_:1},8,["color"])):u("",!0)],2),"retry"===e.execution.mode?(o(),a("div",ue,[g(d(j),{color:S.value?"text-dark":"text-base",size:"small"},{default:k((()=>[n(l(d(f).baseText("executionDetails.retry"))+" #"+l(e.execution.retryOf),1)])),_:1},8,["color"])])):u("",!0),T.value?(o(),a("div",{key:3,class:x(t.$style.annotation)},[e.execution.annotation?.vote?(o(),a("div",{key:0,class:x(t.$style.ratingIcon)},["up"==e.execution.annotation.vote?(o(),b(d(z),{key:0,class:x(t.$style.up),icon:"thumbs-up"},null,8,["class"])):(o(),b(d(z),{key:1,class:x(t.$style.down),icon:"thumbs-down"},null,8,["class"]))],2)):u("",!0),M.value.tags.length>0?(o(),b(d(W),{key:1,tags:M.value.tags,clickable:!1},null,8,["tags"])):u("",!0)],2)):u("",!0)],2),i("div",{class:x(t.$style.icons)},[D.value?(o(),b(d(E),{key:0,class:x([t.$style.icon,t.$style.retry]),items:R.value,disabled:!e.workflowPermissions.execute,"activator-icon":"redo-2","data-test-id":"retry-execution-button",onSelect:U},null,8,["class","items","disabled"])):u("",!0),"manual"===e.execution.mode?(o(),b(d(C),{key:1,placement:"top"},{content:k((()=>[i("span",null,l(d(f).baseText("executionsList.test")),1)])),default:k((()=>[g(d(z),{class:x([t.$style.icon,t.$style.manual]),icon:"flask-conical"},null,8,["class"])])),_:1})):u("",!0),"evaluation"===e.execution.mode?(o(),b(d(C),{key:2,placement:"top"},{content:k((()=>[i("span",null,l(d(f).baseText("executionsList.evaluation")),1)])),default:k((()=>[g(d(z),{class:x([t.$style.icon,t.$style.evaluation]),icon:"check-check"},null,8,["class"])])),_:1})):u("",!0)],2)])),_:1},8,["class","to","data-test-execution-status"])],2)}}}),_e=D(de,[["__cssModules",{$style:{WorkflowExecutionsCard:"_WorkflowExecutionsCard_m24vz_125",active:"_active_m24vz_132",executionStatus:"_executionStatus_m24vz_135",executionLink:"_executionLink_m24vz_138",new:"_new_m24vz_141",spinner:"_spinner_m24vz_141",running:"_running_m24vz_141",statusLabel:"_statusLabel_m24vz_148",success:"_success_m24vz_153",waiting:"_waiting_m24vz_162",error:"_error_m24vz_168",unknown:"_unknown_m24vz_174",annotation:"_annotation_m24vz_177",ratingIcon:"_ratingIcon_m24vz_184",up:"_up_m24vz_184",down:"_down_m24vz_187",icon:"_icon_m24vz_204",icons:"_icons_m24vz_209",retry:"_retry_m24vz_217",manual:"_manual_m24vz_220",showGap:"_showGap_m24vz_228"}}]]),ve={key:0,class:"mr-l"},xe={key:3,class:"mr-m"},me=s({__name:"WorkflowExecutionsSidebar",props:{workflow:{},executions:{},loading:{type:Boolean},loadingMore:{type:Boolean},temporaryExecution:{}},emits:["retryExecution","loadMore","filterUpdated","update:autoRefresh","execution:stopMany"],setup(e,{emit:t}){const s=e,_=t,m=$(),p=I(),z=h(),E=K(),C=A(),W=J(),L=r({activeExecutionSet:!1,cardsMounted:!1,scroll:!0}),R=r({}),D=r(null),{observe:U}=ce({root:D,threshold:.01,onIntersect:()=>_("loadMore",20)}),O=c((()=>X(s.workflow?.scopes).workflow)),B=c((()=>C.isConcurrencyEnabled&&!C.isQueueModeEnabled));function q(e,t){e&&F(e)&&t&&(R.value[t]=e)}function P(e){const t=s.executions.findIndex((t=>t.id===e));if(E.activeExecution?.id===e&&(L.value.activeExecutionSet=!0,L.value.cardsMounted=!0),t===s.executions.length-1&&!s.loading&&!s.loadingMore){const t=R.value[e]?.$el;U(t)}}function V(e){_("retryExecution",e)}function H(e){L.value.activeExecutionSet=!1,L.value.cardsMounted=!1,L.value.scroll=!0,_("filterUpdated",e)}function N(e){_("update:autoRefresh",e)}f((()=>m),((e,t)=>{t.name===G.EXECUTION_PREVIEW&&e.name===G.EXECUTION_HOME&&p.go(-1)})),f((()=>E.activeExecution),((e,t)=>{e&&e.id!==t?.id&&(L.value.activeExecutionSet=!0)})),f(L,(e=>{Object.values(e).every(Boolean)&&function(){if(D.value&&E.activeExecution&&R.value[E.activeExecution.id]){const e=R.value[E.activeExecution.id].$el.getBoundingClientRect(),t=200;e.top>D.value.offsetHeight&&(L.value.scroll=!1,D.value.scrollTo({top:e.top-t,behavior:"smooth"}))}}()}),{deep:!0});const Y=()=>{W.goToUpgrade("concurrency","upgrade-concurrency")};return(t,r)=>(o(),a("div",{class:x(["executions-sidebar",t.$style.container]),"data-test-id":"executions-sidebar"},[i("div",{class:x(t.$style.heading)},[g(d(T),{tag:"h2",size:"medium",color:"text-dark"},{default:k((()=>[n(l(d(z).baseText("generic.executions")),1)])),_:1}),B.value?(o(),b(ie,{key:0,"running-executions-count":d(E).concurrentExecutionsCount,"concurrency-cap":d(C).concurrency,"is-cloud-deployment":d(C).isCloudDeployment,onGoToUpgrade:Y},null,8,["running-executions-count","concurrency-cap","is-cloud-deployment"])):u("",!0),g(ae,{executions:s.executions},null,8,["executions"])],2),i("div",{class:x(t.$style.controls)},[g(d(M),{modelValue:d(E).autoRefresh,"onUpdate:modelValue":[r[0]||(r[0]=e=>d(E).autoRefresh=e),N],"data-test-id":"auto-refresh-checkbox",label:d(z).baseText("executionsList.autoRefresh")},null,8,["modelValue","label"]),g(re,{"popover-side":"right","popover-align":"start",onFilterChanged:H})],2),i("div",{ref_key:"executionListRef",ref:D,class:x(t.$style.executionList),"data-test-id":"current-executions-list",onScroll:r[1]||(r[1]=e=>function(e=20){if(!s.loading&&D.value){const t=D.value.offsetHeight-(D.value.scrollHeight-D.value.scrollTop);t>-10&&t<10&&_("loadMore",e)}}(20))},[e.loading?(o(),a("div",ve,[g(d(S),{variant:"rect"})])):u("",!0),e.loading||0!==e.executions.length?e.temporaryExecution?(o(),b(_e,{key:2,ref:t=>q(t,e.temporaryExecution?.id),execution:e.temporaryExecution,"data-test-id":`execution-details-${e.temporaryExecution.id}`,"show-gap":!0,"workflow-permissions":O.value,onRetryExecution:V},null,8,["execution","data-test-id","workflow-permissions"])):u("",!0):(o(),a("div",{key:1,class:x(t.$style.noResultsContainer),"data-test-id":"execution-list-empty"},[g(d(j),{color:"text-base",size:"medium",align:"center"},{default:k((()=>[n(l(d(z).baseText("executionsLandingPage.noResults")),1)])),_:1})],2)),g(y,{name:"executions-list"},{default:k((()=>[(o(!0),a(v,null,w(e.executions,(e=>(o(),b(_e,{key:e.id,ref_for:!0,ref:t=>q(t,e.id),execution:e,"workflow-permissions":O.value,"data-test-id":`execution-details-${e.id}`,onRetryExecution:V,onMounted:P},null,8,["execution","workflow-permissions","data-test-id"])))),128))])),_:1}),e.loadingMore?(o(),a("div",xe,[g(d(S),{variant:"p",rows:1})])):u("",!0)],34),i("div",{class:x(t.$style.infoAccordion)},[g(ne,{"initially-expanded":!1})],2)],2))}}),fe=D(me,[["__cssModules",{$style:{container:"_container_1nvjo_125",heading:"_heading_1nvjo_137",controls:"_controls_1nvjo_144",executionList:"_executionList_1nvjo_152",infoAccordion:"_infoAccordion_1nvjo_170",noResultsContainer:"_noResultsContainer_1nvjo_183"}}],["__scopeId","data-v-b9def645"]]),ge=s({__name:"WorkflowExecutionsList",props:{loading:{type:Boolean,default:!1},workflow:{},executions:{default:()=>[]},execution:{},loadingMore:{type:Boolean,default:!1}},emits:["execution:delete","execution:stop","execution:retry","update:auto-refresh","update:filters","load-more","reload"],setup(e,{emit:t}){const n=e,i=t,{promptSaveUnsavedWorkflowChanges:r}=H({router:I()}),s=c((()=>n.executions.find((e=>e.id===n.execution?.id))?void 0:n.execution??void 0)),l=c((()=>n.loading||!n.execution&&n.executions.length)),d=()=>{n.execution?.id&&i("execution:delete",n.execution.id)},_=()=>{n.execution?.id&&i("execution:stop",n.execution.id)},v=e=>{const t="current-workflow"===e.command;i("execution:retry",{id:e.execution.id,loadWorkflow:t})};return R((async(e,t,o)=>{B(e)!==Y.WORKFLOW?await r(o):o()})),(t,n)=>{const r=m("RouterView");return o(),a("div",{class:x(t.$style.container)},[g(fe,{executions:e.executions,loading:e.loading&&!e.executions.length,"loading-more":e.loadingMore,"temporary-execution":s.value,workflow:e.workflow,"onUpdate:autoRefresh":n[0]||(n[0]=e=>i("update:auto-refresh",e)),onReloadExecutions:n[1]||(n[1]=e=>i("reload")),onFilterUpdated:n[2]||(n[2]=e=>i("update:filters",e)),onLoadMore:n[3]||(n[3]=e=>i("load-more")),onRetryExecution:v},null,8,["executions","loading","loading-more","temporary-execution","workflow"]),l.value?u("",!0):(o(),a("div",{key:0,class:x(t.$style.content)},[g(r,{name:"executionPreview",execution:e.execution,onDeleteCurrentExecution:d,onRetryExecution:v,onStopExecution:_},null,8,["execution"])],2))],2)}}}),pe=D(ge,[["__cssModules",{$style:{container:"_container_pd7qp_125",content:"_content_pd7qp_131"}}]]),ye=s({__name:"WorkflowExecutionsView",setup(e){const t=K(),n=V(),i=U(),a=h(),s=P(),l=$(),d=I(),v=O(),{callDebounced:x}=Z(),m=r(!1),g=r(!1),y=r(),w=Q(),k=c((()=>{const e=l.params.executionId;return"string"==typeof e?e:void 0})),z=c((()=>w.value?[...t.currentExecutionsByWorkflowId[w.value]??[],...t.executionsByWorkflowId[w.value]??[]]:[])),E=c((()=>z.value.find((e=>e.id===k.value))??C.value)),C=r(),W=c((()=>"true"===l.query.new));async function L(){if(k.value){try{C.value=await t.fetchExecution(k.value),t.activeExecution=C.value}catch(e){v.showError(e,a.baseText("nodeView.showError.openExecution.title"))}C.value||v.showMessage({type:"error",title:a.baseText("openExecution.missingExeuctionId.title"),message:a.baseText("openExecution.missingExeuctionId.message")})}}function T(){"hidden"===document.visibilityState?t.stopAutoRefreshInterval():t.startAutoRefreshInterval(w.value)}function j(){!W.value&&w.value?y.value=i.workflowsById[w.value]??n.workflow:y.value=n.workflow}async function R(e){e?await t.startAutoRefreshInterval(w.value):t.stopAutoRefreshInterval()}async function M(){if(w.value)try{await t.fetchExecutions({...t.executionsFilters,workflowId:w.value})}catch(e){999===e.errorCode?v.showMessage({title:a.baseText("executionsList.showError.refreshData.title"),message:e.message,type:"error",duration:3500},!1):v.showError(e,a.baseText("executionsList.showError.refreshData.title"))}}async function S(e){t.reset(),t.setFilters(e),await t.initialize(w.value)}async function D(e){if(e)try{await t.stopCurrentExecution(e),v.showMessage({title:a.baseText("executionsList.showMessage.stopExecution.title"),message:a.baseText("executionsList.showMessage.stopExecution.message",{interpolate:{activeExecutionId:e}}),type:"success"}),await M()}catch(o){v.showError(o,a.baseText("executionsList.showError.stopExecution.title"))}}async function A(e){if(e){m.value=!0;try{const o=z.value.findIndex((t=>t.id===e)),n=z.value[o+1]||z.value[o-1]||z.value[0];await t.deleteExecutions({ids:[e]}),y.value&&(z.value.length>0?await d.replace({name:G.EXECUTION_PREVIEW,params:{name:y.value.id,executionId:n.id}}).catch((()=>{})):await d.replace({name:G.EXECUTION_HOME,params:{name:y.value.id}}))}catch(o){return m.value=!1,void v.showError(o,a.baseText("executionsList.showError.handleDeleteSelected.title"))}m.value=!1,v.showMessage({title:a.baseText("executionsList.showMessage.handleDeleteSelected.title"),type:"success"})}}async function B(e){v.showMessage({title:a.baseText("executionDetails.runningMessage"),type:"info",duration:2e3}),await async function(e){try{const o=q((await t.retryExecution(e.id,e.loadWorkflow)).status);o&&v.showMessage(o)}catch(o){v.showError(o,a.baseText("executionsList.showError.retryExecution.title"))}}(e),await M(),s.track("User clicked retry execution button",{workflow_id:y.value?.id,execution_id:e.id,retry_type:e.loadWorkflow?"current":"original"})}async function F(){g.value||await x(H,{debounceTime:1e3})}async function H(){if(t.executionsFilters.status?.includes("running")||z.value.length>=t.executionsCount)return;let e;g.value=!0,0!==z.value.length&&(e=z.value.slice(-1)[0].id);try{await t.fetchExecutions(t.executionsFilters,e)}catch(o){return g.value=!1,void v.showError(o,a.baseText("executionsList.showError.loadMore.title"))}g.value=!1}return f((()=>w.value),(()=>{j()})),f((()=>k.value),(async()=>{await L()})),_((async()=>{j(),w.value&&await Promise.all([t.initialize(w.value),L()]),await async function(){l.name===G.EXECUTION_HOME&&z.value.length>0&&y.value&&await d.replace({name:G.EXECUTION_PREVIEW,params:{name:y.value.id,executionId:z.value[0].id},query:l.query}).catch((()=>{}))}(),document.addEventListener("visibilitychange",T)})),p((()=>{t.reset(),document.removeEventListener("visibilitychange",T)})),(e,t)=>y.value?(o(),b(pe,{key:0,executions:z.value,execution:E.value,workflow:y.value,loading:m.value,"loading-more":g.value,"onExecution:stop":D,"onExecution:delete":A,"onExecution:retry":B,"onUpdate:filters":S,"onUpdate:autoRefresh":R,onLoadMore:F,onReload:M},null,8,["executions","execution","workflow","loading","loading-more"])):u("",!0)}}),e("default",ye)}}})); //# sourceMappingURL=WorkflowExecutionsView-legacy-B2vrgb-m.js.map