import{d as A,f as L,g as V,j as n,ao as j,bx as B,bK as b,bz as F,c as r,k as a,a as c,l as i,i as Q,aO as X,o as p,m as u,n as e,bL as $,bM as _,G as z,D as R,bN as G,y as H,I as J,bO as K,bP as M,bI as U,a6 as W,bo as q}from"./index-CgvuCQfr.js";import{u as E}from"./usePageTitle-DVT0B9Gy.js";const at=A({__name:"TaskRun",setup(Y){const m=Q(),k=L("taskRunId"),d=V(),g=n(()=>[{label:"Details",hidden:X.xl},{label:"Logs"},{label:"Artifacts"},{label:"Task Inputs"}]),l=j("tab","Logs"),{tabs:I}=B(g,l),w=n(()=>k.value?[k.value]:null),y=b(d.taskRuns.getTaskRun,w,{interval:3e4}),t=n(()=>y.response),o=n(()=>{var s;return(s=t.value)==null?void 0:s.flowRunId}),T=n(()=>o.value?[o.value]:null),h=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(){h.refresh(),m.push(q.flowRun(o.value))}const D=n(()=>{var s;return(s=t.value)==null?void 0:s.stateType});F(D);const P=n(()=>t.value?`Task Run: ${t.value.name}`:"Task Run");return E(P),(s,f)=>{const N=i("p-code-highlight"),O=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(O,{selected:e(l),"onUpdate:selected":f[0]||(f[0]=C=>W(l)?l.value=C:null),tabs:e(I)},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(N,{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(G),{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-CoVjcxx-.js.map
