1 line
1.6 KiB
JavaScript
1 line
1.6 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18574,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(18566);function a(){let e=(0,r.useSearchParams)().get("path")||"/",[a,i]=(0,s.useState)(!1),[l,o]=(0,s.useState)(!1),[d,n]=(0,s.useState)(null),c=(0,s.useMemo)(()=>e.startsWith("/")?e:`/${e}`,[e]);return(0,s.useEffect)(()=>{i(!1),o(!1),n(null);let e=window.setTimeout(()=>{a||o(!0)},6e4);return()=>window.clearTimeout(e)},[c,a]),(0,t.jsxs)("main",{className:"min-h-screen bg-white flex items-center justify-center",children:[(0,t.jsxs)("div",{className:"w-[430px] h-[932px] border border-gray-200 bg-white relative overflow-hidden",children:[(0,t.jsx)("iframe",{"data-doc-iframe":"true","data-loaded":a?"true":"false",src:c,className:"w-full h-full border-0",onLoad:()=>{i(!0),o(!1)},onError:()=>{n("页面加载失败")},title:`Capture: ${e}`,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"}),!a&&!l&&!d&&(0,t.jsx)("div",{className:"absolute inset-0 bg-white flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"w-8 h-8 border-2 border-gray-300 border-t-gray-600 rounded-full animate-spin mx-auto mb-2"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"加载中..."})]})})]}),(l||d)&&(0,t.jsx)("div",{className:"fixed left-0 top-0 right-0 bg-red-600 text-white text-sm px-3 py-2 text-center",children:d||"页面加载超时"}),a&&(0,t.jsxs)("div",{className:"fixed left-0 bottom-0 right-0 bg-green-600 text-white text-xs px-3 py-1 text-center",children:["页面已加载: ",e]})]})}e.s(["default",()=>a])}]); |