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