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

feat(settings): mark the MCP integration as labs-only and red (#1114) (#1120)

feat(settings): mark the MCP integration as labs-only and red (#1120)

Closes #1114
Nacho 2 месяцев назад
Родитель
Сommit
12c9aa77e8

+ 1 - 1
README.es.md

@@ -303,7 +303,7 @@ dispositivos conocidos, peers WireGuard, estadísticas de AdGuard Home, el
 grafo de topología detectado y las alertas activas. Nada más: sin cambios de
 configuración ni reinicios.
 
-Está **desactivado por defecto**. Para activarlo:
+Es experimental y vive bajo el flag de Labs en Ajustes. Está **desactivado por defecto**. Para activarlo:
 
 ```bash
 NETPULSE_MCP_ENABLED=1

+ 1 - 1
README.md

@@ -292,7 +292,7 @@ tools: fleet status, per-router health, known devices, WireGuard peers,
 AdGuard Home stats, the detected topology graph and active alerts. Nothing
 else: no configuration changes, no restarts.
 
-It is **disabled by default**. To enable it:
+It is experimental and lives under the Labs flag in Settings. It is **disabled by default**. To enable it:
 
 ```bash
 NETPULSE_MCP_ENABLED=1

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

@@ -1575,7 +1575,7 @@
       "integrationsGroup": "Integrations",
       "proxmoxCaption": "Cluster inventory (hypervisors and CTs)",
       "mqttCaption": "Fleet state published to the MQTT broker",
-      "mcpCaption": "Read-only queries for AI assistants",
+      "mcpCaption": "Read-only queries for AI assistants (labs)",
       "configure": "Configure {{name}}"
     },
     "session": {

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

@@ -1575,7 +1575,7 @@
       "integrationsGroup": "Integraciones",
       "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",
+      "mcpCaption": "Consultas de solo lectura para asistentes de IA (labs)",
       "configure": "Configurar {{name}}"
     },
     "session": {

+ 7 - 4
app/src/pages/Settings.tsx

@@ -3922,11 +3922,13 @@ function ServicesCard({
   ]
   // #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
-  // de Notificaciones.
-  const integrationRows: { key: keyof IntegrationsState; label: string; caption: string; dialogKey: IntegrationDialogKey; locked?: boolean }[] = [
+  // de Notificaciones. MCP (#1114) es LABS: fila con acento rojo (danger)
+  // visible solo con Labs activado; el endpoint no muere al ocultar Labs
+  // (misma semántica que orquestación: el opt-in persiste server-side).
+  const integrationRows: { key: keyof IntegrationsState; label: string; caption: string; dialogKey: IntegrationDialogKey; locked?: boolean; labs?: boolean; danger?: boolean }[] = [
     { key: 'proxmox', label: 'Proxmox VE', caption: t('settings.services.proxmoxCaption'), dialogKey: 'proxmox' },
     { key: 'mqtt', label: 'MQTT', caption: t('settings.services.mqttCaption'), dialogKey: 'mqtt' },
-    { key: 'mcp', label: 'MCP', caption: t('settings.services.mcpCaption'), dialogKey: 'mcp', locked: mcpLocked },
+    { key: 'mcp', label: 'MCP', caption: t('settings.services.mcpCaption'), dialogKey: 'mcp', locked: mcpLocked, labs: true, danger: true },
   ]
 
   // AdGuard (#813): el toggle de Servicios también controla el sondeo y la
@@ -4029,13 +4031,14 @@ function ServicesCard({
 
         <div className="pb-1 pt-4 text-label uppercase text-text-muted">{t('settings.services.integrationsGroup')}</div>
         <div className="divide-y divide-border/60">
-          {integrationRows.map((row) => (
+          {integrationRows.filter((row) => !row.labs || services.labs).map((row) => (
             <SwitchRow
               key={row.key}
               label={row.label}
               caption={row.caption}
               checked={integrations[row.key]}
               disabled={disabled || row.locked}
+              danger={row.danger}
               trailing={gear(row.dialogKey, row.label)}
                 onCheckedChange={(v) => {
                   setIntegration(row.key, v)