1 line
5.5 KiB
JavaScript
Executable File
1 line
5.5 KiB
JavaScript
Executable File
"use strict";(self.webpackChunkest_farmework=self.webpackChunkest_farmework||[]).push([[2578],{217:(e,t,o)=>{o.d(t,{A:()=>b});var n=o(96540),r=o(92303),i=o(74848);function a(e){let{children:t,fallback:o}=e;return(0,r.A)()?(0,i.jsx)(i.Fragment,{children:t?.()}):o??null}var l=o(56347),s=o(95945);const d="undefined"!=typeof window?window.location.hostname:"",c=`${"undefined"!=typeof window?window.location.protocol:""}//${d}`,u={"/FlukeMoniPage":`${c}:3002/FlukeMoniPage`,"/NetAllyMoniPage":`${c}:3002/NetAllyMoniPage`,"/Control":`${c}:3002/Control`,"/Office":`${c}:3003/?&faultScenarios=Office`,"/Industry":`${c}:3003/?&faultScenarios=Industry`,"/DataCenter":`${c}:3003/?&faultScenarios=DataCenter`,"/Competition":`${c}:3003/?&faultScenarios=WorldSkill`,"/CompetitionAdmin":`${c}:3003/admin`},p={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(5px)",zIndex:999,opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",justifyContent:"center",alignItems:"center"},f={position:"relative",backgroundColor:"white",padding:"25px",borderRadius:"12px",boxShadow:"0 10px 25px rgba(0,0,0,0.2)",zIndex:1e3,maxWidth:"85%",width:"320px",textAlign:"center",transform:"scale(0.9)",opacity:0,transition:"all 0.3s ease-in-out"},g={fontSize:"18px",fontWeight:"bold",color:"#333",marginBottom:"15px"},x={fontSize:"14px",color:"#666",lineHeight:"1.5",marginBottom:"20px"},m={padding:"10px 24px",backgroundColor:"#2563eb",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"14px",fontWeight:"500",transition:"all 0.2s ease",boxShadow:"0 2px 4px rgba(37, 99, 235, 0.2)"},h={backgroundColor:"#1d4ed8",transform:"translateY(-1px)",boxShadow:"0 4px 6px rgba(37, 99, 235, 0.3)"},w={display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",backgroundColor:"#f8fafc",position:"fixed",top:30,left:0,right:0,bottom:0,transition:"filter 0.3s ease"},b=()=>{const[e,t]=(0,n.useState)(""),[o,r]=(0,n.useState)(!1),[d,c]=(0,n.useState)(!1),[b,y]=(0,n.useState)(!1),k=(0,l.W6)(),S=(0,l.zy)(),{userLevel:j,organization:C,username:v,productModel:z}=(0,s.A)();(0,n.useEffect)((()=>{const e=()=>{window.innerWidth<=768&&(r(!0),setTimeout((()=>y(!0)),100))};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const I=()=>{y(!1),setTimeout((()=>r(!1)),300)};(0,n.useEffect)((()=>{const e=localStorage.getItem("authToken");e?t(e):k.push("/login")}),[k]),(0,n.useEffect)((()=>{"/"!==S.pathname&&S.pathname.endsWith("/")&&k.replace(S.pathname.slice(0,-1))}),[S.pathname]);return(0,i.jsx)(a,{fallback:(0,i.jsx)("div",{children:"Loading..."}),children:()=>{if(!u[S.pathname])return(0,i.jsx)("div",{children:"404 - Page not found"});if(!e)return(0,i.jsx)("div",{children:"Redirecting to login..."});const t=(()=>{const e=u[S.pathname];if(!e)return null;const t=new URL(`${e}/`),o=localStorage.getItem("authToken")||"",n=localStorage.getItem("organization")||"",r=localStorage.getItem("username")||"",i=localStorage.getItem("userLevel")||"0",a=localStorage.getItem("model")||"",l=a&&a.endsWith("E")?"general":"fluke";return t.searchParams.append("token",o),t.searchParams.append("org",n),t.searchParams.append("user",r),t.searchParams.append("userLevel",i),t.searchParams.append("estmodel",l),t.toString()})();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{style:{...w,filter:o?"blur(2px)":"none"},children:(0,i.jsx)("iframe",{src:t,style:{width:"100%",height:"100%",border:"none",borderRadius:"8px",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.05)"},sandbox:"allow-same-origin allow-scripts allow-popups allow-forms allow-mixed-content allowfullscreen allow-downloads allow-modals allow-popups",security:"unrestricted",referrerPolicy:"no-referrer",loading:"lazy",allow:"*"})}),o&&(0,i.jsx)("div",{style:{...p,opacity:b?1:0},onClick:I,children:(0,i.jsxs)("div",{style:{...f,transform:b?"scale(1)":"scale(0.9)",opacity:b?1:0},onClick:e=>e.stopPropagation(),children:[(0,i.jsx)("div",{style:g,children:"\u26a0\ufe0f\u63d0\u793a"}),(0,i.jsx)("div",{style:x,children:"\u4e3a\u4e86\u83b7\u5f97\u6700\u4f73\u7684\u663e\u793a\u6548\u679c\uff0c\u6211\u4eec\u5efa\u8bae\u60a8\u4f7f\u7528\u7535\u8111\u7aef\u8bbf\u95ee\u672c\u5e73\u53f0\u3002"}),(0,i.jsx)("button",{style:{...m,...d?h:{}},onClick:I,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:"\u6211\u77e5\u9053\u4e86"})]})})]})}})}},47946:(e,t,o)=>{o.r(t),o.d(t,{default:()=>s});var n=o(96540),r=o(44586),i=o(41103),a=o(217),l=o(74848);function s(){const{siteConfig:e}=(0,r.A)(),[t,o]=(0,n.useState)(!1);return(0,l.jsx)(i.A,{title:`${e.title}`,description:"Description will go into a meta tag in <head />",children:(0,l.jsxs)("main",{children:[t&&(0,l.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(70, 70, 70, 0.88)",zIndex:1e4,display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",cursor:"pointer"},onClick:()=>{o(!1),(()=>{const e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()})()},children:(0,l.jsxs)("div",{style:{padding:"40px",backgroundColor:"transparent",borderRadius:"12px",maxWidth:"90%"},children:[(0,l.jsx)("h2",{style:{fontSize:"40px",color:"#ffffff",fontWeight:"bold",marginBottom:"20px"},children:"\u6700\u4f73\u4f53\u9a8c\u63d0\u793a"}),(0,l.jsx)("p",{style:{fontSize:"24px",color:"#ffffff"},children:"\u70b9\u51fb\u4efb\u610f\u4f4d\u7f6e\u8fdb\u5165\u5168\u5c4f\u6a21\u5f0f\uff0c\u83b7\u5f97\u6700\u4f73\u4f7f\u7528\u4f53\u9a8c"})]})}),(0,l.jsx)(a.A,{})]})})}}}]); |