diff --git a/reader/dist/assets/index-4n2TtMCZ.js b/reader/dist/assets/index-uQMIeWPE.js similarity index 99% rename from reader/dist/assets/index-4n2TtMCZ.js rename to reader/dist/assets/index-uQMIeWPE.js index ffa81aa..ec5b441 100644 --- a/reader/dist/assets/index-4n2TtMCZ.js +++ b/reader/dist/assets/index-uQMIeWPE.js @@ -151,4 +151,4 @@ Please report this to https://github.com/markedjs/marked.`,a){const r="

An err ${f} - `,[f,u,r,s]),[b,h]=M.useState(!0),[g,w]=M.useState(null),E=Ce(U=>U.config.contentZoomLevel);return M.useEffect(()=>{o.current&&o.current.contentDocument&&(o.current.contentDocument.body.style.zoom=`${E}%`)},[E]),M.useEffect(()=>{(async()=>{try{h(!0);let k=(await km.get(`/${a.filename}`)).data;k===""&&(k="**No Data!**"),k=be.parse(k),p(k),w(null)}catch(T){console.error("Error loading file:",T),w(T.message)}finally{h(!1)}})()},[a]),g?R.jsxs("div",{className:"text-red-500 p-4 border border-red-300 rounded",children:["Error: ",g]}):b?R.jsx(Gx,{}):R.jsx("div",{className:"w-full h-full overflow-hidden",children:R.jsx("iframe",{ref:o,srcDoc:m,title:`File: ${a.id}`,className:"w-full h-full border-0",allow:"fullscreen",onLoad:()=>{var U,T;(T=(U=o.current)==null?void 0:U.contentDocument)!=null&&T.body&&(o.current.contentDocument.body.style.zoom=`${E}%`)}},a.id)})}const Gx=({delayMs:a=2e3,className:u="p-4 flex justify-center items-center h-40",text:s="Loading..."})=>{const[r,o]=M.useState(!1);return M.useEffect(()=>{const f=setTimeout(()=>{o(!0)},a);return()=>clearTimeout(f)},[]),r?R.jsx("div",{className:u,children:R.jsx("div",{className:"animate-pulse",children:s})}):null};Sy.createRoot(document.getElementById("root")).render(R.jsx(M.StrictMode,{children:R.jsx(Ux,{})})); + `,[f,u,r,s]),[b,h]=M.useState(!0),[g,w]=M.useState(null),E=Ce(U=>U.config.contentZoomLevel);return M.useEffect(()=>{o.current&&o.current.contentDocument&&(o.current.contentDocument.body.style.zoom=`${E}%`)},[E]),M.useEffect(()=>{(async()=>{try{h(!0);let k=(await km.get(`/${a.filename}`)).data;k===""&&(k="**No Data!**"),k=be.parse(k),p(k),w(null)}catch(T){console.error("Error loading file:",T),w(T.message)}finally{h(!1)}})()},[a]),g?R.jsxs("div",{className:"text-red-500 p-4 border border-red-300 rounded",children:["Error: ",g]}):b?R.jsx(Gx,{}):R.jsx("div",{className:"w-full h-full overflow-hidden",children:R.jsx("iframe",{ref:o,srcDoc:m,title:`File: ${a.id}`,className:"w-full h-full border-0",sandbox:"allow-same-origin",allow:"fullscreen",onLoad:()=>{var U,T;(T=(U=o.current)==null?void 0:U.contentDocument)!=null&&T.body&&(o.current.contentDocument.body.style.zoom=`${E}%`)}},a.id)})}const Gx=({delayMs:a=2e3,className:u="p-4 flex justify-center items-center h-40",text:s="Loading..."})=>{const[r,o]=M.useState(!1);return M.useEffect(()=>{const f=setTimeout(()=>{o(!0)},a);return()=>clearTimeout(f)},[]),r?R.jsx("div",{className:u,children:R.jsx("div",{className:"animate-pulse",children:s})}):null};Sy.createRoot(document.getElementById("root")).render(R.jsx(M.StrictMode,{children:R.jsx(Ux,{})})); diff --git a/reader/dist/index.html b/reader/dist/index.html index a352798..aa632a7 100644 --- a/reader/dist/index.html +++ b/reader/dist/index.html @@ -4,10 +4,9 @@ - - + Конспект - + diff --git a/reader/index.html b/reader/index.html index acc8ccd..dadd6fa 100644 --- a/reader/index.html +++ b/reader/index.html @@ -4,8 +4,7 @@ - - + Конспект diff --git a/reader/nginx.conf b/reader/nginx.conf index 7e9f098..95a6eb8 100644 --- a/reader/nginx.conf +++ b/reader/nginx.conf @@ -4,15 +4,37 @@ server { root /usr/share/nginx/html; index index.html; - # Handle React Router (SPA) - location / { - try_files $uri $uri/ /index.html; + # Never cache HTML files - ADD THIS + location ~* \.html$ { + expires -1; + add_header Cache-Control "no-cache, no-store, must-revalidate" always; + add_header Pragma "no-cache" always; } - # Cache static assets - location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + # Special handling for root index.html - ADD THIS + location = / { + try_files /index.html =404; + expires -1; + add_header Cache-Control "no-cache, no-store, must-revalidate" always; + add_header Pragma "no-cache" always; + } + + # Handle React Router (SPA) - MODIFY THIS + location / { + try_files $uri $uri/ @fallback; + } + + # Fallback for SPA routing - ADD THIS + location @fallback { + rewrite ^.*$ /index.html last; + expires -1; + add_header Cache-Control "no-cache, no-store, must-revalidate" always; + add_header Pragma "no-cache" always; + } + + # Cache static assets with hashes - EXPAND THIS + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { expires 1y; - add_header Cache-Control "public, immutable"; + add_header Cache-Control "public, immutable" always; } } - diff --git a/reader/src/App.jsx b/reader/src/App.jsx index d2b50e1..bf164f4 100644 --- a/reader/src/App.jsx +++ b/reader/src/App.jsx @@ -468,6 +468,7 @@ export function PDFViewer({ file, compact, zoomFactor, justifyText }) { title={`File: ${file.id}`} className="w-full h-full border-0" key={file.id} + sandbox="allow-same-origin" allow="fullscreen" onLoad={() => { if (iframeRef.current?.contentDocument?.body) {