UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 23.4 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","./core-legacy-VD8c7QJ-.js","./src-legacy-B67uuxhB.js","./_plugin-vue_export-helper-legacy-DFdC_I5Z.js","./users.store-legacy-azRUgFdP.js","./constants-legacy-2_ytuuS3.js","./settings.store-legacy-I6rZOvfF.js","./useDebounce-legacy-CRJGWVMg.js","./usePageRedirectionHelper-legacy-DQM99rgh.js","./executions.store-legacy-Cfatr-ks.js","./useInjectWorkflowId-legacy-piYT0WDS.js","./dateFormatter-legacy-C29N6HGV.js","./useExecutionHelpers-legacy-43gwTTrP.js","./WorkflowExecutionsInfoAccordion-legacy-BsRavNWq.js","./ExecutionsTime-legacy-Bd8rPjYZ.js","./useIntersectionObserver-legacy-Cmi51iK7.js"],(function(e,t){var o,n,i,a,r,s,c,l,u,d,_,v,x,m,f,g,p,w,y,k,b,h,E,z,C,W,L,T,I,$,j,R,M,S,A,D,U,O,F,V,q,B,P,N,X,G,H,Q,Z,J,K,Y,ee,te,oe,ne,ie,ae,re,se,ce,le,ue,de,_e,ve,xe,me,fe,ge,pe,we;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,w=e.r,y=e.rt,k=e.w,b=e.yt},function(e){h=e.at},function(e){E=e.Di,z=e.Ji,C=e.Mt,W=e.Qi,L=e.T,T=e.Xi,I=e.ct,$=e.dt,j=e.jt,R=e.k,M=e.lt,S=e.st},function(e){A=e.t},function(e){D=e.Pn,U=e._,O=e.fr,F=e.s,V=e.sn,q=e.sr,B=e.xr,P=e.zt},function(e){N=e.Bo,X=e.Qc,G=e.Qo,H=e.Zo},function(e){Q=e.t},function(e){Z=e.t},function(e){J=e.t},function(e){K=e.t},function(e){Y=e.t},function(e){ee=e.a,te=e.i},function(e){oe=e.t},function(e){ne=e.t},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-0357c9fd] .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:{},(ye=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[ye]="4b65cd8b-7d52-40b4-85ac-55e369053a66",t._sentryDebugIdIdentifier="sentry-dbid-4b65cd8b-7d52-40b4-85ac-55e369053a66")}catch(t){}var t,ye;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=I(),f=h(),p=oe(),w=Q(),y=c((()=>w.isEnterpriseFeatureEnabled[X.AdvancedExecutionFilters])),z=c((()=>y.value)),$=Y(),j=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)),A=c((()=>p.isExecutionRetriable(r.execution)));function D(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($),executionId:e.execution.id},query:d(v).query},"data-test-execution-status":M.value.name},{default:b((()=>[i("div",{class:x(t.$style.description)},["new"===M.value.name?(o(),k(d(T),{key:0,color:"text-dark",bold:!0,size:"medium","data-test-id":"execution-time"},{default:b((()=>[n(l(d(te)(M.value.createdAt))+" - "+l(d(f).baseText("executionDetails.startingSoon")),1)])),_:1})):(o(),k(d(T),{key:1,color:"text-dark",bold:!0,size:"medium","data-test-id":"execution-time"},{default:b((()=>[n(l(M.value.startTime),1)])),_:1})),i("div",{class:x(t.$style.executionStatus)},["running"===M.value.name?(o(),k(d(R),{key:0,size:"small",class:x([t.$style.spinner,"mr-4xs"])},null,8,["class"])):u("",!0),g(d(T),{class:x(t.$style.statusLabel),size:"small"},{default:b((()=>[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(),k(d(T),{key:1,color:S.value?"text-dark":"text-base",size:"small","data-test-id":"execution-time-in-status"},{default:b((()=>[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(),k(d(T),{key:2,color:S.value?"text-dark":"text-base",size:"small"},{default:b((()=>[i("span",null,l(d(f).baseText("executionDetails.at"))+" "+l(d(ee)(e.execution.createdAt)),1)])),_:1},8,["color"])):""!==M.value.runningTime?(o(),k(d(T),{key:3,color:S.value?"text-dark":"text-base",size:"small"},{default:b((()=>[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(T),{color:S.value?"text-dark":"text-base",size:"small"},{default:b((()=>[n(l(d(f).baseText("executionDetails.retry"))+" #"+l(e.execution.retryOf),1)])),_:1},8,["color"])])):u("",!0),z.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(),k(d(W),{key:0,class:x(t.$style.up),icon:"thumbs-up"},null,8,["class"])):(o(),k(d(W),{key:1,class:x(t.$style.down),icon:"thumbs-down"},null,8,["class"]))],2)):u("",!0),M.value.tags.length>0?(o(),k(d(L),{key:1,tags:M.value.tags,clickable:!1},null,8,["tags"])):u("",!0)],2)):u("",!0)],2),i("div",{class:x(t.$style.icons)},[A.value?(o(),k(d(C),{key:0,class:x([t.$style.icon,t.$style.retry]),items:j.value,disabled:!e.workflowPermissions.execute,"activator-icon":"redo-2","data-test-id":"retry-execution-button",onSelect:D},null,8,["class","items","disabled"])):u("",!0),"manual"===e.execution.mode?(o(),k(d(E),{key:1,placement:"top"},{content:b((()=>[i("span",null,l(d(f).baseText("executionsList.test")),1)])),default:b((()=>[g(d(W),{class:x([t.$style.icon,t.$style.manual]),icon:"flask-conical"},null,8,["class"])])),_:1})):u("",!0),"evaluation"===e.execution.mode?(o(),k(d(E),{key:2,placement:"top"},{content:b((()=>[i("span",null,l(d(f).baseText("executionsList.evaluation")),1)])),default:b((()=>[g(d(W),{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=A(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=I(),p=M(),E=h(),C=K(),W=Q(),L=J(),R=r({activeExecutionSet:!1,cardsMounted:!1,scroll:!0}),S=r({}),A=r(null),{observe:D}=ce({root:A,threshold:.01,onIntersect:()=>_("loadMore",20)}),U=c((()=>N(s.workflow?.scopes).workflow)),O=c((()=>W.isConcurrencyEnabled&&!W.isQueueModeEnabled));function F(e,t){e&&B(e)&&t&&(S.value[t]=e)}function V(e){const t=s.executions.findIndex((t=>t.id===e));if(C.activeExecution?.id===e&&(R.value.activeExecutionSet=!0,R.value.cardsMounted=!0),t===s.executions.length-1&&!s.loading&&!s.loadingMore){const t=S.value[e]?.$el;D(t)}}function q(e){_("retryExecution",e)}function P(e){R.value.activeExecutionSet=!1,R.value.cardsMounted=!1,R.value.scroll=!0,_("filterUpdated",e)}function X(e){_("update:autoRefresh",e)}f((()=>m),((e,t)=>{t.name===G.EXECUTION_PREVIEW&&e.name===G.EXECUTION_HOME&&p.go(-1)})),f((()=>C.activeExecution),((e,t)=>{e&&e.id!==t?.id&&(R.value.activeExecutionSet=!0)})),f(R,(e=>{Object.values(e).every(Boolean)&&function(){if(A.value&&C.activeExecution&&S.value[C.activeExecution.id]){const e=S.value[C.activeExecution.id].$el.getBoundingClientRect(),t=200;e.top>A.value.offsetHeight&&(R.value.scroll=!1,A.value.scrollTo({top:e.top-t,behavior:"smooth"}))}}()}),{deep:!0});const H=()=>{L.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(z),{tag:"h2",size:"medium",color:"text-dark"},{default:b((()=>[n(l(d(E).baseText("generic.executions")),1)])),_:1}),O.value?(o(),k(ie,{key:0,"running-executions-count":d(C).concurrentExecutionsCount,"concurrency-cap":d(W).concurrency,"is-cloud-deployment":d(W).isCloudDeployment,onGoToUpgrade:H},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($),{modelValue:d(C).autoRefresh,"onUpdate:modelValue":[r[0]||(r[0]=e=>d(C).autoRefresh=e),X],"data-test-id":"auto-refresh-checkbox",label:d(E).baseText("executionsList.autoRefresh")},null,8,["modelValue","label"]),g(re,{"popover-side":"right","popover-align":"start","workflow-id":s.workflow?.id,onFilterChanged:P},null,8,["workflow-id"])],2),i("div",{ref_key:"executionListRef",ref:A,class:x(t.$style.executionList),"data-test-id":"current-executions-list",onScroll:r[1]||(r[1]=e=>function(e=20){if(!s.loading&&A.value){const t=A.value.offsetHeight-(A.value.scrollHeight-A.value.scrollTop);t>-10&&t<10&&_("loadMore",e)}}(20))},[e.loading?(o(),a("div",ve,[g(d(j),{variant:"rect"})])):u("",!0),e.loading||0!==e.executions.length?e.temporaryExecution?(o(),k(_e,{key:2,ref:t=>F(t,e.temporaryExecution?.id),execution:e.temporaryExecution,"data-test-id":`execution-details-${e.temporaryExecution.id}`,"show-gap":!0,"workflow-permissions":U.value,onRetryExecution:q},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(T),{color:"text-base",size:"medium",align:"center"},{default:b((()=>[n(l(d(E).baseText("executionsLandingPage.noResults")),1)])),_:1})],2)),g(w,{name:"executions-list"},{default:b((()=>[(o(!0),a(v,null,y(e.executions,(e=>(o(),k(_e,{key:e.id,ref_for:!0,ref:t=>F(t,e.id),execution:e,"workflow-permissions":U.value,"data-test-id":`execution-details-${e.id}`,onRetryExecution:q,onMounted:V},null,8,["execution","workflow-permissions","data-test-id"])))),128))])),_:1}),e.loadingMore?(o(),a("div",xe,[g(d(j),{variant:"p",rows:1})])):u("",!0)],34),i("div",{class:x(t.$style.infoAccordion)},[g(ne,{"initially-expanded":!1})],2)],2))}}),fe=A(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-0357c9fd"]]),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}=P({router:M()}),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 S((async(e,t,o)=>{V(e)!==H.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=A(ge,[["__cssModules",{$style:{container:"_container_pd7qp_125",content:"_content_pd7qp_131"}}]]),we=s({__name:"WorkflowExecutionsView",setup(e){const t=K(),n=F(),i=q(),a=h(),s=O(),l=I(),d=M(),v=D(),{callDebounced:x}=Z(),m=r(!1),g=r(!1),w=r(),y=Y(),b=c((()=>{const e=l.params.executionId;return"string"==typeof e?e:void 0})),E=c((()=>y.value?[...t.currentExecutionsByWorkflowId[y.value]??[],...t.executionsByWorkflowId[y.value]??[]]:[])),z=c((()=>{const e=E.value.find((e=>e.id===b.value)),t=C.value;return e?t?.id===e.id&&t.workflowVersionId?{...e,workflowVersionId:t.workflowVersionId}:e:t})),C=r(),W=c((()=>"true"===l.query.new));async function L(){if(b.value){try{C.value=await t.fetchExecution(b.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(y.value)}function $(){!W.value&&y.value?w.value=i.workflowsById[y.value]??n.workflow:w.value=n.workflow}async function j(e){e?await t.startAutoRefreshInterval(y.value):t.stopAutoRefreshInterval()}async function R(){if(y.value)try{await t.fetchExecutions({...t.executionsFilters,workflowId:y.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(y.value)}async function A(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 R()}catch(o){v.showError(o,a.baseText("executionsList.showError.stopExecution.title"))}}async function V(e){if(e){m.value=!0;try{const o=E.value.findIndex((t=>t.id===e)),n=E.value[o+1]||E.value[o-1]||E.value[0];await t.deleteExecutions({ids:[e]}),w.value&&(E.value.length>0?await d.replace({name:G.EXECUTION_PREVIEW,params:{name:w.value.id,executionId:n.id}}).catch((()=>{})):await d.replace({name:G.EXECUTION_HOME,params:{name:w.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=U((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 R(),s.track("User clicked retry execution button",{workflow_id:w.value?.id,execution_id:e.id,retry_type:e.loadWorkflow?"current":"original"})}async function P(){g.value||await x(N,{debounceTime:1e3})}async function N(){if(t.executionsFilters.status?.includes("running")||E.value.length>=t.executionsCount)return;let e;g.value=!0,0!==E.value.length&&(e=E.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((()=>y.value),(()=>{$()})),f((()=>b.value),(async()=>{await L()})),_((async()=>{$(),y.value&&await Promise.all([t.initialize(y.value),L()]),await async function(){l.name===G.EXECUTION_HOME&&E.value.length>0&&w.value&&await d.replace({name:G.EXECUTION_PREVIEW,params:{name:w.value.id,executionId:E.value[0].id},query:l.query}).catch((()=>{}))}(),document.addEventListener("visibilitychange",T)})),p((()=>{t.reset(),document.removeEventListener("visibilitychange",T)})),(e,t)=>w.value?(o(),k(pe,{key:0,executions:E.value,execution:z.value,workflow:w.value,loading:m.value,"loading-more":g.value,"onExecution:stop":A,"onExecution:delete":V,"onExecution:retry":B,"onUpdate:filters":S,"onUpdate:autoRefresh":j,onLoadMore:P,onReload:R},null,8,["executions","execution","workflow","loading","loading-more"])):u("",!0)}}),e("default",we)}}})); //# sourceMappingURL=WorkflowExecutionsView-legacy--rCLZWLm.js.map