import{r as c,j as o,b4 as b,b2 as m,b3 as k,d2 as j,u as P,A as g,B as v,Q as C,F as d,L as f,q as O,cZ as M,eh as E,v as F}from"./index-DNBEEyYo.js";import{K as x,a as h}from"./KubeMonitoringPods-CfKreu69.js";import{b as L}from"./index-bIvQJs1X.js";const B=({execution:s,isOpenPopup:a,handleTogglePopup:n})=>{const[t,e]=c.useState(s.notebookOutPath?"notebookOutPath":"stdoutPath"),r=s[t]??"",l=c.useMemo(()=>[...s.notebookOutPath?[{title:"notebook out",isActive:t==="notebookOutPath",onClick:()=>e("notebookOutPath")}]:[],{title:"stdout",isActive:t==="stdoutPath",onClick:()=>e("stdoutPath")},{title:"stderr",isActive:t==="stderrPath",onClick:()=>e("stderrPath")}],[t,s.notebookOutPath]);return o.jsx(b,{size:"7xl",isOpen:a,onClose:n,hasCloseButton:!0,title:o.jsx(j,{title:"Logs",tabs:l,width:"90%"}),bodyProps:{pt:0,mt:"10px"},children:o.jsx(m,{file:{attributes:{path:r,name:k(r)}},errorContent:{title:"Logs not found",message:""},viewOnly:!0},t)})},w=({jobName:s,executionId:a})=>{var p,u;const{id:n}=P(),{data:t,isLoading:e,isFetching:r,refetch:l}=L({pId:n,name:s,execId:a,params:{expand:"kube_monitor"}},{selectFromResult:g({data:v(C("kubeMonitor"))}),pollingInterval:5e3,skip:!a}),i=(t==null?void 0:t.job)??(t==null?void 0:t.sparkJob)??(t==null?void 0:t.rayJob);return o.jsx(d,{mb:"20px",children:e?o.jsx(d,{sx:{py:"100px"},children:o.jsx(f,{})}):o.jsxs(O,{flexDirection:"column",gap:"20px",children:[o.jsx(d,{sx:{position:"absolute",top:"14px",right:"78px"},children:r?o.jsx(M,{}):o.jsx(E,{icon:F.refresh,onClick:l,sx:{mt:"-6px",mr:"-6px"},borderless:!0})}),i&&o.jsx(x,{title:"Job Status",...i,children:((p=i.pods)==null?void 0:p.items)&&o.jsx(h,{pods:i.pods.items})}),(t==null?void 0:t.workload)&&o.jsx(x,{title:"Workload Status",...t.workload,children:((u=t.workload.pods)==null?void 0:u.items)&&o.jsx(h,{pods:t.workload.pods.items})})]})})},K=c.memo(w);export{B as E,K as a};
