import{d as L,b as O,D as V,e as n,m as z,B as F,al as j,az as _,ao as E,c as r,h as t,a as c,i,a1 as J,o as p,k as u,u as e,aA as P,aB as R,C as Q,p as m,aC as U,t as Z,g as $,aD as q,aE as G,ax as H,v as K,ae as M}from"./index-WCZ_4nWW.js";import{u as W}from"./usePageTitle-Y7n4a-YH.js";const ta=L({__name:"TaskRun",setup(X){const g=J(),k=O("taskRunId"),d=V(),b=n(()=>[{label:"Details",hidden:z.xl},{label:"Logs"},{label:"Artifacts"},{label:"Task Inputs"}]),l=F("tab","Logs"),{tabs:T}=j(b,l),h=n(()=>k.value?[k.value]:null),w=_(d.taskRuns.getTaskRun,h,{interval:3e4}),a=n(()=>w.response),o=n(()=>{var s;return(s=a.value)==null?void 0:s.flowRunId}),y=n(()=>o.value?[o.value]:null),I=_(d.flowRuns.getFlowRun,y),v=n(()=>{var s;return(s=a.value)!=null&&s.taskInputs?JSON.stringify(a.value.taskInputs,void 0,2):"{}"});function x(){I.refresh(),g.push(M.flowRun(o.value))}const D=n(()=>{var s;return(s=a.value)==null?void 0:s.stateType});E(D);const C=n(()=>a.value?`Task Run: ${a.value.name}`:"Task Run");return W(C),(s,f)=>{const B=i("p-code-highlight"),S=i("p-tabs"),A=i("p-layout-well");return a.value?(p(),r(A,{key:0,class:"task-run"},{header:t(()=>[u(e(P),{"task-run-id":a.value.id,onDelete:x},null,8,["task-run-id"])]),well:t(()=>[u(e(R),{alternate:"","task-run":a.value},null,8,["task-run"])]),default:t(()=>[u(S,{selected:e(l),"onUpdate:selected":f[0]||(f[0]=N=>K(l)?l.value=N:null),tabs:e(T)},Q({details:t(()=>[u(e(R),{"task-run":a.value},null,8,["task-run"])]),logs:t(()=>[u(e(q),{"task-run":a.value},null,8,["task-run"])]),artifacts:t(()=>[a.value?(p(),r(e(G),{key:0,"task-run":a.value},null,8,["task-run"])):c("",!0)]),"task-inputs":t(()=>[a.value?(p(),r(e(H),{key:0,"text-to-copy":v.value},{default:t(()=>[u(B,{lang:"json",text:v.value,class:"task-run__inputs"},null,8,["text"])]),_:1},8,["text-to-copy"])):c("",!0)]),_:2},[a.value?{name:"task-inputs-heading",fn:t(()=>[m(" Task inputs "),u(e(U),{title:"Task Inputs"},{default:t(()=>[m(Z(e($).info.taskInput),1)]),_:1})]),key:"0"}:void 0]),1032,["selected","tabs"])]),_:1})):c("",!0)}}});export{ta as default};
