mirror of
https://github.com/Snigdha-OS/Snigdha-OS.github.io.git
synced 2025-09-07 05:05:18 +02:00
4 lines
7.9 KiB
JavaScript
4 lines
7.9 KiB
JavaScript
import{j as e,D as h,f as j,r as o,a as w}from"./index-DqLTW_kH.js";import{m}from"./proxy-Bjl3UtPz.js";import{C as y}from"./check-34MO4raf.js";import{S as N,G as v,W as f}from"./wifi-CF_nOGF2.js";import{M as S}from"./map-pin-BL6Lq7Z0.js";function k({version:s,size:t,url:a}){return e.jsxs(m.a,{href:a,whileHover:{scale:1.02},whileTap:{scale:.98},className:"flex items-center justify-between w-full p-4 bg-white/80 backdrop-blur-sm rounded-lg border border-gray-200 hover:border-cornflower-blue transition-colors",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"font-semibold text-gray-900",children:["Snigdha OS ",s]}),e.jsx("p",{className:"text-sm text-gray-500",children:t})]}),e.jsx(h,{className:"h-5 w-5 text-cornflower-blue"})]})}const M=["Minimum 2GB RAM (4GB recommended)","20GB disk space","CPU with virtualization support","DVD drive / USB boot support","Internet connectivity for updates"];function E(){return e.jsxs("div",{className:"bg-white/80 backdrop-blur-sm p-6 rounded-lg",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"System Requirements"}),e.jsx("ul",{className:"space-y-3",children:M.map(s=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(y,{className:"h-5 w-5 text-green-500 flex-shrink-0"}),e.jsx("span",{className:"text-gray-600",children:s})]},s))})]})}function G({sha256:s,gpg:t}){return e.jsxs("div",{className:"bg-white/80 backdrop-blur-sm p-6 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(N,{className:"h-5 w-5 text-cornflower-blue"}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Verify Download"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-1",children:"SHA256 Checksum"}),e.jsx("code",{className:"block p-2 bg-gray-100 rounded text-sm break-all",children:s})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-1",children:"GPG Signature"}),e.jsx("code",{className:"block p-2 bg-gray-100 rounded text-sm break-all",children:t})]})]})]})}function L({mirrors:s,onSelect:t}){return e.jsx("div",{className:"space-y-4",children:s.map((a,r)=>e.jsx(m.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:r*.1},className:"bg-white/80 backdrop-blur-sm p-4 rounded-lg border border-gray-200 hover:border-cornflower-blue transition-colors",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"h-5 w-5 text-cornflower-blue"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-gray-900",children:a.name}),e.jsx("p",{className:"text-sm text-gray-500",children:a.location})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1 text-sm text-gray-600",children:[e.jsx(f,{className:"h-4 w-4"}),j(a.speed)]}),e.jsxs("button",{onClick:()=>t(a),className:"flex items-center gap-2 px-4 py-2 bg-cornflower-blue text-white rounded-lg hover:bg-blue-600 transition-colors",children:[e.jsx(h,{className:"h-4 w-4"}),"Select"]})]})]})},a.id))})}function D({speed:s}){const t=r=>r>=100?"Excellent for fast downloads":r>=50?"Good for normal downloads":r>=20?"Moderate speed, downloads may take longer":"Slow connection, consider using a different mirror",a=r=>r>=100?"text-green-500":r>=50?"text-blue-500":r>=20?"text-yellow-500":"text-red-500";return e.jsxs("div",{className:"bg-white/80 backdrop-blur-sm p-6 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(f,{className:"h-5 w-5 text-cornflower-blue"}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Network Speed"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("span",{className:`text-2xl font-bold ${a(s)}`,children:[s," Mbps"]})}),e.jsx("p",{className:"text-gray-600",children:t(s)})]})]})}function B({mirror:s,userLocation:t,onSelect:a}){return e.jsxs("div",{className:"bg-white/80 backdrop-blur-sm p-6 rounded-lg border-2 border-cornflower-blue",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(S,{className:"h-5 w-5 text-cornflower-blue"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-gray-900",children:"Suggested Mirror"}),e.jsxs("p",{className:"text-sm text-gray-500",children:["Based on your location: ",t.city,", ",t.country]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"font-medium text-gray-900",children:s.name}),e.jsx("p",{className:"text-sm text-gray-600",children:s.location}),e.jsx("button",{onClick:()=>a(s),className:"w-full mt-2 px-4 py-2 bg-cornflower-blue text-white rounded-lg hover:bg-blue-600 transition-colors",children:"Use This Mirror"})]})]})}const C=[{version:"2024.1",size:"4.2 GB",url:"https://snigdhaos.org/downloads/snigdhaos-2024.1-installer-amd64.iso",sha256:"e4654e5633f4e1f8f57a9fb3dca02f9db06e9acb5e346f0fae9d9f5c3a9c0e9",gpg:`-----BEGIN PGP SIGNATURE-----
|
|
Version: GnuPG v2
|
|
...`}],U=[{id:"us-east",name:"US East Mirror",location:"New York, USA",url:"https://mirror-east.snigdhaos.org",speed:120},{id:"eu-central",name:"EU Central Mirror",location:"Frankfurt, Germany",url:"https://mirror-eu.snigdhaos.org",speed:100},{id:"asia-east",name:"Asia East Mirror",location:"Singapore",url:"https://mirror-asia.snigdhaos.org",speed:80}];async function P(){const s=performance.now(),t=await fetch("https://www.cloudflare.com/cdn-cgi/trace",{cache:"no-store"}),r=performance.now()-s;if(!t.ok)throw new Error("Failed to measure network speed");const c=await t.text(),l=new Blob([c]).size*8/(r/1e3)/1e6;return Math.round(l*100)/100}function R(){const[s,t]=o.useState(null),[a,r]=o.useState(!0),[c,i]=o.useState(null);return o.useEffect(()=>{async function l(){try{const n=await P();t(n)}catch(n){i(n instanceof Error?n:new Error("Failed to measure network speed"))}finally{r(!1)}}l()},[]),{speed:s,isLoading:a,error:c}}async function T(){const s=await fetch("https://ipapi.co/json/");if(!s.ok)throw new Error("Failed to fetch location");const t=await s.json();return{country:t.country_name,city:t.city,continent:t.continent_code}}function z(){const[s,t]=o.useState(null),[a,r]=o.useState(!0),[c,i]=o.useState(null);return o.useEffect(()=>{async function l(){try{const n=await T();t(n)}catch(n){i(n instanceof Error?n:new Error("Failed to get location"))}finally{r(!1)}}l()},[]),{location:s,isLoading:a,error:c}}function H(){const s=C[0],[t,a]=o.useState(null),{speed:r,isLoading:c}=R(),{location:i,isLoading:l}=z(),n=d=>{a(d)},x=[...U].sort((d,p)=>{if(!r)return 0;const g=Math.abs(d.speed-r),b=Math.abs(p.speed-r);return g-b}),u=i?x[0]:null;return c||l?e.jsx("div",{className:"min-h-[50vh] flex items-center justify-center",children:e.jsx(w,{className:"h-8 w-8 animate-spin text-cornflower-blue"})}):e.jsx("div",{className:"py-12",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs(m.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center mb-12",children:[e.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Download Snigdha OS"}),e.jsx("p",{className:"mt-4 text-lg text-gray-600",children:"Get the latest version of the most advanced penetration testing distribution"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsx(k,{...s}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Download Mirrors"}),e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Mirrors are sorted by compatibility with your connection speed for optimal download performance"}),e.jsx(L,{mirrors:x,onSelect:n})]}),e.jsx(G,{sha256:s.sha256,gpg:s.gpg})]}),e.jsxs("div",{className:"space-y-6",children:[r!==null&&e.jsx(D,{speed:r}),i&&u&&e.jsx(B,{mirror:u,userLocation:i,onSelect:n}),e.jsx(E,{})]})]})]})})}export{H as default};
|