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