feat(admin): 调整网络访问控制和系统代理交互,移除知识库设置卡片

This commit is contained in:
monster committed 2026-11-19 12:23:34 +08:00
1 parent cb31e43438
commit 40a0477505
14 files changed
+329 -1470

No files matched your search

@@ -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<string[]>([])
const [rows, setRows] = useState<{ id: number; cidr: string }[]>([])
const [savedCIDRs, setSavedCIDRs] = useState<string[]>([])
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<HTMLFormElement>) => {
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() {
<Card className="order-5">
<CardHeader>
<CardTitle>{t("pages.otherSettings.mcpNetwork.title")}</CardTitle>
<CardDescription>
{t("pages.otherSettings.mcpNetwork.description")}
</CardDescription>
{dirty && (
<CardAction className="flex gap-2">
<Button
type="button"
variant="outline"
disabled={saving}
onClick={() => {
setCIDRs(savedCIDRs)
setError("")
}}
>
{t("pages.otherSettings.mcpNetwork.cancel")}
</Button>
<Button
type="submit"
form="mcp-network-settings"
loading={saving}
disabled={!loaded || saving || cidrs.some((cidr) => !cidr.trim())}
>
{t("pages.otherSettings.mcpNetwork.save")}
</Button>
</CardAction>
)}
</CardHeader>
<CardContent>
<form id="mcp-network-settings" className="space-y-4" onSubmit={submit}>
<Field>
<FieldLabel>{t("pages.otherSettings.mcpNetwork.label")}</FieldLabel>
<FieldDescription>
{t("pages.otherSettings.mcpNetwork.hint")}
</FieldDescription>
{cidrs.map((cidr, index) => (
<div key={index} className="flex items-center gap-2">
<Input
aria-label={t("pages.otherSettings.mcpNetwork.entry", {
index: index + 1,
})}
value={cidr}
placeholder="10.0.0.0/8"
required
disabled={!loaded || saving}
onChange={(event) =>
setCIDRs((items) =>
items.map((item, i) =>
i === index ? event.target.value : item
)
)
}
/>
<Button
type="button"
variant="outline"
disabled={saving}
onClick={() =>
setCIDRs((items) => items.filter((_, i) => i !== index))
}
>
{t("pages.otherSettings.mcpNetwork.remove")}
</Button>
</div>
))}
{loaded && cidrs.length === 0 && (
<p className="text-sm text-muted-foreground">
{t("pages.otherSettings.mcpNetwork.empty")}
</p>
)}
</Field>
<Button
type="button"
variant="outline"
disabled={!loaded || saving}
onClick={() => setCIDRs((items) => [...items, ""])}
<Dialog open={open} onOpenChange={handleOpenChange}>
<Item variant="outline">
<ItemContent className="min-w-0">
<ItemTitle>
{t("pages.otherSettings.mcpNetwork.blocklist")}
</ItemTitle>
{loaded && (
<ItemDescription className="line-clamp-none break-words">
{savedCIDRs.length ? (
<Trans
i18nKey="pages.otherSettings.mcpNetwork.description"
values={{ cidrs: savedCIDRs.join(", ") }}
components={{ ranges: <bdi dir="ltr" /> }}
/>
) : (
t("pages.otherSettings.mcpNetwork.empty")
)}
</ItemDescription>
)}
</ItemContent>
<ItemActions>
<DialogTrigger
disabled={!loaded}
render={<Button variant="secondary" />}
>
{t("pages.otherSettings.mcpNetwork.configure")}
</DialogTrigger>
</ItemActions>
</Item>
<DialogContent
className="flex max-h-[85dvh] flex-col overflow-hidden sm:max-w-lg"
closeLabel={t("common.close")}
showCloseButton={!saving}
>
{t("pages.otherSettings.mcpNetwork.add")}
</Button>
{error && (
<p role="alert" className="text-sm text-destructive">
{error}
</p>
)}
</form>
<DialogHeader>
<DialogTitle>
{t("pages.otherSettings.mcpNetwork.blocklist")}
</DialogTitle>
<DialogDescription>
{t("pages.otherSettings.mcpNetwork.hint")}
</DialogDescription>
</DialogHeader>
<form className="flex min-h-0 flex-col gap-4" onSubmit={submit}>
<fieldset
disabled={saving}
className="flex min-h-0 flex-col gap-4"
>
<ScrollArea className="-me-6 min-h-0 flex-1">
<div className="space-y-3 pe-6">
<div className="overflow-hidden rounded-lg border">
<div className="border-b bg-muted/40 px-4 py-3 text-sm font-medium">
{t("pages.otherSettings.mcpNetwork.label")}
</div>
{rows.length === 0 ? (
<p className="px-4 py-8 text-center text-sm text-muted-foreground">
{t("pages.otherSettings.mcpNetwork.empty")}
</p>
) : (
<ul className="divide-y">
{rows.map((row, index) => {
const label = t(
"pages.otherSettings.mcpNetwork.entry",
{ index: index + 1 }
)
return (
<li
key={row.id}
className="grid grid-cols-[minmax(0,1fr)_2rem] items-center gap-3 px-4 py-3"
>
<Input
aria-label={label}
dir="ltr"
value={row.cidr}
placeholder="10.0.0.0/8"
required
onChange={(event) => {
const cidr = event.target.value
setRows((items) =>
items.map((item) =>
item.id === row.id
? { ...item, cidr }
: item
)
)
setError("")
}}
/>
<Button
type="button"
variant="ghost"
size="icon-sm"
className="text-destructive hover:bg-destructive/10 hover:text-destructive"
aria-label={
t("pages.otherSettings.mcpNetwork.remove") +
" · " +
label
}
onClick={() => {
setRows((items) =>
items.filter((item) => item.id !== row.id)
)
setError("")
}}
>
<HugeiconsIcon
icon={Delete02Icon}
strokeWidth={2}
aria-hidden="true"
/>
</Button>
</li>
)
})}
</ul>
)}
</div>
{error && (
<p role="alert" className="text-sm text-destructive">
{error}
</p>
)}
</div>
</ScrollArea>
<DialogFooter className="shrink-0 sm:justify-between">
<Button
type="button"
variant="outline"
onClick={() => {
setRows((items) => [
...items,
{ id: (items.at(-1)?.id ?? -1) + 1, cidr: "" },
])
setError("")
}}
>
<HugeiconsIcon icon={Add01Icon} aria-hidden="true" />
{t("pages.otherSettings.mcpNetwork.add")}
</Button>
<div className="flex items-center justify-end gap-2">
<DialogClose
render={<Button type="button" variant="outline" />}
>
{t("pages.otherSettings.mcpNetwork.cancel")}
</DialogClose>
<Button
type="submit"
loading={saving}
disabled={
!dirty || saving || cidrs.some((cidr) => !cidr.trim())
}
>
{t("pages.otherSettings.mcpNetwork.save")}
</Button>
</div>
</DialogFooter>
</fieldset>
</form>
</DialogContent>
</Dialog>
{!loaded && error && (
<p role="alert" className="text-sm text-destructive">
{error}
</p>
)}
</CardContent>
</Card>
)
@@ -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() {
</Dialog>
</CardAction>
</CardHeader>
<CardContent className="space-y-4">
<CardContent className="gap-3">
{proxies.map((item) => (
<div
key={item.id}
className="flex items-center justify-between gap-2 rounded-md border p-3"
>
<span className="min-w-0 truncate">
{item.name} · {item.url}
</span>
<div className="flex gap-2">
<Button
type="button"
variant="outline"
size="sm"
disabled={saving}
onClick={() => {
setEditing(item)
setError("")
}}
>
{t("pages.otherSettings.proxies.editAction")}
</Button>
<Button
type="button"
variant="outline"
size="sm"
disabled={saving}
onClick={() => {
if (
window.confirm(
t("pages.otherSettings.proxies.confirmDelete")
)
)
void persist(
proxies.filter((proxy) => proxy.id !== item.id)
)
}}
>
{t("pages.otherSettings.proxies.delete")}
</Button>
<div className="flex min-w-0 items-center gap-1">
<span className="truncate">{item.name}</span>
<HugeiconsIcon
icon={DotIcon}
className="size-4 shrink-0 text-muted-foreground"
aria-hidden="true"
/>
<span className="truncate">{item.url}</span>
</div>
<DropdownMenu>
<DropdownMenuTrigger
disabled={saving}
render={
<Button
type="button"
variant="ghost"
size="icon-sm"
aria-label={`${t("common.more")} · ${item.name}`}
/>
}
>
<HugeiconsIcon
icon={MoreHorizontalIcon}
strokeWidth={2}
aria-hidden="true"
/>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
onClick={() => {
setEditing(item)
setError("")
}}
>
<HugeiconsIcon
icon={Edit02Icon}
strokeWidth={2}
aria-hidden="true"
/>
{t("pages.otherSettings.proxies.editAction")}
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
variant="destructive"
onClick={() => {
if (
window.confirm(
t("pages.otherSettings.proxies.confirmDelete")
)
) {
void persist(
proxies.filter((proxy) => proxy.id !== item.id)
)
}
}}
>
<HugeiconsIcon
icon={Delete02Icon}
strokeWidth={2}
aria-hidden="true"
/>
{t("pages.otherSettings.proxies.delete")}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
))}
{!editing && error && (
+5 -62
View File
@@ -1065,11 +1065,12 @@ export const ar = {
otherSettings: {
about: "حول",
mcpNetwork: {
title: "الوصول إلى شبكة MCP",
description:
"يُسمح بالشبكات العامة والخاصة افتراضيًا. تُرفض العناوين المدرجة في قائمة الحظر دائمًا.",
title: "التحكم في الوصول إلى الشبكة",
blocklist: "قائمة حظر شبكة MCP",
configure: "إعداد",
description: "يُحظر الوصول إلى <ranges>{{cidrs}}</ranges>",
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: "اضبط طرق المصادقة التي يدعمها النظام.",
+5 -69
View File
@@ -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 <ranges>{{cidrs}}</ranges>",
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:
+5 -63
View File
@@ -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 <ranges>{{cidrs}}</ranges>",
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:
+5 -67
View File
@@ -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 <ranges>{{cidrs}}</ranges>",
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:
+5 -67
View File
@@ -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 à <ranges>{{cidrs}}</ranges>",
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:
+5 -62
View File
@@ -1090,11 +1090,12 @@ export const jaJP = {
otherSettings: {
about: "このアプリについて",
mcpNetwork: {
title: "MCP ネットワークアクセス",
description:
"既定ではパブリックおよびプライベートネットワークを許可します。ブロック対象のアドレスは常に拒否されます。",
title: "ネットワークアクセス制御",
blocklist: "MCP ネットワークブロックリスト",
configure: "設定",
description: "<ranges>{{cidrs}}</ranges> へのアクセスを禁止",
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: "システムが対応する認証方法を設定します。",
+5 -62
View File
@@ -1073,11 +1073,12 @@ export const koKR = {
otherSettings: {
about: "정보",
mcpNetwork: {
title: "MCP 네트워크 접근",
description:
"기본적으로 공용 및 사설 네트워크를 허용합니다. 차단 목록의 주소는 항상 거부됩니다.",
title: "네트워크 접근 제어",
blocklist: "MCP 네트워크 차단 목록",
configure: "설정",
description: "접근 차단: <ranges>{{cidrs}}</ranges>",
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: "시스템에서 지원하는 인증 방식을 설정합니다.",
+5 -67
View File
@@ -1115,11 +1115,12 @@ export const ruRU = {
otherSettings: {
about: "О программе",
mcpNetwork: {
title: "Сетевой доступ MCP",
description:
"Публичные и частные сети разрешены по умолчанию. Адреса из списка блокировки всегда отклоняются.",
title: "Управление сетевым доступом",
blocklist: "Список блокировки сети MCP",
configure: "Настроить",
description: "Доступ запрещён к <ranges>{{cidrs}}</ranges>",
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:
+5 -54
View File
@@ -2276,10 +2276,12 @@ export const zhCN = {
otherSettings: {
about: "关于",
mcpNetwork: {
title: "MCP 网络访问",
description: "默认允许访问公网和私网,命中黑名单的地址始终拒绝访问。",
title: "网络访问控制",
blocklist: "MCP 网络黑名单",
configure: "配置",
description: "禁止访问 <ranges>{{cidrs}}</ranges>",
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: "配置系统支持的身份验证方式。",
+5 -54
View File
@@ -1080,10 +1080,12 @@ export const zhTW = {
otherSettings: {
about: "關於",
mcpNetwork: {
title: "MCP 網路存取",
description: "預設允許存取公網和私網,符合黑名單的位址一律拒絕存取。",
title: "網路存取控制",
blocklist: "MCP 網路黑名單",
configure: "設定",
description: "禁止存取 <ranges>{{cidrs}}</ranges>",
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: "設定系統支援的身分驗證方式。",
@@ -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<KnowledgeModelKind | null>(null)
const [documentParsingDialogOpen, setDocumentParsingDialogOpen] =
useState(false)
const [contentEnhancementDialogOpen, setContentEnhancementDialogOpen] =
useState(false)
const [tagDialogOpen, setTagDialogOpen] = useState(false)
const [editingTagId, setEditingTagId] = useState<string | null>(null)
const [tagName, setTagName] = useState("")
@@ -727,107 +667,6 @@ export function OtherSettingsPage() {
}
}
const handleKnowledgeModelSubmit = (
event: FormEvent<HTMLFormElement>,
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<HTMLFormElement>) => {
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<HTMLFormElement>
) => {
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<HTMLFormElement>) => {
event.preventDefault()
const formData = new FormData(event.currentTarget)
@@ -1192,537 +1031,6 @@ export function OtherSettingsPage() {
</AlertDialogContent>
</AlertDialog>
<Card className="order-4">
<CardHeader>
<CardTitle>{t("pages.otherSettings.knowledgeBase.title")}</CardTitle>
<CardDescription>
{t("pages.otherSettings.knowledgeBase.description")}
</CardDescription>
</CardHeader>
<CardContent>
<ItemGroup>
{(["embeddingModel", "rerankerModel"] as KnowledgeModelKind[]).map(
(kind) => {
const config = knowledgeBaseSettings[kind]
const modelOptions = KNOWLEDGE_MODEL_OPTIONS[kind]
const modelName = t(`pages.otherSettings.knowledgeBase.${kind}`)
return (
<Item key={kind} variant="outline">
<ItemContent>
<ItemTitle>{modelName}</ItemTitle>
<ItemDescription>
{config ? (
<>
<bdi>{config.model}</bdi>
<span aria-hidden="true"> · </span>
<bdi>{config.modelId}</bdi>
<span aria-hidden="true"> · </span>
<bdi>{config.baseUrl}</bdi>
</>
) : (
t("pages.otherSettings.knowledgeBase.notConfigured")
)}
</ItemDescription>
</ItemContent>
<ItemActions>
<Dialog
open={knowledgeModelDialog === kind}
onOpenChange={(open) =>
setKnowledgeModelDialog(open ? kind : null)
}
>
<DialogTrigger render={<Button variant="secondary" />}>
{t(
config
? "pages.otherSettings.knowledgeBase.edit"
: "pages.otherSettings.knowledgeBase.configure"
)}
</DialogTrigger>
<DialogContent
className="sm:max-w-lg"
closeLabel={t("common.close")}
>
<form
className="flex flex-col gap-6"
onSubmit={(event) =>
handleKnowledgeModelSubmit(event, kind)
}
>
<DialogHeader>
<DialogTitle>
{t(
"pages.otherSettings.knowledgeBase.dialogTitle",
{ model: modelName }
)}
</DialogTitle>
<DialogDescription>
{t(
"pages.otherSettings.knowledgeBase.dialogDescription"
)}
</DialogDescription>
</DialogHeader>
<FieldGroup className="gap-4">
<Field>
<FieldLabel htmlFor={`${kind}-model`}>
{t("pages.otherSettings.knowledgeBase.model")}
</FieldLabel>
<Select
name="model"
defaultValue={
config?.model ?? modelOptions[0].value
}
items={modelOptions}
>
<SelectTrigger
id={`${kind}-model`}
className="w-full"
>
<SelectValue />
</SelectTrigger>
<SelectContent alignItemWithTrigger={false}>
<SelectGroup>
{modelOptions.map((option) => (
<SelectItem
key={option.value}
value={option.value}
>
{option.label}
</SelectItem>
))}
</SelectGroup>
</SelectContent>
</Select>
<FieldDescription>
{t(
kind === "embeddingModel"
? "pages.otherSettings.knowledgeBase.embeddingSupportDescription"
: "pages.otherSettings.knowledgeBase.rerankerSupportDescription"
)}
</FieldDescription>
</Field>
<Field>
<FieldLabel htmlFor={`${kind}-model-id`}>
{t(
"pages.otherSettings.knowledgeBase.modelId"
)}
</FieldLabel>
<Input
id={`${kind}-model-id`}
name="modelId"
defaultValue={
config?.modelId ?? modelOptions[0].value
}
placeholder={t(
"pages.otherSettings.knowledgeBase.modelIdPlaceholder"
)}
required
/>
<FieldDescription>
{t(
"pages.otherSettings.knowledgeBase.modelIdDescription"
)}
</FieldDescription>
</Field>
<Field>
<FieldLabel htmlFor={`${kind}-base-url`}>
{t(
"pages.otherSettings.knowledgeBase.baseUrl"
)}
</FieldLabel>
<Input
id={`${kind}-base-url`}
name="baseUrl"
type="url"
defaultValue={config?.baseUrl}
placeholder={t(
"pages.otherSettings.knowledgeBase.baseUrlPlaceholder"
)}
required
/>
</Field>
<Field>
<FieldLabel htmlFor={`${kind}-api-key`}>
{t(
"pages.otherSettings.knowledgeBase.apiKey"
)}
</FieldLabel>
<Input
id={`${kind}-api-key`}
name="apiKey"
type="password"
autoComplete="new-password"
placeholder={t(
config
? "pages.otherSettings.knowledgeBase.apiKeyUpdatePlaceholder"
: "pages.otherSettings.knowledgeBase.apiKeyPlaceholder"
)}
required={!config}
/>
<FieldDescription>
{t(
config
? "pages.otherSettings.knowledgeBase.apiKeyUpdateDescription"
: "pages.otherSettings.knowledgeBase.apiKeyDescription"
)}
</FieldDescription>
</Field>
</FieldGroup>
<DialogFooter>
<DialogClose
render={
<Button type="button" variant="outline" />
}
>
{t("pages.otherSettings.knowledgeBase.cancel")}
</DialogClose>
<Button type="submit">
{t("pages.otherSettings.knowledgeBase.save")}
</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
</ItemActions>
</Item>
)
}
)}
<Item variant="outline">
<ItemContent>
<ItemTitle>
{t(
"pages.otherSettings.knowledgeBase.documentParsingEngine.title"
)}
{knowledgeBaseSettings.documentParsingEngine && (
<Badge variant="outline">
{t(
"pages.otherSettings.knowledgeBase.documentParsingEngine.provider"
)}
</Badge>
)}
</ItemTitle>
<ItemDescription>
{t(
knowledgeBaseSettings.documentParsingEngine
? "pages.otherSettings.knowledgeBase.documentParsingEngine.configuredDescription"
: "pages.otherSettings.knowledgeBase.documentParsingEngine.defaultDescription"
)}
</ItemDescription>
</ItemContent>
<ItemActions>
<Dialog
open={documentParsingDialogOpen}
onOpenChange={setDocumentParsingDialogOpen}
>
<DialogTrigger render={<Button variant="secondary" />}>
{t(
knowledgeBaseSettings.documentParsingEngine
? "pages.otherSettings.knowledgeBase.edit"
: "pages.otherSettings.knowledgeBase.configure"
)}
</DialogTrigger>
<DialogContent
className="sm:max-w-lg"
closeLabel={t("common.close")}
>
<form
className="flex flex-col gap-6"
onSubmit={handleDocumentParsingSubmit}
>
<DialogHeader>
<DialogTitle>
{t(
"pages.otherSettings.knowledgeBase.documentParsingEngine.dialogTitle"
)}
</DialogTitle>
<DialogDescription>
{t(
"pages.otherSettings.knowledgeBase.documentParsingEngine.dialogDescription"
)}
</DialogDescription>
</DialogHeader>
<FieldGroup className="gap-4">
<Field>
<FieldLabel>
{t(
"pages.otherSettings.knowledgeBase.documentParsingEngine.providerLabel"
)}
</FieldLabel>
<FieldDescription>
{t(
"pages.otherSettings.knowledgeBase.documentParsingEngine.providerDescription"
)}
</FieldDescription>
</Field>
<Field>
<FieldLabel htmlFor="document-parsing-api-key">
{t(
"pages.otherSettings.knowledgeBase.documentParsingEngine.apiKey"
)}
</FieldLabel>
<Input
id="document-parsing-api-key"
name="apiKey"
type="password"
autoComplete="new-password"
placeholder={t(
knowledgeBaseSettings.documentParsingEngine
? "pages.otherSettings.knowledgeBase.documentParsingEngine.apiKeyUpdatePlaceholder"
: "pages.otherSettings.knowledgeBase.documentParsingEngine.apiKeyPlaceholder"
)}
required={
!knowledgeBaseSettings.documentParsingEngine
}
/>
<FieldDescription>
{t(
knowledgeBaseSettings.documentParsingEngine
? "pages.otherSettings.knowledgeBase.documentParsingEngine.apiKeyUpdateDescription"
: "pages.otherSettings.knowledgeBase.documentParsingEngine.apiKeyDescription"
)}
</FieldDescription>
</Field>
</FieldGroup>
<DialogFooter>
<DialogClose
render={<Button type="button" variant="outline" />}
>
{t("pages.otherSettings.knowledgeBase.cancel")}
</DialogClose>
<Button type="submit">
{t("pages.otherSettings.knowledgeBase.save")}
</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
</ItemActions>
</Item>
<Item variant="outline">
<ItemContent>
<ItemTitle>
{t(
"pages.otherSettings.knowledgeBase.contentEnhancementModel.title"
)}
</ItemTitle>
<ItemDescription>
{knowledgeBaseSettings.contentEnhancementModel ? (
<>
<bdi>
{
knowledgeBaseSettings.contentEnhancementModel
.displayName
}
</bdi>
<span aria-hidden="true"> · </span>
<bdi>
{knowledgeBaseSettings.contentEnhancementModel.modelId}
</bdi>
<span aria-hidden="true"> · </span>
<bdi>
{
KNOWLEDGE_MODEL_PROTOCOLS.find(
(option) =>
option.value ===
knowledgeBaseSettings.contentEnhancementModel
?.protocol
)?.label
}
</bdi>
<span aria-hidden="true"> · </span>
<bdi>
{knowledgeBaseSettings.contentEnhancementModel.baseUrl}
</bdi>
</>
) : (
t(
"pages.otherSettings.knowledgeBase.contentEnhancementModel.notConfiguredDescription"
)
)}
</ItemDescription>
</ItemContent>
<ItemActions>
<Dialog
open={contentEnhancementDialogOpen}
onOpenChange={setContentEnhancementDialogOpen}
>
<DialogTrigger render={<Button variant="secondary" />}>
{t(
knowledgeBaseSettings.contentEnhancementModel
? "pages.otherSettings.knowledgeBase.edit"
: "pages.otherSettings.knowledgeBase.configure"
)}
</DialogTrigger>
<DialogContent
className="max-h-[calc(100vh-2rem)] overflow-y-auto sm:max-w-2xl"
closeLabel={t("common.close")}
>
<form
className="flex flex-col gap-6"
onSubmit={handleContentEnhancementSubmit}
>
<DialogHeader>
<DialogTitle>
{t(
"pages.otherSettings.knowledgeBase.contentEnhancementModel.dialogTitle"
)}
</DialogTitle>
<DialogDescription>
{t(
"pages.otherSettings.knowledgeBase.contentEnhancementModel.dialogDescription"
)}
</DialogDescription>
</DialogHeader>
<FieldGroup className="gap-4">
<FieldGroup className="grid gap-4 sm:grid-cols-2">
<Field>
<FieldLabel htmlFor="enhancement-model-id">
{t("pages.models.modelId")}
</FieldLabel>
<Input
id="enhancement-model-id"
name="modelId"
defaultValue={
knowledgeBaseSettings.contentEnhancementModel
?.modelId
}
placeholder={t("pages.models.modelIdPlaceholder")}
required
/>
</Field>
<Field>
<FieldLabel htmlFor="enhancement-model-display-name">
{t("pages.models.displayName")}
</FieldLabel>
<Input
id="enhancement-model-display-name"
name="displayName"
defaultValue={
knowledgeBaseSettings.contentEnhancementModel
?.displayName
}
placeholder={t(
"pages.models.displayNamePlaceholder"
)}
required
/>
</Field>
</FieldGroup>
<Field>
<FieldLabel htmlFor="enhancement-model-base-url">
{t("pages.models.baseUrl")}
</FieldLabel>
<Input
id="enhancement-model-base-url"
name="baseUrl"
type="url"
defaultValue={
knowledgeBaseSettings.contentEnhancementModel
?.baseUrl
}
placeholder={t("pages.models.baseUrlPlaceholder")}
required
/>
</Field>
<Field>
<FieldLabel htmlFor="enhancement-model-api-key">
{t("pages.models.apiKey")}
</FieldLabel>
<Input
id="enhancement-model-api-key"
name="apiKey"
type="password"
autoComplete="new-password"
placeholder={t(
knowledgeBaseSettings.contentEnhancementModel
? "pages.otherSettings.knowledgeBase.apiKeyUpdatePlaceholder"
: "pages.models.apiKeyPlaceholder"
)}
required={
!knowledgeBaseSettings.contentEnhancementModel
}
/>
<FieldDescription>
{t(
knowledgeBaseSettings.contentEnhancementModel
? "pages.otherSettings.knowledgeBase.apiKeyUpdateDescription"
: "pages.otherSettings.knowledgeBase.apiKeyDescription"
)}
</FieldDescription>
</Field>
<FieldGroup className="grid gap-4 sm:grid-cols-2">
<Field>
<FieldLabel htmlFor="enhancement-model-context-size">
{t("pages.models.contextSize")} (K)
</FieldLabel>
<Input
id="enhancement-model-context-size"
name="contextSizeK"
type="number"
min="1"
step="1"
defaultValue={
knowledgeBaseSettings.contentEnhancementModel
?.contextSizeK ?? 128
}
required
/>
</Field>
<Field>
<FieldLabel htmlFor="enhancement-model-protocol">
{t("pages.models.protocol")}
</FieldLabel>
<Select
name="protocol"
items={KNOWLEDGE_MODEL_PROTOCOLS}
defaultValue={
knowledgeBaseSettings.contentEnhancementModel
?.protocol ??
KNOWLEDGE_MODEL_PROTOCOLS[0].value
}
>
<SelectTrigger
id="enhancement-model-protocol"
className="w-full"
>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectGroup>
{KNOWLEDGE_MODEL_PROTOCOLS.map((option) => (
<SelectItem
key={option.value}
value={option.value}
>
{option.label}
</SelectItem>
))}
</SelectGroup>
</SelectContent>
</Select>
</Field>
</FieldGroup>
</FieldGroup>
<DialogFooter>
<DialogClose
render={<Button type="button" variant="outline" />}
>
{t("pages.otherSettings.knowledgeBase.cancel")}
</DialogClose>
<Button type="submit">
{t("pages.otherSettings.knowledgeBase.save")}
</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
</ItemActions>
</Item>
</ItemGroup>
</CardContent>
</Card>
<Card className="order-1">
<CardHeader>
<CardTitle>{t("pages.otherSettings.loginMethods.title")}</CardTitle>
@@ -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, /<Card className="order-1">[\s\S]*?loginMethods\.title/)
assert.match(source, /<Card className="order-2">[\s\S]*?email\.title/)
assert.match(source, /<Card className="order-3">[\s\S]*?skillTags\.title/)
assert.match(source, /<Card className="order-4">[\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=\{<Button variant="secondary" \/>\}/g
) ?? []
).length,
3
)
assert.match(
source,
/variant="secondary"\s+onClick=\{\(\) => handleEmailDialogOpenChange\(true\)\}/
)
assert.doesNotMatch(
source,
/DialogTrigger render=\{<Button variant="outline" \/>\}[\s\S]*?knowledgeBase\.configure/
)
assert.match(
source,
/type="submit"\s+variant="secondary"\s+disabled=\{testSending\}/