import{C as g}from"./ConsoleDisplayer-040e0fe4.js";import{ag as c,h as f,B as n,t as d,g as t,d as l,w as o,H as h,au as y,K as V,L as b,o as v,f as p,C as u,m as I,z as _,A as C,D,a7 as m,I as S,J as k}from"./index-c3b77b9a.js";import"./eventsource-7c5cd362.js";const x={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"},B={class:"text-h5"},E={name:"ConsolePage",components:{ConsoleDisplayer:g},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,b.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})}}},H=Object.assign(E,{setup(r){const{tm:e}=c("features/console");return(a,i)=>(v(),f("div",x,[n("div",P,[n("div",null,[n("h4",null,d(t(e)("title")),1),l(h,{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",w,[l(y,{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(V,{modelValue:a.pipDialog,"onUpdate:modelValue":i[3]||(i[3]=s=>a.pipDialog=s),width:"400"},{activator:o(({props:s})=>[l(u,I({variant:"plain"},s),{default:o(()=>[p(d(t(e)("pipInstall.button")),1)]),_:2},1040)]),default:o(()=>[l(_,null,{default:o(()=>[l(C,null,{default:o(()=>[n("span",B,d(t(e)("pipInstall.dialogTitle")),1)]),_:1}),l(D,null,{default:o(()=>[l(m,{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(m,{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(S,null,{default:o(()=>[l(k),l(u,{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(g,{ref:"consoleDisplayer",style:{height:"calc(100vh - 220px)"}},null,512)]))}});export{H as default};
