import{_ as e,s as l,o as t,c as a,a as i,F as s,q as n,d as u,w as r,D as d,t as o,x as v,e as c,f as m,H as p,B as x,S as f,h as y,G as g,A as b}from"./index-5CctA6VU.js";import{u as k}from"./experiment-BWsAMZL-.js";const h={class:"w-full px-6 pb-2 text-default relative"},_={class:"flex justify-between pt-6 pb-2 flex-wrap"},w={class:"min-w-[400px] max-w-[50%] pr-4"},$={key:0,class:"flex pb-4"},j={class:"title"},S=["title"],A={key:1,class:"text-dimmest"},C=["href"],I={key:0,class:"w-1/2 min-w-[400px] pl-5"},L={class:"title"},N=["title"],V=e({__name:"ExperimentHeader",setup(e){const f=k(),y=l(f.experiment),g=m(()=>[{title:"start_time",value:x(y.value.create_time)},{title:"last_time",value:f.duration},{title:"python",value:y.value.system.python||""}]),b=m(()=>[{title:"hostname",value:y.value.system.hostname||""},{title:"os",value:y.value.system.os||""}]);return(e,l)=>{const m=p("router-link"),x=v;return t(),a("div",h,[i("div",_,[i("div",w,[(t(!0),a(s,null,n(g.value,l=>(t(),a("div",{key:l.title},[l.value||"git"===l.title?(t(),a("div",$,[i("div",j,o(e.$t(`experiment.index.header.experiment_infos.${l.title}`)),1),l.isLink?"git"!==l.title||l.value?(t(),a("a",{key:2,href:l.value,target:"_blank",class:"hover:underline break-all"},o(l.value),9,C)):(t(),a("div",A,"None")):(t(),a("div",{key:0,title:l.value},o(l.value),9,S))])):c("",!0)]))),128))]),y.value.system?(t(),a("div",I,[(t(!0),a(s,null,n(b.value,l=>(t(),a("div",{key:l.title,class:"flex pb-4"},[i("div",L,o(e.$t(`experiment.index.header.experiment_device.${l.title}`)),1),i("div",{title:l.value},o(l.value||"Unkown"),9,N)]))),128)),u(x,{theme:"primary",hollow:"",class:"rounded-lg"},{default:r(()=>[u(m,{to:"env",class:"block px-3 py-1"},{default:r(()=>[d(o(e.$t("experiment.index.config.all_detail")),1)]),_:1})]),_:1})])):c("",!0)])])}}},[["__scopeId","data-v-e7e0a975"]]),D={class:"table"},E={class:"flex items-center justify-between border-b py-2 px-4 bg-higher rounded-t-lg"},H={class:"pr-10 font-semibold"},U={class:"w-full"},q={class:"line bg-higher border-b"},B=["title"],F={class:"max-h-[500px] overflow-y-auto"},G=["line","index"],O=["title"],P={key:0,class:"w-full py-4 flex justify-center"},T=e({__name:"DataTable",props:{title:{type:String,default:""},data:{type:Array,default:()=>[]},column:{type:Array,default:()=>[]}},setup(e){const r=e,d=l(""),v=m(()=>""===d.value?r.data:r.data.filter(e=>Object.keys(e).some(l=>String(e[l]).toLowerCase().includes(d.value.toLowerCase()))));return(l,r)=>{const m=f;return t(),a("div",D,[i("div",E,[i("p",H,o(e.title),1),u(m,{class:"bg-default max-w-[300px]",placeholder:l.$t("experiment.index.config.table.search"),reverse:"",modelValue:d.value,"onUpdate:modelValue":r[0]||(r[0]=e=>d.value=e)},null,8,["placeholder","modelValue"])]),i("div",U,[i("div",q,[(t(!0),a(s,null,n(e.column,e=>(t(),a("div",{class:"header-item",key:e.key,title:e.title},o(e.title),9,B))),128))]),i("div",F,[(t(!0),a(s,null,n(v.value,(e,l)=>(t(),a("div",{class:"data-line",key:e.key,line:e,index:l},[(t(!0),a(s,null,n(e,e=>(t(),a("div",{class:"body-item",key:null==e?void 0:e.key,title:e},o(String(e)),9,O))),128))],8,G))),128))]),0===v.value.length?(t(),a("div",P,o(l.$t("experiment.index.config.table.empty")),1)):c("",!0)])])}}},[["__scopeId","data-v-7df30f46"]]),z=["title"],J={class:"pl-6 w-full grid lg:grid-cols-2 lg:gap-10"},K={class:"pt-4 w-full"},M={class:"pt-4"},Q={__name:"ExperimentConfig",setup(e){const s=l(k().experiment),n=m(()=>[{title:b("experiment.index.config.table.key"),key:"key"},{title:b("experiment.index.config.table.value"),key:"value"}]),r=m(()=>{const e=[];for(const l in s.value.config)e.push({key:l,value:s.value.config[l].value,sort:s.value.config[l].sort});return e.sort((e,l)=>e.sort-l.sort).map(e=>(delete e.sort,e))}),d=l([]),o=l(k().id);return y.get(`/experiment/${o.value}/summary`).then(({data:e})=>{d.value=(e.summaries||[]).map(e=>({key:e.key,value:isNaN(e.value)?e.value:g(e.value)}))}).catch(e=>{}),(e,l)=>(t(),a("div",{class:"pr-5",icon:"config",title:e.$t("experiment.index.config.title"),retract:!1},[i("div",J,[i("div",K,[u(T,{class:"w-full","table-border":"",column:n.value,data:r.value,title:e.$t("experiment.index.config.table.config")},null,8,["column","data","title"])]),i("div",M,[u(T,{"table-border":"",column:n.value,data:d.value,title:e.$t("experiment.index.config.table.summary")},null,8,["column","data","title"])])]),l[0]||(l[0]=i("div",{class:"w-full h-6"},null,-1))],8,z))}},R={__name:"IndexPage",setup:e=>(e,l)=>(t(),a(s,null,[u(V),l[0]||(l[0]=i("hr",null,null,-1)),u(Q)],64))};export{R as default};
