import{C as c}from"./ConsoleDisplayer-CnCQn4OD.js";import{u as g,c as f,a as n,t as d,z as t,b as l,w as o,d as p,U as V,an as b,K as h,L as y,O as I,Q as u,R as v,M as S,V as m,C,S as k,Y as D,o as x}from"./index-WOIPm_2l.js";import"./eventsource-CejZdUM0.js";const w={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"}},E={class:"d-flex align-center"},T={class:"text-h5"},_={name:"ConsolePage",components:{ConsoleDisplayer:c},data(){return{autoScrollEnabled:!0,pipDialog:!1,pipInstallPayload:{package:"",mirror:""},loading:!1,status:""}},watch:{autoScrollEnabled(r){this.$refs.consoleDisplayer&&(this.$refs.consoleDisplayer.autoScroll=r)}},methods:{pipInstall(){this.loading=!0,D.post("/api/update/pip-install",this.pipInstallPayload).then(r=>{this.status=r.data.message,setTimeout(()=>{this.status="",this.pipDialog=!1},2e3)}).catch(r=>{this.status=r.response.data.message}).finally(()=>{this.loading=!1})}}},N=Object.assign(_,{setup(r){const{tm:e}=g("features/console");return(a,i)=>(x(),f("div",w,[n("div",P,[n("div",null,[n("h4",null,d(t(e)("title")),1),l(V,{type:"info",variant:"tonal",density:"compact",class:"mt-2",style:{"max-width":"600px"}},{default:o(()=>[p(d(t(e)("debugHint.text")),1)]),_:1})]),n("div",E,[l(b,{modelValue:a.autoScrollEnabled,"onUpdate:modelValue":i[0]||(i[0]=s=>a.autoScrollEnabled=s),label:a.autoScrollEnabled?t(e)("autoScroll.enabled"):t(e)("autoScroll.disabled"),"hide-details":"",density:"compact",color:"primary",style:{"margin-right":"16px"}},null,8,["modelValue","label"]),l(k,{modelValue:a.pipDialog,"onUpdate:modelValue":i[3]||(i[3]=s=>a.pipDialog=s),width:"400"},{activator:o(({props:s})=>[l(m,C({variant:"plain"},s),{default:o(()=>[p(d(t(e)("pipInstall.button")),1)]),_:2},1040)]),default:o(()=>[l(h,null,{default:o(()=>[l(y,null,{default:o(()=>[n("span",T,d(t(e)("pipInstall.dialogTitle")),1)]),_:1}),l(I,null,{default:o(()=>[l(u,{modelValue:a.pipInstallPayload.package,"onUpdate:modelValue":i[1]||(i[1]=s=>a.pipInstallPayload.package=s),label:t(e)("pipInstall.packageLabel"),variant:"outlined"},null,8,["modelValue","label"]),l(u,{modelValue:a.pipInstallPayload.mirror,"onUpdate:modelValue":i[2]||(i[2]=s=>a.pipInstallPayload.mirror=s),label:t(e)("pipInstall.mirrorLabel"),variant:"outlined"},null,8,["modelValue","label"]),n("small",null,d(t(e)("pipInstall.mirrorHint")),1),n("div",null,[n("small",null,d(a.status),1)])]),_:1}),l(v,null,{default:o(()=>[l(S),l(m,{color:"blue-darken-1",variant:"text",onClick:a.pipInstall,loading:a.loading},{default:o(()=>[p(d(t(e)("pipInstall.installButton")),1)]),_:1},8,["onClick","loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])]),l(c,{ref:"consoleDisplayer",style:{height:"calc(100vh - 220px)"}},null,512)]))}});export{N as default};
