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