diff --git a/src/app/(public)/HomeClient.tsx b/src/app/(public)/HomeClient.tsx index 5b520b7..fc9f7e3 100644 --- a/src/app/(public)/HomeClient.tsx +++ b/src/app/(public)/HomeClient.tsx @@ -99,22 +99,37 @@ function OsGuideContent({ title, steps }: { title: string, steps: string[] }) { {title} ); } function CaCard({ cert, isRoot, t, selectedOs, setSelectedOs }: { cert: CaCertificate, isRoot: boolean, t: any, selectedOs: string, setSelectedOs: (os: any) => void }) { + const [copied, setCopied] = useState(false); + + const copyLinuxCli = () => { + if (!cert.linux_cdn_url) return; + const command = `curl -sL ${cert.linux_cdn_url} | sudo bash`; + navigator.clipboard.writeText(command); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }; + return (
{/* Sync Status Badge */} @@ -152,30 +167,30 @@ function CaCard({ cert, isRoot, t, selectedOs, setSelectedOs }: { cert: CaCertif
-
+
} onClick={() => {}} /> } onClick={() => setSelectedOs('mobile')} variant="green" /> } onClick={() => setSelectedOs('windows')} variant="blue" /> } onClick={() => setSelectedOs('macos')} variant="gray" @@ -183,15 +198,27 @@ function CaCard({ cert, isRoot, t, selectedOs, setSelectedOs }: { cert: CaCertif
{cert.linux_cdn_url && ( -
+
} onClick={() => setSelectedOs('linux')} variant="gray" isFullWidth /> +
)}
@@ -251,6 +278,18 @@ const FileIcon = ({ className }: { className?: string }) => ( ); +const CopyIcon = ({ className }: { className?: string }) => ( + + + +); + +const CheckIcon = ({ className }: { className?: string }) => ( + + + +); + export default function HomeClient() { const t = useTranslations("Home"); const [certificates, setCertificates] = useState([]); diff --git a/src/messages/en.json b/src/messages/en.json index 9a9a5a5..e96eabe 100644 --- a/src/messages/en.json +++ b/src/messages/en.json @@ -189,6 +189,8 @@ "download_windows_title": "Download Windows Installer (.bat)", "download_macos_title": "Download macOS Profile (.mobileconfig)", "download_linux_title": "Download Linux Installer (.sh)", + "copy_cli": "Copy CLI", + "copied": "Copied!", "root_ca": "Root CA", "intermediate_ca": "Intermediate CA", "root_ca_hierarchy": "Root Trust Foundation", @@ -210,9 +212,9 @@ "Go to 'About' > 'Certificate Trust Settings' and enable full trust." ], "guide_steps_linux": [ - "Download the .sh installer script.", - "Open terminal and run: sudo bash install-*.sh", - "The script will automatically detect and update your CA store." + "Use the one-liner command for instant setup (recommended):", + "curl -sL [URL] | sudo bash", + "Note: Get the [URL] by right-clicking the 'Linux' download button on the certificate card above." ], "guide_steps_mobile": [ "Android: Settings > Security > Install from storage > CA Certificate.", diff --git a/src/messages/id.json b/src/messages/id.json index 621de10..b7c8bcc 100644 --- a/src/messages/id.json +++ b/src/messages/id.json @@ -189,6 +189,8 @@ "download_windows_title": "Unduh Penginstal Windows (.bat)", "download_macos_title": "Unduh Profil macOS (.mobileconfig)", "download_linux_title": "Unduh Penginstal Linux (.sh)", + "copy_cli": "Salin CLI", + "copied": "Tersalin!", "root_ca": "Root CA", "intermediate_ca": "Intermediate CA", "root_ca_hierarchy": "Fondasi Kepercayaan Akar", @@ -210,9 +212,9 @@ "Buka 'About' > 'Certificate Trust Settings' dan aktifkan kepercayaan penuh." ], "guide_steps_linux": [ - "Unduh skrip penginstal .sh.", - "Buka terminal dan jalankan: sudo bash install-*.sh", - "Skrip akan secara otomatis mendeteksi distro dan memperbarui penyimpanan CA Anda." + "Gunakan perintah satu-baris untuk instalasi instan (disarankan):", + "curl -sL [URL] | sudo bash", + "Catatan: Dapatkan [URL] dengan klik kanan tombol 'Linux' pada kartu sertifikat di atas lalu 'Salin Alamat Link'." ], "guide_steps_mobile": [ "Android: Pengaturan > Keamanan > Instal dari penyimpanan > Sertifikat CA.",