An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Use the SiYuan dialog for remote connections https://github.com/siyuan-note/siyuan/issues/19204
Daniel5dd20b37f0fd
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.jsonindex 21e049bd39..ae4fa5b36b 100644--- a/app/appearance/langs/ar.json+++ b/app/appearance/langs/ar.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "سجل الاتصالات البعيدة","connectRemoteKernel": "الاتصال بنواة بعيدة...","remoteConnection": "بعيد",- "localConnection": "محلي","switchConnectionRestartTip": "يؤدي تبديل الاتصال إلى حفظ مساحات العمل الحالية وإغلاقها ثم إعادة تشغيل عميل سطح المكتب؛ وتستمر النوى البعيدة في العمل","remoteKernelAddressTip": "أدخل عنوان HTTPS دون مسار أو استعلام أو بيانات اعتماد مضمنة","checkingRemoteKernel": "جارٍ التحقق من الاتصال...","remoteKernelVersionMismatch": "يجب أن يتطابق إصدار النواة البعيدة مع إصدار العميل","remoteKernelConnectionFailed": "تعذر الاتصال؛ تحقق من العنوان والشبكة وشهادة TLS",- "backToLocalWorkspace": "العودة إلى مساحة العمل المحلية",- "invalidLocalWorkspace": "حدد مجلد مساحة عمل محلية موجودة","tableCellRichEnable": "تحويل إلى نص منسق","tableCellRichEdit": "تحرير النص المنسق","tableCellRichDisable": "تحويل إلى محتوى ضمن السطر",diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.jsonindex 611ead6de0..fa2ff4195f 100644--- a/app/appearance/langs/de.json+++ b/app/appearance/langs/de.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "Verlauf der Remoteverbindungen","connectRemoteKernel": "Mit entferntem Kernel verbinden...","remoteConnection": "Remote",- "localConnection": "Lokal","switchConnectionRestartTip": "Beim Wechsel werden die aktuellen Arbeitsbereiche gespeichert und geschlossen und der Desktop-Client neu gestartet; entfernte Kernel laufen weiter","remoteKernelAddressTip": "HTTPS-Adresse ohne Pfad, Abfrageparameter oder eingebettete Zugangsdaten eingeben","checkingRemoteKernel": "Verbindung wird geprüft...","remoteKernelVersionMismatch": "Die Version des entfernten Kernels muss mit der Client-Version übereinstimmen","remoteKernelConnectionFailed": "Verbindung fehlgeschlagen; Adresse, Netzwerk und TLS-Zertifikat prüfen",- "backToLocalWorkspace": "Zum lokalen Arbeitsbereich zurückkehren",- "invalidLocalWorkspace": "Wählen Sie einen vorhandenen lokalen Arbeitsbereichsordner","tableCellRichEnable": "In Rich Text umwandeln","tableCellRichEdit": "Rich Text bearbeiten","tableCellRichDisable": "In Inline-Inhalt umwandeln",diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.jsonindex 9665c7c89a..f2e8225a01 100644--- a/app/appearance/langs/en.json+++ b/app/appearance/langs/en.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "Remote connection history","connectRemoteKernel": "Connect to remote kernel...","remoteConnection": "Remote",- "localConnection": "Local","switchConnectionRestartTip": "Switching saves and closes current workspaces, then restarts the desktop client; remote kernels keep running","remoteKernelAddressTip": "Enter an HTTPS origin without a path, query, or embedded credentials","checkingRemoteKernel": "Checking connection...","remoteKernelVersionMismatch": "The remote kernel version must match the client","remoteKernelConnectionFailed": "Unable to connect; check the address, network, and TLS certificate",- "backToLocalWorkspace": "Return to local workspace",- "invalidLocalWorkspace": "Select an existing local workspace directory","tableCellRichEnable": "Convert to rich text","tableCellRichEdit": "Edit rich text","tableCellRichDisable": "Convert to inline content",diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.jsonindex eaa47d0ebc..6a9af45924 100644--- a/app/appearance/langs/es.json+++ b/app/appearance/langs/es.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "Historial de conexiones remotas","connectRemoteKernel": "Conectar a un núcleo remoto...","remoteConnection": "Remoto",- "localConnection": "Local","switchConnectionRestartTip": "Al cambiar de conexión se guardan y cierran los espacios de trabajo actuales y se reinicia el cliente de escritorio; los núcleos remotos siguen funcionando","remoteKernelAddressTip": "Introduce una dirección HTTPS sin ruta, parámetros de consulta ni credenciales incorporadas","checkingRemoteKernel": "Comprobando conexión...","remoteKernelVersionMismatch": "La versión del núcleo remoto debe coincidir con la del cliente","remoteKernelConnectionFailed": "No se puede conectar; comprueba la dirección, la red y el certificado TLS",- "backToLocalWorkspace": "Volver al espacio de trabajo local",- "invalidLocalWorkspace": "Selecciona una carpeta de espacio de trabajo local existente","tableCellRichEnable": "Convertir a texto enriquecido","tableCellRichEdit": "Editar texto enriquecido","tableCellRichDisable": "Convertir a contenido en línea",diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.jsonindex 536616bf50..be2fa11de8 100644--- a/app/appearance/langs/fr.json+++ b/app/appearance/langs/fr.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "Historique des connexions distantes","connectRemoteKernel": "Se connecter à un noyau distant...","remoteConnection": "Distant",- "localConnection": "Local","switchConnectionRestartTip": "Le changement de connexion enregistre et ferme les espaces de travail actuels, puis redémarre le client de bureau ; les noyaux distants restent actifs","remoteKernelAddressTip": "Saisissez une adresse HTTPS sans chemin, paramètres de requête ni identifiants intégrés","checkingRemoteKernel": "Vérification de la connexion...","remoteKernelVersionMismatch": "La version du noyau distant doit correspondre à celle du client","remoteKernelConnectionFailed": "Connexion impossible ; vérifiez l’adresse, le réseau et le certificat TLS",- "backToLocalWorkspace": "Revenir à l’espace de travail local",- "invalidLocalWorkspace": "Sélectionnez le dossier d’un espace de travail local existant","tableCellRichEnable": "Convertir en texte enrichi","tableCellRichEdit": "Modifier le texte enrichi","tableCellRichDisable": "Convertir en contenu en ligne",diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.jsonindex 77638e1b85..67b68fd588 100644--- a/app/appearance/langs/he.json+++ b/app/appearance/langs/he.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "היסטוריית חיבורים מרוחקים","connectRemoteKernel": "התחברות לליבה מרוחקת...","remoteConnection": "מרוחק",- "localConnection": "מקומי","switchConnectionRestartTip": "החלפת החיבור שומרת וסוגרת את סביבות העבודה הנוכחיות ומפעילה מחדש את יישום שולחן העבודה; הליבות המרוחקות ממשיכות לפעול","remoteKernelAddressTip": "יש להזין כתובת HTTPS ללא נתיב, שאילתה או פרטי הזדהות מוטמעים","checkingRemoteKernel": "בודק חיבור...","remoteKernelVersionMismatch": "גרסת הליבה המרוחקת חייבת להתאים לגרסת הלקוח","remoteKernelConnectionFailed": "לא ניתן להתחבר; יש לבדוק את הכתובת, הרשת ותעודת TLS",- "backToLocalWorkspace": "חזרה לסביבת עבודה מקומית",- "invalidLocalWorkspace": "יש לבחור תיקייה קיימת של סביבת עבודה מקומית","tableCellRichEnable": "המרה לטקסט עשיר","tableCellRichEdit": "עריכת טקסט עשיר","tableCellRichDisable": "המרה לתוכן בתוך השורה",diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.jsonindex a6288b8d0a..e7ea095dc0 100644--- a/app/appearance/langs/hi.json+++ b/app/appearance/langs/hi.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "दूरस्थ कनेक्शन इतिहास","connectRemoteKernel": "दूरस्थ कर्नेल से कनेक्ट करें...","remoteConnection": "दूरस्थ",- "localConnection": "स्थानीय","switchConnectionRestartTip": "कनेक्शन बदलने पर मौजूदा कार्यस्थान सहेजकर बंद किए जाते हैं और डेस्कटॉप क्लाइंट फिर से शुरू होता है; दूरस्थ कर्नेल चलते रहते हैं","remoteKernelAddressTip": "पथ, क्वेरी या अंतर्निहित क्रेडेंशियल के बिना HTTPS पता दर्ज करें","checkingRemoteKernel": "कनेक्शन जाँचा जा रहा है...","remoteKernelVersionMismatch": "दूरस्थ कर्नेल का संस्करण क्लाइंट से मेल खाना चाहिए","remoteKernelConnectionFailed": "कनेक्ट नहीं हो सका; पता, नेटवर्क और TLS प्रमाणपत्र जाँचें",- "backToLocalWorkspace": "स्थानीय कार्यस्थान पर लौटें",- "invalidLocalWorkspace": "मौजूदा स्थानीय कार्यस्थान की निर्देशिका चुनें","tableCellRichEnable": "रिच टेक्स्ट में बदलें","tableCellRichEdit": "रिच टेक्स्ट संपादित करें","tableCellRichDisable": "इनलाइन सामग्री में बदलें",diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.jsonindex 71385167b0..afd06a7443 100644--- a/app/appearance/langs/id.json+++ b/app/appearance/langs/id.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "Riwayat koneksi jarak jauh","connectRemoteKernel": "Hubungkan ke kernel jarak jauh...","remoteConnection": "Jarak jauh",- "localConnection": "Lokal","switchConnectionRestartTip": "Pergantian koneksi menyimpan dan menutup ruang kerja saat ini, lalu memulai ulang klien desktop; kernel jarak jauh tetap berjalan","remoteKernelAddressTip": "Masukkan alamat HTTPS tanpa jalur, kueri, atau kredensial tertanam","checkingRemoteKernel": "Memeriksa koneksi...","remoteKernelVersionMismatch": "Versi kernel jarak jauh harus sama dengan klien","remoteKernelConnectionFailed": "Tidak dapat terhubung; periksa alamat, jaringan, dan sertifikat TLS",- "backToLocalWorkspace": "Kembali ke ruang kerja lokal",- "invalidLocalWorkspace": "Pilih direktori ruang kerja lokal yang sudah ada","tableCellRichEnable": "Ubah menjadi teks kaya","tableCellRichEdit": "Edit teks kaya","tableCellRichDisable": "Ubah menjadi konten sebaris",diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.jsonindex 0bd3740dfa..7a567782ce 100644--- a/app/appearance/langs/it.json+++ b/app/appearance/langs/it.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "Cronologia delle connessioni remote","connectRemoteKernel": "Connetti a un kernel remoto...","remoteConnection": "Remoto",- "localConnection": "Locale","switchConnectionRestartTip": "Il cambio di connessione salva e chiude gli spazi di lavoro attuali, poi riavvia il client desktop; i kernel remoti restano in esecuzione","remoteKernelAddressTip": "Inserisci un indirizzo HTTPS senza percorso, query o credenziali incorporate","checkingRemoteKernel": "Verifica della connessione...","remoteKernelVersionMismatch": "La versione del kernel remoto deve corrispondere a quella del client","remoteKernelConnectionFailed": "Connessione impossibile; controlla indirizzo, rete e certificato TLS",- "backToLocalWorkspace": "Torna allo spazio di lavoro locale",- "invalidLocalWorkspace": "Seleziona una cartella di spazio di lavoro locale esistente","tableCellRichEnable": "Converti in testo formattato","tableCellRichEdit": "Modifica testo formattato","tableCellRichDisable": "Converti in contenuto in linea",diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.jsonindex ca788c973d..b16866015e 100644--- a/app/appearance/langs/ja.json+++ b/app/appearance/langs/ja.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "リモート接続履歴","connectRemoteKernel": "リモートカーネルに接続...","remoteConnection": "リモート",- "localConnection": "ローカル","switchConnectionRestartTip": "接続を切り替えると現在のワークスペースを保存して閉じ、デスクトップクライアントを再起動します。リモートカーネルは動作を継続します","remoteKernelAddressTip": "パス、クエリ、認証情報を含まない HTTPS アドレスを入力してください","checkingRemoteKernel": "接続を確認中...","remoteKernelVersionMismatch": "リモートカーネルとクライアントのバージョンを一致させてください","remoteKernelConnectionFailed": "接続できません。アドレス、ネットワーク、TLS 証明書を確認してください",- "backToLocalWorkspace": "ローカルワークスペースに戻る",- "invalidLocalWorkspace": "既存のローカルワークスペースのフォルダーを選択してください","tableCellRichEnable": "リッチテキストに変換","tableCellRichEdit": "リッチテキストを編集","tableCellRichDisable": "インラインコンテンツに変換",diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.jsonindex d1a0d5f574..a32503d464 100644--- a/app/appearance/langs/ko.json+++ b/app/appearance/langs/ko.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "원격 연결 기록","connectRemoteKernel": "원격 커널에 연결...","remoteConnection": "원격",- "localConnection": "로컬","switchConnectionRestartTip": "연결을 전환하면 현재 작업 공간을 저장하고 닫은 후 데스크톱 클라이언트를 다시 시작합니다. 원격 커널은 계속 실행됩니다","remoteKernelAddressTip": "경로, 쿼리 또는 인증 정보가 포함되지 않은 HTTPS 주소를 입력하세요","checkingRemoteKernel": "연결 확인 중...","remoteKernelVersionMismatch": "원격 커널과 클라이언트의 버전이 일치해야 합니다","remoteKernelConnectionFailed": "연결할 수 없습니다. 주소, 네트워크 및 TLS 인증서를 확인하세요",- "backToLocalWorkspace": "로컬 작업 공간으로 돌아가기",- "invalidLocalWorkspace": "기존 로컬 작업 공간 폴더를 선택하세요","tableCellRichEnable": "서식 있는 텍스트로 변환","tableCellRichEdit": "서식 있는 텍스트 편집","tableCellRichDisable": "인라인 콘텐츠로 변환",diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.jsonindex 9885e89eb1..21c8e1c4fa 100644--- a/app/appearance/langs/nl.json+++ b/app/appearance/langs/nl.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "Geschiedenis van externe verbindingen","connectRemoteKernel": "Verbinden met externe kernel...","remoteConnection": "Extern",- "localConnection": "Lokaal","switchConnectionRestartTip": "Bij het wisselen worden de huidige werkruimten opgeslagen en gesloten en wordt de desktopclient herstart; externe kernels blijven actief","remoteKernelAddressTip": "Voer een HTTPS-adres in zonder pad, query of ingesloten inloggegevens","checkingRemoteKernel": "Verbinding controleren...","remoteKernelVersionMismatch": "De versie van de externe kernel moet overeenkomen met die van de client","remoteKernelConnectionFailed": "Verbinding mislukt; controleer het adres, het netwerk en het TLS-certificaat",- "backToLocalWorkspace": "Terug naar lokale werkruimte",- "invalidLocalWorkspace": "Selecteer een bestaande lokale werkruimtemap","tableCellRichEnable": "Omzetten naar opgemaakte tekst","tableCellRichEdit": "Opgemaakte tekst bewerken","tableCellRichDisable": "Omzetten naar inline-inhoud",diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.jsonindex d9cac46994..33cdb2fef4 100644--- a/app/appearance/langs/pl.json+++ b/app/appearance/langs/pl.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "Historia połączeń zdalnych","connectRemoteKernel": "Połącz ze zdalnym jądrem...","remoteConnection": "Zdalne",- "localConnection": "Lokalne","switchConnectionRestartTip": "Zmiana połączenia zapisuje i zamyka bieżące obszary robocze, a następnie uruchamia ponownie klienta; zdalne jądra nadal działają","remoteKernelAddressTip": "Wpisz adres HTTPS bez ścieżki, zapytania ani osadzonych danych logowania","checkingRemoteKernel": "Sprawdzanie połączenia...","remoteKernelVersionMismatch": "Wersja zdalnego jądra musi odpowiadać wersji klienta","remoteKernelConnectionFailed": "Nie można połączyć; sprawdź adres, sieć i certyfikat TLS",- "backToLocalWorkspace": "Wróć do lokalnego obszaru roboczego",- "invalidLocalWorkspace": "Wybierz istniejący katalog lokalnego obszaru roboczego","tableCellRichEnable": "Konwertuj na tekst sformatowany","tableCellRichEdit": "Edytuj tekst sformatowany","tableCellRichDisable": "Konwertuj na treść w wierszu",diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.jsonindex c817402d93..2bd0074e7b 100644--- a/app/appearance/langs/pt-BR.json+++ b/app/appearance/langs/pt-BR.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "Histórico de conexões remotas","connectRemoteKernel": "Conectar ao kernel remoto...","remoteConnection": "Remoto",- "localConnection": "Local","switchConnectionRestartTip": "A troca de conexão salva e fecha os espaços de trabalho atuais e reinicia o cliente de desktop; os kernels remotos continuam em execução","remoteKernelAddressTip": "Insira um endereço HTTPS sem caminho, consulta ou credenciais incorporadas","checkingRemoteKernel": "Verificando conexão...","remoteKernelVersionMismatch": "A versão do kernel remoto deve corresponder à do cliente","remoteKernelConnectionFailed": "Não foi possível conectar; verifique o endereço, a rede e o certificado TLS",- "backToLocalWorkspace": "Voltar ao espaço de trabalho local",- "invalidLocalWorkspace": "Selecione uma pasta de espaço de trabalho local existente","tableCellRichEnable": "Converter em texto formatado","tableCellRichEdit": "Editar texto formatado","tableCellRichDisable": "Converter em conteúdo em linha",diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.jsonindex 1206f05918..52e9a5461b 100644--- a/app/appearance/langs/ru.json+++ b/app/appearance/langs/ru.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "История удалённых подключений","connectRemoteKernel": "Подключиться к удалённому ядру...","remoteConnection": "Удалённое",- "localConnection": "Локальное","switchConnectionRestartTip": "При смене подключения текущие рабочие пространства сохраняются и закрываются, затем клиент перезапускается; удалённые ядра продолжают работать","remoteKernelAddressTip": "Введите адрес HTTPS без пути, параметров запроса и встроенных учётных данных","checkingRemoteKernel": "Проверка подключения...","remoteKernelVersionMismatch": "Версия удалённого ядра должна совпадать с версией клиента","remoteKernelConnectionFailed": "Не удалось подключиться; проверьте адрес, сеть и сертификат TLS",- "backToLocalWorkspace": "Вернуться к локальному рабочему пространству",- "invalidLocalWorkspace": "Выберите папку существующего локального рабочего пространства","tableCellRichEnable": "Преобразовать в форматированный текст","tableCellRichEdit": "Редактировать форматированный текст","tableCellRichDisable": "Преобразовать в строчное содержимое",diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.jsonindex e19e5d629c..444d446230 100644--- a/app/appearance/langs/sk.json+++ b/app/appearance/langs/sk.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "História vzdialených pripojení","connectRemoteKernel": "Pripojiť k vzdialenému jadru...","remoteConnection": "Vzdialené",- "localConnection": "Lokálne","switchConnectionRestartTip": "Zmena pripojenia uloží a zatvorí aktuálne pracovné priestory a reštartuje desktopového klienta; vzdialené jadrá zostanú spustené","remoteKernelAddressTip": "Zadajte adresu HTTPS bez cesty, parametrov dotazu alebo vložených prihlasovacích údajov","checkingRemoteKernel": "Kontroluje sa pripojenie...","remoteKernelVersionMismatch": "Verzia vzdialeného jadra sa musí zhodovať s verziou klienta","remoteKernelConnectionFailed": "Nedá sa pripojiť; skontrolujte adresu, sieť a certifikát TLS",- "backToLocalWorkspace": "Späť do lokálneho pracovného priestoru",- "invalidLocalWorkspace": "Vyberte existujúci priečinok lokálneho pracovného priestoru","tableCellRichEnable": "Previesť na formátovaný text","tableCellRichEdit": "Upraviť formátovaný text","tableCellRichDisable": "Previesť na obsah v riadku",diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.jsonindex 15d19360ea..29cbc70df8 100644--- a/app/appearance/langs/th.json+++ b/app/appearance/langs/th.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "ประวัติการเชื่อมต่อระยะไกล","connectRemoteKernel": "เชื่อมต่อเคอร์เนลระยะไกล...","remoteConnection": "ระยะไกล",- "localConnection": "ภายในเครื่อง","switchConnectionRestartTip": "การสลับการเชื่อมต่อจะบันทึกและปิดพื้นที่ทำงานปัจจุบัน แล้วเริ่มไคลเอนต์เดสก์ท็อปใหม่ โดยเคอร์เนลระยะไกลยังทำงานต่อไป","remoteKernelAddressTip": "ป้อนที่อยู่ HTTPS ที่ไม่มีพาธ คิวรี หรือข้อมูลรับรองฝังอยู่","checkingRemoteKernel": "กำลังตรวจสอบการเชื่อมต่อ...","remoteKernelVersionMismatch": "เวอร์ชันเคอร์เนลระยะไกลต้องตรงกับไคลเอนต์","remoteKernelConnectionFailed": "เชื่อมต่อไม่ได้ โปรดตรวจสอบที่อยู่ เครือข่าย และใบรับรอง TLS",- "backToLocalWorkspace": "กลับไปยังพื้นที่ทำงานในเครื่อง",- "invalidLocalWorkspace": "เลือกโฟลเดอร์พื้นที่ทำงานในเครื่องที่มีอยู่","tableCellRichEnable": "แปลงเป็นข้อความแบบมีรูปแบบ","tableCellRichEdit": "แก้ไขข้อความแบบมีรูปแบบ","tableCellRichDisable": "แปลงเป็นเนื้อหาในบรรทัด",diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.jsonindex 20df37cbcc..76e7d3ec3b 100644--- a/app/appearance/langs/tr.json+++ b/app/appearance/langs/tr.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "Uzak bağlantı geçmişi","connectRemoteKernel": "Uzak çekirdeğe bağlan...","remoteConnection": "Uzak",- "localConnection": "Yerel","switchConnectionRestartTip": "Bağlantı değiştirildiğinde mevcut çalışma alanları kaydedilip kapatılır ve masaüstü istemcisi yeniden başlatılır; uzak çekirdekler çalışmaya devam eder","remoteKernelAddressTip": "Yol, sorgu veya gömülü kimlik bilgisi içermeyen bir HTTPS adresi girin","checkingRemoteKernel": "Bağlantı denetleniyor...","remoteKernelVersionMismatch": "Uzak çekirdek sürümü istemci sürümüyle eşleşmelidir","remoteKernelConnectionFailed": "Bağlanılamadı; adresi, ağı ve TLS sertifikasını denetleyin",- "backToLocalWorkspace": "Yerel çalışma alanına dön",- "invalidLocalWorkspace": "Mevcut bir yerel çalışma alanı dizini seçin","tableCellRichEnable": "Zengin metne dönüştür","tableCellRichEdit": "Zengin metni düzenle","tableCellRichDisable": "Satır içi içeriğe dönüştür",diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.jsonindex 9484fd092d..43106c1884 100644--- a/app/appearance/langs/uk.json+++ b/app/appearance/langs/uk.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "Історія віддалених підключень","connectRemoteKernel": "Підключитися до віддаленого ядра...","remoteConnection": "Віддалене",- "localConnection": "Локальне","switchConnectionRestartTip": "Зміна підключення зберігає та закриває поточні робочі простори й перезапускає настільний клієнт; віддалені ядра продовжують працювати","remoteKernelAddressTip": "Введіть адресу HTTPS без шляху, параметрів запиту та вбудованих облікових даних","checkingRemoteKernel": "Перевірка підключення...","remoteKernelVersionMismatch": "Версія віддаленого ядра має збігатися з версією клієнта","remoteKernelConnectionFailed": "Не вдалося підключитися; перевірте адресу, мережу та сертифікат TLS",- "backToLocalWorkspace": "Повернутися до локального робочого простору",- "invalidLocalWorkspace": "Виберіть папку наявного локального робочого простору","tableCellRichEnable": "Перетворити на форматований текст","tableCellRichEdit": "Редагувати форматований текст","tableCellRichDisable": "Перетворити на вміст у рядку",diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.jsonindex a0c7fe8aa8..dcbd7f3624 100644--- a/app/appearance/langs/zh-CN.json+++ b/app/appearance/langs/zh-CN.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "远程连接历史","connectRemoteKernel": "连接远程内核...","remoteConnection": "远程",- "localConnection": "本地","switchConnectionRestartTip": "切换连接会保存并关闭当前工作空间,然后自动重启桌面客户端;远程内核不受影响","remoteKernelAddressTip": "请输入 HTTPS 地址,不支持路径、查询参数或地址内凭据","checkingRemoteKernel": "正在检查连接...","remoteKernelVersionMismatch": "远程内核版本必须与客户端一致","remoteKernelConnectionFailed": "无法连接,请检查地址、网络和 TLS 证书",- "backToLocalWorkspace": "返回本地工作空间",- "invalidLocalWorkspace": "请选择已有的本地工作空间目录","tableCellRichEnable": "转换为富文本","tableCellRichEdit": "编辑富文本","tableCellRichDisable": "转换为行级内容",diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.jsonindex 5f34e735da..fd0769865f 100644--- a/app/appearance/langs/zh-TW.json+++ b/app/appearance/langs/zh-TW.json@@ -1,14 +1,12 @@{+ "remoteConnectionHistory": "遠端連線記錄","connectRemoteKernel": "連線至遠端核心...","remoteConnection": "遠端",- "localConnection": "本機","switchConnectionRestartTip": "切換連線會儲存並關閉目前工作空間,然後自動重新啟動桌面用戶端;遠端核心不受影響","remoteKernelAddressTip": "請輸入 HTTPS 網址,不支援路徑、查詢參數或網址內的憑證","checkingRemoteKernel": "正在檢查連線...","remoteKernelVersionMismatch": "遠端核心版本必須與用戶端一致","remoteKernelConnectionFailed": "無法連線,請檢查網址、網路和 TLS 憑證",- "backToLocalWorkspace": "返回本機工作空間",- "invalidLocalWorkspace": "請選擇既有的本機工作空間目錄","tableCellRichEnable": "轉換為富文字","tableCellRichEdit": "編輯富文字","tableCellRichDisable": "轉換為行內內容",diff --git a/app/electron/connectionEntry.js b/app/electron/connectionEntry.jsindex 172af0be11..808ee7fee6 100644--- a/app/electron/connectionEntry.js+++ b/app/electron/connectionEntry.js@@ -17,10 +17,10 @@}try {button.textContent = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "appearance", "langs", lang + ".json"),- "utf8")).workspaceList;+ "utf8")).connectRemoteKernel;} catch (error) {button.textContent = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "appearance", "langs", "en.json"),- "utf8")).workspaceList;+ "utf8")).connectRemoteKernel;}};button.style.cssText = "position:fixed;bottom:16px;right:16px;z-index:1000;-webkit-app-region:no-drag;width:auto";diff --git a/app/electron/connectionManager.js b/app/electron/connectionManager.jsindex 16bd217654..498844fd6b 100644--- a/app/electron/connectionManager.js+++ b/app/electron/connectionManager.js@@ -1,4 +1,4 @@-const {app, BrowserWindow, ipcMain, session, net, dialog, safeStorage} = require("electron");+const {app, BrowserWindow, ipcMain, session, net, safeStorage} = require("electron");const crypto = require("node:crypto");const fs = require("node:fs");const path = require("node:path");@@ -9,7 +9,8 @@ const {readConnections, writeConnections, remotePartition} = require("./connecticonst getRemoteSession = (target) => session.fromPartition(remotePartition(target.origin));-const createConnectionManager = ({confDir, languageDir, restart, currentTarget, version, log, showWindow = true}) => {+const createConnectionManager = ({confDir, languageDir, restart, currentTarget, version, log, showWindow = true,+ isTrustedDialogSender = () => false}) => {const file = path.join(confDir, "connections.json");const page = pathToFileURL(path.join(__dirname, "connections.html")).href;let window;@@ -19,6 +20,16 @@ const createConnectionManager = ({confDir, languageDir, restart, currentTarget,let controller;let checkedOrigin;let authenticatedOrigin;+ let dialogSender;+ let dialogFrame;+ const releaseDialog = () => {+ dialogSender?.removeListener("destroyed", releaseDialog);+ dialogSender = undefined;+ dialogFrame = undefined;+ controller?.abort();+ checkedOrigin = undefined;+ authenticatedOrigin = undefined;+ };try {for (const name of fs.readdirSync(confDir)) {if (/^connection-session-[a-f0-9]{48}\.bin$/.test(name)) {@@ -120,25 +131,43 @@ const createConnectionManager = ({confDir, languageDir, restart, currentTarget,}return response;};- const list = () => {- let local = [];- try {- local = JSON.parse(fs.readFileSync(path.join(confDir, "workspace.json"), "utf8"));- } catch (error) {- if (error.code !== "ENOENT") {- throw error;+ const list = () => readConnections(file).origins.map(origin => ({mode: "remote", origin}));+ ipcMain.handle("siyuan-connections", async (event, data) => {+ if (data.cmd === "init" && data.dialog && isTrustedDialogSender(event)) {+ releaseDialog();+ if (window && !window.isDestroyed()) {+ window.close();}+ dialogSender = event.sender;+ dialogFrame = event.senderFrame;+ dialogSender.once("destroyed", releaseDialog);+ language = /^[a-z]{2}(?:-[A-Z]{2})?$/.test(data.lang || "") ? data.lang : app.getLocale();+ initialOrigin = data.origin || currentTarget()?.origin || "";+ initialError = "";}- return [...local.filter(item => typeof item === "string").reverse().map(item => ({mode: "local", path: item})),- ...readConnections(file).origins.map(origin => ({mode: "remote", origin}))];- };- ipcMain.handle("siyuan-connections", async (event, data) => {- // 管理操作仅接受本机管理窗口主框架发出的请求。- if (!window || window.isDestroyed() || event.sender !== window.webContents ||- event.senderFrame !== window.webContents.mainFrame || event.senderFrame.url !== page) {+ // 仅接受已登记的主界面对话框或本机连接页主框架发出的请求。+ const fromDialog = event.sender === dialogSender && event.senderFrame === dialogFrame &&+ isTrustedDialogSender(event);+ const fromWindow = !dialogSender && window && !window.isDestroyed() && event.sender === window.webContents &&+ event.senderFrame === window.webContents.mainFrame && event.senderFrame.url === page;+ if (!fromDialog && !fromWindow) {return {error: "Invalid connection manager sender"};}try {+ if (data.cmd === "close") {+ if (fromDialog) {+ releaseDialog();+ } else {+ window.close();+ }+ return {};+ }+ if (data.cmd === "minimize") {+ if (fromWindow) {+ window.minimize();+ }+ return {};+ }if (data.cmd === "init") {let entries = [];let error = initialError;@@ -162,28 +191,6 @@ const createConnectionManager = ({confDir, languageDir, restart, currentTarget,});return {entries: list()};}- if (data.cmd === "local") {- let workspacePath = data.path;- if (workspacePath === undefined) {- const selected = await dialog.showOpenDialog(window, {properties: ["openDirectory"]});- if (selected.canceled) {- return {};- }- workspacePath = selected.filePaths[0];- }- if (workspacePath) {- try {- if (!path.isAbsolute(workspacePath) || !fs.statSync(workspacePath).isDirectory() ||- !fs.readFileSync(path.join(workspacePath, "conf", "conf.json"), "utf8").includes("kernelVersion")) {- throw new Error("Invalid workspace");- }- } catch (error) {- throw new Error(languages().invalidLocalWorkspace);- }- }- await restart({mode: "local", path: workspacePath, lang: language});- return {};- }let origin;try {origin = normalizeRemoteKernelOrigin(data.origin);@@ -253,6 +260,7 @@ const createConnectionManager = ({confDir, languageDir, restart, currentTarget,}});const show = (options = {}) => {+ releaseDialog();if (window && !window.isDestroyed()) {if (options.origin || options.error) {window.webContents.send("siyuan-connection-target", {origin: options.origin, error: options.error});@@ -267,7 +275,9 @@ const createConnectionManager = ({confDir, languageDir, restart, currentTarget,checkedOrigin = undefined;authenticatedOrigin = undefined;window = new BrowserWindow({width: 720, height: 600, minWidth: 560, minHeight: 480, show: showWindow,- title: languages().workspaceList, autoHideMenuBar: true,+ title: languages().connectRemoteKernel, autoHideMenuBar: true,+ frame: process.platform === "darwin", titleBarStyle: "hidden", fullscreenable: false,+ icon: path.join(__dirname, "..", "stage", "icon-large.png"),webPreferences: {nodeIntegration: true, contextIsolation: false, webSecurity: true,partition: "siyuan-connection-manager"}});window.webContents.on("will-navigate", event => event.preventDefault());diff --git a/app/electron/connectionManager.test.js b/app/electron/connectionManager.test.jsindex 9e953c025a..308c1e09f9 100644--- a/app/electron/connectionManager.test.js+++ b/app/electron/connectionManager.test.js@@ -38,6 +38,7 @@ if (!process.versions.electron) {const requests = [];const restarts = [];let handler;+ let dialogHost;const handle = ipcMain.handle.bind(ipcMain);ipcMain.handle = (name, callback) => {if (name === "siyuan-connections") {@@ -80,6 +81,8 @@ if (!process.versions.electron) {await session.defaultSession.cookies.set({url: origin, name: "legacy", value: "retained", secure: true});const manager = createConnectionManager({confDir: profile, languageDir: path.join(__dirname, "../appearance/langs"),version: "1.0.0", currentTarget: () => ({origin}), log: () => {},+ isTrustedDialogSender: event => dialogHost && event.sender === dialogHost.webContents &&+ event.senderFrame === dialogHost.webContents.mainFrame && event.senderFrame.url.startsWith("data:text/html,"),restart: target => restarts.push(target), showWindow: false});await manager.prepareSession({origin});assert.equal((await remoteSession.cookies.get({url: origin}))[0].value, "retained");@@ -97,6 +100,10 @@ if (!process.versions.electron) {ready();})`);const invoke = data => evaluate(`require("electron").ipcRenderer.invoke("siyuan-connections", ${JSON.stringify(data)})`);+ assert.equal(await evaluate('document.querySelectorAll("#min, #close, .drag").length'), 3);+ assert.equal(await evaluate('document.querySelectorAll("#local, #localDefault").length'), 0);+ fs.writeFileSync(path.join(profile, "workspace.json"), JSON.stringify(["D:/local-workspace"]));+ assert.deepEqual((await invoke({cmd: "init"})).entries, []);assert.ok(await evaluate('document.getElementById("restartTip").textContent.length > 10'));fs.writeFileSync(path.join(os.tmpdir(), "siyuan-connections-preview.png"), (await window.webContents.capturePage()).toPNG());assert.match((await invoke({cmd: "open", origin})).error, /./);@@ -139,7 +146,91 @@ if (!process.versions.electron) {assert.ok((await pending).error);assert.ok((await invoke({cmd: "open", origin})).error);assert.ok(requests.every(item => item.url.startsWith(origin + "/api/system/")));- window.destroy();+ const otherWindow = new BrowserWindow({show: false});+ const closed = new Promise(resolve => window.once("closed", resolve));+ await handler({sender: window.webContents, senderFrame: window.webContents.mainFrame}, {cmd: "close"});+ await closed;+ assert.equal(window.isDestroyed(), true);+ assert.equal(otherWindow.isDestroyed(), false);+ slow = false;+ authenticated = false;+ dialogHost = new BrowserWindow({show: false, width: 900, height: 700,+ webPreferences: {nodeIntegration: true, contextIsolation: false, backgroundThrottling: false, offscreen: true}});+ await dialogHost.loadURL("data:text/html,<html><body></body></html>");+ const runDialog = code => dialogHost.webContents.executeJavaScript(code);+ const ts = require("typescript");+ const compile = name => ts.transpileModule(fs.readFileSync(path.join(__dirname, "../src", name), "utf8"), {+ compilerOptions: {module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020},+ }).outputText;+ const strings = JSON.parse(fs.readFileSync(path.join(__dirname, "../appearance/langs/en.json"), "utf8"));+ await runDialog(`(() => {+ window.siyuan = {languages: ${JSON.stringify(strings)}, config: {lang: "en"}, dialogs: [], zIndex: 1,+ menus: {menu: {element: document.createElement("div"), remove() {}}}};+ const modules = {+ electron: require("electron"),+ "../util/genID": {genUUID: () => "test-dialog"},+ "./moveResize": {moveResize() {}},+ "../util/functions": {isMobile: () => false},+ "../protyle/util/compatibility": {isNotCtrl: event => !event.ctrlKey && !event.metaKey},+ "../constants": {Constants: {TIMEOUT_OPENDIALOG: 0, TIMEOUT_DBLCLICK: 0}},+ };+ const load = source => {+ const exports = {};+ new Function("require", "exports", source)(name => {+ if (!(name in modules)) { throw new Error(name); }+ return modules[name];+ }, exports);+ return exports;+ };+ modules["../util/escape"] = load(${JSON.stringify(compile("util/escape.ts"))});+ modules["./index"] = load(${JSON.stringify(compile("dialog/index.ts"))});+ window.openRemoteConnection = load(${JSON.stringify(compile("dialog/remoteConnection.ts"))}).openRemoteConnection;+ window.openRemoteConnection(${JSON.stringify(origin)});+ })()`);+ const waitDialog = condition => runDialog(`new Promise((resolve, reject) => {+ const timer = setTimeout(() => reject(new Error("Dialog timeout")), 5000);+ const ready = () => {+ if (${condition}) { clearTimeout(timer); resolve(); } else { setTimeout(ready, 20); }+ };+ ready();+ })`);+ await waitDialog('!document.querySelector("[data-field=connect]").disabled');+ assert.equal(await runDialog('document.querySelectorAll(".b3-dialog").length'), 1);+ assert.equal(await runDialog('document.querySelector("[data-field=historySection]").classList.contains("fn__none")'), true);+ if (process.env.SIYUAN_CONNECTION_PREVIEW) {+ const buildDir = path.join(__dirname, "../stage/build/app");+ const index = fs.readFileSync(path.join(buildDir, "index.html"), "utf8");+ const css = index.match(/href="(base\.[^"]+\.css)"/)[1];+ for (const stylesheet of [path.join(buildDir, css), path.join(__dirname, "../appearance/themes/daylight/theme.css")]) {+ await runDialog(`(() => {+ const style = document.createElement("style");+ style.textContent = ${JSON.stringify(fs.readFileSync(stylesheet, "utf8"))};+ document.head.append(style);+ })()`);+ }+ assert.equal(await runDialog('getComputedStyle(document.querySelector("[data-field=auth]")).display'), "none");+ await waitDialog('document.querySelector(".b3-dialog--open")');+ await dialogHost.webContents.insertCSS(":root {--b3-font-size:14px;--b3-font-family:Arial,sans-serif} .b3-dialog__container, .b3-dialog__scrim {transition:none}");+ await new Promise(resolve => setTimeout(resolve, 300));+ fs.writeFileSync(path.join(os.tmpdir(), "siyuan-connection-dialog-preview.png"), (await dialogHost.webContents.capturePage()).toPNG());+ }+ const windowCount = BrowserWindow.getAllWindows().length;+ await runDialog('window.openRemoteConnection(); document.querySelector("[data-field=connect]").click()');+ await waitDialog('!document.querySelector("[data-field=auth]").classList.contains("fn__none")');+ assert.equal(BrowserWindow.getAllWindows().length, windowCount);+ assert.equal(await runDialog('document.querySelectorAll(".b3-dialog").length'), 1);+ await waitDialog('!document.querySelector("[data-field=connect]").disabled');+ await runDialog('document.querySelector("[data-field=authCode]").value = "valid"; document.querySelector("[data-field=connect]").click()');+ await waitDialog('!document.querySelector("[data-field=connect]").disabled');+ assert.equal(restarts.length, 2);+ assert.equal(restarts[1].origin, origin);+ assert.ok((await handler({sender: dialogHost.webContents, senderFrame: {}}, {cmd: "init", dialog: true})).error);+ await runDialog('document.querySelector("[data-field=cancel]").click()');+ await waitDialog('!document.querySelector(".b3-dialog")');+ assert.equal(dialogHost.isDestroyed(), false);+ assert.ok((await handler({sender: dialogHost.webContents, senderFrame: dialogHost.webContents.mainFrame}, {cmd: "open", origin})).error);+ dialogHost.destroy();+ otherWindow.destroy();console.log("Connection manager passed");app.exit(0);} catch (error) {diff --git a/app/electron/connections.css b/app/electron/connections.cssindex 9388aebfce..33ca5810f0 100644--- a/app/electron/connections.css+++ b/app/electron/connections.css@@ -1,5 +1,5 @@-body { margin: 0; font: 14px/1.6 system-ui, sans-serif; color: #222; background: #fff; }-main { max-width: 680px; margin: auto; padding: 24px; }+body { font-size: 14px; line-height: 1.6; text-align: start; }+main { max-width: 680px; margin: auto; padding: 48px 24px 24px; }h1 { font-size: 22px; margin: 0 0 12px; }h2 { font-size: 16px; }p { margin: 8px 0; }diff --git a/app/electron/connections.html b/app/electron/connections.htmlindex c49290e706..40a3e699aa 100644--- a/app/electron/connections.html+++ b/app/electron/connections.html@@ -5,6 +5,7 @@<meta name="color-scheme" content="light dark"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self'; img-src data:"><title>SiYuan</title>+ <link rel="stylesheet" href="window.css"><link rel="stylesheet" href="connections.css"></head><body>@@ -25,8 +26,15 @@<p id="message" role="status" aria-live="polite"></p><h2 id="historyTitle"></h2><div id="history"></div>- <div class="actions"><button id="local" type="button"></button><button id="localDefault" type="button"></button></div></main>+<svg class="svg" id="min" viewBox="0 0 32 32">+ <path d="M1.333 14.667h29.333q1.333 0 1.333 1.333v0q0 1.333-1.333 1.333h-29.333q-1.333 0-1.333-1.333v0q0-1.333 1.333-1.333z"></path>+</svg>+<svg class="svg" id="close" viewBox="0 0 32 32">+ <path d="M32 3.221l-12.779 12.779 12.779 12.779-3.221 3.221-12.779-12.779-12.779 12.779-3.221-3.221 12.779-12.779-12.779-12.779 3.221-3.221 12.779 12.779 12.779-12.779z"></path>+</svg>+<div class="drag"></div>+ <script src="window.js"></script><script src="connections.js"></script></body></html>diff --git a/app/electron/connections.js b/app/electron/connections.jsindex 9c6583169b..cd67efb7a5 100644--- a/app/electron/connections.js+++ b/app/electron/connections.js@@ -1,6 +1,7 @@const {ipcRenderer} = require("electron");const element = (id) => document.getElementById(id);const invoke = (cmd, data = {}) => ipcRenderer.invoke("siyuan-connections", {cmd, ...data});+window.initWindowChrome({close: () => invoke("close"), minimize: () => invoke("minimize")});let languages;let checked = false;let authenticated = false;@@ -37,17 +38,11 @@ const renderHistory = (entries) => {row.className = "entry";const open = document.createElement("button");open.type = "button";- open.textContent = (entry.mode === "remote" ? languages.remoteConnection : languages.localConnection) +- " · " + (entry.origin || entry.path);- open.addEventListener("click", async () => {+ open.textContent = entry.origin;+ open.addEventListener("click", () => {reset();- if (entry.mode === "remote") {- element("origin").value = entry.origin;- element("connectionForm").requestSubmit();- } else {- const result = await invoke("local", {path: entry.path});- message(result.error);- }+ element("origin").value = entry.origin;+ element("connectionForm").requestSubmit();});row.append(open);if (entry.mode === "remote") {@@ -77,14 +72,6 @@ ipcRenderer.on("siyuan-connection-target", (event, data) => {});element("cancel").addEventListener("click", reset);element("refreshCaptcha").addEventListener("click", refreshCaptcha);-element("local").addEventListener("click", async () => {- reset();- message((await invoke("local")).error);-});-element("localDefault").addEventListener("click", async () => {- reset();- message((await invoke("local", {path: ""})).error);-});element("connectionForm").addEventListener("submit", async (event) => {event.preventDefault();const requestSequence = ++sequence;@@ -140,16 +127,14 @@ void invoke("init").then(result => {languages = result.languages;document.documentElement.lang = result.lang;document.documentElement.dir = ["ar", "he"].includes(result.lang) ? "rtl" : "ltr";- document.title = languages.workspaceList;+ document.title = languages.connectRemoteKernel;element("title").textContent = languages.connectRemoteKernel;element("addressLabel").textContent = languages.remoteConnection;element("addressTip").textContent = languages.remoteKernelAddressTip;element("restartTip").textContent = languages.switchConnectionRestartTip;element("connect").textContent = languages.connectRemoteKernel;element("cancel").textContent = languages.cancel;- element("historyTitle").textContent = languages.workspaceList;- element("local").textContent = languages.localConnection + " · " + languages.openBy;- element("localDefault").textContent = languages.backToLocalWorkspace;+ element("historyTitle").textContent = languages.remoteConnectionHistory;element("authCode").placeholder = languages._kernel["173"];element("authCode").ariaLabel = languages._kernel["173"];element("captcha").placeholder = languages._kernel["175"];diff --git a/app/electron/main.js b/app/electron/main.jsindex 5998ca8577..3a9d284fce 100644--- a/app/electron/main.js+++ b/app/electron/main.js@@ -2721,6 +2721,9 @@ app.whenReady().then(() => {languageDir: path.join(appDir, "appearance", "langs"),version: appVer,currentTarget: () => remoteKernelTarget,+ isTrustedDialogSender: event => event.senderFrame === event.sender.mainFrame &&+ !!getWindowKernelTarget(event.sender.id) &&+ getWindowPathname(BrowserWindow.fromWebContents(event.sender)) === "/stage/build/app/",log: writeLog,restart: async (target) => {if (pendingConnectionArgs || updateInstallPromise || systemShutdownState !== systemShutdownNone) {diff --git a/app/electron/remote-auth.html b/app/electron/remote-auth.htmlindex b9f20975a1..ef9899c7af 100644--- a/app/electron/remote-auth.html+++ b/app/electron/remote-auth.html@@ -239,7 +239,7 @@.catch(() => fetch("/appearance/langs/en.json", {cache: "no-store"}).then((response) => response.json())).then((languages) => {document.title = languages._kernel["178"];- document.getElementById("connections").textContent = languages.workspaceList;+ document.getElementById("connections").textContent = languages.connectRemoteKernel;document.getElementById("closeWindow").ariaLabel = languages._kernel["177"];document.getElementById("title").textContent = languages._kernel["176"];document.getElementById("origin").textContent = window.location.origin;diff --git a/app/electron/window.js b/app/electron/window.jsindex 19161d7251..1fb2e7585b 100644--- a/app/electron/window.js+++ b/app/electron/window.js@@ -854,16 +854,24 @@ const chooseWorkspacePath = async (langData) => {};// 窗口通用初始化:macOS body class、关闭/最小化按钮 IPC-const initWindowChrome = () => {+const initWindowChrome = (options = {}) => {const {ipcRenderer} = require("electron");if ("darwin" === process.platform) {document.body.classList.add("darwin");}document.getElementById("close").addEventListener("click", () => {- ipcRenderer.send("siyuan-first-quit");+ if (options.close) {+ options.close();+ } else {+ ipcRenderer.send("siyuan-first-quit");+ }});document.getElementById("min").addEventListener("click", () => {- ipcRenderer.send("siyuan-cmd", "minimize");+ if (options.minimize) {+ options.minimize();+ } else {+ ipcRenderer.send("siyuan-cmd", "minimize");+ }});};diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260903150000-s4hctea.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260903150000-s4hctea.syindex 2298b9047b..bc2f16192f 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260903150000-s4hctea.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20260903150000-s4hctea.sy@@ -6,17 +6,18 @@"id": "20260903150000-s4hctea","title": "Connect to a Remote Kernel","type": "doc",- "updated": "20260908100358"+ "updated": "20260908104736"},"Children": [{"ID": "20260903150000-mz3r596", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-mz3r596", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "Overview"}]},{"ID": "20260903150000-dood0bb", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-dood0bb", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "The desktop app can connect to a SiYuan kernel running on another device and use the local desktop interface for editing. Remote mode only connects to an existing kernel and does not start a kernel on the local device."}]},- {"ID": "20260908100358-97gqv2l", "Type": "NodeHeading", "Properties": {"id": "20260908100358-97gqv2l", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "Connect and switch through the desktop interface"}], "HeadingLevel": 2},+ {"ID": "20260908100358-97gqv2l", "Type": "NodeHeading", "Properties": {"id": "20260908100358-97gqv2l", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "Connection methods"}], "HeadingLevel": 2},+ {"ID": "20260908104736-op9vzxg", "Type": "NodeHeading", "HeadingLevel": 3, "Properties": {"id": "20260908104736-op9vzxg", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "Desktop interface"}]},{"ID": "20260908100358-kpwyker", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-kpwyker", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "In the desktop workspace menu, select "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "Workspaces"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "Connect to remote kernel..."}, {"Type": "NodeText", "Data": ", enter the remote server’s HTTPS address, and connect. The address must not contain a path, query, username, or password. The client checks the kernel version and login state, then displays an access authorization code field when authentication is required. You can choose to remember your login."}]},- {"ID": "20260908100358-nvq3oum", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-nvq3oum", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "The connection window lists local workspaces and remote connection history together. Select a remote address to reconnect, choose an existing local workspace, or return to the last local workspace. Removing a remote history entry only removes its address; it does not delete server data or clear the login session."}]},+ {"ID": "20260908100358-nvq3oum", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-nvq3oum", "updated": "20260908103205"}, "Children": [{"Type": "NodeText", "Data": "The connection window lists remote connection history. Select an address to reconnect or remove a history entry. Removing an entry only removes its address; it does not delete server data or clear the login session."}]},{"ID": "20260908100358-67icxqc", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-67icxqc", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "Switching connections saves and safely closes the open workspaces, then automatically restarts the desktop client with the selected connection. It does not stop or restart remote kernels. Wait for saving and shutdown to finish."}]},- {"ID": "20260908100358-h2ypcuv", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-h2ypcuv", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "The first launch, remote startup, and authentication pages provide access to workspace selection. Connection failures open the connection window, where you can edit the address, retry, or return to a local workspace. Checks can be canceled. Remote history is stored on the client, and authorization codes are not saved as plaintext configuration. GUI connections do not enable remote extension trust by default. Command-line startup remains available."}]},- {"ID": "20260903150000-c2oh8cr", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-c2oh8cr", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "Start"}]},+ {"ID": "20260908100358-h2ypcuv", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-h2ypcuv", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "The first launch, remote startup, and authentication pages provide access to remote connections. Connection failures open the connection window, where you can edit the address, retry, or select another remote connection. Checks can be canceled. Remote history is stored on the client, and authorization codes are not saved as plaintext configuration. GUI connections do not enable remote extension trust by default."}]},+ {"ID": "20260903150000-c2oh8cr", "Type": "NodeHeading", "HeadingLevel": 3, "Properties": {"id": "20260903150000-c2oh8cr", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "Command line"}]},{"ID": "20260903150000-601s61t", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-601s61t", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "After completely exiting the SiYuan desktop client, start the desktop app from a command line and append "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "--remote=https://host[:port]"}, {"Type": "NodeText", "Data": ". If an instance is already running, the single-instance mechanism does not switch its current connection."}]},{"ID": "20260903150000-rir445a", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-rir445a", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "Security and Version"}]},{"ID": "20260903150000-0ekr8rg", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-0ekr8rg", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "Only HTTPS remote addresses are supported, and the client operating system must trust the server's TLS certificate. Connect only to a server you trust. The desktop client and remote kernel versions must match exactly; otherwise, the connection is rejected. The core frontend and sign-in page always come from the client installation package. Remote extension code is disabled by default, and remote HTML embeds are unavailable."}]},diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260903150000-u4065fm.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260903150000-u4065fm.syindex dfaf9c4ff8..2627ae2dad 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260903150000-u4065fm.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20260903150000-u4065fm.sy@@ -6,7 +6,7 @@"id": "20260903150000-u4065fm","title": "连接远程内核","type": "doc",- "updated": "20260908100338"+ "updated": "20260908104736"},"Children": [{@@ -38,23 +38,24 @@}]},- {"ID": "20260908100338-b5ef1sw", "Type": "NodeHeading", "Properties": {"id": "20260908100338-b5ef1sw", "updated": "20260908100338"}, "Children": [{"Type": "NodeText", "Data": "图形界面连接与切换"}], "HeadingLevel": 2},+ {"ID": "20260908100338-b5ef1sw", "Type": "NodeHeading", "Properties": {"id": "20260908100338-b5ef1sw", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "连接方式"}], "HeadingLevel": 2},+ {"ID": "20260908104736-5cp1hsm", "Type": "NodeHeading", "HeadingLevel": 3, "Properties": {"id": "20260908104736-5cp1hsm", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "图形界面"}]},{"ID": "20260908100338-7lr3clk", "Type": "NodeParagraph", "Properties": {"id": "20260908100338-7lr3clk", "updated": "20260908100338"}, "Children": [{"Type": "NodeText", "Data": "在桌面端的工作空间菜单中选择 "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "工作空间"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "连接远程内核..."}, {"Type": "NodeText", "Data": ",输入远程服务器的 HTTPS 地址,然后连接。地址不能包含路径、查询参数或用户名和密码。客户端会检查内核版本和登录状态,需要鉴权时显示访问授权码输入框;可选择记住登录状态。"}]},- {"ID": "20260908100338-yvellnc", "Type": "NodeParagraph", "Properties": {"id": "20260908100338-yvellnc", "updated": "20260908100338"}, "Children": [{"Type": "NodeText", "Data": "连接窗口统一列出本地工作空间和远程连接历史。点击远程地址可重新连接,也可选择已有的本地工作空间或返回上次使用的本地工作空间。移除远程历史只删除地址记录,不删除服务器上的数据或清除登录状态。"}]},+ {"ID": "20260908100338-yvellnc", "Type": "NodeParagraph", "Properties": {"id": "20260908100338-yvellnc", "updated": "20260908103205"}, "Children": [{"Type": "NodeText", "Data": "连接窗口列出远程连接历史。点击地址可重新连接,也可移除历史记录。移除只删除地址记录,不删除服务器上的数据或清除登录状态。"}]},{"ID": "20260908100338-5tea9ns", "Type": "NodeParagraph", "Properties": {"id": "20260908100338-5tea9ns", "updated": "20260908100338"}, "Children": [{"Type": "NodeText", "Data": "切换连接时,客户端会通过保存和安全退出流程关闭当前打开的工作空间,然后自动重启并连接所选目标。远程内核不会因此停止或重启。请等待保存和退出完成。"}]},- {"ID": "20260908100338-ri3ltil", "Type": "NodeParagraph", "Properties": {"id": "20260908100338-ri3ltil", "updated": "20260908100338"}, "Children": [{"Type": "NodeText", "Data": "首次启动页、远程启动等待页和鉴权页提供工作空间入口。连接失败时会打开连接窗口,可修改地址、重试或返回本地;检查过程中可取消。远程连接历史保存在客户端,授权码不会作为明文配置保存。图形界面连接默认不启用远程扩展信任;命令行启动方式仍可使用。"}]},+ {"ID": "20260908100338-ri3ltil", "Type": "NodeParagraph", "Properties": {"id": "20260908100338-ri3ltil", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "首次启动页、远程启动等待页和鉴权页提供远程连接入口。连接失败时会打开连接窗口,可修改地址或重试,也可选择其他远程连接;检查过程中可取消。远程连接历史保存在客户端,授权码不会作为明文配置保存。图形界面连接默认不启用远程扩展信任。"}]},{"ID": "20260903150000-15zokfv","Type": "NodeHeading",- "HeadingLevel": 2,+ "HeadingLevel": 3,"Properties": {"id": "20260903150000-15zokfv",- "updated": "20260903150000"+ "updated": "20260908104736"},"Children": [{"Type": "NodeText",- "Data": "启动方式"+ "Data": "命令行"}]},diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260903150000-3qa6edk.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260903150000-3qa6edk.syindex 1ad7e1ab0e..70e7cdf5f0 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260903150000-3qa6edk.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20260903150000-3qa6edk.sy@@ -6,17 +6,18 @@"id": "20260903150000-3qa6edk","title": "連線至遠端內核","type": "doc",- "updated": "20260908100358"+ "updated": "20260908104736"},"Children": [{"ID": "20260903150000-jrf9aw4", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-jrf9aw4", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "概述"}]},{"ID": "20260903150000-6shebfx", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-6shebfx", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "桌面端可以連線至其他裝置上執行的思源內核,並使用本機桌面介面進行編輯。遠端模式僅用於連線至現有內核,不會在本機啟動內核。"}]},- {"ID": "20260908100358-u9jb6fe", "Type": "NodeHeading", "Properties": {"id": "20260908100358-u9jb6fe", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "圖形介面連線與切換"}], "HeadingLevel": 2},+ {"ID": "20260908100358-u9jb6fe", "Type": "NodeHeading", "Properties": {"id": "20260908100358-u9jb6fe", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "連線方式"}], "HeadingLevel": 2},+ {"ID": "20260908104736-q8215x7", "Type": "NodeHeading", "HeadingLevel": 3, "Properties": {"id": "20260908104736-q8215x7", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "圖形介面"}]},{"ID": "20260908100358-1qurfwt", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-1qurfwt", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "在桌面端的工作空間選單中選擇 "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "工作空間"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "連線至遠端核心..."}, {"Type": "NodeText", "Data": ",輸入遠端伺服器的 HTTPS 網址,然後連線。網址不能包含路徑、查詢參數或使用者名稱和密碼。用戶端會檢查核心版本與登入狀態,需要驗證時顯示存取授權碼輸入框;可選擇記住登入狀態。"}]},- {"ID": "20260908100358-es7xe07", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-es7xe07", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "連線視窗統一列出本機工作空間與遠端連線記錄。點選遠端網址可重新連線,也可選擇既有的本機工作空間或返回上次使用的本機工作空間。移除遠端記錄只刪除網址記錄,不刪除伺服器上的資料或清除登入狀態。"}]},+ {"ID": "20260908100358-es7xe07", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-es7xe07", "updated": "20260908103205"}, "Children": [{"Type": "NodeText", "Data": "連線視窗列出遠端連線記錄。點選網址可重新連線,也可移除記錄。移除只刪除網址記錄,不刪除伺服器上的資料或清除登入狀態。"}]},{"ID": "20260908100358-wba4bpx", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-wba4bpx", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "切換連線時,用戶端會透過儲存與安全結束流程關閉目前開啟的工作空間,然後自動重新啟動並連線至所選目標。遠端核心不會因此停止或重新啟動。請等待儲存與結束完成。"}]},- {"ID": "20260908100358-f7rav2z", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-f7rav2z", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "首次啟動頁、遠端啟動等待頁與驗證頁提供工作空間入口。連線失敗時會開啟連線視窗,可修改網址、重試或返回本機;檢查過程中可取消。遠端連線記錄儲存在用戶端,授權碼不會以明文設定儲存。圖形介面連線預設不啟用遠端擴充套件信任;命令列啟動方式仍可使用。"}]},- {"ID": "20260903150000-o9vrit3", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-o9vrit3", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "啟動方式"}]},+ {"ID": "20260908100358-f7rav2z", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-f7rav2z", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "首次啟動頁、遠端啟動等待頁與驗證頁提供遠端連線入口。連線失敗時會開啟連線視窗,可修改網址或重試,也可選擇其他遠端連線;檢查過程中可取消。遠端連線記錄儲存在用戶端,授權碼不會以明文設定儲存。圖形介面連線預設不啟用遠端擴充套件信任。"}]},+ {"ID": "20260903150000-o9vrit3", "Type": "NodeHeading", "HeadingLevel": 3, "Properties": {"id": "20260903150000-o9vrit3", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "命令列"}]},{"ID": "20260903150000-m5fkfh5", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-m5fkfh5", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "完全結束思源桌面用戶端後,從命令列啟動桌面端並加入參數 "}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "--remote=https://host[:port]"}, {"Type": "NodeText", "Data": "。如果已有執行中的實例,單一實例機制不會切換目前的連線。"}]},{"ID": "20260903150000-l1lghrh", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-l1lghrh", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "安全性與版本"}]},{"ID": "20260903150000-dk8m7z0", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-dk8m7z0", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "僅支援 HTTPS 遠端位址,用戶端作業系統必須信任伺服器使用的 TLS 憑證。請只連線至你信任的伺服器;桌面用戶端與遠端內核的版本必須完全一致,否則無法連線。桌面用戶端始終使用安裝套件內建的核心前端與登入頁面,預設不載入遠端擴充程式碼;遠端 HTML 嵌入內容不可用。"}]},diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260903150000-hpfmx4t.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260903150000-hpfmx4t.syindex 3fecb0b5c1..2441d01d47 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260903150000-hpfmx4t.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20260903150000-hpfmx4t.sy@@ -6,17 +6,18 @@"id": "20260903150000-hpfmx4t","title": "リモートカーネルへの接続","type": "doc",- "updated": "20260908100358"+ "updated": "20260908104736"},"Children": [{"ID": "20260903150000-ekjy0ld", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-ekjy0ld", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "概要"}]},{"ID": "20260903150000-0adfpc3", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-0adfpc3", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "デスクトップ版では、別のデバイスで動作している SiYuan カーネルに接続し、ローカルのデスクトップ UI から編集できます。リモートモードは既存のカーネルへの接続専用であり、ローカルではカーネルを起動しません。"}]},- {"ID": "20260908100358-365wfm2", "Type": "NodeHeading", "Properties": {"id": "20260908100358-365wfm2", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "画面からの接続と切り替え"}], "HeadingLevel": 2},+ {"ID": "20260908100358-365wfm2", "Type": "NodeHeading", "Properties": {"id": "20260908100358-365wfm2", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "接続方法"}], "HeadingLevel": 2},+ {"ID": "20260908104736-r99lh8j", "Type": "NodeHeading", "HeadingLevel": 3, "Properties": {"id": "20260908104736-r99lh8j", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "グラフィカルインターフェース"}]},{"ID": "20260908100358-0tb3jc9", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-0tb3jc9", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "デスクトップのワークスペースメニューで "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "ワークスペース"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "リモートカーネルに接続..."}, {"Type": "NodeText", "Data": " を選択し、リモートサーバーの HTTPS アドレスを入力して接続します。アドレスにパス、クエリ、ユーザー名、パスワードは含められません。クライアントはカーネルのバージョンとログイン状態を確認し、認証が必要な場合はアクセス認証コードの入力欄を表示します。ログイン状態を記憶することもできます。"}]},- {"ID": "20260908100358-tt94c3t", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-tt94c3t", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "接続ウィンドウにはローカルワークスペースとリモート接続履歴がまとめて表示されます。リモートアドレスを選んで再接続するか、既存のローカルワークスペースを選ぶか、最後に使用したローカルワークスペースに戻れます。リモート履歴の削除はアドレスの記録のみを削除し、サーバー上のデータやログイン状態には影響しません。"}]},+ {"ID": "20260908100358-tt94c3t", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-tt94c3t", "updated": "20260908103205"}, "Children": [{"Type": "NodeText", "Data": "接続ウィンドウにはリモート接続履歴が表示されます。アドレスを選んで再接続したり、履歴を削除したりできます。履歴の削除はアドレスの記録のみを削除し、サーバー上のデータやログイン状態には影響しません。"}]},{"ID": "20260908100358-z5xdi86", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-z5xdi86", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "接続を切り替えると、開いているワークスペースを保存して安全に終了した後、デスクトップクライアントが自動的に再起動し、選択した接続先を開きます。リモートカーネルは停止も再起動もしません。保存と終了が完了するまでお待ちください。"}]},- {"ID": "20260908100358-4piqgjo", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-4piqgjo", "updated": "20260908100358"}, "Children": [{"Type": "NodeText", "Data": "初回起動画面、リモート起動待機画面、認証画面からワークスペースを選択できます。接続に失敗すると接続ウィンドウが開き、アドレスの変更、再試行、ローカルへの復帰ができます。確認中の処理はキャンセルできます。リモート接続履歴はクライアントに保存され、認証コードを平文の設定として保存することはありません。画面からの接続では、リモート拡張機能への信頼は既定で無効です。コマンドラインからの起動も引き続き利用できます。"}]},- {"ID": "20260903150000-c8khz3k", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-c8khz3k", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "起動方法"}]},+ {"ID": "20260908100358-4piqgjo", "Type": "NodeParagraph", "Properties": {"id": "20260908100358-4piqgjo", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "初回起動画面、リモート起動待機画面、認証画面からリモート接続を開けます。接続に失敗すると接続ウィンドウが開き、アドレスの変更、再試行、別のリモート接続の選択ができます。確認中の処理はキャンセルできます。リモート接続履歴はクライアントに保存され、認証コードを平文の設定として保存することはありません。画面からの接続では、リモート拡張機能への信頼は既定で無効です。"}]},+ {"ID": "20260903150000-c8khz3k", "Type": "NodeHeading", "HeadingLevel": 3, "Properties": {"id": "20260903150000-c8khz3k", "updated": "20260908104736"}, "Children": [{"Type": "NodeText", "Data": "コマンドライン"}]},{"ID": "20260903150000-bqc7crd", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-bqc7crd", "updated": "20260903150000"}, "Children": [{"Type": "NodeText", "Data": "SiYuan デスクトップクライアントを完全に終了してから、コマンドラインでデスクトップ版を起動し、"}, {"Type": "NodeTextMark", "TextMarkType": "code", "TextMarkTextContent": "--remote=https://host[:port]"}, {"Type": "NodeText", "Data": " パラメーターを追加します。既存のインスタンスが実行中の場合、シングルインスタンス機構によって現在の接続先が切り替わることはありません。"}]},{"ID": "20260903150000-csljqix", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260903150000-csljqix", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "セキュリティとバージョン"}]},{"ID": "20260903150000-1qj316h", "Type": "NodeParagraph", "Properties": {"id": "20260903150000-1qj316h", "updated": "20260908082237"}, "Children": [{"Type": "NodeText", "Data": "リモートアドレスには HTTPS のみを使用でき、クライアントのオペレーティングシステムがサーバーの TLS 証明書を信頼している必要があります。信頼できるサーバーにのみ接続してください。デスクトップクライアントとリモートカーネルのバージョンは完全に一致している必要があります。一致しない場合は接続できません。コアフロントエンドとログインページは常にクライアントのインストールパッケージから読み込みます。リモート拡張機能のコードは既定では読み込まず、リモート HTML の埋め込みは利用できません。"}]},diff --git a/app/src/dialog/remoteConnection.ts b/app/src/dialog/remoteConnection.tsnew file mode 100644index 0000000000..43379954c9--- /dev/null+++ b/app/src/dialog/remoteConnection.ts@@ -0,0 +1,226 @@+import {ipcRenderer} from "electron";+import {Dialog} from "./index";+import {escapeAttr, escapeHtml} from "../util/escape";++let activeDialog: Dialog;++export const openRemoteConnection = (initialOrigin = "") => {+ if (activeDialog) {+ activeDialog.element.querySelector<HTMLInputElement>("[data-field='origin']").focus();+ return;+ }+ const languages = window.siyuan.languages;+ const invoke = (cmd: string, data = {}) => ipcRenderer.invoke("siyuan-connections", {cmd, ...data});+ let sequence = 0;+ let closed = false;+ let checked = false;+ let authenticated = false;+ let initialized = false;+ const dialog = new Dialog({+ title: escapeHtml(languages.connectRemoteKernel),+ width: "600px",+ content: `<div class="b3-dialog__content">+ <div class="ft__on-surface">${escapeHtml(languages.switchConnectionRestartTip)}</div>+ <div class="fn__hr"></div>+ <form>+ <input data-field="origin" class="b3-text-field fn__block" type="url" placeholder="https://siyuan.example.com" required aria-label="${escapeAttr(escapeHtml(languages.remoteConnection))}">+ <div class="fn__hr"></div>+ <div class="ft__on-surface">${escapeHtml(languages.remoteKernelAddressTip)}</div>+ <div data-field="auth" class="fn__none">+ <div class="fn__hr"></div>+ <input data-field="authCode" class="b3-text-field fn__block" type="password" autocomplete="current-password">+ <div data-field="captchaRow" class="fn__none">+ <div class="fn__hr"></div>+ <div class="fn__flex">+ <input data-field="captcha" class="b3-text-field fn__flex-1" autocomplete="off">+ <div class="fn__space"></div>+ <button data-field="refreshCaptcha" class="b3-button b3-button--outline" type="button"><img data-field="captchaImage"></button>+ </div>+ </div>+ <div class="fn__hr"></div>+ <label class="fn__flex"><input data-field="rememberMe" type="checkbox" class="b3-switch"><span class="fn__space"></span><span data-field="rememberLabel"></span></label>+ </div>+ <button type="submit" class="fn__none" tabindex="-1"></button>+ </form>+ <div data-field="message" class="ft__error" style="white-space:pre-wrap;margin-top:8px" role="status" aria-live="polite"></div>+ <div data-field="historySection" class="fn__none">+ <div class="fn__hr"></div>+ <div class="ft__on-surface">${escapeHtml(languages.remoteConnectionHistory)}</div>+ <div data-field="history" class="b3-list" style="max-height:200px;overflow:auto"></div>+ </div>+</div>+<div class="b3-dialog__action">+ <button data-field="cancel" class="b3-button b3-button--cancel">${escapeHtml(languages.cancel)}</button>+ <div class="fn__space"></div>+ <button data-field="connect" class="b3-button b3-button--text" disabled>${escapeHtml(languages.connectRemoteKernel)}</button>+</div>`,+ destroyCallback: () => {+ closed = true;+ sequence++;+ activeDialog = undefined;+ void invoke("close");+ },+ });+ activeDialog = dialog;+ const field = <T extends HTMLElement = HTMLElement>(name: string) =>+ dialog.element.querySelector<T>(`[data-field="${name}"]`);+ const origin = field<HTMLInputElement>("origin");+ const authCode = field<HTMLInputElement>("authCode");+ const captcha = field<HTMLInputElement>("captcha");+ const connect = field<HTMLButtonElement>("connect");+ const form = dialog.element.querySelector("form");+ const message = (value = "", error = true) => {+ field("message").textContent = value;+ field("message").classList.toggle("ft__error", error);+ };+ const reset = () => {+ sequence++;+ checked = false;+ authenticated = false;+ field("auth").classList.add("fn__none");+ field("captchaRow").classList.add("fn__none");+ authCode.value = "";+ captcha.value = "";+ connect.disabled = !initialized;+ message();+ void invoke("cancel");+ };+ const refreshCaptcha = async () => {+ const requestSequence = sequence;+ try {+ const result = await invoke("captcha", {origin: origin.value.trim()});+ if (closed || sequence !== requestSequence) {+ return;+ }+ if (result.image) {+ field<HTMLImageElement>("captchaImage").src = result.image;+ } else {+ message(result.error);+ }+ } catch (error) {+ if (!closed && sequence === requestSequence) {+ message(String(error.message));+ }+ }+ };+ const renderHistory = (entries: {origin: string}[]) => {+ field("historySection").classList.toggle("fn__none", entries.length === 0);+ field("history").replaceChildren();+ entries.forEach(entry => {+ const row = document.createElement("div");+ row.className = "fn__flex";+ const open = document.createElement("button");+ open.className = "b3-list-item fn__flex-1";+ open.textContent = entry.origin;+ open.addEventListener("click", () => {+ reset();+ origin.value = entry.origin;+ form.requestSubmit();+ });+ const remove = document.createElement("button");+ remove.className = "b3-button b3-button--outline";+ remove.textContent = languages.remove;+ remove.addEventListener("click", async () => {+ try {+ const result = await invoke("remove", {origin: entry.origin});+ if (!closed) {+ if (result.entries) {+ renderHistory(result.entries);+ }+ message(result.error);+ }+ } catch (error) {+ if (!closed) {+ message(String(error.message));+ }+ }+ });+ row.append(open, remove);+ field("history").append(row);+ });+ };+ form.addEventListener("submit", async event => {+ event.preventDefault();+ if (connect.disabled || closed) {+ return;+ }+ const requestSequence = ++sequence;+ const address = origin.value.trim();+ connect.disabled = true;+ message(languages.checkingRemoteKernel, false);+ try {+ let result;+ if (!checked) {+ result = await invoke("check", {origin: address});+ } else if (!authenticated) {+ result = await invoke("login", {origin: address, authCode: authCode.value.trim(),+ captcha: captcha.value, rememberMe: field<HTMLInputElement>("rememberMe").checked});+ authCode.value = "";+ } else {+ result = {authenticated: true};+ }+ if (closed || sequence !== requestSequence) {+ return;+ }+ if (typeof result.authenticated === "boolean") {+ checked = true;+ authenticated = result.authenticated;+ }+ if (authenticated) {+ const opened = await invoke("open", {origin: address});+ if (!closed && sequence === requestSequence) {+ message(opened.error || languages.switchConnectionRestartTip, !!opened.error);+ }+ } else {+ message(result.error);+ field("auth").classList.toggle("fn__none", !checked);+ if (result.captcha) {+ field("captchaRow").classList.remove("fn__none");+ await refreshCaptcha();+ }+ if (!closed && checked) {+ authCode.focus();+ }+ }+ } catch (error) {+ if (!closed && sequence === requestSequence) {+ message(String(error.message));+ }+ } finally {+ if (!closed && sequence === requestSequence) {+ connect.disabled = false;+ }+ }+ });+ origin.addEventListener("input", reset);+ field("cancel").addEventListener("click", () => dialog.destroy());+ field("refreshCaptcha").addEventListener("click", refreshCaptcha);+ connect.addEventListener("click", () => form.requestSubmit());+ [origin, authCode, captcha].forEach(input => dialog.bindInput(input, () => form.requestSubmit()));+ origin.value = initialOrigin;+ origin.focus();+ void invoke("init", {dialog: true, lang: window.siyuan.config.lang, origin: initialOrigin}).then(result => {+ if (closed) {+ return;+ }+ if (!result.languages) {+ message(result.error);+ return;+ }+ authCode.placeholder = result.languages._kernel["173"];+ authCode.ariaLabel = authCode.placeholder;+ captcha.placeholder = result.languages._kernel["175"];+ captcha.ariaLabel = captcha.placeholder;+ field("refreshCaptcha").ariaLabel = languages.refresh;+ field("rememberLabel").textContent = result.languages._kernel["257"];+ origin.value = result.origin;+ message(result.error);+ renderHistory(result.entries);+ initialized = true;+ connect.disabled = false;+ }).catch(error => {+ if (!closed) {+ message(String(error.message));+ }+ });+};diff --git a/app/src/menus/workspace.ts b/app/src/menus/workspace.tsindex db64ee2299..51f06c435d 100644--- a/app/src/menus/workspace.ts+++ b/app/src/menus/workspace.ts@@ -1,6 +1,7 @@import {MenuItem} from "./Menu";/// #if !BROWSERimport {ipcRenderer} from "electron";+import {openRemoteConnection} from "../dialog/remoteConnection";/// #endifimport {openHistory} from "../history/history";import {getOpenNotebookCount, originalPath, pathPosix, useShell} from "../util/pathName";@@ -253,9 +254,7 @@ export const workspaceMenu = async (app: App, rect: DOMRect) => {let remoteConnections: string[] = [];/// #if !BROWSERremoteConnections = await ipcRenderer.invoke(Constants.SIYUAN_GET, {cmd: "remoteConnections"});- const manageConnections = (origin?: string) => ipcRenderer.send("siyuan-manage-connections", {- lang: window.siyuan.config.lang, origin,- });+ const manageConnections = (origin?: string) => openRemoteConnection(origin);/// #endifconst renderMenu = (workspaces: IWorkspace[]) => {window.siyuan.menus.menu.remove();@@ -299,16 +298,12 @@ export const workspaceMenu = async (app: App, rect: DOMRect) => {if ((!window.siyuan.config.readonly && getHostCapabilities().workspaces) || !isBrowser()) {let workspaceSubMenu: IMenu[];/// #if !BROWSER- workspaceSubMenu = [{+ workspaceSubMenu = getHostCapabilities().workspaces ? [{id: "newOrOpenBy",label: getHostCapabilities().workspaces? `${window.siyuan.languages.new} / ${window.siyuan.languages.openBy}` : window.siyuan.languages.openBy,iconHTML: "",click: async () => {- if (!getHostCapabilities().workspaces) {- manageConnections();- return;- }const localPath = await ipcRenderer.invoke(Constants.SIYUAN_GET, {cmd: "showOpenDialog",defaultPath: window.siyuan.config.system.homeDir,@@ -327,7 +322,7 @@ export const workspaceMenu = async (app: App, rect: DOMRect) => {}});}- }];+ }] : [];workspaceSubMenu.push({id: "connectRemoteKernel",label: window.siyuan.languages.connectRemoteKernel,