import{_ as r}from"./ConsoleDisplayer-63d32d55.js";import{o as u,l as m,n as o,b as a,w as e,L as g,y as f,p as n,q as _,e as p,C as c,D as h,E as V,I as d,t as y,K as v,B as C}from"./index-068413d1.js";import"./common-22671c73.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),I=o("span",{class:"text-h5"},"安装 Pip 库",-1),x=o("small",null,"如果不填镜像站链接，默认使用阿里云镜像：https://mirrors.aliyun.com/pypi/simple/",-1),D={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(D,{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(()=>[I]),_: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"]),x,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};
