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

feat(settings): graduate the rack view out of Labs (#1408)

Closes #1407
Nacho 1 месяц назад
Родитель
Сommit
4cdae238de

+ 8 - 4
app/public/locales/en/translation.json

@@ -320,6 +320,7 @@
       "d_one": "{{n}} day ago",
       "d_other": "{{n}} days ago"
     },
+    "close": "Close",
     "days": {
       "mon": "Mon",
       "tue": "Tue",
@@ -1641,9 +1642,7 @@
       "deleteDesc": "The token for “{{slug}}” will be revoked. The scraper will stop sending data until you regenerate the token.",
       "regenToken": "Regenerate token",
       "regenTokenCaption": "Rotate external agent token (LABS)",
-      "badge": "LABS",
-      "rack": "Rack view",
-      "rackCaption": "Draw your rack and detect cables. Off by default; do not use in production."
+      "badge": "LABS"
     },
     "saved": "Preferences saved",
     "services": {
@@ -1656,6 +1655,7 @@
       "labsCaption": "In development. For experimental use",
       "orchestrationHint": "Manage routers from the UI (AdGuard, guest Wi-Fi, DDNS…)",
       "networkGroup": "Network services",
+      "rackCaption": "Draw your rack and detect cables. Off by default.",
       "firmwareUpgradesCaption": "Show or hide the firmware upgrades page",
       "integrationsGroup": "Integrations",
       "proxmoxCaption": "Cluster inventory (hypervisors and CTs)",
@@ -2229,6 +2229,7 @@
     "owutConfirmTitle": "Upgrade with owut (ASU)",
     "owutConfirmBody": "The ASU server will build a stock OpenWrt image and the router will install it. The session drops when it reboots.",
     "owutConfirmPackages": "The ASU image keeps the packages you installed on the router",
+    "owutConfirmVendor": "This upgrade comes from the vendor repository (GL.iNet), not from OpenWrt.",
     "scheduleTitle": "Schedule upgrade",
     "scheduleBody": "Date/time and recurrence. It only flashes when the installed version differs from the target.",
     "rec_once": "Once",
@@ -2643,6 +2644,9 @@
   "rack": {
     "title": "Rack",
     "subtitle": "Your physical hardware, placed and patched.",
+    "uplinkUnit": "Uplink unit",
+    "uplinkUnitNone": "None",
+    "uplinkUnitSet": "Uplink unit updated",
     "addRack": "Add rack",
     "deleteRack": "Delete rack",
     "deleteRackConfirm": "Delete this rack and everything mounted on it?",
@@ -2711,6 +2715,6 @@
     "betaTitle": "Preview: much work remains",
     "betaText": "This view is under active development and not fully reliable yet. Do not use it in production; feedback is welcome.",
     "disabledTitle": "The rack view is disabled",
-    "disabledText": "It is a development view (labs). Enable it in Settings → Labs → Rack view to try it."
+    "disabledText": "It is an optional view. Enable it in Settings → Services → Rack view."
   }
 }

+ 8 - 4
app/public/locales/es/translation.json

@@ -320,6 +320,7 @@
       "d_one": "hace {{n}} día",
       "d_other": "hace {{n}} días"
     },
+    "close": "Cerrar",
     "days": {
       "mon": "Lun",
       "tue": "Mar",
@@ -1641,9 +1642,7 @@
       "deleteDesc": "Se revocará el token de \"{{slug}}\". El scraper dejará de poder enviar datos hasta que regeneres el token.",
       "regenToken": "Regenerar token",
       "regenTokenCaption": "Rotación del token de agentes externos (LABS)",
-      "badge": "LABS",
-      "rack": "Vista de rack",
-      "rackCaption": "Dibuja tu rack y detecta los cables. Desactivado por defecto; no usar en producción."
+      "badge": "LABS"
     },
     "saved": "Preferencias guardadas",
     "services": {
@@ -1656,6 +1655,7 @@
       "labsCaption": "En desarrollo. Para uso experimental",
       "orchestrationHint": "Permite gestionar routers desde la interfaz (AdGuard, WiFi invitados, DDNS…)",
       "networkGroup": "Servicios de red",
+      "rackCaption": "Dibuja tu rack y detecta los cables. Desactivado por defecto.",
       "firmwareUpgradesCaption": "Muestra u oculta la página de actualizaciones de firmware",
       "integrationsGroup": "Integraciones",
       "proxmoxCaption": "Inventario del cluster (hipervisores y CTs)",
@@ -2229,6 +2229,7 @@
     "owutConfirmTitle": "Actualizar con owut (ASU)",
     "owutConfirmBody": "El servidor ASU construirá una imagen OpenWrt estándar y el router la instalará. La sesión se cortará al reiniciar.",
     "owutConfirmPackages": "La imagen ASU conserva los paquetes que instalaste en el router",
+    "owutConfirmVendor": "Esta actualización procede del repositorio del fabricante (GL.iNet), no de OpenWrt.",
     "scheduleTitle": "Programar actualización",
     "scheduleBody": "Fecha/hora y recurrencia. Solo flashea si la versión instalada difiere del objetivo.",
     "rec_once": "Una vez",
@@ -2643,6 +2644,9 @@
   "rack": {
     "title": "Rack",
     "subtitle": "Tu hardware físico, colocado y cableado.",
+    "uplinkUnit": "Unidad de uplink",
+    "uplinkUnitNone": "Ninguna",
+    "uplinkUnitSet": "Unidad de uplink actualizada",
     "addRack": "Añadir rack",
     "deleteRack": "Eliminar rack",
     "deleteRackConfirm": "¿Eliminar el rack y todo lo que tiene montado?",
@@ -2711,6 +2715,6 @@
     "betaTitle": "Vista previa: queda mucho trabajo por hacer",
     "betaText": "Esta vista está en desarrollo activo y todavía no es fiable al 100%. No la utilices todavía en producción; esperamos tus comentarios.",
     "disabledTitle": "La vista de rack está desactivada",
-    "disabledText": "Es una vista en desarrollo (labs). Actívala en Ajustes → Labs → Vista de rack si quieres probarla."
+    "disabledText": "Es una vista opcional. Actívala en Ajustes → Servicios → Vista de rack."
   }
 }

