3Dshock/client/build/static/js/main.4fce879a.chunk.js

2 lines
11 KiB
JavaScript
Raw Normal View History

2021-03-11 05:33:06 +00:00
(this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],{211:function(e,t,n){},213:function(e,t,n){},386:function(e,t,n){"use strict";n.r(t);var r,a=n(0),c=n(24),s=n.n(c),i=(n(211),n(212),n(213),n(103)),o=n(29),u=n(21),l=n.n(u),p=n(30),j=n(55),d=n(203),h=n(391),b=n(388),f=n(390),x=n(393),O=n(86),m=n(57),v=n(127),g=n.n(v),w=n(112),y=n(64),k=n.n(y),C=function(){var e=Object(p.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.next=2;break;case 2:return e.next=4,k.a.post("/api/clients",t);case 4:return n=e.sent,e.abrupt("return",n.data.client_id);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),S=function(){var e=Object(p.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.next=2;break;case 2:return e.next=4,k.a.get("/api/clients/".concat(t));case 4:return n=e.sent,e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=Object(p.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,k.a.post("/api/clients/".concat(t,"/session"));case 3:return n=e.sent,e.abrupt("return",n.data);case 7:return e.prev=7,e.t0=e.catch(0),d.b.error("Something went wrong, check connection with the machine"),e.abrupt("return",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),N=function(){var e=Object(p.a)(l.a.mark((function e(t){var n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.a.get("/api/clients/".concat(t,"/session"));case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),I=function(){var e=Object(p.a)(l.a.mark((function e(t){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.a.delete("/api/clients/".concat(t,"/session"));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(){var e=Object(p.a)(l.a.mark((function e(t){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I(t);case 2:return e.next=4,T(t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=function(){var e=Object(p.a)(l.a.mark((function e(){var t;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.a.get("/api/status");case 2:return t=e.sent,e.abrupt("return",t.data.status);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),E=n(7),F=function(){var e=Object(o.f)(),t=Object(a.useState)(null),n=Object(j.a)(t,2),r=n[0],c=n[1],s=function(){var t=Object(p.a)(l.a.mark((function t(n){var r;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n.phone.length<10)){t.next=4;break}return d.b.error("Check all fields!"),c("Phone number needs to be a length of at least 10"),t.abrupt("return");case 4:return t.next=6,C({name:n.name,email:n.email,phone:parseInt(n.phone.replace(/\D/g,""))});case 6:r=t.sent,e.push("/sessions/".concat(r));case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return Object(E.jsxs)(w.Content,{children:[Object(E.jsx)(h.a.Title,{className:"page-head",level:3,children:"Dashboard"}),Object(E.jsx)(h.a.Text,{children:"Enter the name, email and phone number of the subject"}),Object(E.jsx)(b.a,{}),Object(E.jsxs)(f.a,{className:"dashboard-form",onFinish:s,labelCol:{span:8},wrapperCol:{span:16},children:[Object(E.jsx)(g.a,{label:"name",name:"name",children:Object(E.jsx)(x.a,{minLength:3})}),Object(E.jsx)(g.a,{label:"email",name:"email",children:Object(E.jsx)(x.a,{type:"email"})}),Object(E.jsx)(g.a,{label:"phone",name:"phone",children:Object(E.jsx)(x.a,{type:"tel",minLength:10})}),Object(E.jsxs)(O.a,{justify:"space-between",children:[Object(E.jsx)(m.a,{danger:!0,onClick:function(){},children:"Reset
//# sourceMappingURL=main.4fce879a.chunk.js.map