import{C as r}from"./ConsoleDisplayer-d858bbcc.js";import{m as u,q as o,b as a,aC 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 P,D as _}from"./index-19df9d81.js";import"./common-e3107fd4.js";import"./_plugin-vue_export-helper-c27b6911.js";const v={style:{height:"100%"}},C={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"}},I=o("h4",null,"控制台",-1),S={class:"d-flex align-center"},k=o("span",{class:"text-h5"},"安装 Pip 库",-1),w=o("small",null,"强制 PyPI 软件仓库链接 > 配置项 `PyPI 软件仓库地址`",-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",v,[o("div",C,[I,o("div",S,[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(()=>[k]),_: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:"强制 PyPI 软件仓库链接（可选）",variant:"outlined"},null,8,["modelValue"]),w,o("div",null,[o("small",null,D(l.status),1)])]),_:1}),a(P,null,{default:s(()=>[a(_),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};
