1 line
4.6 KiB
JavaScript
Executable File
1 line
4.6 KiB
JavaScript
Executable File
"use strict";(self.webpackChunkest_farmework=self.webpackChunkest_farmework||[]).push([[8857],{217:(e,t,o)=>{o.d(t,{A:()=>b});var n=o(96540),a=o(92303),r=o(74848);function i(e){let{children:t,fallback:o}=e;return(0,a.A)()?(0,r.jsx)(r.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}`,p={"/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`},u={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"},h={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)"},x={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,a]=(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:v,organization:C,username:j,productModel:I}=(0,s.A)();(0,n.useEffect)((()=>{const e=()=>{window.innerWidth<=768&&(a(!0),setTimeout((()=>y(!0)),100))};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const P=()=>{y(!1),setTimeout((()=>a(!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,r.jsx)(i,{fallback:(0,r.jsx)("div",{children:"Loading..."}),children:()=>{if(!p[S.pathname])return(0,r.jsx)("div",{children:"404 - Page not found"});if(!e)return(0,r.jsx)("div",{children:"Redirecting to login..."});const t=(()=>{const e=p[S.pathname];if(!e)return null;const t=new URL(`${e}/`),o=localStorage.getItem("authToken")||"",n=localStorage.getItem("organization")||"",a=localStorage.getItem("username")||"",r=localStorage.getItem("userLevel")||"0",i=localStorage.getItem("model")||"",l=i&&i.endsWith("E")?"general":"fluke";return t.searchParams.append("token",o),t.searchParams.append("org",n),t.searchParams.append("user",a),t.searchParams.append("userLevel",r),t.searchParams.append("estmodel",l),t.toString()})();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{...w,filter:o?"blur(2px)":"none"},children:(0,r.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,r.jsx)("div",{style:{...u,opacity:b?1:0},onClick:P,children:(0,r.jsxs)("div",{style:{...f,transform:b?"scale(1)":"scale(0.9)",opacity:b?1:0},onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("div",{style:g,children:"\u26a0\ufe0f\u63d0\u793a"}),(0,r.jsx)("div",{style:h,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,r.jsx)("button",{style:{...m,...d?x:{}},onClick:P,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:"\u6211\u77e5\u9053\u4e86"})]})})]})}})}},684:(e,t,o)=>{o.r(t),o.d(t,{default:()=>l});o(96540);var n=o(44586),a=o(41103),r=o(217),i=o(74848);function l(){const{siteConfig:e}=(0,n.A)();return(0,i.jsx)(a.A,{title:`${e.title}`,description:"Description will go into a meta tag in <head />",children:(0,i.jsx)("main",{children:(0,i.jsx)(r.A,{})})})}}}]); |