1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
"use strict";(self.webpackChunkmaingate_console=self.webpackChunkmaingate_console||[]).push([[18],{56018:function(e,r,t){t.r(r),t.d(r,{default:function(){return g}});var c=t(74165),a=t(1413),s=t(15861),n=t(70885),i=t(47313),l=t(27998),o=t(22370),u=t(94948),d=["512 512","<path fill='var(--ci-primary-color, currentColor)' d='M208,16A112.127,112.127,0,0,0,96,128v79.681a80.236,80.236,0,0,0,9.768,38.308l27.455,50.333L60.4,343.656A79.725,79.725,0,0,0,24,410.732V496H312V464H56V410.732a47.836,47.836,0,0,1,21.841-40.246l97.66-63.479-41.64-76.341A48.146,48.146,0,0,1,128,207.681V128a80,80,0,0,1,160,0v79.681a48.146,48.146,0,0,1-5.861,22.985L240.5,307.007,312,353.483V315.317l-29.223-19,27.455-50.334A80.23,80.23,0,0,0,320,207.681V128A112.127,112.127,0,0,0,208,16Z' class='ci-primary'/><polygon fill='var(--ci-primary-color, currentColor)' points='424 400 424 336 392 336 392 400 328 400 328 432 392 432 392 496 424 496 424 432 488 432 488 400 424 400' class='ci-primary'/>"],m=t(45498),p=t(80598),h=["512 512","<polygon fill='var(--ci-primary-color, currentColor)' points='200.359 382.269 61.057 251.673 82.943 228.327 199.641 337.731 428.686 108.687 451.314 131.313 200.359 382.269' class='ci-primary'/>"],x=t(34491),v=(t(88282),t(86480)),f=t(85554),j=t(21963),y=t(30657),Z=t(62721),b=t(46417);function g(){var e=(0,f.v9)((function(e){return e.accessToken})),r=(0,j.Bw)(e),t=(0,y.Fp)(),g=t.instance,N=t.accounts,S=(0,f.I0)(),k=(0,i.useState)(!1),C=(0,n.Z)(k,2),w=C[0],D=C[1],O=(0,i.useState)([]),A=(0,n.Z)(O,2),M=A[0],T=A[1],V=(0,i.useState)([]),H=(0,n.Z)(V,2),L=H[0],I=H[1],P=(0,i.useState)(!1),E=(0,n.Z)(P,2),z=E[0],B=E[1],F=(0,i.useState)(!1),_=(0,n.Z)(F,2),Q=_[0],R=_[1],U=(0,i.useState)(""),Y=(0,n.Z)(U,2),q=Y[0],J=Y[1],X=(0,i.useState)(""),$=(0,n.Z)(X,2),G=$[0],K=$[1],W=(0,i.useState)(""),ee=(0,n.Z)(W,2),re=ee[0],te=ee[1],ce=(0,i.useState)(""),ae=(0,n.Z)(ce,2),se=ae[0],ne=ae[1],ie=(0,i.useState)(""),le=(0,n.Z)(ie,2),oe=le[0],ue=le[1],de=(0,i.useState)(""),me=(0,n.Z)(de,2),pe=me[0],he=me[1],xe=(0,i.useState)(!1),ve=(0,n.Z)(xe,2),fe=ve[0],je=ve[1],ye=(0,i.useState)(!1),Ze=(0,n.Z)(ye,2),be=Ze[0],ge=Ze[1],Ne=(0,i.useState)(!1),Se=(0,n.Z)(Ne,2),ke=Se[0],Ce=Se[1],we=(0,i.useState)(!1),De=(0,n.Z)(we,2),Oe=De[0],Ae=De[1],Me=(0,i.useState)(""),Te=(0,n.Z)(Me,2),Ve=Te[0],He=Te[1],Le=(0,i.useState)(""),Ie=(0,n.Z)(Le,2),Pe=Ie[0],Ee=Ie[1],ze=(0,i.useState)(""),Be=(0,n.Z)(ze,2),Fe=Be[0],_e=Be[1],Qe=(0,i.useState)(""),Re=(0,n.Z)(Qe,2),Ue=Re[0],Ye=Re[1];(0,i.useEffect)((function(){!function(){Ke.apply(this,arguments)}()}),[]);var qe=function(){B(!1)},Je=function(e){return function(r){r.preventDefault(),K(e._id),te(e.desc),ne(e.email),ue(e.platform),he(e.service),R(!0)}},Xe=function(){R(!1)};function $e(){return Ge.apply(this,arguments)}function Ge(){return(Ge=(0,s.Z)((0,c.Z)().mark((function t(){var s;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r){t.next=6;break}return t.next=3,g.acquireTokenSilent((0,a.Z)((0,a.Z)({},Z.Q),{},{account:N[0]}));case 3:return s=t.sent,S({type:"set",accessToken:s.accessToken}),t.abrupt("return",s.accessToken);case 6:return t.abrupt("return",e);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ke(){return(Ke=(0,s.Z)((0,c.Z)().mark((function e(){var r,t,a,s,n;return(0,c.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(!0),e.next=3,$e();case 3:return r=e.sent,e.prev=4,e.next=7,v.ZP.get("".concat("","/api/service"),{headers:{Authorization:"Bearer ".concat(r)}});case 7:200===(t=e.sent).status?(n=[],Object.keys(t.data).forEach((function(e){n.push(t.data[e].ServiceName)})),J(null!==(a=n[0])&&void 0!==a?a:""),T(n),We(null!==(s=n[0])&&void 0!==s?s:"")):x.Am.error("\uc11c\ube44\uc2a4 \uc870\ud68c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(t.statusText)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),x.Am.error("\uc11c\ube44\uc2a4 \uc870\ud68c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(e.t0.message));case 14:D(!1);case 15:case"end":return e.stop()}}),e,null,[[4,11]])})))).apply(this,arguments)}function We(e){return er.apply(this,arguments)}function er(){return(er=(0,s.Z)((0,c.Z)().mark((function e(r){var t,a,s;return(0,c.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(!0),e.next=3,$e();case 3:return t=e.sent,a=r||q,e.prev=5,e.next=8,v.ZP.get("".concat("","/api/whitelist"),{params:{service:a},headers:{Authorization:"Bearer ".concat(t)}});case 8:200===(s=e.sent).status?I(s.data):x.Am.error("\ud654\uc774\ud2b8\ub9ac\uc2a4\ud2b8 \uc870\ud68c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(s.statusText)),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(5),x.Am.error("\ud654\uc774\ud2b8\ub9ac\uc2a4\ud2b8 \uc870\ud68c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(e.t0.message));case 15:D(!1);case 16:case"end":return e.stop()}}),e,null,[[5,12]])})))).apply(this,arguments)}function rr(){return(rr=(0,s.Z)((0,c.Z)().mark((function e(){var r,t;return(0,c.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$e();case 2:return r=e.sent,e.prev=3,e.next=6,v.ZP.put("".concat("","/api/whitelist"),{desc:re,email:se,platform:oe,service:pe},{params:{service:q},headers:{Authorization:"Bearer ".concat(r)}});case 6:200===(t=e.sent).status?(We(),x.Am.success("\uba64\ubc84 \ucd94\uac00\ub97c \uc131\uacf5\ud588\uc2b5\ub2c8\ub2e4.",{autoClose:1e3})):x.Am.error("\uba64\ubc84 \ucd94\uac00\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(t.statusText)),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),x.Am.error("\uba64\ubc84 \ucd94\uac00\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(e.t0.message));case 13:case"end":return e.stop()}}),e,null,[[3,10]])})))).apply(this,arguments)}function tr(){return(tr=(0,s.Z)((0,c.Z)().mark((function e(){var r,t;return(0,c.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$e();case 2:return r=e.sent,e.prev=3,e.next=6,v.ZP.delete("".concat("","/api/whitelist"),{params:{id:G},headers:{Authorization:"Bearer ".concat(r)}});case 6:200===(t=e.sent).status?(We(),x.Am.success("\uba64\ubc84 \uc0ad\uc81c\ub97c \uc131\uacf5\ud588\uc2b5\ub2c8\ub2e4.",{autoClose:1e3})):x.Am.error("\uba64\ubc84 \uc0ad\uc81c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(t.statusText)),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),x.Am.error("\uba64\ubc84 \uc0ad\uc81c\ub97c \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4: ".concat(e.t0.message));case 13:case"end":return e.stop()}}),e,null,[[3,10]])})))).apply(this,arguments)}function cr(){je(!1),ge(!1),Ce(!1),Ae(!1),He(""),Ee(""),_e(""),Ye("")}return(0,b.jsxs)(l.rb,{children:[(0,b.jsx)(l.b7,{xs:12,children:(0,b.jsxs)(l.xH,{className:"mb-4",children:[(0,b.jsx)(l.bn,{children:(0,b.jsx)("strong",{children:"\ud654\uc774\ud2b8\ub9ac\uc2a4\ud2b8"})}),(0,b.jsxs)(l.sl,{children:[(0,b.jsxs)(l.lx,{className:"row g-3",children:[(0,b.jsx)("div",{className:"col-1",children:(0,b.jsx)(l.jO,{type:"text",id:"serviceTypeText",defaultValue:"Service",readOnly:!0,plainText:!0})}),(0,b.jsx)("div",{className:"col-auto",children:(0,b.jsx)(l.LX,{onChange:function(e){J(e.target.value)},value:q,children:M.map((function(e){return(0,b.jsx)("option",{value:e,children:e},e)}))})}),(0,b.jsx)("div",{className:"col-auto",children:(0,b.jsxs)(l.u5,{className:"mb-3",onClick:function(){We()},disabled:w,children:[!w&&(0,b.jsx)(o.Z,{icon:u.j,className:"me-2"}),w&&(0,b.jsx)(l.LQ,{component:"span",size:"sm","aria-hidden":"true",className:"me-2"}),"\uc870\ud68c"]})})]}),(0,b.jsxs)(l.u5,{className:"mb-3",color:"info",onClick:function(){cr(),K(""),te(""),ne(""),he(""),ue("microsoft"),he(q),B(!0)},children:[(0,b.jsx)(o.Z,{icon:d,className:"me-2"}),"\ucd94\uac00"]}),(0,b.jsxs)(l.Sx,{striped:!0,hover:!0,children:[(0,b.jsx)(l.V,{children:(0,b.jsxs)(l.T6,{children:[(0,b.jsx)(l.is,{scope:"col",children:"ID"}),(0,b.jsx)(l.is,{scope:"col",children:"Desc"}),(0,b.jsx)(l.is,{scope:"col",children:"Email"}),(0,b.jsx)(l.is,{scope:"col",children:"Platform"}),(0,b.jsx)(l.is,{scope:"col",children:"Service"}),(0,b.jsx)(l.is,{scope:"col",children:"Action"})]})}),(0,b.jsxs)(l.NR,{children:[w&&(0,b.jsx)(l.LQ,{}),!w&&L&&L.map((function(e){return(0,b.jsxs)(l.T6,{children:[(0,b.jsx)(l.is,{scope:"row",children:e._id}),(0,b.jsx)(l.NN,{children:e.desc}),(0,b.jsx)(l.NN,{children:e.email}),(0,b.jsx)(l.NN,{children:e.platform}),(0,b.jsx)(l.NN,{children:e.service}),(0,b.jsx)(l.NN,{children:(0,b.jsxs)(l.u5,{size:"sm",color:"danger",onClick:Je(e),children:[(0,b.jsx)(o.Z,{icon:m.N}),"\uc0ad\uc81c"]})})]},e._id)})),!w&&(!L||0===L.length)&&(0,b.jsx)(l.T6,{children:(0,b.jsxs)(l.NN,{colSpan:"6",children:[(0,b.jsx)(o.Z,{icon:p.D,className:"me-2"}),"\ub4f1\ub85d\ub41c \ub370\uc774\ud130\uac00 \uc5c6\uc2b5\ub2c8\ub2e4."]})})]})]})]}),(0,b.jsxs)(l.Tk,{size:"lg",alignment:"center",backdrop:"static",visible:z,onClose:qe,children:[(0,b.jsx)(l.p0,{children:(0,b.jsx)(l.fl,{children:"\uba64\ubc84 \ucd94\uac00"})}),(0,b.jsxs)(l.sD,{children:[(0,b.jsx)("div",{className:"mb-3",children:(0,b.jsx)(l.jO,{label:"Service",type:"text",value:pe,feedbackInvalid:Ve,invalid:fe,readOnly:!0})}),(0,b.jsx)("div",{className:"mb-3",children:(0,b.jsx)(l.jO,{label:"Platform",type:"text",value:oe,onChange:function(e){ue(e.target.value)},feedbackInvalid:Pe,invalid:be})}),(0,b.jsx)("div",{className:"mb-3",children:(0,b.jsx)(l.jO,{label:"Email",type:"text",value:se,onChange:function(e){ne(e.target.value)},feedbackInvalid:Fe,invalid:ke})}),(0,b.jsx)("div",{className:"mb-3",children:(0,b.jsx)(l.jO,{label:"Desc",type:"text",value:re,onChange:function(e){te(e.target.value)},feedbackInvalid:Ue,invalid:Oe})})]}),(0,b.jsxs)(l.Ym,{children:[(0,b.jsx)(l.u5,{color:"secondary",onClick:qe,children:"\ub2eb\uae30"}),(0,b.jsxs)(l.u5,{color:"primary",onClick:function(){return cr(),pe?""===oe?(ge(!0),void Ee("Platform \uc744 \uc785\ub825\ud558\uc138\uc694.")):""===se?(Ce(!0),void _e("Email \uc744 \uc785\ub825\ud558\uc138\uc694.")):se.match(/^\S+@\S+\.\S+$/)?""===re?(Ae(!0),void Ye("Desc \ub97c \uc785\ub825\ud558\uc138\uc694.")):(function(){rr.apply(this,arguments)}(),void B(!1)):(Ce(!0),void _e("Email \ud615\uc2dd\uc774 \uc544\ub2d9\ub2c8\ub2e4.")):(je(!0),void He("Service \ub97c \uc785\ub825\ud558\uc138\uc694."))},children:[(0,b.jsx)(o.Z,{icon:h}),"\uba64\ubc84\ub97c \ucd94\uac00\ud569\ub2c8\ub2e4."]})]})]}),(0,b.jsxs)(l.Tk,{size:"lg",alignment:"center",backdrop:"static",visible:Q,onClose:Xe,children:[(0,b.jsx)(l.p0,{children:(0,b.jsx)(l.fl,{children:"\uba64\ubc84 \uc0ad\uc81c"})}),(0,b.jsxs)(l.sD,{children:[(0,b.jsxs)("div",{className:"mb-3",children:[(0,b.jsx)(l.L8,{htmlFor:"memberDeleteModalService",children:"service"}),(0,b.jsx)(l.jO,{id:"memberDeleteModalService",type:"text",value:pe,readOnly:!0})]}),(0,b.jsxs)("div",{className:"mb-3",children:[(0,b.jsx)(l.L8,{htmlFor:"memberDeleteModalPlatform",children:"Platform"}),(0,b.jsx)(l.jO,{id:"memberDeleteModalPlatform",type:"text",value:oe,readOnly:!0})]}),(0,b.jsxs)("div",{className:"mb-3",children:[(0,b.jsx)(l.L8,{htmlFor:"memberDeleteModalId",children:"ID"}),(0,b.jsx)(l.jO,{id:"memberDeleteModalId",type:"text",value:G,readOnly:!0})]}),(0,b.jsxs)("div",{className:"mb-3",children:[(0,b.jsx)(l.L8,{htmlFor:"memberDeleteModalEmail",children:"Email"}),(0,b.jsx)(l.jO,{id:"memberDeleteModalEmail",type:"text",value:se,readOnly:!0})]}),(0,b.jsxs)("div",{className:"mb-3",children:[(0,b.jsx)(l.L8,{htmlFor:"memberDeleteModalDesc",children:"Desc"}),(0,b.jsx)(l.jO,{id:"memberDeleteModalDesc",type:"text",value:re,readOnly:!0})]})]}),(0,b.jsxs)(l.Ym,{children:[(0,b.jsx)(l.u5,{color:"secondary",onClick:Xe,children:"\ub2eb\uae30"}),(0,b.jsxs)(l.u5,{color:"danger",onClick:function(){!function(){tr.apply(this,arguments)}(),R(!1)},children:[(0,b.jsx)(o.Z,{icon:m.N}),"\uba64\ubc84\ub97c \uc0ad\uc81c\ud569\ub2c8\ub2e4."]})]})]})]})}),(0,b.jsx)(x.Ix,{position:"top-right",autoClose:5e3,hideProgressBar:!1,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!1,draggable:!0,pauseOnHover:!0})]})}},94948:function(e,r,t){t.d(r,{j:function(){return c}});var c=["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'/>"]},45498:function(e,r,t){t.d(r,{N:function(){return c}});var c=["512 512","<path fill='var(--ci-primary-color, currentColor)' d='M96,472a23.82,23.82,0,0,0,23.579,24H392.421A23.82,23.82,0,0,0,416,472V152H96Zm32-288H384V464H128Z' class='ci-primary'/><rect width='32' height='200' x='168' y='216' fill='var(--ci-primary-color, currentColor)' class='ci-primary'/><rect width='32' height='200' x='240' y='216' fill='var(--ci-primary-color, currentColor)' class='ci-primary'/><rect width='32' height='200' x='312' y='216' fill='var(--ci-primary-color, currentColor)' class='ci-primary'/><path fill='var(--ci-primary-color, currentColor)' d='M328,88V40c0-13.458-9.488-24-21.6-24H205.6C193.488,16,184,26.542,184,40V88H64v32H448V88ZM216,48h80V88H216Z' class='ci-primary'/>"]},80598:function(e,r,t){t.d(r,{D:function(){return c}});var c=["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,r,t){t.d(r,{Bw:function(){return a}});t(47313);function c(e){try{if(3!==e.split(".").length||"string"!==typeof e)return null;var r=e.split(".")[1],t="=".repeat((4-r.length%4)%4),c=r.replace("-","+").replace("_","/")+t,a=decodeURIComponent(window.atob(c).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(a)}catch(s){return null}}function a(e){var r=c(e),t=!0;if(r&&r.exp){var a=new Date(0);a.setUTCSeconds(r.exp),t=a.valueOf()<(new Date).valueOf()}return t}}}]); |