import{C as r}from"./ConsoleDisplayer-6c15c163.js";import{m as u,q as o,b as a,ap as m,w as s,W as g,l as c,o as f,v as n,y as h,e as d,E as y,G as V,H as b,S as p,t as D,U as _,D as v}from"./index-4f532da6.js";import"./common-d4d7cfa6.js";import"./_plugin-vue_export-helper-c27b6911.js";const C={style:{height:"100%"}},P={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"}},S=o("h4",null,"控制台",-1),k={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,c.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})}}},j=Object.assign(x,{setup(i){return(l,t)=>(f(),u("div",C,[o("div",P,[S,o("div",k,[a(m,{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(g,{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(b,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,D(l.status),1)])]),_:1}),a(_,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 - 220px)"}},null,512)]))}});export{j as default};
