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