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