+ 6 - 7
app/src/components/Layout.tsx

@@ -56,7 +56,7 @@ const NAV_ITEMS: NavItem[] = [
   { to: '/routers', labelKey: 'nav.routers', icon: RouterIcon },
   { to: '/devices', labelKey: 'nav.devices', icon: MonitorSmartphone },
   { to: '/topology', labelKey: 'nav.topology', icon: Waypoints },
-  { to: '/rack', labelKey: 'nav.rack', icon: Server, badge: 'labs' },
+  { to: '/rack', labelKey: 'nav.rack', icon: Server },
   { to: '/roaming', labelKey: 'nav.roaming', icon: Wifi },
   { to: '/wifi/channel-plan', labelKey: 'nav.channelPlan', icon: RadioTower },
   { to: '/firmware-upgrades', labelKey: 'nav.firmwareUpgrades', icon: Cpu, adminOnly: true },
@@ -206,9 +206,9 @@ function LiveDot() {
 // ---------------------------------------------------------------------------
 
 /** Items de nav visibles según el overview. /roaming solo si hay usteer.
- *  La visibilidad de funcionalidades Labs (rack) se controla desde la
- *  tarjeta Servicios en Ajustes (useServicesVisibility); actualizaciones de
- *  firmware tiene toggle propio (#1146). */
+ *  La visibilidad del rack se controla desde la tarjeta Servicios en
+ *  Ajustes (useServicesVisibility); ya no requiere Labs (#1407).
+ *  Actualizaciones de firmware tiene toggle propio (#1146). */
 function useVisibleNavItems(): NavItem[] {
   const { usteer, orchestration } = useNetPulse()
   const [services] = useServicesVisibility()
@@ -221,11 +221,10 @@ function useVisibleNavItems(): NavItem[] {
           (it.to !== '/roaming' || usteerAvailable) &&
           // Orquestación: opt-in del admin (#121) y solo con Labs activo.
           (it.to !== '/orchestration' || (labsOn && !!orchestration)) &&
-          // Funcionalidades Labs controladas por cada toggle (rediseño v3):
-          // solo se muestran en el nav si Labs está activo y su toggle encendido.
           // Firmware upgrades (#1146): visibilidad propia, ya no es Labs.
           (it.to !== '/firmware-upgrades' || services.actualizaciones) &&
-          (it.to !== '/rack' || (labsOn && services.rack)),
+          // Rack (#1407): graduado de Labs, solo requiere su toggle.
+          (it.to !== '/rack' || !!services.rack),
       ),
     [usteerAvailable, orchestration, labsOn, services.rack, services.actualizaciones],
   )

+ 6 - 14
app/src/pages/Settings.tsx

@@ -3952,6 +3952,8 @@ function ServicesCard({
     { key: 'openvpn', label: 'OpenVPN', caption: t('settings.services.openvpnCaption') },
     // #1146: visibilidad de la página de actualizaciones (ya no es Labs).
     { key: 'actualizaciones', label: t('nav.firmwareUpgrades'), caption: t('settings.services.firmwareUpgradesCaption') },
+    // #1407: el rack se gradúa de Labs, con toggle propio en Servicios.
+    { key: 'rack', label: t('nav.rack'), caption: t('settings.services.rackCaption') },
   ]
   // #996: el grupo Integraciones se queda SOLO con MQTT y Proxmox (estado e
   // inventario); ntfy y Telegram son canales de aviso y viven en la tarjeta
@@ -4061,9 +4063,10 @@ function ServicesCard({
         </div>
       </div>
 
-      {/* Labs: subtarjeta con acento rojo (#1146) con TODAS las filas labs
-          (servicios e integraciones): orquestación y rack. Sin Labs
-          activo no se muestra nada de este bloque. */}
+      {/* Labs: subtarjeta con acento rojo (#1146) con las filas labs
+          restantes (orquestación e integraciones marcadas labs). Sin Labs
+          activo no se muestra nada de este bloque. El rack ya no está aquí
+          (#1407): tiene su fila propia en Servicios de red. */}
       {services.labs && (
         <div className="mt-4 rounded-xl border border-danger/30 bg-danger/5 p-4">
           <div className="mb-1 flex items-center gap-1.5">
@@ -4080,17 +4083,6 @@ function ServicesCard({
               disabled={orchBusy || disabled}
               danger
             />
-            <SwitchRow
-              label={t('settings.labs.rack')}
-              caption={t('settings.labs.rackCaption')}
-              checked={services.rack}
-              disabled={disabled}
-              danger
-              onCheckedChange={(v) => {
-                setService('rack', v)
-                onSaved()
-              }}
-            />
             {integrationRows.filter((row) => row.labs).map((row) => (
               <SwitchRow
                 key={row.key}