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