import{d as O,W as E,aF as L,f as n,an as V,bv as j,bJ as f,bx as B,c as r,g as a,a as c,h as i,u as J,aO as P,o as p,j as u,k as e,bK as W,bL as _,C as q,A as R,bM as G,q as H,G as K,bN as M,bO as Q,bH as U,a5 as X,bo as $}from"./index-BqDjVCF_.js";import{u as z}from"./usePageTitle-CZh_IXm2.js";const at=O({__name:"TaskRun",setup(Y){const g=J(),k=E("taskRunId"),d=L(),m=n(()=>[{label:"Details",hidden:P.xl},{label:"Logs"},{label:"Artifacts"},{label:"Task Inputs"}]),l=V("tab","Logs"),{tabs:h}=j(m,l),y=n(()=>k.value?[k.value]:null),T=f(d.taskRuns.getTaskRun,y,{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),I=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(){I.refresh(),g.push($.flowRun(o.value))}const C=n(()=>{var s;return(s=t.value)==null?void 0:s.stateType});B(C);const D=n(()=>t.value?`Task Run: ${t.value.name}`:"Task Run");return z(D),(s,b)=>{const F=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(W),{"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":b[0]||(b[0]=A=>X(l)?l.value=A: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(Q),{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(F,{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(K).info.taskInput),1)]),_:1})]),key:"0"}:void 0]),1032,["selected","tabs"])]),_:1})):c("",!0)}}});export{at as default};
//# sourceMappingURL=TaskRun-DTvlvtYY.js.map
