3 lines
14 KiB
JavaScript
3 lines
14 KiB
JavaScript
/*! For license information please see 6.01c8543c.chunk.js.LICENSE.txt */
|
|
(this["webpackJsonp@coreui/coreui-free-react-admin-template"]=this["webpackJsonp@coreui/coreui-free-react-admin-template"]||[]).push([[6,15],{657:function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,s=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(o){s=!0,i=o}finally{try{r||null==c.return||c.return()}finally{if(s)throw i}}return n}}(e,t)||function(e,t){if(e){if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.d(t,"a",(function(){return s}))},659:function(e,t,n){e.exports=n(387)},660:function(e,t,n){"use strict";function r(e,t,n,r,s,i,a){try{var c=e[i](a),o=c.value}catch(l){return void n(l)}c.done?t(o):Promise.resolve(o).then(r,s)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(s,i){var a=e.apply(t,n);function c(e){r(a,s,i,c,o,"next",e)}function o(e){r(a,s,i,c,o,"throw",e)}c(void 0)}))}}n.d(t,"a",(function(){return s}))},672:function(e,t,n){"use strict";n.r(t);n(1),n(644);var r=n(639),s=(n(638),n(18));t.default=function(){return Object(s.jsx)("div",{className:"c-app c-default-layout flex-row align-items-center",children:Object(s.jsx)(r.l,{children:Object(s.jsx)(r.K,{className:"justify-content-center",children:Object(s.jsx)(r.k,{md:"8",children:Object(s.jsxs)(r.i,{children:[Object(s.jsx)(r.f,{className:"p-4",children:Object(s.jsx)(r.g,{children:Object(s.jsxs)(r.s,{children:[Object(s.jsx)("h1",{children:"\u30ed\u30b0\u30a4\u30f3"}),Object(s.jsx)("p",{className:"text-muted",children:"SSO\u3067\u30b5\u30a4\u30f3\u30a4\u30f3\u3059\u308b\u306b\u306f\u3001\u3053\u3053\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044"}),Object(s.jsx)(r.K,{children:Object(s.jsx)(r.k,{children:Object(s.jsx)(r.e,{color:"primary",className:"px-4",onClick:function(){console.log("launch sso"),window.open("https://fsbsso.sumasen.net/Shibboleth.sso/Login","_self")},children:"SSO\u3067\u30ed\u30b0\u30a4\u30f3"})})})]})})}),Object(s.jsx)(r.f,{className:"text-white bg-primary py-5 d-md-down-none",style:{width:"44%"},children:Object(s.jsx)(r.g,{className:"text-center",children:Object(s.jsxs)("div",{children:[Object(s.jsx)("h2",{children:"\u30ed\u30b0\u30a4\u30f3\u65b9\u6cd5"}),Object(s.jsx)("p",{children:"\u3053\u308c\u306fSSO\u30ed\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001SSO\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u307e\u3059\u3002"})]})})})]})})})})})}},673:function(e,t,n){"use strict";t.parse=function(e,t){if("string"!==typeof e)throw new TypeError("argument str must be a string");for(var n={},s=t||{},a=e.split(i),o=s.decode||r,l=0;l<a.length;l++){var u=a[l],d=u.indexOf("=");if(!(d<0)){var h=u.substr(0,d).trim(),p=u.substr(++d,u.length).trim();'"'==p[0]&&(p=p.slice(1,-1)),void 0==n[h]&&(n[h]=c(p,o))}}return n},t.serialize=function(e,t,n){var r=n||{},i=r.encode||s;if("function"!==typeof i)throw new TypeError("option encode is invalid");if(!a.test(e))throw new TypeError("argument name is invalid");var c=i(t);if(c&&!a.test(c))throw new TypeError("argument val is invalid");var o=e+"="+c;if(null!=r.maxAge){var l=r.maxAge-0;if(isNaN(l)||!isFinite(l))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(l)}if(r.domain){if(!a.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!a.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){if("function"!==typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");o+="; Expires="+r.expires.toUTCString()}r.httpOnly&&(o+="; HttpOnly");r.secure&&(o+="; Secure");if(r.sameSite){switch("string"===typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o};var r=decodeURIComponent,s=encodeURIComponent,i=/; */,a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function c(e,t){try{return t(e)}catch(n){return e}}},778:function(e,t,n){"use strict";n.r(t);var r=n(1),s=n.n(r),i=n(659),a=n.n(i),c=n(43),o=n(660),l=n(657),u=n(644),d=n.n(u),h=n(673);function p(e,t){void 0===t&&(t={});var n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(function(e,t){return"undefined"===typeof t&&(t=!e||"{"!==e[0]&&"["!==e[0]&&'"'!==e[0]),!t}(n,t.doNotParse))try{return JSON.parse(n)}catch(r){}return e}var f=function(){return(f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},m=function(){function e(e,t){var n=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=function(e,t){return"string"===typeof e?h.parse(e,t):"object"===typeof e&&null!==e?e:{}}(e,t),new Promise((function(){n.HAS_DOCUMENT_COOKIE="object"===typeof document&&"string"===typeof document.cookie})).catch((function(){}))}return e.prototype._updateBrowserValues=function(e){this.HAS_DOCUMENT_COOKIE&&(this.cookies=h.parse(document.cookie,e))},e.prototype._emitChange=function(e){for(var t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)},e.prototype.get=function(e,t,n){return void 0===t&&(t={}),this._updateBrowserValues(n),p(this.cookies[e],t)},e.prototype.getAll=function(e,t){void 0===e&&(e={}),this._updateBrowserValues(t);var n={};for(var r in this.cookies)n[r]=p(this.cookies[r],e);return n},e.prototype.set=function(e,t,n){var r;"object"===typeof t&&(t=JSON.stringify(t)),this.cookies=f(f({},this.cookies),((r={})[e]=t,r)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=h.serialize(e,t,n)),this._emitChange({name:e,value:t,options:n})},e.prototype.remove=function(e,t){var n=t=f(f({},t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=f({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=h.serialize(e,"",n)),this._emitChange({name:e,value:void 0,options:t})},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){var t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)},e}(),b=n(21),j=n(639),O=s.a.lazy((function(){return n.e(9).then(n.bind(null,773))})),x=s.a.lazy((function(){return Promise.all([n.e(5),n.e(7)]).then(n.bind(null,774))})),v=s.a.lazy((function(){return n.e(8).then(n.bind(null,775))})),y=s.a.lazy((function(){return n.e(14).then(n.bind(null,776))})),g=[{path:"/",exact:!0,name:"Home"},{path:"/dashboard",name:"\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9",component:O},{path:"/reports",exact:!0,name:"\u30ec\u30dd\u30fc\u30c8",component:x},{path:"/uploader",exact:!0,name:"\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9",component:v},{path:"/secret",exact:!0,name:"\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9",component:y}],S=(n(672),n(18)),w=Object(S.jsx)("div",{className:"pt-3 text-center",children:Object(S.jsx)("div",{className:"sk-spinner sk-spinner-pulse",children:" "})}),N=function(){var e=Object(r.useState)(""),t=Object(l.a)(e,2),n=t[0],s=t[1],i=Object(r.useState)(""),u=Object(l.a)(i,2),h=u[0],p=u[1],f=Object(r.useState)(""),O=Object(l.a)(f,2),x=O[0],v=O[1];function y(){return N.apply(this,arguments)}function N(){return(N=Object(o.a)(a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d()("https://fsbsso.sumasen.net/Shibboleth.sso/Session");case 2:t=e.sent,JSON.stringify(n)!==JSON.stringify(t.data)&&s(t.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=Object(o.a)(a.a.mark((function e(t){var n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={headers:{"Content-Type":"application/json;charset=UTF-8","Access-Control-Allow-Origin":"*"}},e.next=3,d.a.post("https://fsbsso.sumasen.net/csv",t,n).catch((function(e){console.log("AXIOS ERROR: ",e)}));case 3:e.sent,console.log("user data posted");case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function C(){return(C=Object(o.a)(a.a.mark((function e(){var t,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==n.attributes[0]){e.next=2;break}return e.abrupt("return",!1);case 2:return t=n.attributes[0].values[0],"FBS","api","c558a56c63c44f65956adde8863ecc3558f3e55a465d4338bb2e7d2692866fd8",e.next=8,d.a.get("https://fsbsso.sumasen.net/users?email="+t,{auth:{username:"api",password:"c558a56c63c44f65956adde8863ecc3558f3e55a465d4338bb2e7d2692866fd8"}}).catch((function(e){return console.log(e),!1}));case 8:return r=e.sent,JSON.stringify(h)!==JSON.stringify(r.data[0])&&p(r.data[0]),e.abrupt("return",!0);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(){var e=(new m).get("_shibsession_64656661756c7468747470733a2f2f66736273736f2e73756d6173656e2e6e65742f73686962626f6c657468");if(void 0===e)return null;y().then((function(){null!==n&&(console.log(e),function(){return C.apply(this,arguments)}().then((function(){var t=Math.floor(1e5+9e5*Math.random());""===x&&v(t);var n=h.firstname,r=h.lastname,s=h.email,i=h.employee_code,a='[\n {\n "mailadress": "'.concat(s,'",\n "name": "').concat(r," ").concat(n,'",\n "jsessionid": ').concat(t,',\n "_idp_session": "",\n "_opensaml_key": "_shibsession_64656661756c7468747470733a2f2f66736273736f2e73756d6173656e2e6e65742f73686962626f6c657468",\n "_opensaml_value": "').concat(e,'"\n }\n ]');return null!==i&&void 0!==i&&window.location.href.includes("dashboard")&&function(e){k.apply(this,arguments)}(a),!0})))}))}return Object(r.useEffect)((function(){y()}),[]),Object(S.jsxs)("main",{className:"c-main",children:[Object(S.jsx)(j.l,{fluid:!0,children:Object(S.jsxs)(r.Suspense,{fallback:w,children:[Object(S.jsxs)(b.d,{children:[" ",g.map((function(e,t){return e.component&&Object(S.jsx)(b.b,{path:e.path,exact:e.exact,name:e.name,render:function(t){return null!==_()?Object(S.jsx)(e.component,Object(c.a)(Object(c.a)({},t),{},{userid:x})):Object(S.jsx)(b.a,{to:{pathname:"/sso"}})}},t)})),Object(S.jsx)(b.a,{from:"/",to:"/dashboard"})]})," "]})})," "]})},k=s.a.memo(N),C=function(){return Object(S.jsxs)(j.r,{fixed:!1,children:[Object(S.jsxs)("div",{children:[Object(S.jsx)("a",{href:"sumasen.net",target:"_blank",rel:"noopener noreferrer",children:"FBS"}),Object(S.jsx)("span",{className:"ml-1",children:"\xa9 2021 DigitalVox."})]}),Object(S.jsxs)("div",{className:"mfs-auto",children:[Object(S.jsx)("span",{className:"mr-1",children:"\u642d\u8f09"}),Object(S.jsx)("a",{href:"#",target:"_blank",rel:"noopener noreferrer",children:"DigitalVox"})]})]})},_=s.a.memo(C),E=n(165),T=n(638),A=function(){var e=Object(E.b)(),t=Object(E.c)((function(e){return e.sidebarShow}));return Object(S.jsxs)(j.u,{withSubheader:!0,children:[Object(S.jsx)(j.V,{inHeader:!0,className:"ml-md-3 d-lg-none",onClick:function(){var n=!![!1,"responsive"].includes(t)||"responsive";e({type:"set",sidebarShow:n})}}),Object(S.jsx)(j.V,{inHeader:!0,className:"ml-3 d-md-down-none",onClick:function(){var n=![!0,"responsive"].includes(t)&&"responsive";e({type:"set",sidebarShow:n})}}),Object(S.jsx)(j.v,{className:"mx-auto d-lg-none",to:"/",children:Object(S.jsx)("h2",{children:"FBS"})}),Object(S.jsx)(j.w,{className:"d-md-down-none mr-auto",children:Object(S.jsx)(j.x,{className:"px-3",children:Object(S.jsx)(j.y,{to:"/dashboard",children:"\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9"})})}),Object(S.jsx)(j.w,{className:"px-3",children:Object(S.jsx)(I,{})}),Object(S.jsx)(j.U,{className:"px-3 justify-content-between",children:Object(S.jsx)(j.d,{className:"border-0 c-subheader-nav m-0 px-0 px-md-3",routes:g})})]})},I=function(){return Object(S.jsxs)(j.n,{inNav:!0,className:"c-header-nav-items mx-2",direction:"down",children:[Object(S.jsx)(j.q,{className:"c-header-nav-link",caret:!1,children:"\u30a2\u30ab\u30a6\u30f3\u30c8"}),Object(S.jsxs)(j.p,{className:"pt-0",placement:"bottom-end",children:[Object(S.jsx)(j.o,{header:!0,tag:"div",color:"light",className:"text-center",children:Object(S.jsx)("strong",{children:"\u30a2\u30ab\u30a6\u30f3\u30c8"})}),Object(S.jsxs)(j.o,{onClick:function(){console.log("launch sso"),window.open("https://fsbsso.sumasen.net/Shibboleth.sso/Login","_self")},children:[Object(S.jsx)(T.a,{name:"cil-bell",className:"mfe-2"}),"SSO \u30ed\u30b0\u30a4\u30f3"]})]})]})},L=[{_tag:"CSidebarNavItem",name:"\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9",to:"/dashboard",icon:Object(S.jsx)(T.a,{name:"cil-speedometer",customClasses:"c-sidebar-nav-icon"})},{_tag:"CSidebarNavTitle",_children:["\u30ec\u30dd\u30fc\u30c8"]},{_tag:"CSidebarNavItem",name:"\u5831\u544a\u66f8",to:"/reports",icon:"cil-drop"},{_tag:"CSidebarNavItem",name:"\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9",to:"/uploader",icon:"cil-drop"}],U=function(){var e=Object(E.b)(),t=Object(E.c)((function(e){return e.sidebarShow}));return Object(S.jsxs)(j.M,{show:t,onShowChange:function(t){return e({type:"set",sidebarShow:t})},children:[Object(S.jsxs)(j.N,{className:"d-md-down-none",to:"/",children:[Object(S.jsx)("h2",{children:"FBS"}),Object(S.jsx)(T.a,{className:"c-sidebar-brand-minimized",name:"sygnet",height:35})]}),Object(S.jsx)(j.P,{children:Object(S.jsx)(j.m,{items:L,components:{CSidebarNavDivider:j.Q,CSidebarNavDropdown:j.R,CSidebarNavItem:j.S,CSidebarNavTitle:j.T}})}),Object(S.jsx)(j.O,{className:"c-d-md-down-none"})]})},D=s.a.memo(U);t.default=function(){return Object(S.jsxs)("div",{className:"c-app c-default-layout",children:[Object(S.jsx)(D,{}),Object(S.jsxs)("div",{className:"c-wrapper",children:[Object(S.jsx)(A,{}),Object(S.jsx)("div",{className:"c-body",children:Object(S.jsx)(k,{})}),Object(S.jsx)(_,{})]})]})}}}]);
|
|
//# sourceMappingURL=6.01c8543c.chunk.js.map
|