mirror of
https://github.com/dyzulk/trustlab.git
synced 2026-01-26 05:25:36 +07:00
feat: integrate direct CDN downloads in HomeClient
This commit is contained in:
@@ -11,6 +11,8 @@ interface CaCertificate {
|
||||
type: string;
|
||||
serial: string;
|
||||
expires_at: string;
|
||||
cdn_url?: string | null;
|
||||
der_cdn_url?: string | null;
|
||||
}
|
||||
|
||||
// Simple internal ScrollToTop component
|
||||
@@ -248,7 +250,7 @@ export default function HomeClient() {
|
||||
<div className="space-y-3">
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<a
|
||||
href={`/download/ca-certificate?serial=${cert.serial}`}
|
||||
href={cert.cdn_url || `/download/ca-certificate?serial=${cert.serial}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center justify-center gap-2 px-4 py-3 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200 rounded-xl border border-gray-200 dark:border-gray-700 font-medium text-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors"
|
||||
@@ -260,7 +262,7 @@ export default function HomeClient() {
|
||||
{t('download_standard')}
|
||||
</a>
|
||||
<a
|
||||
href={`/download/ca-certificate?serial=${cert.serial}&format=der`}
|
||||
href={cert.der_cdn_url || `/download/ca-certificate?serial=${cert.serial}&format=der`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center justify-center gap-2 px-4 py-3 bg-green-50 dark:bg-green-500/10 text-green-700 dark:text-green-400 rounded-xl border border-green-200 dark:border-green-500/20 font-medium text-sm hover:bg-green-100 dark:hover:bg-green-500/20 transition-colors"
|
||||
@@ -325,7 +327,7 @@ export default function HomeClient() {
|
||||
<div className="space-y-3">
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<a
|
||||
href={`/download/ca-certificate?serial=${cert.serial}`}
|
||||
href={cert.cdn_url || `/download/ca-certificate?serial=${cert.serial}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center justify-center gap-2 px-4 py-3 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-200 rounded-xl border border-gray-200 dark:border-gray-700 font-medium text-sm hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors"
|
||||
@@ -337,7 +339,7 @@ export default function HomeClient() {
|
||||
{t('download_standard')}
|
||||
</a>
|
||||
<a
|
||||
href={`/download/ca-certificate?serial=${cert.serial}&format=der`}
|
||||
href={cert.der_cdn_url || `/download/ca-certificate?serial=${cert.serial}&format=der`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="flex items-center justify-center gap-2 px-4 py-3 bg-green-50 dark:bg-green-500/10 text-green-700 dark:text-green-400 rounded-xl border border-green-200 dark:border-green-500/20 font-medium text-sm hover:bg-green-100 dark:hover:bg-green-500/20 transition-colors"
|
||||
|
||||
Reference in New Issue
Block a user