Просмотр исходного кода

feat(settings): collapse rtlplayground links under a Firmwares button (#1782) (#1800)

Nacho 1 месяц назад
Родитель
Сommit
35d3fc41e3

+ 1 - 0
app/public/locales/en/translation.json

@@ -1873,6 +1873,7 @@
       "rtlInstructions": "Flashing instructions",
       "rtlTechGuide": "Technical guide",
       "rtlImages": "Images",
+      "firmwares": "Firmwares",
       "rtlDescription": "rtlplayground is the firmware for Realtek switches that turns them into NetPulse agents. Flashing instructions, technical guide and images:"
     },
     "session": {

+ 1 - 0
app/public/locales/es/translation.json

@@ -1873,6 +1873,7 @@
       "rtlInstructions": "Instrucciones de flasheo",
       "rtlTechGuide": "Guía técnica",
       "rtlImages": "Imágenes",
+      "firmwares": "Firmwares",
       "rtlDescription": "rtlplayground es el firmware para switches Realtek que los convierte en agentes de NetPulse. Instrucciones de flasheo, guía técnica e imágenes:"
     },
     "session": {

+ 17 - 9
app/src/pages/Settings.tsx

@@ -58,6 +58,7 @@ import { TokensManager } from '@/components/TokensManager'
 import { TopologyOverridesManager } from '@/components/topology/TopologyOverridesManager'
 import { ReadinessPanel, type UpdateReadiness } from '@/components/UpdateReadiness'
 import { UpdateDialog } from '@/components/UpdateDialog'
+import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'
 import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '@/components/ui/alert-dialog'
 import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'
 import { Slider } from '@/components/ui/slider'
@@ -4161,15 +4162,22 @@ function ServicesCard({
           <DialogHeader>
             <DialogTitle className="sr-only">{t('settings.services.externalAgents')}</DialogTitle>
           </DialogHeader>
-          <div className="mb-4 rounded-xl border border-border bg-surface px-4 py-3">
-            <p className="text-sm font-medium text-text-primary">rtlplayground</p>
-            <p className="mt-1 text-caption leading-relaxed text-text-muted">{t('settings.services.rtlDescription')}</p>
-            <div className="mt-2 flex flex-wrap gap-x-4 gap-y-1 text-caption">
-              <a className="text-accent hover:underline underline-offset-2" href="https://github.com/gnacho/netpulse/blob/main/docs/AGENTE-RTL-SWITCH.md" target="_blank" rel="noreferrer">{t('settings.services.rtlInstructions')}</a>
-              <a className="text-accent hover:underline underline-offset-2" href="https://github.com/gnacho/RTLPlayground/blob/netpulse/beacon-octets/doc/beacon.md" target="_blank" rel="noreferrer">{t('settings.services.rtlTechGuide')}</a>
-              <a className="text-accent hover:underline underline-offset-2" href="https://github.com/gnacho/RTLPlayground/releases" target="_blank" rel="noreferrer">{t('settings.services.rtlImages')}</a>
-            </div>
-          </div>
+          <Accordion type="single" collapsible className="mb-4 rounded-xl border border-border bg-surface">
+            <AccordionItem value="firmwares" className="border-b-0">
+              <AccordionTrigger className="px-4 py-3 text-sm font-medium text-text-primary hover:no-underline">
+                {t('settings.services.firmwares')}
+              </AccordionTrigger>
+              <AccordionContent className="px-4 pb-3">
+                <p className="text-sm font-medium text-text-primary">rtlplayground</p>
+                <p className="mt-1 text-caption leading-relaxed text-text-muted">{t('settings.services.rtlDescription')}</p>
+                <div className="mt-2 flex flex-wrap gap-x-4 gap-y-1 text-caption">
+                  <a className="text-accent hover:underline underline-offset-2" href="https://github.com/gnacho/netpulse/blob/main/docs/AGENTE-RTL-SWITCH.md" target="_blank" rel="noreferrer">{t('settings.services.rtlInstructions')}</a>
+                  <a className="text-accent hover:underline underline-offset-2" href="https://github.com/gnacho/RTLPlayground/blob/netpulse/beacon-octets/doc/beacon.md" target="_blank" rel="noreferrer">{t('settings.services.rtlTechGuide')}</a>
+                  <a className="text-accent hover:underline underline-offset-2" href="https://github.com/gnacho/RTLPlayground/releases" target="_blank" rel="noreferrer">{t('settings.services.rtlImages')}</a>
+                </div>
+              </AccordionContent>
+            </AccordionItem>
+          </Accordion>
           <Integrations bare />
         </DialogContent>
       </Dialog>