import{_ as e,o as l,a,b as t,t as n,g as i,f as o,q as u,ah as s,m as r,A as y,c as v,d as p,F as c,s as d,z as h,x as g}from"./index-mtICtCH6.js";const m={key:0,class:"w-full flex relative"},k={class:"text-dimmer w-44 shrink-0"},f={key:0},_=["href"],b=e({__name:"EnvItem",props:{envKey:{type:[String,Number],default:""},envValue:{type:[String,Number],default:""},highLight:{type:Boolean,default:!1},link:{type:String,default:null},copy:{type:Boolean,default:!1}},setup:e=>(v,p)=>{const c=y;return e.envValue?(l(),a("div",m,[t("span",k,n(v.$t(`experiment.env.keys.${e.envKey}`)),1),t("span",{class:u(["item",{"high-light":e.highLight,copy:e.copy}]),onClick:p[0]||(p[0]=l=>{return e.copy&&(a=e.envValue,s(a),void r.success("Copy!"));var a})},[e.link?(l(),a("a",{key:1,href:e.link,target:"_blank",class:"hover:underline underline-offset-2"},n(e.envValue),9,_)):(l(),a("span",f,n(e.envValue),1)),e.copy?(l(),i(c,{key:2,icon:"copy",class:"copy-button"})):o("",!0)],2)])):o("",!0)}},[["__scopeId","data-v-0bf7a51b"]]),L={key:0,class:"env-items"},x={key:0,class:"flex items-center gap-2 font-semibold"},w=e({__name:"EnvGroup",props:{data:{type:Array,default:()=>[]},title:{type:String,default:null}},setup(e){const t=e,u=v((()=>t.data.filter((e=>e.value)).length>0));return(t,s)=>p(u)?(l(),a("div",L,[e.title?(l(),a("h1",x,n(e.title),1)):o("",!0),(l(!0),a(c,null,d(e.data,(e=>(l(),i(b,{"env-key":e.key,"env-value":e.value,key:e.key,highLight:e.highLight,copy:e.copy,link:e.link},null,8,["env-key","env-value","highLight","copy","link"])))),128))])):o("",!0)}},[["__scopeId","data-v-167a6b3c"]]),S=(e,l)=>({experiment:V(e,l.logdir),system:B(e.system),python:E(e.system),git:I(e.system)}),V=(e,l)=>{var a;if(!e)return null;const t=null==e?void 0:e.system;return[{key:"name",value:e.name},{key:"swanlab",value:null==(a=null==t?void 0:t.swanlab)?void 0:a.version},{key:"description",value:e.description},{key:"start_time",value:h(null==e?void 0:e.create_time)},{key:"duration",value:g(e)||""},{key:"logdir",value:l+(l.includes("/")?"/":"\\")+e.run_id,highLight:!0,copy:!0}]},B=e=>{var l,a,t;if(!e)return null;return[{key:"provider",value:(null==(t=null==(a=null==(l=null==e?void 0:e.swanlab)?void 0:l._coop)?void 0:a.qing_cloud)?void 0:t.aicp_platform)&&"基石智算",link:"https://coreshub.cn/"},{key:"hostname",value:e.hostname},{key:"OS",value:e.os},{key:"pid",value:e.pid}]},E=e=>e?[{key:"python",value:e.python},{key:"verbose",value:e.python_verbose},{key:"executable",value:e.executable,highLight:!0,copy:!0},{key:"workspace",value:e.cwd,highLight:!0,copy:!0},{key:"command",value:e.command,highLight:!0,copy:!0}]:null,I=e=>e?[{key:"git_remote",value:e.git_remote,hightLight:!0,link:e.git_remote},{key:"git_branch",value:e.git_info?e.git_info[0]:""},{key:"git_commit",value:e.git_info?e.git_info[1]:"",hightLight:!0,copy:!0}]:null,q=e=>{var l,a;const t=null==e?void 0:e.system;if(!t)return null;const n=null==(l=null==e?void 0:e.system)?void 0:l.gpu;return{apple:null==(a=t.soc)?void 0:a.apple,cpu:A(t),memory:C(t),gpu:(null==n?void 0:n.type)?n:null,nvidia:null==n?void 0:n.nvidia}},A=e=>{var l,a;return[{key:"brand",value:null==(l=e.cpu)?void 0:l.brand},{key:"cpu",value:(null==(a=e.cpu)?void 0:a.cores)||e.cpu}]},C=e=>[{key:"memory",value:e.memory?e.memory+"GB":""}];export{w as E,b as a,q as b,S as g};
