mirror of
https://github.com/docmost/docmost.git
synced 2026-09-11 07:56:54 +08:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc3734da86 |
@@ -708,9 +708,9 @@
|
||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP ist nur in der Docmost Enterprise-Edition verfügbar. Kontaktieren Sie sales@docmost.com.",
|
||||
"MCP Server URL": "MCP-Server-URL",
|
||||
"Connect AI assistants with your Docmost account via OAuth.": "Verbinde AI-Assistenten über OAuth mit deinem Docmost-Konto.",
|
||||
"Enforce OAuth": "OAuth erzwingen",
|
||||
"Enforce OAuth": "Enforce OAuth",
|
||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI-Assistenten müssen sich über OAuth mit einem Docmost-Konto verbinden. API-Schlüssel können nicht mit dem MCP-Server verwendet werden.",
|
||||
"Toggle enforce OAuth for MCP": "OAuth-Erzwingung für MCP umschalten",
|
||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
||||
"Supported tools": "Unterstützte Tools",
|
||||
"MCP server URL:": "MCP-Server-URL:",
|
||||
"Learn more": "Mehr erfahren",
|
||||
|
||||
@@ -708,9 +708,9 @@
|
||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP solo está disponible en la edición empresarial de Docmost. Contacte con sales@docmost.com.",
|
||||
"MCP Server URL": "URL del servidor MCP",
|
||||
"Connect AI assistants with your Docmost account via OAuth.": "Conecta asistentes de IA con tu cuenta de Docmost mediante OAuth.",
|
||||
"Enforce OAuth": "Exigir OAuth",
|
||||
"Enforce OAuth": "Enforce OAuth",
|
||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "Los asistentes de IA deben conectarse con una cuenta de Docmost mediante OAuth. No se pueden usar claves API con el servidor MCP.",
|
||||
"Toggle enforce OAuth for MCP": "Activar o desactivar la exigencia de OAuth para MCP",
|
||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
||||
"Supported tools": "Herramientas compatibles",
|
||||
"MCP server URL:": "URL del servidor MCP:",
|
||||
"Learn more": "Más información",
|
||||
|
||||
@@ -708,9 +708,9 @@
|
||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP n'est disponible que dans l'édition Entreprise de Docmost. Contactez sales@docmost.com.",
|
||||
"MCP Server URL": "URL du serveur MCP",
|
||||
"Connect AI assistants with your Docmost account via OAuth.": "Connectez des assistants IA à votre compte Docmost via OAuth.",
|
||||
"Enforce OAuth": "Imposer OAuth",
|
||||
"Enforce OAuth": "Enforce OAuth",
|
||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "Les assistants IA doivent se connecter avec un compte Docmost via OAuth. Les clés API ne peuvent pas être utilisées avec le serveur MCP.",
|
||||
"Toggle enforce OAuth for MCP": "Activer ou désactiver l’imposition d’OAuth pour MCP",
|
||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
||||
"Supported tools": "Outils pris en charge",
|
||||
"MCP server URL:": "URL du serveur MCP :",
|
||||
"Learn more": "En savoir plus",
|
||||
|
||||
@@ -708,9 +708,9 @@
|
||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP è disponibile solo nell'edizione Enterprise di Docmost. Contatta sales@docmost.com.",
|
||||
"MCP Server URL": "URL del server MCP",
|
||||
"Connect AI assistants with your Docmost account via OAuth.": "Connetti gli assistenti AI al tuo account Docmost tramite OAuth.",
|
||||
"Enforce OAuth": "Rendi obbligatorio OAuth",
|
||||
"Enforce OAuth": "Enforce OAuth",
|
||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "Gli assistenti AI devono connettersi con un account Docmost tramite OAuth. Le chiavi API non possono essere utilizzate con il server MCP.",
|
||||
"Toggle enforce OAuth for MCP": "Attiva/disattiva l'obbligo di OAuth per MCP",
|
||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
||||
"Supported tools": "Strumenti supportati",
|
||||
"MCP server URL:": "URL del server MCP:",
|
||||
"Learn more": "Scopri di più",
|
||||
|
||||
@@ -708,9 +708,9 @@
|
||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP は Docmost のエンタープライズ版でのみ利用可能です。sales@docmost.com までお問い合わせください。",
|
||||
"MCP Server URL": "MCP サーバーの URL",
|
||||
"Connect AI assistants with your Docmost account via OAuth.": "OAuth を使用して AI アシスタントを Docmost アカウントに接続します。",
|
||||
"Enforce OAuth": "OAuth を必須化",
|
||||
"Enforce OAuth": "Enforce OAuth",
|
||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI アシスタントは OAuth を使用して Docmost アカウントに接続する必要があります。MCP サーバーでは API キーは使用できません。",
|
||||
"Toggle enforce OAuth for MCP": "MCP の OAuth 必須化を切り替え",
|
||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
||||
"Supported tools": "サポートされているツール",
|
||||
"MCP server URL:": "MCP サーバーの URL:",
|
||||
"Learn more": "詳細を見る",
|
||||
@@ -1191,7 +1191,7 @@
|
||||
"Default value": "デフォルト値",
|
||||
"Delete property": "プロパティを削除",
|
||||
"Delete view": "ビューを削除",
|
||||
"Delete {{count}} rows?_one": "1行を削除しますか?",
|
||||
"Delete {{count}} rows?_one": "Delete 1 row?",
|
||||
"Delete {{count}} rows?_other": "Delete {{count}} rows?",
|
||||
"Descending": "降順",
|
||||
"Discard": "破棄",
|
||||
@@ -1291,9 +1291,9 @@
|
||||
"Value": "値",
|
||||
"View updated for everyone": "ビューが全員向けに更新されました",
|
||||
"You have unsaved changes. Do you want to discard them?": "未保存の変更があります。破棄しますか?",
|
||||
"{{count}} rows deleted_one": "1行を削除しました",
|
||||
"{{count}} rows deleted_one": "1 row deleted",
|
||||
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
||||
"{{count}} selected_one": "1件を選択中",
|
||||
"{{count}} selected_one": "1 selected",
|
||||
"{{count}} selected_other": "{{count}} selected",
|
||||
"Compare": "比較",
|
||||
"Compare versions": "バージョンを比較",
|
||||
|
||||
@@ -708,9 +708,9 @@
|
||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP는 Docmost 엔터프라이즈 에디션에서만 제공됩니다. sales@docmost.com으로 문의하세요.",
|
||||
"MCP Server URL": "MCP 서버 URL",
|
||||
"Connect AI assistants with your Docmost account via OAuth.": "OAuth를 통해 AI 도우미를 Docmost 계정에 연결합니다.",
|
||||
"Enforce OAuth": "OAuth 강제",
|
||||
"Enforce OAuth": "Enforce OAuth",
|
||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI 도우미는 OAuth를 통해 Docmost 계정에 연결해야 합니다. MCP 서버에서는 API 키를 사용할 수 없습니다.",
|
||||
"Toggle enforce OAuth for MCP": "MCP에 대해 OAuth 강제 전환",
|
||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
||||
"Supported tools": "지원되는 도구",
|
||||
"MCP server URL:": "MCP 서버 URL:",
|
||||
"Learn more": "자세히 알아보기",
|
||||
|
||||
@@ -708,9 +708,9 @@
|
||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP is alleen beschikbaar in de Docmost Enterprise-editie. Neem contact op met sales@docmost.com.",
|
||||
"MCP Server URL": "MCP-server-URL",
|
||||
"Connect AI assistants with your Docmost account via OAuth.": "Verbind AI-assistenten met je Docmost-account via OAuth.",
|
||||
"Enforce OAuth": "OAuth afdwingen",
|
||||
"Enforce OAuth": "Enforce OAuth",
|
||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI-assistenten moeten verbinding maken met een Docmost-account via OAuth. API-sleutels kunnen niet worden gebruikt met de MCP-server.",
|
||||
"Toggle enforce OAuth for MCP": "OAuth afdwingen voor MCP in- of uitschakelen",
|
||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
||||
"Supported tools": "Ondersteunde tools",
|
||||
"MCP server URL:": "MCP-server-URL:",
|
||||
"Learn more": "Meer informatie",
|
||||
|
||||
@@ -708,9 +708,9 @@
|
||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "O MCP está disponível apenas na edição empresarial do Docmost. Contate sales@docmost.com.",
|
||||
"MCP Server URL": "URL do servidor MCP",
|
||||
"Connect AI assistants with your Docmost account via OAuth.": "Conecte assistentes de IA à sua conta do Docmost via OAuth.",
|
||||
"Enforce OAuth": "Exigir OAuth",
|
||||
"Enforce OAuth": "Enforce OAuth",
|
||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "Os assistentes de IA devem se conectar com uma conta do Docmost via OAuth. Chaves de API não podem ser usadas com o servidor MCP.",
|
||||
"Toggle enforce OAuth for MCP": "Ativar/desativar exigência de OAuth para MCP",
|
||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
||||
"Supported tools": "Ferramentas compatíveis",
|
||||
"MCP server URL:": "URL do servidor MCP:",
|
||||
"Learn more": "Saiba mais",
|
||||
|
||||
@@ -708,9 +708,9 @@
|
||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP доступен только в корпоративной версии Docmost. Свяжитесь по адресу sales@docmost.com.",
|
||||
"MCP Server URL": "URL сервера MCP",
|
||||
"Connect AI assistants with your Docmost account via OAuth.": "Подключайте AI-помощников к вашей учетной записи Docmost через OAuth.",
|
||||
"Enforce OAuth": "Сделать OAuth обязательным",
|
||||
"Enforce OAuth": "Enforce OAuth",
|
||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI-помощники должны подключаться к учетной записи Docmost через OAuth. Ключи API нельзя использовать с MCP-сервером.",
|
||||
"Toggle enforce OAuth for MCP": "Переключить обязательное использование OAuth для MCP",
|
||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
||||
"Supported tools": "Поддерживаемые инструменты",
|
||||
"MCP server URL:": "URL сервера MCP:",
|
||||
"Learn more": "Подробнее",
|
||||
|
||||
@@ -708,9 +708,9 @@
|
||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP доступний лише в корпоративній редакції Docmost. Зверніться до sales@docmost.com.",
|
||||
"MCP Server URL": "URL сервера MCP",
|
||||
"Connect AI assistants with your Docmost account via OAuth.": "Підключайте AI-асистентів до свого облікового запису Docmost через OAuth.",
|
||||
"Enforce OAuth": "Зробити OAuth обов’язковим",
|
||||
"Enforce OAuth": "Enforce OAuth",
|
||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI-асистенти повинні підключатися до облікового запису Docmost через OAuth. Ключі API не можна використовувати з MCP-сервером.",
|
||||
"Toggle enforce OAuth for MCP": "Увімкнути обов’язковий OAuth для MCP",
|
||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
||||
"Supported tools": "Підтримувані інструменти",
|
||||
"MCP server URL:": "URL сервера MCP:",
|
||||
"Learn more": "Дізнатися більше",
|
||||
|
||||
@@ -708,9 +708,9 @@
|
||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP 仅在 Docmost 企业版中提供。请联系 sales@docmost.com。",
|
||||
"MCP Server URL": "MCP 服务器 URL",
|
||||
"Connect AI assistants with your Docmost account via OAuth.": "通过 OAuth 将 AI 助手连接到你的 Docmost 账户。",
|
||||
"Enforce OAuth": "强制使用 OAuth",
|
||||
"Enforce OAuth": "Enforce OAuth",
|
||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI 助手必须通过 OAuth 使用 Docmost 账户连接。MCP 服务器不能使用 API 密钥。",
|
||||
"Toggle enforce OAuth for MCP": "切换 MCP 的强制使用 OAuth 设置",
|
||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
||||
"Supported tools": "支持的工具",
|
||||
"MCP server URL:": "MCP 服务器 URL:",
|
||||
"Learn more": "了解更多",
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
import React, {
|
||||
useContext,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import {
|
||||
HocuspocusProvider,
|
||||
onAuthenticationFailedParameters,
|
||||
onStatelessParameters,
|
||||
} from "@hocuspocus/provider";
|
||||
import {
|
||||
HocuspocusContext,
|
||||
HocuspocusRoomContext,
|
||||
} from "@hocuspocus/provider-react";
|
||||
|
||||
type CollabRoomProps = {
|
||||
name: string;
|
||||
token: string;
|
||||
flushDelay?: number;
|
||||
onStateless?: (data: onStatelessParameters) => void;
|
||||
onAuthenticationFailed?: (data: onAuthenticationFailedParameters) => void;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* Replaces the library HocuspocusRoom, whose unmount defers provider.destroy()
|
||||
* by a timeout (a StrictMode grace we don't need): a room for the same
|
||||
* document mounting in the same commit then attaches while the old provider is
|
||||
* still registered on the shared socket and crashes with "Cannot attach two
|
||||
* providers with the same effective name". Destroying synchronously preserves
|
||||
* unmount-before-mount ordering, and attach evicts whatever a previously
|
||||
* interrupted teardown left registered.
|
||||
*/
|
||||
export default function CollabRoom({
|
||||
name,
|
||||
token,
|
||||
flushDelay,
|
||||
onStateless,
|
||||
onAuthenticationFailed,
|
||||
children,
|
||||
}: CollabRoomProps) {
|
||||
const context = useContext(HocuspocusContext);
|
||||
if (!context) {
|
||||
throw new Error(
|
||||
"CollabRoom must be used within HocuspocusProviderWebsocketComponent",
|
||||
);
|
||||
}
|
||||
const { websocketProvider } = context;
|
||||
|
||||
const [provider, setProvider] = useState(
|
||||
() =>
|
||||
new HocuspocusProvider({ name, websocketProvider, token, flushDelay }),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
provider.configuration.name !== name ||
|
||||
provider.configuration.token !== token ||
|
||||
provider.configuration.websocketProvider !== websocketProvider
|
||||
) {
|
||||
provider.destroy();
|
||||
setProvider(
|
||||
new HocuspocusProvider({ name, websocketProvider, token, flushDelay }),
|
||||
);
|
||||
}
|
||||
}, [name, token, websocketProvider]);
|
||||
|
||||
useEffect(() => {
|
||||
const providerMap = websocketProvider.configuration.providerMap;
|
||||
const existing = providerMap.get(provider.effectiveName);
|
||||
if (existing && existing !== provider) {
|
||||
try {
|
||||
existing.destroy();
|
||||
} catch {
|
||||
// a broken teardown is exactly why it leaked; the delete below recovers
|
||||
}
|
||||
providerMap.delete(provider.effectiveName);
|
||||
}
|
||||
provider.attach();
|
||||
return () => provider.destroy();
|
||||
}, [provider]);
|
||||
|
||||
const handlersRef = useRef({ onStateless, onAuthenticationFailed });
|
||||
handlersRef.current = { onStateless, onAuthenticationFailed };
|
||||
|
||||
useEffect(() => {
|
||||
const statelessListener = (data: onStatelessParameters) =>
|
||||
handlersRef.current.onStateless?.(data);
|
||||
const authenticationFailedListener = (
|
||||
data: onAuthenticationFailedParameters,
|
||||
) => handlersRef.current.onAuthenticationFailed?.(data);
|
||||
provider.on("stateless", statelessListener);
|
||||
provider.on("authenticationFailed", authenticationFailedListener);
|
||||
return () => {
|
||||
provider.off("stateless", statelessListener);
|
||||
provider.off("authenticationFailed", authenticationFailedListener);
|
||||
};
|
||||
}, [provider]);
|
||||
|
||||
const contextValue = useMemo(() => ({ provider }), [provider]);
|
||||
|
||||
return (
|
||||
<HocuspocusRoomContext.Provider value={contextValue}>
|
||||
{children}
|
||||
</HocuspocusRoomContext.Provider>
|
||||
);
|
||||
}
|
||||
@@ -14,10 +14,10 @@ import {
|
||||
} from "@hocuspocus/provider";
|
||||
import {
|
||||
HocuspocusProviderWebsocketComponent,
|
||||
HocuspocusRoom,
|
||||
useHocuspocusEvent,
|
||||
useHocuspocusProvider,
|
||||
} from "@hocuspocus/provider-react";
|
||||
import CollabRoom from "@/features/editor/collab-room.tsx";
|
||||
import {
|
||||
Editor,
|
||||
EditorContent,
|
||||
@@ -145,7 +145,7 @@ export default function PageEditor({
|
||||
<TransclusionLookupProvider>
|
||||
{collabQuery?.token ? (
|
||||
<HocuspocusProviderWebsocketComponent websocketProvider={socket}>
|
||||
<CollabRoom
|
||||
<HocuspocusRoom
|
||||
name={`page.${pageId}`}
|
||||
token={collabQuery.token}
|
||||
flushDelay={500}
|
||||
@@ -158,7 +158,7 @@ export default function PageEditor({
|
||||
content={content}
|
||||
canComment={canComment}
|
||||
/>
|
||||
</CollabRoom>
|
||||
</HocuspocusRoom>
|
||||
</HocuspocusProviderWebsocketComponent>
|
||||
) : (
|
||||
<StaticPageEditor content={content} ariaLabel={t("Page content")} />
|
||||
|
||||
+1
-1
Submodule apps/server/src/ee updated: cbf35d363a...844f2003cd
Reference in New Issue
Block a user