import{_ as r}from"./ConsoleDisplayer-11c0e161.js";import{o as u,l as m,n as o,b as a,w as e,K as g,v as f,p as n,A as _,e as p,B as c,C as h,D as V,H as d,t as y,J as v,z as C}from"./index-6e6522ad.js";import"./common-f00522b3.js";const P={style:{height:"100%"}},b={style:{"background-color":"white",padding:"8px","padding-left":"16px","border-radius":"8px","margin-bottom":"16px",display:"flex","flex-direction":"row","align-items":"center","justify-content":"space-between"}},k=o("h4",null,"控制台",-1),x=o("span",{class:"text-h5"},"安装 Pip 库",-1),D=o("small",null,"如果不填镜像站链接，默认使用阿里云镜像：https://mirrors.aliyun.com/pypi/simple/",-1),I={name:"ConsolePage",components:{ConsoleDisplayer:r},data(){return{pipDialog:!1,pipInstallPayload:{package:"",mirror:""},loading:!1,status:""}},methods:{pipInstall(){this.loading=!0,f.post("/api/update/pip-install",this.pipInstallPayload).then(i=>{this.status=i.data.message,setTimeout(()=>{this.status="",this.pipDialog=!1},2e3)}).catch(i=>{this.status=i.response.data.message}).finally(()=>{this.loading=!1})}}},N=Object.assign(I,{setup(i){return(l,s)=>(u(),m("div",P,[o("div",b,[k,a(g,{modelValue:l.pipDialog,"onUpdate:modelValue":s[2]||(s[2]=t=>l.pipDialog=t),width:"400"},{activator:e(({props:t})=>[a(n,_({variant:"plain"},t),{default:e(()=>[p("安装 pip 库")]),_:2},1040)]),default:e(()=>[a(c,null,{default:e(()=>[a(h,null,{default:e(()=>[x]),_:1}),a(V,null,{default:e(()=>[a(d,{modelValue:l.pipInstallPayload.package,"onUpdate:modelValue":s[0]||(s[0]=t=>l.pipInstallPayload.package=t),label:"*库名，如 llmtuner",variant:"outlined"},null,8,["modelValue"]),a(d,{modelValue:l.pipInstallPayload.mirror,"onUpdate:modelValue":s[1]||(s[1]=t=>l.pipInstallPayload.mirror=t),label:"镜像站链接（可选）",variant:"outlined"},null,8,["modelValue"]),D,o("div",null,[o("small",null,y(l.status),1)])]),_:1}),a(v,null,{default:e(()=>[a(C),a(n,{color:"blue-darken-1",variant:"text",onClick:l.pipInstall,loading:l.loading},{default:e(()=>[p(" 安装 ")]),_:1},8,["onClick","loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),a(r,{style:{height:"calc(100vh - 160px)"}})]))}});export{N as default};
