import{C as g}from"./ConsoleDisplayer-6a0a8a09.js";import{a5 as c,k as f,l as n,t as p,h as s,b as a,aj as h,w as i,X as V,_ as b,o as y,p as r,C as D,d as u,D as I,E as v,H as _,T as m,W as C,B as k}from"./index-6dc81347.js";import"./common-fd73112a.js";import"./_plugin-vue_export-helper-c27b6911.js";const S={style:{height:"100%"}},P={style:{"background-color":"var(--v-theme-surface)",padding:"8px","padding-left":"16px","border-radius":"8px","margin-bottom":"16px",display:"flex","flex-direction":"row","align-items":"center","justify-content":"space-between"}},w={class:"d-flex align-center"},x={class:"text-h5"},T={name:"ConsolePage",components:{ConsoleDisplayer:g},data(){return{autoScrollDisabled:!1,pipDialog:!1,pipInstallPayload:{package:"",mirror:""},loading:!1,status:""}},watch:{autoScrollDisabled(d){this.$refs.consoleDisplayer&&(this.$refs.consoleDisplayer.autoScroll=!d)}},methods:{pipInstall(){this.loading=!0,b.post("/api/update/pip-install",this.pipInstallPayload).then(d=>{this.status=d.data.message,setTimeout(()=>{this.status="",this.pipDialog=!1},2e3)}).catch(d=>{this.status=d.response.data.message}).finally(()=>{this.loading=!1})}}},E=Object.assign(T,{setup(d){const{tm:e}=c("features/console");return(l,o)=>(y(),f("div",S,[n("div",P,[n("h4",null,p(s(e)("title")),1),n("div",w,[a(h,{modelValue:l.autoScrollDisabled,"onUpdate:modelValue":o[0]||(o[0]=t=>l.autoScrollDisabled=t),label:l.autoScrollDisabled?s(e)("autoScroll.disabled"):s(e)("autoScroll.enabled"),"hide-details":"",density:"compact",style:{"margin-right":"16px"}},null,8,["modelValue","label"]),a(V,{modelValue:l.pipDialog,"onUpdate:modelValue":o[3]||(o[3]=t=>l.pipDialog=t),width:"400"},{activator:i(({props:t})=>[a(r,D({variant:"plain"},t),{default:i(()=>[u(p(s(e)("pipInstall.button")),1)]),_:2},1040)]),default:i(()=>[a(I,null,{default:i(()=>[a(v,null,{default:i(()=>[n("span",x,p(s(e)("pipInstall.dialogTitle")),1)]),_:1}),a(_,null,{default:i(()=>[a(m,{modelValue:l.pipInstallPayload.package,"onUpdate:modelValue":o[1]||(o[1]=t=>l.pipInstallPayload.package=t),label:s(e)("pipInstall.packageLabel"),variant:"outlined"},null,8,["modelValue","label"]),a(m,{modelValue:l.pipInstallPayload.mirror,"onUpdate:modelValue":o[2]||(o[2]=t=>l.pipInstallPayload.mirror=t),label:s(e)("pipInstall.mirrorLabel"),variant:"outlined"},null,8,["modelValue","label"]),n("small",null,p(s(e)("pipInstall.mirrorHint")),1),n("div",null,[n("small",null,p(l.status),1)])]),_:1}),a(C,null,{default:i(()=>[a(k),a(r,{color:"blue-darken-1",variant:"text",onClick:l.pipInstall,loading:l.loading},{default:i(()=>[u(p(s(e)("pipInstall.installButton")),1)]),_:1},8,["onClick","loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])]),a(g,{ref:"consoleDisplayer",style:{height:"calc(100vh - 220px)"}},null,512)]))}});export{E as default};
