1 line
4.7 KiB
JavaScript
1 line
4.7 KiB
JavaScript
(()=>{var e={};e.id=866,e.ids=[866],e.modules={509:(e,t,s)=>{"use strict";s.a(e,async(e,r)=>{try{s.r(t),s.d(t,{config:()=>h,default:()=>d,getServerSideProps:()=>x,getStaticPaths:()=>m,getStaticProps:()=>p,reportWebVitals:()=>g,routeModule:()=>b,unstable_getServerProps:()=>w,unstable_getServerSideProps:()=>j,unstable_getStaticParams:()=>S,unstable_getStaticPaths:()=>v,unstable_getStaticProps:()=>f});var a=s(63865),i=s(9455),l=s(30671),n=s(49407),o=s(89600),c=s(21711),u=e([c]);c=(u.then?(await u)():u)[0];let d=(0,l.M)(c,"default"),p=(0,l.M)(c,"getStaticProps"),m=(0,l.M)(c,"getStaticPaths"),x=(0,l.M)(c,"getServerSideProps"),h=(0,l.M)(c,"config"),g=(0,l.M)(c,"reportWebVitals"),f=(0,l.M)(c,"unstable_getStaticProps"),v=(0,l.M)(c,"unstable_getStaticPaths"),S=(0,l.M)(c,"unstable_getStaticParams"),w=(0,l.M)(c,"unstable_getServerProps"),j=(0,l.M)(c,"unstable_getServerSideProps"),b=new a.PagesRouteModule({definition:{kind:i.A.PAGES,page:"/su/console",pathname:"/su/console",bundlePath:"",filename:""},components:{App:o.default,Document:n.default},userland:c});r()}catch(e){r(e)}})},54254:(e,t,s)=>{"use strict";s.a(e,async(e,r)=>{try{s.d(t,{A:()=>u});var a=s(8732),i=s(82015),l=s.n(i),n=s(10717);s(20008);var o=s(39127),c=e([n,o]);function u({socketDomain:e}){let[t,s]=l().useState(null),[r,i]=l().useState(null),[n,o]=l().useState("");return(0,a.jsxs)(l().Fragment,{children:[(0,a.jsxs)("div",{className:"w-full justify-between",children:[(0,a.jsx)("h2",{className:"text-2xl m-0",children:"Console"}),(0,a.jsx)("button",{onClick:e=>{t&&t.emit("log","Logging to the console")},children:"Log console"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6 w-full items-stretch",children:[(0,a.jsx)("section",{className:"paper bg-slate-900",id:"terminalWrapper",children:(0,a.jsx)("div",{className:"flex flex-col w-full gap-10 items-start justify-start terminal",children:(0,a.jsxs)("div",{className:"flex flex-col items-start w-full",children:[(0,a.jsx)("h2",{className:"m-0 text-white text-base",children:"Shell"}),(0,a.jsx)("hr",{className:"opacity-20"}),(0,a.jsx)("div",{id:"shell",className:"relative grow z-50 overflow-hidden w-full h-[340px]"})]})})}),(0,a.jsx)("section",{className:"paper bg-slate-500",id:"terminalWrapper",children:(0,a.jsx)("div",{className:"flex flex-col w-full gap-10 items-start justify-start terminal",children:(0,a.jsxs)("div",{className:"flex flex-col items-start w-full",children:[(0,a.jsx)("h2",{className:"m-0 text-white text-base",children:"Server Log"}),(0,a.jsx)("hr",{className:"opacity-20"}),(0,a.jsx)("div",{id:"terminal",className:"relative grow z-50 overflow-hidden w-full h-[150px]"})]})})})]})]})}[n,o]=c.then?(await c)():c,r()}catch(e){r(e)}})},20008:(e,t,s)=>{"use strict";async function r({socket:e}){let{Terminal:t}=s(86182),{FitAddon:r}=s(91999),a=new r,i=document.getElementById("terminalWrapper"),l=document.getElementById("terminal"),n=Math.round(i.clientWidth/12),o=new t({cols:n,rows:6});o.open(l),a.fit(),e.on("console",e=>{o.write(e)});{let s=new r,a=document.getElementById("shell"),i=new t({cols:n,rows:17});i.open(a),s.fit(),e.on("shell",e=>{i.write(e)}),i.onKey((t,s)=>{e.emit("shell",t.key)})}return o}s.d(t,{A:()=>r})},21711:(e,t,s)=>{"use strict";s.a(e,async(e,r)=>{try{s.r(t),s.d(t,{default:()=>u,getServerSideProps:()=>d});var a=s(8732);s(82015);var i=s(93615),l=s.n(i),n=s(49888),o=s(54254);s(68353);var c=e([o]);function u({user:e,data:t,socketDomain:s}){let r=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("title",{children:"Console | Datasquirel"}),(0,a.jsx)("meta",{name:"description",content:"Databases Console"})]});return(0,a.jsx)(n.A,{head:r,user:e,children:(0,a.jsx)(o.A,{socketDomain:s})})}async function d({req:e,res:t,query:s}){let r=await l()(e);if(!r?.logged_in_status)return{redirect:{destination:"/su/login",permanent:!1}};let a=process.env.DSQL_SOCKET_DOMAIN;return{props:{user:r,socketDomain:a||""}}}o=(c.then?(await c)():c)[0],r()}catch(e){r(e)}})},68353:()=>{},40361:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/pages.runtime.prod.js")},27912:e=>{"use strict";e.exports=require("next/head")},82015:e=>{"use strict";e.exports=require("react")},22326:e=>{"use strict";e.exports=require("react-dom")},8732:e=>{"use strict";e.exports=require("react/jsx-runtime")},86182:e=>{"use strict";e.exports=require("xterm")},91999:e=>{"use strict";e.exports=require("xterm-addon-fit")},79428:e=>{"use strict";e.exports=require("buffer")},55511:e=>{"use strict";e.exports=require("crypto")},81630:e=>{"use strict";e.exports=require("http")},33873:e=>{"use strict";e.exports=require("path")},39127:e=>{"use strict";e.exports=import("ansi-regex")},10717:e=>{"use strict";e.exports=import("socket.io-client")}};var t=require("../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),r=t.X(0,[883,9821,9600,3932],()=>s(509));module.exports=r})(); |