PageSourceSearch

https://shareandgo.com.au/assets/UploadDiagnostic-BLHsW-5t.js

js shareandgo.com.au collected 2026-10-04 01:53:47 UTC 5,831 bytes, 1 lines download raw bytes

1import{r as p,j as t,d as b}from"./index-BsqGAfoC.js";import{s as S,u as R}from"./directUpload-kLk-dZkX.js";const x="https://shareandgo-backend-1059809638052.australia-southeast1.run.app",D=({state:d,label:f,detail:l})=>{const g=d==="pass"?"#059669":d==="fail"?"#dc2626":d==="run"?"#2563eb":"#64748b",u=d==="pass"?"✓":d==="fail"?"✗":d==="run"?"…":"•";return t.jsxs("div",{style:{display:"flex",gap:12,padding:"12px 0",borderBottom:"1px solid #f1f5f9"},children:[t.jsx("span",{style:{color:g,fontWeight:700,width:18,fontSize:18},children:u}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:500,color:"#0f172a"},children:f}),l&&t.jsx("div",{style:{color:"#64748b",fontSize:13,marginTop:3,wordBreak:"break-word"},children:l})]})]})};function B(){const[d,f]=p.useState([]),[l,g]=p.useState(!1),[u,k]=p.useState(""),v=p.useRef(null),$=p.useRef(!1),i=p.useCallback((e,s,o)=>{f(c=>[...c.filter(h=>h.label!==e),{label:e,state:s,detail:o}])},[]),w=async e=>{f([]),k(""),g(!0);const s=[],o=async(r,n)=>{i(r,"run");try{const a=await n();return i(r,"pass",a),!0}catch(a){const y=a!=null&&a.response?`HTTP ${a.response.status} ${JSON.stringify(a.response.data).slice(0,160)}`:(a==null?void 0:a.message)||String(a);return i(r,"fail",y),s.push(r),!1}};
1i("Your browser","pass",`${navigator.userAgent.slice(0,120)}`),i("Connection","pass",navigator.onLine?"online":"the browser says it is OFFLINE");const c=localStorage.getItem("access_token");i("You are signed in",c?"pass":"fail",c?`a sign-in token is present (${c.length} characters)`:"no sign-in token found in this browser"),c||s.push("You are signed in");const h={headers:{Authorization:`Bearer ${c}`}};await o("ShareAndGo is reachable",async()=>{const r=performance.now(),n=await b.get(`${x}/api/health`,{timeout:15e3});return`answered in ${Math.round(performance.now()-r)} ms (${n.status})`});let m=null;await o("Your account works",async()=>{var a,y;const n=((a=(await b.get(`${x}/api/admin/datarooms`,{...h,timeout:2e4})).data)==null?void 0:a.data_rooms)||[];return m=((y=n[0])==null?void 0:y.id)||null,`${n.length} data room${n.length===1?"":"s"} visible`}),await o("Your storage allowance",async()=>{const n=(await b.get(`${x}/api/billing/usage`,{...h,timeout:2e4})).data||{};return JSON.stringify(n).slice(0,180)}),e?(i("The file reached this page","pass",`${e.name} · ${(e.size/1024/1024).toFixed(2)} MB · type "${e.type||"unknown"}"`),await o("The file can be read",async()=>`read the first ${(await e.slice(0,4096).arrayBuffer()).byteLength} bytes successfully`),m?await o("A test upload reaches the server",async()=>{const r=new FormData;r.append("file",e);const n=performance.now();if(S(e))return await R(e,{dataRoomId:m}),`accepted in ${Math.round((performance.now()-n)/1e3)} s — sent straight to storage, exactly as the app does for a file this size`;const a=await b.post(`${x}/api/documents/upload?data_room_id=${m}`,r,{...h,timeout:9e4+Math.ceil((e.size||0)/1e5)*1e3});return`accepted in ${Math.round((performance.now()-n)/1e3)} s (${a.status}) — this file is now in your first data room, delete it when you are done`}):(i("A test upload reaches the server","fail","could not find a data room to test with"),s.push("A test upload reaches the server"))):i("Choose a file to test the upload itself","idle","the checks above test your connection and account. Pick a small file to test an actual upload."),g(!1),k(s.length===0?"Everything passed. Uploading works from this browser right now — if the data room still will not upload, the problem is in that page rather than your connection or account, and a fresh tab usually clears it.":`Stopped at: ${s.join(", ")}. Send Andy a screenshot of this page.`)},j=e=>{var o,c;e.preventDefault(),$.current=!0;const s=(c=(o=e.dataTransfer)==null?void 0:o.files)==null?void 0:c[0];i("Drag and drop works","pass",s?`received ${s.name}`:"the drop fired but carried no file"),s&&w(s)};return t.jsx("div",{style:{fontFamily:"Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif",background:"#f9fafb",minHeight:"100vh",padding:"32px 20px"},children:t.jsxs("div",{style:{maxWidth:680,margin:"0 auto",background:"#fff",borderRadius:16,padding:32,boxShadow:"0 1px 3px rgba(0,0,0,.08)"},children:[t.jsx("h1",{style:{fontSize:22,fontWeight:600,letterSpacing:"-0.02em",margin:"0 0 6px",color:"#0f172a"},children:"Upload check"}),t.jsx("p",{style:{color:"#475569",lineHeight:1.6,margin:"0 0 24px"},children:"This finds out where an upload stops. Press the button, and if you can, pick a small file so it can test a real upload. Nothing here changes your data rooms."}),t.jsxs("div",{onDrop:j,onDragOver:e=>e.preventDefault(),style:{border:"2px dashed #cbd5e1",borderRadius:12,padding:28,textAlign:"center",marginBottom:20,background:"#f8fafc"},children:[t.jsx("div",{style:{color:"#64748b",marginBottom:14},children:"Drag a file here, or"}),t.jsx("button",{onClick:()=>{var e;return(e=v.current)==null?void 0:e.click()},disabled:l,style:{background:"#111827",color:"#fff",border:0,borderRadius:10,padding:"11px 20px",fontSize:15,fontWeight:500,cursor:"pointer"},children:"Choose a file"}),t.jsx("input",{ref:v,type:"file",style:{display:"none"},onChange:e=>{var o;const s=(o=e.target.files)==null?void 0:o[0];s&&w(s)}})]}),t.jsx("button",{onClick:()=>w(null),disabled:l,style:{background:"#fff",color:"#111827",border:"1px solid #cbd5e1",borderRadius:10,padding:"10px 18px",fontSize:14,cursor:"pointer",marginBottom:20},children:l?"Checking…":"Just check my connection and account"}),d.length>0&&t.jsx("div",{style:{marginTop:8},children:d.map(e=>t.jsx(D,{...e},e.label))}),u&&t.jsx("div",{style:{marginTop:22,padding:16,borderRadius:10,lineHeight:1.6,background:u.startsWith("Everything")?"#e
1cfdf5":"#fef2f2",color:u.startsWith("Everything")?"#065f46":"#991b1b"},children:u})]})})}export{B as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.