import{_ as r}from"./ConsoleDisplayer-1c38daca.js";import{o as u,k as m,n as o,b as a,ag as g,w as s,T as c,y as f,p as n,v as h,e as d,C as y,D as V,E as _,Q as p,t as b,S as D,B as v}from"./index-733aa71a.js";import"./common-8ef9a0d2.js";const C={style:{height:"100%"}},k={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"}},P=o("h4",null,"控制台",-1),S={class:"d-flex align-center"},w=o("span",{class:"text-h5"},"安装 Pip 库",-1),I=o("small",null,"如果不填镜像站链接，默认使用阿里云镜像：https://mirrors.aliyun.com/pypi/simple/",-1),x={name:"ConsolePage",components:{ConsoleDisplayer:r},data(){return{autoScrollDisabled:!1,pipDialog:!1,pipInstallPayload:{package:"",mirror:""},loading:!1,status:""}},watch:{autoScrollDisabled(i){this.$refs.consoleDisplayer&&(this.$refs.consoleDisplayer.autoScroll=!i)}},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(x,{setup(i){return(l,t)=>(u(),m("div",C,[o("div",k,[P,o("div",S,[a(g,{modelValue:l.autoScrollDisabled,"onUpdate:modelValue":t[0]||(t[0]=e=>l.autoScrollDisabled=e),label:l.autoScrollDisabled?"自动滚动已关闭":"自动滚动已开启","hide-details":"",density:"compact",style:{"margin-right":"16px"}},null,8,["modelValue","label"]),a(c,{modelValue:l.pipDialog,"onUpdate:modelValue":t[3]||(t[3]=e=>l.pipDialog=e),width:"400"},{activator:s(({props:e})=>[a(n,h({variant:"plain"},e),{default:s(()=>[d("安装 pip 库")]),_:2},1040)]),default:s(()=>[a(y,null,{default:s(()=>[a(V,null,{default:s(()=>[w]),_:1}),a(_,null,{default:s(()=>[a(p,{modelValue:l.pipInstallPayload.package,"onUpdate:modelValue":t[1]||(t[1]=e=>l.pipInstallPayload.package=e),label:"*库名，如 llmtuner",variant:"outlined"},null,8,["modelValue"]),a(p,{modelValue:l.pipInstallPayload.mirror,"onUpdate:modelValue":t[2]||(t[2]=e=>l.pipInstallPayload.mirror=e),label:"镜像站链接（可选）",variant:"outlined"},null,8,["modelValue"]),I,o("div",null,[o("small",null,b(l.status),1)])]),_:1}),a(D,null,{default:s(()=>[a(v),a(n,{color:"blue-darken-1",variant:"text",onClick:l.pipInstall,loading:l.loading},{default:s(()=>[d(" 安装 ")]),_:1},8,["onClick","loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])]),a(r,{ref:"consoleDisplayer",style:{height:"calc(100vh - 160px)"}},null,512)]))}});export{N as default};
