1 line
9.4 KiB
JavaScript
1 line
9.4 KiB
JavaScript
"use strict";(self.webpackChunkmaingate_console=self.webpackChunkmaingate_console||[]).push([[664],{41664:function(e,t,n){n.r(t),n.d(t,{default:function(){return m}});var a=n(74165),r=n(1413),c=n(15861),s=n(70885),i=n(47313),l=n(27998),o=n(22370),u=n(94948),d=n(80598),x=(n(88282),n(86480)),p=n(85554),h=n(21963),f=n(30657),j=n(62721),v=n(46417);function m(){var e=(0,p.v9)((function(e){return e.accessToken})),t=(0,h.Bw)(e),n=(0,f.Fp)(),m=n.instance,b=n.accounts,Z=(0,p.I0)(),y=(0,i.useState)(0),g=(0,s.Z)(y,2),S=g[0],k=g[1],w=(0,i.useState)(!1),C=(0,s.Z)(w,2),N=C[0],O=C[1],A=(0,i.useState)([]),L=(0,s.Z)(A,2),T=L[0],I=L[1],Q=(0,i.useState)(""),z=(0,s.Z)(Q,2),B=z[0],D=z[1],H=(0,i.useState)(""),M=(0,s.Z)(H,2),U=M[0],P=M[1],V=(0,i.useState)(""),_=(0,s.Z)(V,2),E=_[0],F=_[1],X=(0,i.useState)(""),q=(0,s.Z)(X,2),J=q[0],R=q[1],$=(0,i.useState)({}),G=(0,s.Z)($,2),K=G[0],W=G[1],Y=(0,i.useState)(""),ee=(0,s.Z)(Y,2),te=ee[0],ne=ee[1],ae=(0,i.useState)(""),re=(0,s.Z)(ae,2),ce=re[0],se=re[1],ie=(0,i.useState)(""),le=(0,s.Z)(ie,2),oe=le[0],ue=le[1],de=(0,i.useState)(""),xe=(0,s.Z)(de,2),pe=xe[0],he=xe[1],fe=(0,i.useState)(""),je=(0,s.Z)(fe,2),ve=je[0],me=je[1],be=(0,i.useState)(""),Ze=(0,s.Z)(be,2),ye=Ze[0],ge=Ze[1],Se=(0,i.useState)(""),ke=(0,s.Z)(Se,2),we=ke[0],Ce=ke[1];(0,i.useEffect)((function(){!function(){Le.apply(this,arguments)}()}),[]);var Ne=function(e){D(e.target.value)};function Oe(){return Ae.apply(this,arguments)}function Ae(){return(Ae=(0,c.Z)((0,a.Z)().mark((function n(){var c;return(0,a.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!t){n.next=6;break}return n.next=3,m.acquireTokenSilent((0,r.Z)((0,r.Z)({},j.Q),{},{account:b[0]}));case 3:return c=n.sent,Z({type:"set",accessToken:c.accessToken}),n.abrupt("return",c.accessToken);case 6:return n.abrupt("return",e);case 7:case"end":return n.stop()}}),n)})))).apply(this,arguments)}function Le(){return(Le=(0,c.Z)((0,a.Z)().mark((function e(){var t,n,r;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(!0),e.next=3,Oe();case 3:return t=e.sent,e.prev=4,e.next=7,x.ZP.get("".concat("","/api/service"),{headers:{Authorization:"Bearer ".concat(t)}});case 7:200===(n=e.sent).status?(r=[],Object.keys(n.data).forEach((function(e){r.push(n.data[e].ServiceName)})),I(r)):toast.error("\uc11c\ube44\uc2a4 \uc870\ud68c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(n.statusText)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),toast.error("\uc11c\ube44\uc2a4 \uc870\ud68c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(e.t0.message));case 14:O(!1);case 15:case"end":return e.stop()}}),e,null,[[4,11]])})))).apply(this,arguments)}function Te(){return(Te=(0,c.Z)((0,a.Z)().mark((function e(){var t,n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(!0),e.next=3,Oe();case 3:return t=e.sent,e.prev=4,e.next=7,x.ZP.get("".concat("","/api/account"),{params:{service:B,accid:U},headers:{Authorization:"Bearer ".concat(t)}});case 7:200===(n=e.sent).status?(W(n.data),n.data.accid||Ce("\uacc4\uc815\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.")):Ce("\uacc4\uc815 \uc870\ud68c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(n.statusText)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),Ce("\uacc4\uc815 \uc870\ud68c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(e.t0.message));case 14:O(!1);case 15:case"end":return e.stop()}}),e,null,[[4,11]])})))).apply(this,arguments)}function Ie(){return(Ie=(0,c.Z)((0,a.Z)().mark((function e(){var t,n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(!0),e.next=3,Oe();case 3:return t=e.sent,e.prev=4,e.next=7,x.ZP.get("".concat("","/api/account"),{params:{service:B,email:E,platform:J},headers:{Authorization:"Bearer ".concat(t)}});case 7:200===(n=e.sent).status?(W(n.data),n.data.accid||Ce("\uacc4\uc815\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.")):Ce("\uacc4\uc815 \uc870\ud68c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(n.statusText)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),Ce("\uacc4\uc815 \uc870\ud68c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(e.t0.message));case 14:O(!1);case 15:case"end":return e.stop()}}),e,null,[[4,11]])})))).apply(this,arguments)}function Qe(){ne(!1),se(!1),ue(!1),he(""),me(""),ge(""),Ce("")}return(0,v.jsx)(l.rb,{children:(0,v.jsxs)(l.b7,{xs:12,children:[(0,v.jsxs)(l.xH,{className:"mb-4",children:[(0,v.jsx)(l.bn,{children:(0,v.jsx)("strong",{children:"\uc870\ud68c \uc870\uac74"})}),(0,v.jsxs)(l.sl,{children:[(0,v.jsxs)(l.n2,{variant:"tabs",role:"tablist",className:"mb-3",children:[(0,v.jsx)(l.U6,{children:(0,v.jsx)(l.AQ,{href:"javascript:void(0);",active:0===S,onClick:function(){return k(0)},children:"\uacc4\uc815 \uc544\uc774\ub514"})}),(0,v.jsx)(l.U6,{children:(0,v.jsx)(l.AQ,{href:"javascript:void(0);",active:1===S,onClick:function(){return k(1)},children:"\uc774\uba54\uc77c"})})]}),(0,v.jsxs)(l.gr,{children:[(0,v.jsx)(l.IA,{role:"tabpanel",visible:0===S,children:(0,v.jsxs)(l.lx,{className:"row g-3",children:[(0,v.jsx)(l.b7,{md:6,children:(0,v.jsx)(l.LX,{label:"\uc11c\ube44\uc2a4 \uc774\ub984",onChange:Ne,value:B,children:T.map((function(e){return(0,v.jsx)("option",{value:e,children:e},e)}))})}),(0,v.jsx)(l.b7,{md:6,children:(0,v.jsx)(l.jO,{label:"\uacc4\uc815 \uc544\uc774\ub514",type:"text",value:U,onChange:function(e){P(e.target.value)},invalid:te,feedbackInvalid:pe})}),(0,v.jsx)("div",{className:"d-flex justify-content-center",children:(0,v.jsxs)(l.u5,{onClick:function(){if(Qe(),!U)return ne(!0),void he("\uacc4\uc815 \uc544\uc774\ub514\ub97c \uc785\ub825\ud558\uc138\uc694.");!function(){Te.apply(this,arguments)}()},disabled:N,children:[!N&&(0,v.jsx)(o.Z,{icon:u.j,className:"me-2"}),N&&(0,v.jsx)(l.LQ,{component:"span",size:"sm","aria-hidden":"true",className:"me-2"}),"\uc870\ud68c"]})})]})}),(0,v.jsx)(l.IA,{role:"tabpanel",visible:1===S,children:(0,v.jsxs)(l.lx,{className:"row g-3",children:[(0,v.jsx)(l.b7,{md:4,children:(0,v.jsx)(l.LX,{label:"\uc11c\ube44\uc2a4 \uc774\ub984",onChange:Ne,value:B,children:T.map((function(e){return(0,v.jsx)("option",{value:e,children:e},e)}))})}),(0,v.jsx)(l.b7,{md:4,children:(0,v.jsx)(l.jO,{label:"\uc774\uba54\uc77c",type:"text",value:E,onChange:function(e){F(e.target.value)},invalid:ce,feedbackInvalid:ve})}),(0,v.jsx)(l.b7,{md:4,children:(0,v.jsx)(l.jO,{label:"\ud50c\ub7ab\ud3fc",type:"text",value:J,onChange:function(e){R(e.target.value)},invalid:oe,feedbackInvalid:ye})}),(0,v.jsx)("div",{className:"d-flex justify-content-center border-top-3",children:(0,v.jsxs)(l.u5,{onClick:function(){return Qe(),E?E.match(/^\S+@\S+\.\S+$/)?J?void function(){Ie.apply(this,arguments)}():(ue(!0),void ge("\ud50c\ub7ab\ud3fc\uc744 \uc785\ub825\ud558\uc138\uc694.")):(se(!0),void me("\uc774\uba54\uc77c \ud615\uc2dd\uc774 \uc544\ub2d9\ub2c8\ub2e4.")):(se(!0),void me("\uc774\uba54\uc77c\uc744 \uc785\ub825\ud558\uc138\uc694."))},disabled:N,children:[!N&&(0,v.jsx)(o.Z,{icon:u.j,className:"me-2"}),N&&(0,v.jsx)(l.LQ,{component:"span",size:"sm","aria-hidden":"true",className:"me-2"}),"\uc870\ud68c"]})})]})})]})]})]}),(0,v.jsxs)(l.xH,{className:"mb-4",children:[(0,v.jsx)(l.bn,{children:(0,v.jsx)("strong",{children:"\uc870\ud68c \uacb0\uacfc"})}),(0,v.jsx)(l.sl,{children:(0,v.jsxs)(l.lx,{className:"row g-3",children:[N&&(0,v.jsx)(l.LQ,{}),!N&&!K.accid&&we&&(0,v.jsx)("div",{className:"d-flex justify-content-center",children:(0,v.jsxs)("strong",{children:[(0,v.jsx)(o.Z,{icon:d.D,className:"me-2"}),we]})}),!N&&K.accid&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(l.b7,{md:6,children:(0,v.jsx)(l.jO,{label:"\uacc4\uc815 \uc544\uc774\ub514",type:"text",value:K.accid,readOnly:!0})}),(0,v.jsx)(l.b7,{md:6,children:(0,v.jsx)(l.jO,{label:"\ud50c\ub7ab\ud3fc",type:"text",value:K.platform,readOnly:!0})}),(0,v.jsx)(l.b7,{md:6,children:(0,v.jsx)(l.jO,{label:"\uc774\uba54\uc77c",type:"text",value:K.email,readOnly:!0})}),(0,v.jsx)(l.b7,{md:6,children:(0,v.jsx)(l.jO,{label:"\uc0dd\uc131\uc77c",type:"text",value:new Date(K.create).toLocaleString(),readOnly:!0})})]})]})})]})]})})}},94948:function(e,t,n){n.d(t,{j:function(){return a}});var a=["512 512","<path fill='var(--ci-primary-color, currentColor)' d='M479.6,399.716l-81.084-81.084-62.368-25.767A175.014,175.014,0,0,0,368,192c0-97.047-78.953-176-176-176S16,94.953,16,192,94.953,368,192,368a175.034,175.034,0,0,0,101.619-32.377l25.7,62.2L400.4,478.911a56,56,0,1,0,79.2-79.195ZM48,192c0-79.4,64.6-144,144-144s144,64.6,144,144S271.4,336,192,336,48,271.4,48,192ZM456.971,456.284a24.028,24.028,0,0,1-33.942,0l-76.572-76.572-23.894-57.835L380.4,345.771l76.573,76.572A24.028,24.028,0,0,1,456.971,456.284Z' class='ci-primary'/>"]},80598:function(e,t,n){n.d(t,{D:function(){return a}});var a=["512 512","<rect width='32' height='176' x='240' y='176' fill='var(--ci-primary-color, currentColor)' class='ci-primary'/><rect width='32' height='32' x='240' y='384' fill='var(--ci-primary-color, currentColor)' class='ci-primary'/><path fill='var(--ci-primary-color, currentColor)' d='M274.014,16H237.986L16,445.174V496H496V445.174ZM464,464H48V452.959L256,50.826,464,452.959Z' class='ci-primary'/>"]},21963:function(e,t,n){n.d(t,{Bw:function(){return r}});n(47313);function a(e){try{if(3!==e.split(".").length||"string"!==typeof e)return null;var t=e.split(".")[1],n="=".repeat((4-t.length%4)%4),a=t.replace("-","+").replace("_","/")+n,r=decodeURIComponent(window.atob(a).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(r)}catch(c){return null}}function r(e){var t=a(e),n=!0;if(t&&t.exp){var r=new Date(0);r.setUTCSeconds(t.exp),n=r.valueOf()<(new Date).valueOf()}return n}}}]); |