1 line
1.8 KiB
JavaScript
1 line
1.8 KiB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{1603:function(e,t,r){Promise.resolve().then(r.t.bind(r,8173,23)),Promise.resolve().then(r.t.bind(r,9671,23)),Promise.resolve().then(r.bind(r,436))},436:function(e,t,r){"use strict";r.d(t,{SimCurrentGear:function(){return c}});var a=r(7437),s=r(2265),n=r(9671),o=r.n(n);function c(){let[e,t]=(0,s.useState)(!1),[r,n]=(0,s.useState)("");async function c(e){try{let r=await fetch("http://127.0.0.1:8000/sim/current_gear",{method:"POST",headers:{"Access-Control-Allow-Origin":"*"},body:e});if(r.ok)t(!0),n(await r.text());else throw Error("Error! status: ".concat(r.status))}catch(e){e instanceof Error?console.log(e.message):console.log("Unexpected error",e)}}return(0,a.jsxs)("div",{children:[(0,a.jsx)("iframe",{id:"renderframe",style:{display:"".concat(e?"block":"none"),width:"100%",height:"100vh",marginBottom:"50px"},srcDoc:"".concat(r)}),(0,a.jsxs)("form",{action:c,children:[(0,a.jsx)("div",{className:o().ctas,children:(0,a.jsx)("textarea",{className:o().textarea,rows:10,id:"simcprofile",name:"simcprofile",style:{display:"".concat(e?"none":"block")}})}),(0,a.jsxs)("div",{className:o().ctas,children:[(0,a.jsx)("button",{className:o().primary,type:"submit",children:"Run Sim"}),(0,a.jsx)("a",{href:"https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app",target:"_blank",rel:"noopener noreferrer",className:o().secondary,children:"Read our docs"})]})]})]})}},9671:function(e){e.exports={page:"page_page__ZU32B",main:"page_main__GlU4n",ctas:"page_ctas__g5wGe",textarea:"page_textarea__8C2wx",primary:"page_primary__V8M9Y",secondary:"page_secondary__lm_PT",footer:"page_footer__sHKi3",logo:"page_logo__7fc9l"}}},function(e){e.O(0,[967,173,971,23,744],function(){return e(e.s=1603)}),_N_E=e.O()}]); |