diff --git a/src/app/(public)/HomeClient.tsx b/src/app/(public)/HomeClient.tsx index d6ec575..7ed2fbf 100644 --- a/src/app/(public)/HomeClient.tsx +++ b/src/app/(public)/HomeClient.tsx @@ -249,6 +249,8 @@ export default function HomeClient() {
@@ -259,6 +261,8 @@ export default function HomeClient() { @@ -271,6 +275,8 @@ export default function HomeClient() {
@@ -281,6 +287,8 @@ export default function HomeClient() { @@ -318,6 +326,8 @@ export default function HomeClient() {
@@ -328,6 +338,8 @@ export default function HomeClient() { @@ -340,6 +352,8 @@ export default function HomeClient() {
@@ -350,6 +364,8 @@ export default function HomeClient() { diff --git a/src/app/(public)/download/ca-certificate/page.tsx b/src/app/(public)/download/ca-certificate/page.tsx index de2c12b..177de61 100644 --- a/src/app/(public)/download/ca-certificate/page.tsx +++ b/src/app/(public)/download/ca-certificate/page.tsx @@ -8,6 +8,7 @@ function DownloadMirrorContent() { const searchParams = useSearchParams(); const [status, setStatus] = useState("Preparing your download..."); const [error, setError] = useState(null); + const [downloadUrl, setDownloadUrl] = useState(null); useEffect(() => { const serial = searchParams.get("serial"); @@ -22,27 +23,27 @@ function DownloadMirrorContent() { // Construct backend URL const baseUrl = process.env.NEXT_PUBLIC_BACKEND_URL; - let downloadUrl = `${baseUrl}/api/public/ca-certificates/${serial}/download`; + let url = `${baseUrl}/api/public/ca-certificates/${serial}/download`; // Append target if specified (windows/mac) if (target) { - downloadUrl += `/${target}`; + url += `/${target}`; } // Append format if specified (der) if (format) { - downloadUrl += `?format=${format}`; + url += `?format=${format}`; } + setDownloadUrl(url); + // Mirroring: Redirect to the backend download URL setStatus("Redirecting to download..."); - window.location.href = downloadUrl; + window.location.href = url; - // Optional: Auto close or go back after some time - // But usually the download happens in the background and the page stays const timeout = setTimeout(() => { - setStatus("If your download didn't start automatically, please refresh this page."); - }, 5000); + setStatus("Your download should have started."); + }, 3000); return () => clearTimeout(timeout); }, [searchParams]); @@ -76,11 +77,31 @@ function DownloadMirrorContent() {
-

{status}

-

Mirroring Download from TrustLab Trust Store

+
+

{status}

+

Mirroring Download from TrustLab Trust Store

+
+ + {downloadUrl && ( +
+

+ If your download didn't start automatically, +

+
+ + + + klik disini untuk download manual + +
+ )}
)}
+