diff --git a/monkeyai/admin/src/components/mcp-network-settings.tsx b/monkeyai/admin/src/components/mcp-network-settings.tsx index f782f6eb..3d2655cd 100644 --- a/monkeyai/admin/src/components/mcp-network-settings.tsx +++ b/monkeyai/admin/src/components/mcp-network-settings.tsx @@ -1,17 +1,29 @@ import { useEffect, useState, type FormEvent } from "react" -import { useTranslation } from "react-i18next" +import { Trans, useTranslation } from "react-i18next" +import { HugeiconsIcon } from "@hugeicons/react" +import { Add01Icon, Delete02Icon } from "@hugeicons/core-free-icons" import { useAppToast } from "@/components/animated-toast-provider" import { Button } from "@/components/ui/button" +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { - Card, - CardAction, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "@/components/ui/card" -import { Field, FieldDescription, FieldLabel } from "@/components/ui/field" + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog" +import { + Item, + ItemActions, + ItemContent, + ItemDescription, + ItemTitle, +} from "@/components/ui/item" +import { ScrollArea } from "@/components/ui/scroll-area" import { Input } from "@/components/ui/input" import { api } from "@/lib/api" @@ -20,11 +32,13 @@ type Setting = { key: string; value: { blocked_cidrs: string[] } } export function MCPNetworkSettings() { const { t } = useTranslation() const { showToast } = useAppToast() - const [cidrs, setCIDRs] = useState([]) + const [rows, setRows] = useState<{ id: number; cidr: string }[]>([]) const [savedCIDRs, setSavedCIDRs] = useState([]) + const [open, setOpen] = useState(false) const [loaded, setLoaded] = useState(false) const [saving, setSaving] = useState(false) const [error, setError] = useState("") + const cidrs = rows.map((row) => row.cidr) const dirty = JSON.stringify(cidrs) !== JSON.stringify(savedCIDRs) useEffect(() => { @@ -35,7 +49,6 @@ export function MCPNetworkSettings() { const items = settings.find((setting) => setting.key === "mcp")?.value .blocked_cidrs ?? [] - setCIDRs(items) setSavedCIDRs(items) setLoaded(true) }) @@ -47,6 +60,15 @@ export function MCPNetworkSettings() { } }, []) + const handleOpenChange = (nextOpen: boolean) => { + if (saving) return + if (nextOpen) { + setRows(savedCIDRs.map((cidr, id) => ({ id, cidr }))) + setError("") + } + setOpen(nextOpen) + } + const submit = async (event: FormEvent) => { event.preventDefault() if (!loaded || saving) return @@ -60,8 +82,8 @@ export function MCPNetworkSettings() { value: { blocked_cidrs: cidrs.map((cidr) => cidr.trim()) }, }), }) - setCIDRs(saved.value.blocked_cidrs) - setSavedCIDRs(saved.value.blocked_cidrs) + setOpen(false) + setSavedCIDRs(saved.value.blocked_cidrs ?? []) showToast({ status: "success", title: t("pages.otherSettings.mcpNetwork.saved"), @@ -77,90 +99,172 @@ export function MCPNetworkSettings() { {t("pages.otherSettings.mcpNetwork.title")} - - {t("pages.otherSettings.mcpNetwork.description")} - - {dirty && ( - - - - - )} -
- - {t("pages.otherSettings.mcpNetwork.label")} - - {t("pages.otherSettings.mcpNetwork.hint")} - - {cidrs.map((cidr, index) => ( -
- - setCIDRs((items) => - items.map((item, i) => - i === index ? event.target.value : item - ) - ) - } - /> - -
- ))} - {loaded && cidrs.length === 0 && ( -

- {t("pages.otherSettings.mcpNetwork.empty")} -

- )} -
- - {error && ( -

- {error} -

- )} -
+ + + {t("pages.otherSettings.mcpNetwork.blocklist")} + + + {t("pages.otherSettings.mcpNetwork.hint")} + + +
+
+ +
+
+
+ {t("pages.otherSettings.mcpNetwork.label")} +
+ {rows.length === 0 ? ( +

+ {t("pages.otherSettings.mcpNetwork.empty")} +

+ ) : ( +
    + {rows.map((row, index) => { + const label = t( + "pages.otherSettings.mcpNetwork.entry", + { index: index + 1 } + ) + return ( +
  • + { + const cidr = event.target.value + setRows((items) => + items.map((item) => + item.id === row.id + ? { ...item, cidr } + : item + ) + ) + setError("") + }} + /> + +
  • + ) + })} +
+ )} +
+ {error && ( +

+ {error} +

+ )} +
+
+ + +
+ } + > + {t("pages.otherSettings.mcpNetwork.cancel")} + + +
+
+
+
+ + + {!loaded && error && ( +

+ {error} +

+ )}
) diff --git a/monkeyai/admin/src/components/proxy-settings.tsx b/monkeyai/admin/src/components/proxy-settings.tsx index b9167e2b..dcf40c84 100644 --- a/monkeyai/admin/src/components/proxy-settings.tsx +++ b/monkeyai/admin/src/components/proxy-settings.tsx @@ -1,5 +1,12 @@ import { useEffect, useState, type FormEvent } from "react" import { useTranslation } from "react-i18next" +import { HugeiconsIcon } from "@hugeicons/react" +import { + Delete02Icon, + DotIcon, + Edit02Icon, + MoreHorizontalIcon, +} from "@hugeicons/core-free-icons" import { Button } from "@/components/ui/button" import { @@ -17,6 +24,13 @@ import { DialogHeader, DialogTitle, } from "@/components/ui/dialog" +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu" import { Field, FieldLabel } from "@/components/ui/field" import { Input } from "@/components/ui/input" import { @@ -239,47 +253,77 @@ export function ProxySettings() { - + {proxies.map((item) => (
- - {item.name} · {item.url} - -
- - +
+ {item.name} +
+ + + } + > + + + { + setEditing(item) + setError("") + }} + > + + + { + if ( + window.confirm( + t("pages.otherSettings.proxies.confirmDelete") + ) + ) { + void persist( + proxies.filter((proxy) => proxy.id !== item.id) + ) + } + }} + > + + +
))} {!editing && error && ( diff --git a/monkeyai/admin/src/i18n/locales/ar.ts b/monkeyai/admin/src/i18n/locales/ar.ts index d02b6158..f875908a 100644 --- a/monkeyai/admin/src/i18n/locales/ar.ts +++ b/monkeyai/admin/src/i18n/locales/ar.ts @@ -1065,11 +1065,12 @@ export const ar = { otherSettings: { about: "حول", mcpNetwork: { - title: "الوصول إلى شبكة MCP", - description: - "يُسمح بالشبكات العامة والخاصة افتراضيًا. تُرفض العناوين المدرجة في قائمة الحظر دائمًا.", + title: "التحكم في الوصول إلى الشبكة", + blocklist: "قائمة حظر شبكة MCP", + configure: "إعداد", + description: "يُحظر الوصول إلى {{cidrs}}", label: "قائمة حظر نطاقات IP", - hint: "استخدم CIDR لـ IPv4/IPv6، مثل 10.0.0.0/8 أو fd00::/8. استخدم /32 أو /128 لعنوان IP واحد. تنطبق القواعد المحفوظة على طلبات MCP وOAuth الجديدة، بما فيها الطلبات عبر الوكيل.", + hint: "استخدم CIDR لـ IPv4/IPv6، مثل 10.0.0.0/8 أو fd00::/8.", entry: "نطاق IP {{index}}", add: "إضافة نطاق IP", remove: "إزالة", @@ -1136,64 +1137,6 @@ export const ar = { deleted: "تم حذف الوسم.", empty: "لم يتم إعداد أي وسوم.", }, - knowledgeBase: { - title: "إعدادات قاعدة المعرفة", - description: "إدارة معالجة محتوى المعرفة واسترجاعه.", - embeddingModel: "نموذج التضمين", - rerankerModel: "نموذج إعادة الترتيب", - documentParsingEngine: { - title: "محرك تحليل المستندات المحسّن", - provider: "Baizhi Cloud", - defaultDescription: - "غير مهيأ. سيستخرج المحلل الأساسي المدمج النص العادي من الملفات.", - configuredDescription: - "تمت تهيئة Baizhi Cloud لتحسين تحليل المستندات المرفوعة.", - dialogTitle: "تهيئة تحليل المستندات المحسّن", - dialogDescription: - "يتضمن MonkeyAI تحليلاً أساسيًا للمستندات. عندما لا يكون استخراج النص من المستندات المعقدة كافيًا، يمكن لـ Baizhi Cloud تحسين النتائج.", - providerLabel: "مقدم الخدمة", - providerDescription: - "Baizhi Cloud · عنوان الخدمة ثابت في النظام ولا يحتاج إلى تهيئة.", - apiKey: "مفتاح API", - apiKeyPlaceholder: "أدخل مفتاح API لخدمة Baizhi Cloud", - apiKeyUpdatePlaceholder: "اتركه فارغًا للاحتفاظ بالمفتاح الحالي", - apiKeyDescription: - "يُرسل المفتاح عند الحفظ فقط ولن يظهر كاملاً مرة أخرى.", - apiKeyUpdateDescription: "اتركه فارغًا للاحتفاظ بالمفتاح الحالي.", - }, - contentEnhancementModel: { - title: "نموذج تحسين المحتوى", - notConfiguredDescription: - "لم تتم تهيئته بعد. لا يمكن إنشاء محتوى محسّن مثل ملخصات النصوص.", - dialogTitle: "تهيئة نموذج تحسين المحتوى", - dialogDescription: - "اضبط نموذج اللغة المستخدم لإنشاء تحسينات قاعدة المعرفة، مثل ملخصات النصوص. يستخدم إعدادات الاتصال نفسها الخاصة بنموذج النظام.", - }, - notConfigured: "لم تتم تهيئته بعد", - configure: "تهيئة", - edit: "تعديل الإعداد", - dialogTitle: "تهيئة {{model}}", - dialogDescription: "أدخل نقطة نهاية النموذج وبيانات اعتماد الوصول.", - model: "النموذج", - modelId: "معرّف النموذج", - modelIdPlaceholder: "أدخل معرّف النموذج المستخدم في الخدمة", - modelIdDescription: - "تحدد الخدمة معرّف النموذج، لذلك قد يختلف عن اسم النموذج المحدد.", - rerankerModelIdPlaceholder: "مثال: BAAI/bge-reranker-v2-m3", - embeddingSupportDescription: "نموذج bge-m3 هو المدعوم حاليًا فقط.", - rerankerSupportDescription: - "نموذج bge-reranker-v2-m3 هو المدعوم حاليًا فقط.", - baseUrl: "Base URL", - baseUrlPlaceholder: "https://api.example.com/v1", - apiKey: "مفتاح API", - apiKeyPlaceholder: "أدخل مفتاح API للنموذج", - apiKeyUpdatePlaceholder: "اتركه فارغًا للاحتفاظ بالمفتاح الحالي", - apiKeyDescription: - "يُرسل المفتاح عند الحفظ فقط ولن يظهر كاملاً مرة أخرى.", - apiKeyUpdateDescription: "اتركه فارغًا للاحتفاظ بالمفتاح الحالي.", - cancel: "إلغاء", - save: "حفظ الإعداد", - }, loginMethods: { title: "طرق تسجيل الدخول", description: "اضبط طرق المصادقة التي يدعمها النظام.", diff --git a/monkeyai/admin/src/i18n/locales/de-DE.ts b/monkeyai/admin/src/i18n/locales/de-DE.ts index 1b0fbdbe..16aff836 100644 --- a/monkeyai/admin/src/i18n/locales/de-DE.ts +++ b/monkeyai/admin/src/i18n/locales/de-DE.ts @@ -1131,11 +1131,12 @@ export const deDE = { otherSettings: { about: "Über", mcpNetwork: { - title: "MCP-Netzwerkzugriff", - description: - "Öffentliche und private Netzwerke sind standardmäßig erlaubt. Gesperrte Adressen werden immer abgewiesen.", + title: "Netzwerkzugriffskontrolle", + blocklist: "MCP-Netzwerksperrliste", + configure: "Konfigurieren", + description: "Zugriff gesperrt für {{cidrs}}", label: "IP-Bereichssperrliste", - hint: "IPv4-/IPv6-CIDRs wie 10.0.0.0/8 oder fd00::/8 verwenden. Für einzelne IPs /32 oder /128 verwenden. Gespeicherte Regeln gelten für neue MCP- und OAuth-Anfragen, auch über Proxys.", + hint: "IPv4-/IPv6-CIDRs wie 10.0.0.0/8 oder fd00::/8 verwenden.", entry: "IP-Bereich {{index}}", add: "IP-Bereich hinzufügen", remove: "Entfernen", @@ -1204,71 +1205,6 @@ export const deDE = { deleted: "Tag gelöscht.", empty: "Es wurden noch keine Tags konfiguriert.", }, - knowledgeBase: { - title: "Wissensdatenbank-Einstellungen", - description: - "Verwalten Sie die Verarbeitung und den Abruf von Wissensinhalten.", - embeddingModel: "Embedding-Modell", - rerankerModel: "Reranker-Modell", - documentParsingEngine: { - title: "Erweiterte Dokumentenanalyse", - provider: "Baizhi Cloud", - defaultDescription: - "Nicht konfiguriert. Der integrierte Parser extrahiert einfachen Text aus Dateien.", - configuredDescription: - "Baizhi Cloud ist konfiguriert und verbessert die Analyse hochgeladener Dokumente.", - dialogTitle: "Erweiterte Dokumentenanalyse konfigurieren", - dialogDescription: - "MonkeyAI enthält eine grundlegende Dokumentenanalyse. Wenn die Textextraktion bei komplexen Dokumenten nicht ausreicht, kann Baizhi Cloud die Ergebnisse verbessern.", - providerLabel: "Dienstanbieter", - providerDescription: - "Baizhi Cloud · Der Endpunkt ist systemseitig festgelegt und muss nicht konfiguriert werden.", - apiKey: "API-Schlüssel", - apiKeyPlaceholder: "API-Schlüssel von Baizhi Cloud eingeben", - apiKeyUpdatePlaceholder: - "Leer lassen, um den aktuellen Schlüssel beizubehalten", - apiKeyDescription: - "Der Schlüssel wird nur beim Speichern übertragen und danach nicht vollständig angezeigt.", - apiKeyUpdateDescription: - "Leer lassen, um den aktuellen Schlüssel beizubehalten.", - }, - contentEnhancementModel: { - title: "Modell zur Inhaltsverbesserung", - notConfiguredDescription: - "Noch nicht konfiguriert. Erweiterte Inhalte wie Textzusammenfassungen können nicht erstellt werden.", - dialogTitle: "Modell zur Inhaltsverbesserung konfigurieren", - dialogDescription: - "Konfigurieren Sie das Sprachmodell für Wissensdatenbank-Erweiterungen wie Textzusammenfassungen. Es verwendet dieselben Verbindungseinstellungen wie ein Systemmodell.", - }, - notConfigured: "Noch nicht konfiguriert", - configure: "Konfigurieren", - edit: "Konfiguration ändern", - dialogTitle: "{{model}} konfigurieren", - dialogDescription: - "Geben Sie den Modell-Endpunkt und die Zugangsdaten ein.", - model: "Modell", - modelId: "Modell-ID", - modelIdPlaceholder: "Die vom Dienst verwendete Modell-ID eingeben", - modelIdDescription: - "Der Dienst legt die Modell-ID fest; sie kann daher vom ausgewählten Modellnamen abweichen.", - rerankerModelIdPlaceholder: "Zum Beispiel: BAAI/bge-reranker-v2-m3", - embeddingSupportDescription: - "Derzeit wird nur das Modell bge-m3 unterstützt.", - rerankerSupportDescription: - "Derzeit wird nur das Modell bge-reranker-v2-m3 unterstützt.", - baseUrl: "Base URL", - baseUrlPlaceholder: "https://api.example.com/v1", - apiKey: "API-Schlüssel", - apiKeyPlaceholder: "API-Schlüssel des Modells eingeben", - apiKeyUpdatePlaceholder: - "Leer lassen, um den aktuellen Schlüssel beizubehalten", - apiKeyDescription: - "Der Schlüssel wird nur beim Speichern übertragen und danach nicht vollständig angezeigt.", - apiKeyUpdateDescription: - "Leer lassen, um den aktuellen Schlüssel beizubehalten.", - cancel: "Abbrechen", - save: "Konfiguration speichern", - }, loginMethods: { title: "Anmeldemethoden", description: diff --git a/monkeyai/admin/src/i18n/locales/en-US.ts b/monkeyai/admin/src/i18n/locales/en-US.ts index 69f978d7..be08cd46 100644 --- a/monkeyai/admin/src/i18n/locales/en-US.ts +++ b/monkeyai/admin/src/i18n/locales/en-US.ts @@ -2413,11 +2413,12 @@ export const enUS = { otherSettings: { about: "About", mcpNetwork: { - title: "MCP network access", - description: - "Public and private networks are allowed by default. Blocklisted addresses are always denied.", + title: "Network access control", + blocklist: "MCP network blocklist", + configure: "Configure", + description: "Access blocked to {{cidrs}}", label: "IP range blocklist", - hint: "Use IPv4/IPv6 CIDRs, such as 10.0.0.0/8 or fd00::/8. Use /32 or /128 for a single IP. Saved rules apply to new MCP and OAuth requests, including proxied requests.", + hint: "Use IPv4/IPv6 CIDRs, such as 10.0.0.0/8 or fd00::/8.", entry: "IP range {{index}}", add: "Add IP range", remove: "Remove", @@ -2485,65 +2486,6 @@ export const enUS = { deleted: "Tag deleted.", empty: "No tags have been configured.", }, - knowledgeBase: { - title: "Knowledge base settings", - description: "Manage how knowledge content is processed and retrieved.", - embeddingModel: "Embedding model", - rerankerModel: "Reranker model", - documentParsingEngine: { - title: "Enhanced document parsing engine", - provider: "Baizhi Cloud", - defaultDescription: - "Not configured. The built-in basic parser will extract plain text from files.", - configuredDescription: - "Baizhi Cloud is configured and will enhance parsing for uploaded documents.", - dialogTitle: "Configure enhanced document parsing", - dialogDescription: - "MonkeyAI includes basic document parsing. When plain-text extraction is not good enough for complex documents, Baizhi Cloud can enhance the results.", - providerLabel: "Service provider", - providerDescription: - "Baizhi Cloud · The service endpoint is fixed by the system and does not need configuration.", - apiKey: "API key", - apiKeyPlaceholder: "Enter the Baizhi Cloud API key", - apiKeyUpdatePlaceholder: "Leave blank to keep the current key", - apiKeyDescription: - "The key is submitted only when saved and will not be shown in full again.", - apiKeyUpdateDescription: "Leave blank to keep the current key.", - }, - contentEnhancementModel: { - title: "Content enhancement model", - notConfiguredDescription: - "Not configured. Enhanced content such as text summaries cannot be generated.", - dialogTitle: "Configure content enhancement model", - dialogDescription: - "Configure the language model used to generate knowledge base enhancements such as text summaries. It uses the same connection settings as a system model.", - }, - notConfigured: "Not configured yet", - configure: "Configure", - edit: "Edit configuration", - dialogTitle: "Configure {{model}}", - dialogDescription: "Enter the model endpoint and access credentials.", - model: "Model", - modelId: "Model ID", - modelIdPlaceholder: "Enter the model ID used by the service", - modelIdDescription: - "The service defines the model ID, so it may differ from the selected model name.", - rerankerModelIdPlaceholder: "For example: BAAI/bge-reranker-v2-m3", - embeddingSupportDescription: - "Only the bge-m3 model is currently supported.", - rerankerSupportDescription: - "Only the bge-reranker-v2-m3 model is currently supported.", - baseUrl: "Base URL", - baseUrlPlaceholder: "https://api.example.com/v1", - apiKey: "API key", - apiKeyPlaceholder: "Enter the model API key", - apiKeyUpdatePlaceholder: "Leave blank to keep the current key", - apiKeyDescription: - "The key is submitted only when saved and will not be shown in full again.", - apiKeyUpdateDescription: "Leave blank to keep the current key.", - cancel: "Cancel", - save: "Save configuration", - }, loginMethods: { title: "Sign-in methods", description: diff --git a/monkeyai/admin/src/i18n/locales/es-419.ts b/monkeyai/admin/src/i18n/locales/es-419.ts index f8d1b2e4..68100f76 100644 --- a/monkeyai/admin/src/i18n/locales/es-419.ts +++ b/monkeyai/admin/src/i18n/locales/es-419.ts @@ -1113,11 +1113,12 @@ export const es419 = { otherSettings: { about: "Acerca de", mcpNetwork: { - title: "Acceso de red MCP", - description: - "Las redes públicas y privadas se permiten de forma predeterminada. Las direcciones bloqueadas siempre se rechazan.", + title: "Control de acceso a la red", + blocklist: "Lista de bloqueo de red de MCP", + configure: "Configurar", + description: "Acceso bloqueado a {{cidrs}}", label: "Lista de bloqueo de rangos IP", - hint: "Usa CIDR IPv4/IPv6, como 10.0.0.0/8 o fd00::/8. Usa /32 o /128 para una sola IP. Las reglas guardadas se aplican a nuevas solicitudes MCP y OAuth, incluso a través de proxies.", + hint: "Usa CIDR IPv4/IPv6, como 10.0.0.0/8 o fd00::/8.", entry: "Rango IP {{index}}", add: "Agregar rango IP", remove: "Eliminar", @@ -1187,69 +1188,6 @@ export const es419 = { deleted: "Etiqueta eliminada.", empty: "No hay etiquetas configuradas.", }, - knowledgeBase: { - title: "Configuración de la base de conocimientos", - description: - "Administra cómo se procesa y recupera el contenido de conocimiento.", - embeddingModel: "Modelo de embedding", - rerankerModel: "Modelo de reranking", - documentParsingEngine: { - title: "Motor avanzado de análisis de documentos", - provider: "Baizhi Cloud", - defaultDescription: - "No configurado. El analizador integrado extraerá texto sin formato de los archivos.", - configuredDescription: - "Baizhi Cloud está configurado y mejorará el análisis de los documentos cargados.", - dialogTitle: "Configurar el análisis avanzado de documentos", - dialogDescription: - "MonkeyAI incluye análisis básico de documentos. Si la extracción de texto de documentos complejos no es suficiente, Baizhi Cloud puede mejorar los resultados.", - providerLabel: "Proveedor del servicio", - providerDescription: - "Baizhi Cloud · El endpoint está fijado por el sistema y no necesita configuración.", - apiKey: "Clave API", - apiKeyPlaceholder: "Ingresa la clave API de Baizhi Cloud", - apiKeyUpdatePlaceholder: - "Déjalo vacío para conservar la clave actual", - apiKeyDescription: - "La clave solo se envía al guardar y no volverá a mostrarse completa.", - apiKeyUpdateDescription: - "Déjalo vacío para conservar la clave actual.", - }, - contentEnhancementModel: { - title: "Modelo de mejora de contenido", - notConfiguredDescription: - "Aún no está configurado. No se podrá generar contenido mejorado, como resúmenes de texto.", - dialogTitle: "Configurar modelo de mejora de contenido", - dialogDescription: - "Configura el modelo de lenguaje que genera mejoras para la base de conocimientos, como resúmenes de texto. Usa la misma conexión que un modelo del sistema.", - }, - notConfigured: "Aún no configurado", - configure: "Configurar", - edit: "Editar configuración", - dialogTitle: "Configurar {{model}}", - dialogDescription: - "Ingresa el endpoint del modelo y las credenciales de acceso.", - model: "Modelo", - modelId: "ID del modelo", - modelIdPlaceholder: "Ingresa el ID usado por el servicio", - modelIdDescription: - "El servicio define el ID del modelo, por lo que puede diferir del nombre seleccionado.", - rerankerModelIdPlaceholder: "Por ejemplo: BAAI/bge-reranker-v2-m3", - embeddingSupportDescription: - "Actualmente solo se admite el modelo bge-m3.", - rerankerSupportDescription: - "Actualmente solo se admite el modelo bge-reranker-v2-m3.", - baseUrl: "Base URL", - baseUrlPlaceholder: "https://api.example.com/v1", - apiKey: "Clave API", - apiKeyPlaceholder: "Ingresa la clave API del modelo", - apiKeyUpdatePlaceholder: "Déjalo vacío para conservar la clave actual", - apiKeyDescription: - "La clave solo se envía al guardar y no volverá a mostrarse completa.", - apiKeyUpdateDescription: "Déjalo vacío para conservar la clave actual.", - cancel: "Cancelar", - save: "Guardar configuración", - }, loginMethods: { title: "Métodos de inicio de sesión", description: diff --git a/monkeyai/admin/src/i18n/locales/fr-FR.ts b/monkeyai/admin/src/i18n/locales/fr-FR.ts index db665c40..f5113582 100644 --- a/monkeyai/admin/src/i18n/locales/fr-FR.ts +++ b/monkeyai/admin/src/i18n/locales/fr-FR.ts @@ -1128,11 +1128,12 @@ export const frFR = { otherSettings: { about: "À propos", mcpNetwork: { - title: "Accès réseau MCP", - description: - "Les réseaux publics et privés sont autorisés par défaut. Les adresses bloquées sont toujours refusées.", + title: "Contrôle d’accès au réseau", + blocklist: "Liste de blocage réseau MCP", + configure: "Configurer", + description: "Accès interdit à {{cidrs}}", label: "Liste de blocage des plages IP", - hint: "Utilisez des CIDR IPv4/IPv6, comme 10.0.0.0/8 ou fd00::/8. Utilisez /32 ou /128 pour une seule IP. Les règles enregistrées s’appliquent aux nouvelles requêtes MCP et OAuth, y compris via proxy.", + hint: "Utilisez des CIDR IPv4/IPv6, comme 10.0.0.0/8 ou fd00::/8.", entry: "Plage IP {{index}}", add: "Ajouter une plage IP", remove: "Supprimer", @@ -1201,69 +1202,6 @@ export const frFR = { deleted: "Étiquette supprimée.", empty: "Aucune étiquette n’est configurée.", }, - knowledgeBase: { - title: "Paramètres de la base de connaissances", - description: - "Gérez le traitement et la recherche du contenu de connaissance.", - embeddingModel: "Modèle d’embedding", - rerankerModel: "Modèle de reranking", - documentParsingEngine: { - title: "Moteur avancé d’analyse de documents", - provider: "Baizhi Cloud", - defaultDescription: - "Non configuré. L’analyseur intégré extraira le texte brut des fichiers.", - configuredDescription: - "Baizhi Cloud est configuré et améliorera l’analyse des documents importés.", - dialogTitle: "Configurer l’analyse avancée des documents", - dialogDescription: - "MonkeyAI inclut une analyse de documents basique. Lorsque l’extraction de texte des documents complexes est insuffisante, Baizhi Cloud peut améliorer les résultats.", - providerLabel: "Fournisseur de service", - providerDescription: - "Baizhi Cloud · Le point d’accès est fixé par le système et ne nécessite aucune configuration.", - apiKey: "Clé API", - apiKeyPlaceholder: "Saisissez la clé API Baizhi Cloud", - apiKeyUpdatePlaceholder: - "Laissez vide pour conserver la clé actuelle", - apiKeyDescription: - "La clé est transmise uniquement à l’enregistrement et ne sera plus affichée en entier.", - apiKeyUpdateDescription: - "Laissez vide pour conserver la clé actuelle.", - }, - contentEnhancementModel: { - title: "Modèle d’enrichissement du contenu", - notConfiguredDescription: - "Pas encore configuré. Les contenus enrichis, tels que les résumés de texte, ne peuvent pas être générés.", - dialogTitle: "Configurer le modèle d’enrichissement du contenu", - dialogDescription: - "Configurez le modèle de langage utilisé pour enrichir la base de connaissances, par exemple en générant des résumés. Il utilise les mêmes paramètres de connexion qu’un modèle système.", - }, - notConfigured: "Pas encore configuré", - configure: "Configurer", - edit: "Modifier la configuration", - dialogTitle: "Configurer {{model}}", - dialogDescription: - "Saisissez le point d’accès du modèle et les identifiants.", - model: "Modèle", - modelId: "ID du modèle", - modelIdPlaceholder: "Saisissez l’ID utilisé par le service", - modelIdDescription: - "Le service définit l’ID du modèle ; il peut différer du nom du modèle sélectionné.", - rerankerModelIdPlaceholder: "Par exemple : BAAI/bge-reranker-v2-m3", - embeddingSupportDescription: - "Seul le modèle bge-m3 est actuellement pris en charge.", - rerankerSupportDescription: - "Seul le modèle bge-reranker-v2-m3 est actuellement pris en charge.", - baseUrl: "Base URL", - baseUrlPlaceholder: "https://api.example.com/v1", - apiKey: "Clé API", - apiKeyPlaceholder: "Saisissez la clé API du modèle", - apiKeyUpdatePlaceholder: "Laissez vide pour conserver la clé actuelle", - apiKeyDescription: - "La clé est transmise uniquement à l’enregistrement et ne sera plus affichée en entier.", - apiKeyUpdateDescription: "Laissez vide pour conserver la clé actuelle.", - cancel: "Annuler", - save: "Enregistrer la configuration", - }, loginMethods: { title: "Méthodes de connexion", description: diff --git a/monkeyai/admin/src/i18n/locales/ja-JP.ts b/monkeyai/admin/src/i18n/locales/ja-JP.ts index 9c6ac03a..e486a33d 100644 --- a/monkeyai/admin/src/i18n/locales/ja-JP.ts +++ b/monkeyai/admin/src/i18n/locales/ja-JP.ts @@ -1090,11 +1090,12 @@ export const jaJP = { otherSettings: { about: "このアプリについて", mcpNetwork: { - title: "MCP ネットワークアクセス", - description: - "既定ではパブリックおよびプライベートネットワークを許可します。ブロック対象のアドレスは常に拒否されます。", + title: "ネットワークアクセス制御", + blocklist: "MCP ネットワークブロックリスト", + configure: "設定", + description: "{{cidrs}} へのアクセスを禁止", label: "IP 範囲のブロックリスト", - hint: "10.0.0.0/8 や fd00::/8 などの IPv4/IPv6 CIDR を使用します。単一 IP には /32 または /128 を指定します。保存したルールは、プロキシ経由を含む新しい MCP および OAuth リクエストに適用されます。", + hint: "10.0.0.0/8 や fd00::/8 などの IPv4/IPv6 CIDR を使用します。", entry: "IP 範囲 {{index}}", add: "IP 範囲を追加", remove: "削除", @@ -1162,64 +1163,6 @@ export const jaJP = { deleted: "タグを削除しました。", empty: "タグはまだ設定されていません。", }, - knowledgeBase: { - title: "ナレッジベース設定", - description: "ナレッジコンテンツの処理と検索を管理します。", - embeddingModel: "埋め込みモデル", - rerankerModel: "リランカーモデル", - documentParsingEngine: { - title: "文書解析強化エンジン", - provider: "Baizhi Cloud", - defaultDescription: - "未設定です。内蔵の基本解析でファイルからプレーンテキストを抽出します。", - configuredDescription: - "Baizhi Cloud が設定され、アップロード文書の解析が強化されます。", - dialogTitle: "文書解析強化エンジンを設定", - dialogDescription: - "MonkeyAI には基本的な文書解析が含まれています。複雑な文書からのテキスト抽出が十分でない場合は、Baizhi Cloud で解析を強化できます。", - providerLabel: "サービスプロバイダー", - providerDescription: - "Baizhi Cloud · サービスの接続先はシステムで固定されているため、設定は不要です。", - apiKey: "API キー", - apiKeyPlaceholder: "Baizhi Cloud の API キーを入力", - apiKeyUpdatePlaceholder: "空欄の場合は現在のキーを保持", - apiKeyDescription: "キーは保存時のみ送信され、再表示されません。", - apiKeyUpdateDescription: "空欄の場合は現在のキーを保持します。", - }, - contentEnhancementModel: { - title: "コンテンツ強化モデル", - notConfiguredDescription: - "未設定のため、テキスト要約などの強化コンテンツは生成されません。", - dialogTitle: "コンテンツ強化モデルを設定", - dialogDescription: - "テキスト要約などのナレッジベース強化コンテンツを生成する言語モデルを設定します。システムモデルと同じ接続設定を使用します。", - }, - notConfigured: "未設定", - configure: "設定", - edit: "設定を変更", - dialogTitle: "{{model}}を設定", - dialogDescription: - "モデルのエンドポイントとアクセス認証情報を入力します。", - model: "モデル", - modelId: "モデル ID", - modelIdPlaceholder: "サービスで使用するモデル ID を入力", - modelIdDescription: - "モデル ID はサービス側で定義されるため、選択したモデル名と異なる場合があります。", - rerankerModelIdPlaceholder: "例:BAAI/bge-reranker-v2-m3", - embeddingSupportDescription: - "現在サポートされているのは bge-m3 モデルのみです。", - rerankerSupportDescription: - "現在サポートされているのは bge-reranker-v2-m3 モデルのみです。", - baseUrl: "Base URL", - baseUrlPlaceholder: "https://api.example.com/v1", - apiKey: "API キー", - apiKeyPlaceholder: "モデルの API キーを入力", - apiKeyUpdatePlaceholder: "空欄の場合は現在のキーを保持", - apiKeyDescription: "キーは保存時のみ送信され、再表示されません。", - apiKeyUpdateDescription: "空欄の場合は現在のキーを保持します。", - cancel: "キャンセル", - save: "設定を保存", - }, loginMethods: { title: "ログイン方法", description: "システムが対応する認証方法を設定します。", diff --git a/monkeyai/admin/src/i18n/locales/ko-KR.ts b/monkeyai/admin/src/i18n/locales/ko-KR.ts index 760e132f..75b35ce6 100644 --- a/monkeyai/admin/src/i18n/locales/ko-KR.ts +++ b/monkeyai/admin/src/i18n/locales/ko-KR.ts @@ -1073,11 +1073,12 @@ export const koKR = { otherSettings: { about: "정보", mcpNetwork: { - title: "MCP 네트워크 접근", - description: - "기본적으로 공용 및 사설 네트워크를 허용합니다. 차단 목록의 주소는 항상 거부됩니다.", + title: "네트워크 접근 제어", + blocklist: "MCP 네트워크 차단 목록", + configure: "설정", + description: "접근 차단: {{cidrs}}", label: "IP 대역 차단 목록", - hint: "10.0.0.0/8 또는 fd00::/8 같은 IPv4/IPv6 CIDR을 사용하세요. 단일 IP에는 /32 또는 /128을 사용하세요. 저장된 규칙은 프록시를 포함한 새로운 MCP 및 OAuth 요청에 적용됩니다.", + hint: "10.0.0.0/8 또는 fd00::/8 같은 IPv4/IPv6 CIDR을 사용하세요.", entry: "IP 대역 {{index}}", add: "IP 대역 추가", remove: "삭제", @@ -1144,64 +1145,6 @@ export const koKR = { deleted: "태그가 삭제되었습니다.", empty: "설정된 태그가 없습니다.", }, - knowledgeBase: { - title: "지식 베이스 설정", - description: "지식 콘텐츠의 처리 및 검색 방식을 관리합니다.", - embeddingModel: "임베딩 모델", - rerankerModel: "리랭커 모델", - documentParsingEngine: { - title: "문서 파싱 향상 엔진", - provider: "Baizhi Cloud", - defaultDescription: - "아직 설정되지 않았습니다. 내장 기본 파서가 파일에서 일반 텍스트를 추출합니다.", - configuredDescription: - "Baizhi Cloud가 설정되어 업로드한 문서의 파싱을 향상합니다.", - dialogTitle: "문서 파싱 향상 엔진 설정", - dialogDescription: - "MonkeyAI는 기본 문서 파싱을 제공합니다. 복잡한 문서의 텍스트 추출 결과가 충분하지 않을 때 Baizhi Cloud로 파싱을 향상할 수 있습니다.", - providerLabel: "서비스 제공자", - providerDescription: - "Baizhi Cloud · 서비스 주소는 시스템에 고정되어 있어 설정할 필요가 없습니다.", - apiKey: "API 키", - apiKeyPlaceholder: "Baizhi Cloud API 키 입력", - apiKeyUpdatePlaceholder: "현재 키를 유지하려면 비워 두세요", - apiKeyDescription: - "키는 저장할 때만 제출되며 이후 전체가 표시되지 않습니다.", - apiKeyUpdateDescription: "비워 두면 현재 키를 유지합니다.", - }, - contentEnhancementModel: { - title: "콘텐츠 강화 모델", - notConfiguredDescription: - "아직 설정되지 않아 텍스트 요약 등의 강화 콘텐츠를 생성할 수 없습니다.", - dialogTitle: "콘텐츠 강화 모델 설정", - dialogDescription: - "텍스트 요약 등 지식 베이스 강화 콘텐츠를 생성할 언어 모델을 설정합니다. 시스템 모델과 동일한 연결 설정을 사용합니다.", - }, - notConfigured: "아직 설정되지 않음", - configure: "설정", - edit: "설정 수정", - dialogTitle: "{{model}} 설정", - dialogDescription: "모델 엔드포인트와 액세스 자격 증명을 입력합니다.", - model: "모델", - modelId: "모델 ID", - modelIdPlaceholder: "서비스에서 실제 사용하는 모델 ID 입력", - modelIdDescription: - "모델 ID는 서비스에서 정의하므로 선택한 모델 이름과 다를 수 있습니다.", - rerankerModelIdPlaceholder: "예: BAAI/bge-reranker-v2-m3", - embeddingSupportDescription: "현재 bge-m3 모델만 지원됩니다.", - rerankerSupportDescription: - "현재 bge-reranker-v2-m3 모델만 지원됩니다.", - baseUrl: "Base URL", - baseUrlPlaceholder: "https://api.example.com/v1", - apiKey: "API 키", - apiKeyPlaceholder: "모델 API 키 입력", - apiKeyUpdatePlaceholder: "현재 키를 유지하려면 비워 두세요", - apiKeyDescription: - "키는 저장할 때만 제출되며 이후 전체가 표시되지 않습니다.", - apiKeyUpdateDescription: "비워 두면 현재 키를 유지합니다.", - cancel: "취소", - save: "설정 저장", - }, loginMethods: { title: "로그인 방식", description: "시스템에서 지원하는 인증 방식을 설정합니다.", diff --git a/monkeyai/admin/src/i18n/locales/ru-RU.ts b/monkeyai/admin/src/i18n/locales/ru-RU.ts index 4a610edb..fc752cdc 100644 --- a/monkeyai/admin/src/i18n/locales/ru-RU.ts +++ b/monkeyai/admin/src/i18n/locales/ru-RU.ts @@ -1115,11 +1115,12 @@ export const ruRU = { otherSettings: { about: "О программе", mcpNetwork: { - title: "Сетевой доступ MCP", - description: - "Публичные и частные сети разрешены по умолчанию. Адреса из списка блокировки всегда отклоняются.", + title: "Управление сетевым доступом", + blocklist: "Список блокировки сети MCP", + configure: "Настроить", + description: "Доступ запрещён к {{cidrs}}", label: "Список блокировки диапазонов IP", - hint: "Используйте CIDR IPv4/IPv6, например 10.0.0.0/8 или fd00::/8. Для одного IP используйте /32 или /128. Сохранённые правила применяются к новым запросам MCP и OAuth, в том числе через прокси.", + hint: "Используйте CIDR IPv4/IPv6, например 10.0.0.0/8 или fd00::/8.", entry: "Диапазон IP {{index}}", add: "Добавить диапазон IP", remove: "Удалить", @@ -1188,69 +1189,6 @@ export const ruRU = { deleted: "Тег удалён.", empty: "Теги ещё не настроены.", }, - knowledgeBase: { - title: "Настройки базы знаний", - description: "Управляйте обработкой и поиском содержимого базы знаний.", - embeddingModel: "Модель эмбеддингов", - rerankerModel: "Модель реранжирования", - documentParsingEngine: { - title: "Улучшенный анализ документов", - provider: "Baizhi Cloud", - defaultDescription: - "Не настроено. Встроенный анализатор извлечёт из файлов обычный текст.", - configuredDescription: - "Baizhi Cloud настроен и будет улучшать анализ загружаемых документов.", - dialogTitle: "Настроить улучшенный анализ документов", - dialogDescription: - "MonkeyAI включает базовый анализ документов. Если извлечение текста из сложных документов недостаточно качественное, Baizhi Cloud может улучшить результат.", - providerLabel: "Поставщик услуги", - providerDescription: - "Baizhi Cloud · Адрес сервиса задан системой и не требует настройки.", - apiKey: "API-ключ", - apiKeyPlaceholder: "Введите API-ключ Baizhi Cloud", - apiKeyUpdatePlaceholder: - "Оставьте пустым, чтобы сохранить текущий ключ", - apiKeyDescription: - "Ключ передаётся только при сохранении и больше не показывается полностью.", - apiKeyUpdateDescription: - "Оставьте пустым, чтобы сохранить текущий ключ.", - }, - contentEnhancementModel: { - title: "Модель улучшения контента", - notConfiguredDescription: - "Ещё не настроено. Нельзя создавать улучшенный контент, например резюме текста.", - dialogTitle: "Настроить модель улучшения контента", - dialogDescription: - "Настройте языковую модель для создания улучшений базы знаний, например резюме текста. Используются те же параметры подключения, что и для системной модели.", - }, - notConfigured: "Ещё не настроено", - configure: "Настроить", - edit: "Изменить конфигурацию", - dialogTitle: "Настроить {{model}}", - dialogDescription: "Введите адрес модели и учётные данные для доступа.", - model: "Модель", - modelId: "ID модели", - modelIdPlaceholder: "Введите ID модели, используемый сервисом", - modelIdDescription: - "ID задаётся сервисом и может отличаться от названия выбранной модели.", - rerankerModelIdPlaceholder: "Например: BAAI/bge-reranker-v2-m3", - embeddingSupportDescription: - "Сейчас поддерживается только модель bge-m3.", - rerankerSupportDescription: - "Сейчас поддерживается только модель bge-reranker-v2-m3.", - baseUrl: "Base URL", - baseUrlPlaceholder: "https://api.example.com/v1", - apiKey: "API-ключ", - apiKeyPlaceholder: "Введите API-ключ модели", - apiKeyUpdatePlaceholder: - "Оставьте пустым, чтобы сохранить текущий ключ", - apiKeyDescription: - "Ключ передаётся только при сохранении и больше не показывается полностью.", - apiKeyUpdateDescription: - "Оставьте пустым, чтобы сохранить текущий ключ.", - cancel: "Отмена", - save: "Сохранить конфигурацию", - }, loginMethods: { title: "Способы входа", description: diff --git a/monkeyai/admin/src/i18n/locales/zh-CN.ts b/monkeyai/admin/src/i18n/locales/zh-CN.ts index 24a53c3c..a339903f 100644 --- a/monkeyai/admin/src/i18n/locales/zh-CN.ts +++ b/monkeyai/admin/src/i18n/locales/zh-CN.ts @@ -2276,10 +2276,12 @@ export const zhCN = { otherSettings: { about: "关于", mcpNetwork: { - title: "MCP 网络访问", - description: "默认允许访问公网和私网,命中黑名单的地址始终拒绝访问。", + title: "网络访问控制", + blocklist: "MCP 网络黑名单", + configure: "配置", + description: "禁止访问 {{cidrs}}", label: "IP 段黑名单", - hint: "使用 IPv4/IPv6 CIDR,例如 10.0.0.0/8、fd00::/8。单个 IP 使用 /32 或 /128。保存后对新的 MCP 和 OAuth 请求生效,包括代理请求。", + hint: "使用 IPv4/IPv6 CIDR,例如 10.0.0.0/8、fd00::/8。", entry: "IP 段 {{index}}", add: "添加 IP 段", remove: "删除", @@ -2346,57 +2348,6 @@ export const zhCN = { deleted: "标签已删除。", empty: "还没有配置标签。", }, - knowledgeBase: { - title: "知识库设置", - description: "用于管理知识内容的处理与检索能力。", - embeddingModel: "Embedding 模型", - rerankerModel: "Reranker 模型", - documentParsingEngine: { - title: "文档解析增强引擎", - provider: "百智云", - defaultDescription: - "还没配置,将使用内置的基础解析把文件提取为纯文本。", - configuredDescription: "已配置百智云服务,上传文档时将使用增强解析。", - dialogTitle: "配置文档解析增强引擎", - dialogDescription: - "MonkeyAI 默认提供基础文档解析;当复杂文档的纯文本提取效果不理想时,可使用百智云服务增强解析。", - providerLabel: "服务提供方", - providerDescription: "百智云 · 服务地址由系统固定,无需配置。", - apiKey: "API 密钥", - apiKeyPlaceholder: "输入百智云 API 密钥", - apiKeyUpdatePlaceholder: "留空则保留当前密钥", - apiKeyDescription: "密钥只会在保存时提交,之后不会完整显示。", - apiKeyUpdateDescription: "留空将保留当前密钥。", - }, - contentEnhancementModel: { - title: "内容增强模型", - notConfiguredDescription: "还没配置,将无法生成文本摘要等增强内容。", - dialogTitle: "配置内容增强模型", - dialogDescription: - "配置用于生成文本摘要等知识库增强内容的大模型,调用方式与系统大模型一致。", - }, - notConfigured: "还没配置", - configure: "配置", - edit: "修改配置", - dialogTitle: "配置 {{model}}", - dialogDescription: "填写模型的调用地址与访问凭据。", - model: "模型", - modelId: "模型 ID", - modelIdPlaceholder: "输入服务平台实际使用的模型 ID", - modelIdDescription: "模型 ID 由服务平台定义,可以与所选模型名称不同。", - rerankerModelIdPlaceholder: "例如:BAAI/bge-reranker-v2-m3", - embeddingSupportDescription: "目前仅支持 bge-m3 模型。", - rerankerSupportDescription: "目前仅支持 bge-reranker-v2-m3 模型。", - baseUrl: "Base URL", - baseUrlPlaceholder: "https://api.example.com/v1", - apiKey: "API 密钥", - apiKeyPlaceholder: "输入模型 API 密钥", - apiKeyUpdatePlaceholder: "留空则保留当前密钥", - apiKeyDescription: "密钥只会在保存时提交,之后不会完整显示。", - apiKeyUpdateDescription: "留空将保留当前密钥。", - cancel: "取消", - save: "保存配置", - }, loginMethods: { title: "登录方式", description: "配置系统支持的身份验证方式。", diff --git a/monkeyai/admin/src/i18n/locales/zh-TW.ts b/monkeyai/admin/src/i18n/locales/zh-TW.ts index 32fd0b99..34227b5c 100644 --- a/monkeyai/admin/src/i18n/locales/zh-TW.ts +++ b/monkeyai/admin/src/i18n/locales/zh-TW.ts @@ -1080,10 +1080,12 @@ export const zhTW = { otherSettings: { about: "關於", mcpNetwork: { - title: "MCP 網路存取", - description: "預設允許存取公網和私網,符合黑名單的位址一律拒絕存取。", + title: "網路存取控制", + blocklist: "MCP 網路黑名單", + configure: "設定", + description: "禁止存取 {{cidrs}}", label: "IP 網段黑名單", - hint: "使用 IPv4/IPv6 CIDR,例如 10.0.0.0/8、fd00::/8。單一 IP 使用 /32 或 /128。儲存後對新的 MCP 和 OAuth 請求生效,包含代理請求。", + hint: "使用 IPv4/IPv6 CIDR,例如 10.0.0.0/8、fd00::/8。", entry: "IP 網段 {{index}}", add: "新增 IP 網段", remove: "刪除", @@ -1149,57 +1151,6 @@ export const zhTW = { deleted: "標籤已刪除。", empty: "尚未設定標籤。", }, - knowledgeBase: { - title: "知識庫設定", - description: "用於管理知識內容的處理與檢索能力。", - embeddingModel: "Embedding 模型", - rerankerModel: "Reranker 模型", - documentParsingEngine: { - title: "文件解析增強引擎", - provider: "百智雲", - defaultDescription: - "尚未設定,將使用內建的基礎解析把文件擷取為純文字。", - configuredDescription: "已設定百智雲服務,上傳文件時將使用增強解析。", - dialogTitle: "設定文件解析增強引擎", - dialogDescription: - "MonkeyAI 預設提供基礎文件解析;當複雜文件的純文字擷取效果不理想時,可使用百智雲服務增強解析。", - providerLabel: "服務提供者", - providerDescription: "百智雲 · 服務位址由系統固定,無需設定。", - apiKey: "API 金鑰", - apiKeyPlaceholder: "輸入百智雲 API 金鑰", - apiKeyUpdatePlaceholder: "留空則保留目前金鑰", - apiKeyDescription: "金鑰只會在儲存時提交,之後不會完整顯示。", - apiKeyUpdateDescription: "留空將保留目前金鑰。", - }, - contentEnhancementModel: { - title: "內容增強模型", - notConfiguredDescription: "尚未設定,將無法產生文字摘要等增強內容。", - dialogTitle: "設定內容增強模型", - dialogDescription: - "設定用於產生文字摘要等知識庫增強內容的大模型,呼叫方式與系統大模型一致。", - }, - notConfigured: "尚未設定", - configure: "設定", - edit: "修改設定", - dialogTitle: "設定 {{model}}", - dialogDescription: "填寫模型的呼叫位址與存取憑證。", - model: "模型", - modelId: "模型 ID", - modelIdPlaceholder: "輸入服務平台實際使用的模型 ID", - modelIdDescription: "模型 ID 由服務平台定義,可以與所選模型名稱不同。", - rerankerModelIdPlaceholder: "例如:BAAI/bge-reranker-v2-m3", - embeddingSupportDescription: "目前僅支援 bge-m3 模型。", - rerankerSupportDescription: "目前僅支援 bge-reranker-v2-m3 模型。", - baseUrl: "Base URL", - baseUrlPlaceholder: "https://api.example.com/v1", - apiKey: "API 金鑰", - apiKeyPlaceholder: "輸入模型 API 金鑰", - apiKeyUpdatePlaceholder: "留空則保留目前金鑰", - apiKeyDescription: "金鑰只會在儲存時提交,之後不會完整顯示。", - apiKeyUpdateDescription: "留空將保留目前金鑰。", - cancel: "取消", - save: "儲存設定", - }, loginMethods: { title: "登入方式", description: "設定系統支援的身分驗證方式。", diff --git a/monkeyai/admin/src/pages/other-settings-page.tsx b/monkeyai/admin/src/pages/other-settings-page.tsx index 33dbb103..b11c9fe7 100644 --- a/monkeyai/admin/src/pages/other-settings-page.tsx +++ b/monkeyai/admin/src/pages/other-settings-page.tsx @@ -38,7 +38,6 @@ import { Dialog, DialogClose, DialogContent, - DialogDescription, DialogFooter, DialogHeader, DialogTitle, @@ -132,21 +131,8 @@ const ENCRYPTION_OPTIONS = [ }, ] as const -const KNOWLEDGE_MODEL_OPTIONS = { - embeddingModel: [{ value: "bge-m3", label: "bge-m3" }], - rerankerModel: [{ value: "bge-reranker-v2-m3", label: "bge-reranker-v2-m3" }], -} as const - -const KNOWLEDGE_MODEL_PROTOCOLS = [ - { value: "openai-chat-completions", label: "OpenAI Chat Completions" }, - { value: "openai-responses", label: "OpenAI Responses" }, - { value: "anthropic", label: "Anthropic" }, -] as const - type OAuthProvider = (typeof OAUTH_PROVIDERS)[number]["value"] type Encryption = (typeof ENCRYPTION_OPTIONS)[number]["value"] -type KnowledgeModelProtocol = - (typeof KNOWLEDGE_MODEL_PROTOCOLS)[number]["value"] type OAuthConnection = { id: string @@ -227,36 +213,6 @@ type EmailSettings = { encryption: Encryption } -type KnowledgeModelConfig = { - model: string - modelId: string - baseUrl: string - apiKey: string -} - -type DocumentParsingEngineConfig = { - provider: "baizhi" - apiKey: string -} - -type ContentEnhancementModelConfig = { - modelId: string - displayName: string - contextSizeK: number - baseUrl: string - protocol: KnowledgeModelProtocol - apiKey: string -} - -type KnowledgeBaseSettings = { - embeddingModel: KnowledgeModelConfig | null - rerankerModel: KnowledgeModelConfig | null - documentParsingEngine: DocumentParsingEngineConfig | null - contentEnhancementModel: ContentEnhancementModelConfig | null -} - -type KnowledgeModelKind = "embeddingModel" | "rerankerModel" - const INITIAL_OAUTH_CONNECTIONS: OAuthConnection[] = [] const INITIAL_LOGIN_METHOD_SETTINGS: LoginMethodSettings = { @@ -275,13 +231,6 @@ const INITIAL_EMAIL_SETTINGS: EmailSettings = { encryption: "starttls", } -const INITIAL_KNOWLEDGE_BASE_SETTINGS: KnowledgeBaseSettings = { - embeddingModel: null, - rerankerModel: null, - documentParsingEngine: null, - contentEnhancementModel: null, -} - export function OtherSettingsPage() { const { t } = useTranslation() const { showToast } = useAppToast() @@ -332,15 +281,6 @@ export function OtherSettingsPage() { const [emailSaving, setEmailSaving] = useState(false) const [tagSaving, setTagSaving] = useState(false) const [tagDeleting, setTagDeleting] = useState(false) - const [knowledgeBaseSettings, setKnowledgeBaseSettings] = useState( - INITIAL_KNOWLEDGE_BASE_SETTINGS - ) - const [knowledgeModelDialog, setKnowledgeModelDialog] = - useState(null) - const [documentParsingDialogOpen, setDocumentParsingDialogOpen] = - useState(false) - const [contentEnhancementDialogOpen, setContentEnhancementDialogOpen] = - useState(false) const [tagDialogOpen, setTagDialogOpen] = useState(false) const [editingTagId, setEditingTagId] = useState(null) const [tagName, setTagName] = useState("") @@ -727,107 +667,6 @@ export function OtherSettingsPage() { } } - const handleKnowledgeModelSubmit = ( - event: FormEvent, - kind: KnowledgeModelKind - ) => { - event.preventDefault() - - const formData = new FormData(event.currentTarget) - const model = String(formData.get("model") ?? "").trim() - const modelId = String(formData.get("modelId") ?? "").trim() - const baseUrl = String(formData.get("baseUrl") ?? "").trim() - const apiKey = String(formData.get("apiKey") ?? "").trim() - const currentConfig = knowledgeBaseSettings[kind] - const modelSupported = KNOWLEDGE_MODEL_OPTIONS[kind].some( - (option) => option.value === model - ) - - if ( - !modelSupported || - !modelId || - !baseUrl || - (!apiKey && !currentConfig) - ) { - return - } - - setKnowledgeBaseSettings((settings) => ({ - ...settings, - [kind]: { - model, - modelId, - baseUrl, - apiKey: apiKey || currentConfig?.apiKey || "", - }, - })) - setKnowledgeModelDialog(null) - } - - const handleDocumentParsingSubmit = (event: FormEvent) => { - event.preventDefault() - - const formData = new FormData(event.currentTarget) - const apiKey = String(formData.get("apiKey") ?? "").trim() - const currentConfig = knowledgeBaseSettings.documentParsingEngine - - if (!apiKey && !currentConfig) { - return - } - - setKnowledgeBaseSettings((settings) => ({ - ...settings, - documentParsingEngine: { - provider: "baizhi", - apiKey: apiKey || currentConfig?.apiKey || "", - }, - })) - setDocumentParsingDialogOpen(false) - } - - const handleContentEnhancementSubmit = ( - event: FormEvent - ) => { - event.preventDefault() - - const formData = new FormData(event.currentTarget) - const modelId = String(formData.get("modelId") ?? "").trim() - const displayName = String(formData.get("displayName") ?? "").trim() - const contextSizeK = Number(formData.get("contextSizeK")) - const baseUrl = String(formData.get("baseUrl") ?? "").trim() - const protocol = String(formData.get("protocol") ?? "").trim() - const apiKey = String(formData.get("apiKey") ?? "").trim() - const currentConfig = knowledgeBaseSettings.contentEnhancementModel - const protocolSupported = KNOWLEDGE_MODEL_PROTOCOLS.some( - (option) => option.value === protocol - ) - - if ( - !modelId || - !displayName || - !Number.isFinite(contextSizeK) || - contextSizeK <= 0 || - !baseUrl || - !protocolSupported || - (!apiKey && !currentConfig) - ) { - return - } - - setKnowledgeBaseSettings((settings) => ({ - ...settings, - contentEnhancementModel: { - modelId, - displayName, - contextSizeK, - baseUrl, - protocol: protocol as KnowledgeModelProtocol, - apiKey: apiKey || currentConfig?.apiKey || "", - }, - })) - setContentEnhancementDialogOpen(false) - } - const handleTestEmail = async (event: FormEvent) => { event.preventDefault() const formData = new FormData(event.currentTarget) @@ -1192,537 +1031,6 @@ export function OtherSettingsPage() { - - - {t("pages.otherSettings.knowledgeBase.title")} - - {t("pages.otherSettings.knowledgeBase.description")} - - - - - {(["embeddingModel", "rerankerModel"] as KnowledgeModelKind[]).map( - (kind) => { - const config = knowledgeBaseSettings[kind] - const modelOptions = KNOWLEDGE_MODEL_OPTIONS[kind] - const modelName = t(`pages.otherSettings.knowledgeBase.${kind}`) - - return ( - - - {modelName} - - {config ? ( - <> - {config.model} - - {config.modelId} - - {config.baseUrl} - - ) : ( - t("pages.otherSettings.knowledgeBase.notConfigured") - )} - - - - - setKnowledgeModelDialog(open ? kind : null) - } - > - }> - {t( - config - ? "pages.otherSettings.knowledgeBase.edit" - : "pages.otherSettings.knowledgeBase.configure" - )} - - -
- handleKnowledgeModelSubmit(event, kind) - } - > - - - {t( - "pages.otherSettings.knowledgeBase.dialogTitle", - { model: modelName } - )} - - - {t( - "pages.otherSettings.knowledgeBase.dialogDescription" - )} - - - - - - {t("pages.otherSettings.knowledgeBase.model")} - - - - {t( - kind === "embeddingModel" - ? "pages.otherSettings.knowledgeBase.embeddingSupportDescription" - : "pages.otherSettings.knowledgeBase.rerankerSupportDescription" - )} - - - - - {t( - "pages.otherSettings.knowledgeBase.modelId" - )} - - - - {t( - "pages.otherSettings.knowledgeBase.modelIdDescription" - )} - - - - - {t( - "pages.otherSettings.knowledgeBase.baseUrl" - )} - - - - - - {t( - "pages.otherSettings.knowledgeBase.apiKey" - )} - - - - {t( - config - ? "pages.otherSettings.knowledgeBase.apiKeyUpdateDescription" - : "pages.otherSettings.knowledgeBase.apiKeyDescription" - )} - - - - - - } - > - {t("pages.otherSettings.knowledgeBase.cancel")} - - - -
-
-
-
-
- ) - } - )} - - - - {t( - "pages.otherSettings.knowledgeBase.documentParsingEngine.title" - )} - {knowledgeBaseSettings.documentParsingEngine && ( - - {t( - "pages.otherSettings.knowledgeBase.documentParsingEngine.provider" - )} - - )} - - - {t( - knowledgeBaseSettings.documentParsingEngine - ? "pages.otherSettings.knowledgeBase.documentParsingEngine.configuredDescription" - : "pages.otherSettings.knowledgeBase.documentParsingEngine.defaultDescription" - )} - - - - - }> - {t( - knowledgeBaseSettings.documentParsingEngine - ? "pages.otherSettings.knowledgeBase.edit" - : "pages.otherSettings.knowledgeBase.configure" - )} - - -
- - - {t( - "pages.otherSettings.knowledgeBase.documentParsingEngine.dialogTitle" - )} - - - {t( - "pages.otherSettings.knowledgeBase.documentParsingEngine.dialogDescription" - )} - - - - - - {t( - "pages.otherSettings.knowledgeBase.documentParsingEngine.providerLabel" - )} - - - {t( - "pages.otherSettings.knowledgeBase.documentParsingEngine.providerDescription" - )} - - - - - {t( - "pages.otherSettings.knowledgeBase.documentParsingEngine.apiKey" - )} - - - - {t( - knowledgeBaseSettings.documentParsingEngine - ? "pages.otherSettings.knowledgeBase.documentParsingEngine.apiKeyUpdateDescription" - : "pages.otherSettings.knowledgeBase.documentParsingEngine.apiKeyDescription" - )} - - - - - } - > - {t("pages.otherSettings.knowledgeBase.cancel")} - - - -
-
-
-
-
- - - - {t( - "pages.otherSettings.knowledgeBase.contentEnhancementModel.title" - )} - - - {knowledgeBaseSettings.contentEnhancementModel ? ( - <> - - { - knowledgeBaseSettings.contentEnhancementModel - .displayName - } - - - - {knowledgeBaseSettings.contentEnhancementModel.modelId} - - - - { - KNOWLEDGE_MODEL_PROTOCOLS.find( - (option) => - option.value === - knowledgeBaseSettings.contentEnhancementModel - ?.protocol - )?.label - } - - - - {knowledgeBaseSettings.contentEnhancementModel.baseUrl} - - - ) : ( - t( - "pages.otherSettings.knowledgeBase.contentEnhancementModel.notConfiguredDescription" - ) - )} - - - - - }> - {t( - knowledgeBaseSettings.contentEnhancementModel - ? "pages.otherSettings.knowledgeBase.edit" - : "pages.otherSettings.knowledgeBase.configure" - )} - - -
- - - {t( - "pages.otherSettings.knowledgeBase.contentEnhancementModel.dialogTitle" - )} - - - {t( - "pages.otherSettings.knowledgeBase.contentEnhancementModel.dialogDescription" - )} - - - - - - - {t("pages.models.modelId")} - - - - - - {t("pages.models.displayName")} - - - - - - - {t("pages.models.baseUrl")} - - - - - - {t("pages.models.apiKey")} - - - - {t( - knowledgeBaseSettings.contentEnhancementModel - ? "pages.otherSettings.knowledgeBase.apiKeyUpdateDescription" - : "pages.otherSettings.knowledgeBase.apiKeyDescription" - )} - - - - - - {t("pages.models.contextSize")} (K) - - - - - - {t("pages.models.protocol")} - - - - - - - } - > - {t("pages.otherSettings.knowledgeBase.cancel")} - - - -
-
-
-
-
-
-
-
- {t("pages.otherSettings.loginMethods.title")} diff --git a/monkeyai/admin/test/other-settings-i18n.test.mjs b/monkeyai/admin/test/other-settings-i18n.test.mjs index 62453506..f728d6f7 100644 --- a/monkeyai/admin/test/other-settings-i18n.test.mjs +++ b/monkeyai/admin/test/other-settings-i18n.test.mjs @@ -96,7 +96,7 @@ test("email sender identity fields appear at the bottom of the dialog", async () assert.equal(zhTW.pages.otherSettings.email.senderEmail, "發信信箱") }) -test("settings cards place tags and knowledge after email", async () => { +test("settings cards place tags after email and omit knowledge settings", async () => { const source = await readFile( new URL("../src/pages/other-settings-page.tsx", import.meta.url), "utf8" @@ -105,7 +105,7 @@ test("settings cards place tags and knowledge after email", async () => { assert.match(source, /[\s\S]*?loginMethods\.title/) assert.match(source, /[\s\S]*?email\.title/) assert.match(source, /[\s\S]*?skillTags\.title/) - assert.match(source, /[\s\S]*?knowledgeBase\.title/) + assert.doesNotMatch(source, /pages\.otherSettings\.knowledgeBase/) }) test("skill tags use an auto-fit grid without fixed item widths", async () => { @@ -154,18 +154,10 @@ test("settings cards use abstract purpose-oriented descriptions", () => { zhCN.pages.otherSettings.skillTags.description, "用于统一组织和管理系统资源。" ) - assert.equal( - zhCN.pages.otherSettings.knowledgeBase.description, - "用于管理知识内容的处理与检索能力。" - ) assert.equal( zhTW.pages.otherSettings.skillTags.description, "用於統一組織和管理系統資源。" ) - assert.equal( - zhTW.pages.otherSettings.knowledgeBase.description, - "用於管理知識內容的處理與檢索能力。" - ) }) test("email summary hides email-dependent controls when unconfigured", async () => { @@ -324,22 +316,10 @@ test("other settings configuration buttons use the secondary style", async () => "utf8" ) - assert.equal( - ( - source.match( - /DialogTrigger render=\{