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