diff --git a/src/app/(public)/HomeClient.tsx b/src/app/(public)/HomeClient.tsx index 68d6527..7c54c07 100644 --- a/src/app/(public)/HomeClient.tsx +++ b/src/app/(public)/HomeClient.tsx @@ -91,22 +91,45 @@ function TabButton({ id, label, active, onClick, icon }: { id: string, label: st ); } -function OsGuideContent({ title, steps, selectedOs, certificates, t }: { title: string, steps: string[], selectedOs: string, certificates: CaCertificate[], t: any }) { - const [guideCertSerial, setGuideCertSerial] = useState(certificates[0]?.serial); +function CliSnippet({ label, command, t }: { label: string, command: string, t: any }) { const [copied, setCopied] = useState(false); - - const activeCert = certificates.find(c => c.serial === guideCertSerial) || certificates[0]; - const linuxCli = activeCert?.linux_cdn_url ? `curl -sL ${activeCert.linux_cdn_url} | sudo bash` : ''; const copyCli = () => { - if (!linuxCli) return; - navigator.clipboard.writeText(linuxCli); + if (!command) return; + navigator.clipboard.writeText(command); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return ( -
+
+
+ {label} +
+
+
+ $ + {command || 'No script available.'} +
+ +
+
+ ); +} + +function OsGuideContent({ title, steps, selectedOs, certificates, t }: { title: string, steps: string[], selectedOs: string, certificates: CaCertificate[], t: any }) { + return ( +

@@ -127,49 +150,35 @@ function OsGuideContent({ title, steps, selectedOs, certificates, t }: { title:

{selectedOs === 'linux' && ( -
-
-
-
- - {t('guide_linux_shortcut_title')} -
-

{t('guide_linux_shortcut_desc')}

-
- - {/* Cert Selector */} -
- -
- -
-
+
+
+
+ + {t('guide_linux_shortcut_title')} +
+

{t('guide_linux_shortcut_desc')}

-
-
- $ - {linuxCli || 'No Linux script available for this certificate.'} -
- +
+ {/* Root CAs */} + {certificates.filter(c => c.type === 'root').map(c => ( + + ))} + + {/* Intermediate CAs */} + {certificates.filter(c => c.type !== 'root').map(c => ( + + ))}
)} diff --git a/src/messages/en.json b/src/messages/en.json index c7afea6..447b772 100644 --- a/src/messages/en.json +++ b/src/messages/en.json @@ -216,9 +216,8 @@ "Open terminal and run: sudo bash install-*.sh", "The script will automatically detect and update your CA store." ], - "guide_linux_shortcut_title": "One-liner Shortcut (Recommended)", - "guide_linux_shortcut_desc": "Copy and paste this command to your terminal for instant installation:", - "guide_linux_select_cert": "Select Certificate to install:", + "guide_linux_shortcut_title": "Instant Installation (CLI)", + "guide_linux_shortcut_desc": "Run the corresponding command for the certificate you wish to trust:", "guide_steps_mobile": [ "Android: Settings > Security > Install from storage > CA Certificate.", "iOS: Install the profile, then Settings > General > About > Certificate Trust Settings." diff --git a/src/messages/id.json b/src/messages/id.json index 855cb1d..9ca140c 100644 --- a/src/messages/id.json +++ b/src/messages/id.json @@ -216,9 +216,8 @@ "Buka terminal dan jalankan: sudo bash install-*.sh", "Skrip akan secara otomatis mendeteksi distro dan memperbarui penyimpanan CA Anda." ], - "guide_linux_shortcut_title": "Pintas Satu-Baris (Disarankan)", - "guide_linux_shortcut_desc": "Salin dan tempel perintah ini ke terminal Anda untuk instalasi instan:", - "guide_linux_select_cert": "Pilih Sertifikat untuk diinstal:", + "guide_linux_shortcut_title": "Instalasi Instan (CLI)", + "guide_linux_shortcut_desc": "Jalankan perintah yang sesuai untuk sertifikat yang ingin Anda percayai:", "guide_steps_mobile": [ "Android: Pengaturan > Keamanan > Instal dari penyimpanan > Sertifikat CA.", "iOS: Instal profil, lalu Pengaturan > Umum > Mengenai > Pengaturan Kepercayaan Sertifikat."