Преглед изворни кода

fix(settings): widen the external agents dialog to avoid vertical scroll (#1798)

* fix(settings): widen the external agents dialog to avoid vertical scroll (#1782)

* feat(settings): info tip with rtlplayground flashing links on the external agents row (#1782)
Nacho пре 1 месец
родитељ
комит
c6cf7279ca

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

@@ -1869,7 +1869,11 @@
       "proxmoxCaption": "Cluster inventory (hypervisors and CTs)",
       "mqttCaption": "Fleet state published to the MQTT broker",
       "mcpCaption": "Read-only queries for AI assistants",
-      "configure": "Configure {{name}}"
+      "configure": "Configure {{name}}",
+      "rtlInfoTip": "rtlplayground turns these switches into NetPulse agents. Flashing guide and images:",
+      "rtlInstructions": "Flashing instructions",
+      "rtlTechGuide": "Technical guide",
+      "rtlImages": "Images"
     },
     "session": {
       "active": "Active session on this device",

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

@@ -1869,7 +1869,11 @@
       "proxmoxCaption": "Inventario del cluster (hipervisores y CTs)",
       "mqttCaption": "Publicación del estado en el broker MQTT",
       "mcpCaption": "Consultas de solo lectura para asistentes de IA",
-      "configure": "Configurar {{name}}"
+      "configure": "Configurar {{name}}",
+      "rtlInfoTip": "rtlplayground convierte estos switches en agentes de NetPulse. Guía de flasheo e imágenes:",
+      "rtlInstructions": "Instrucciones de flasheo",
+      "rtlTechGuide": "Guía técnica",
+      "rtlImages": "Imágenes"
     },
     "session": {
       "active": "Sesión activa en este dispositivo",

+ 3 - 2
app/src/components/InfoTip.tsx

@@ -1,3 +1,4 @@
+import type { ReactNode } from 'react'
 import { Info } from 'lucide-react'
 import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
 
@@ -5,7 +6,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip
 // ratón, para que la sección quede con lo justo. Reusa el Tooltip radix de
 // la app (mismo patrón que PortPanel). Compartido por Settings y las cards
 // de integración (#1002).
-export function InfoTip({ text }: { text: string }) {
+export function InfoTip({ text, children }: { text: string; children?: ReactNode }) {
   return (
     <Tooltip>
       <TooltipTrigger asChild>
@@ -22,7 +23,7 @@ export function InfoTip({ text }: { text: string }) {
         </button>
       </TooltipTrigger>
       <TooltipContent side="top" className="max-w-xs text-left leading-relaxed">
-        {text}
+        {children ?? text}
       </TooltipContent>
     </Tooltip>
   )

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

@@ -4070,7 +4070,14 @@ function ServicesCard({
           <div className="flex items-center justify-between gap-4 py-2.5">
             <div className="flex min-w-0 items-center gap-3">
               <div className="min-w-0">
-                <p className="text-sm font-medium text-text-primary">{t('settings.services.externalAgents')}</p>
+                <div className="flex items-center gap-1.5">
+                  <p className="text-sm font-medium text-text-primary">{t('settings.services.externalAgents')}</p>
+                  <InfoTip text={t('settings.services.rtlInfoTip')}>
+                    <a className="block mt-1 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="block mt-1 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="block mt-1 text-accent hover:underline underline-offset-2" href="https://github.com/gnacho/RTLPlayground/releases" target="_blank" rel="noreferrer">{t('settings.services.rtlImages')}</a>
+                  </InfoTip>
+                </div>
                 <p className="truncate text-caption text-text-muted">{t('settings.services.externalAgentsCaption')}</p>
               </div>
             </div>
@@ -4157,7 +4164,7 @@ function ServicesCard({
         </DialogContent>
       </Dialog>
       <Dialog open={dialog === 'complementos'} onOpenChange={(o) => { if (!o) setDialog(null) }}>
-        <DialogContent className={integrationDialogCls} aria-describedby={undefined}>
+        <DialogContent className="w-[calc(100vw-2rem)] max-h-[94vh] overflow-y-auto sm:max-w-[1300px]" aria-describedby={undefined}>
           <DialogHeader>
             <DialogTitle className="sr-only">{t('settings.services.externalAgents')}</DialogTitle>
           </DialogHeader>