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: If a file with the same name exists during export PDF/Docx, it will be automatically renamed https://github.com/siyuan-note/siyuan/issues/11357
Danielc79238025cb1
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.jsonindex b1362c1d66..9882ca49e6 100644--- a/app/appearance/langs/en_US.json+++ b/app/appearance/langs/en_US.json@@ -1484,7 +1484,7 @@"212": "There are some defects in the current version of cloud data sync, please upgrade to the latest version. Sorry for the inconvenience","213": "Cloud verification failed, please try to upgrade to the latest version and log in again before syncing","214": "This function needs to be signed in and purchasing [PRO Features] or [Subscription] to use",- "215": "Save failed: The target file is being used by another program",+ "215": "TODO","216": "Rebuilding asset content data index, please wait...","217": "[%d/%d] Created asset content data index","218": "Too many snapshots of the data repo have been detected, which slows down program startup and data sync. Please consider executing [Settings - About - Data repo purge]",diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.jsonindex ee2938cdfe..14b820bd0f 100644--- a/app/appearance/langs/es_ES.json+++ b/app/appearance/langs/es_ES.json@@ -1484,7 +1484,7 @@"212": "Hay algunos defectos en la versi\u00f3n actual de sincronizaci\u00f3n de datos en la nube, actualice a la versi\u00f3n m\u00e1s reciente. Disculpe las molestias","213": "La verificaci\u00f3n en la nube fall\u00f3, intente actualizar a la versi\u00f3n m\u00e1s reciente e inicie sesi\u00f3n de nuevo antes de sincronizar","214": "Esta función requiere iniciar sesión en su cuenta y comprar [PRO Features] o [Subscription] antes de poder usarla.",- "215": "Error al guardar: el archivo de destino está siendo utilizado por otro programa",+ "215": "TODO","216": "Reconstruyendo el índice de datos de contenido de recursos, espere...","217": "[%d/%d] Índice de datos de contenido de activos creado","218": "Se han detectado demasiadas instantáneas del repositorio de datos, lo que ralentiza el inicio del programa y la sincronización de datos. Considere ejecutar [Configuración - Acerca de - Purga del repositorio de datos]",diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.jsonindex 4cd8a85775..6286e2c8d9 100644--- a/app/appearance/langs/fr_FR.json+++ b/app/appearance/langs/fr_FR.json@@ -1484,7 +1484,7 @@"212": "Il y a quelques défauts dans la version actuelle de la synchronisation des données cloud, veuillez mettre à niveau vers la dernière version. Désolé pour le désagrément","213": "Échec de la vérification cloud, veuillez essayer de mettre à niveau vers la dernière version et de vous reconnecter avant de synchroniser","214": "Cette fonction nécessite de vous connecter à votre compte et d'acheter des [PRO Features] ou un [Subscription] avant de pouvoir l'utiliser.",- "215": "Échec de l'enregistrement : le fichier de destination est utilisé par un autre programme",+ "215": "TODO","216": "Reconstruction de l'index des données du contenu des ressources, veuillez patienter...","217": "[%d/%d] Création d'un index de données de contenu d'actif","218": "Trop d'instantanés du référentiel de données ont été détectés, ce qui ralentit le démarrage du programme et la synchronisation des données. Veuillez envisager d'exécuter [Paramètres - À propos - Purge du référentiel de données]",diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.jsonindex 56b0d1f7de..8bdfe934d5 100644--- a/app/appearance/langs/ja_JP.json+++ b/app/appearance/langs/ja_JP.json@@ -1484,7 +1484,7 @@"212": "現在のバージョンのクラウドデータ同期にはいくつかの問題があります。最新バージョンにアップグレードしてください","213": "クラウド認証に失敗しました。最新バージョンにアップグレードしてから再度ログインして同期を試みてください","214": "この機能を使用するには、ログインして [PRO 機能] または [サブスクリプション] を購入する必要があります",- "215": "保存に失敗しました。対象ファイルが別のプログラムによって使用されています",+ "215": "TODO","216": "アセットコンテンツデータインデックスを再構築しています。お待ちください...","217": "[%d/%d] アセットコンテンツデータインデックスを作成しました","218": "検出されたデータリポジトリのスナップショットが多すぎるため、プログラムの起動とデータ同期が遅くなります。[設定] - [情報] - [データリポジトリの消去] の実行を検討してください",diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.jsonindex baf565af41..cbe6dc8001 100644--- a/app/appearance/langs/zh_CHT.json+++ b/app/appearance/langs/zh_CHT.json@@ -1484,7 +1484,7 @@"212": "當前版本雲端數據同步存在一些缺陷,請升級到最新版,帶來不便,敬請諒解","213": "雲端校驗失敗,請嘗試升級到最新版並重新登錄後再進行同步","214": "此功能需要登入帳號併購買 [功能特性] 或 [年付訂閱] 後才能使用",- "215": "保存失敗:目標文件正在被其他程序佔用",+ "215": "TODO","216": "正在重建資源文件內容數據索引,請稍等...","217": "[%d/%d] 已經創建資源文件內容數據索引","218": "偵測到資料倉儲快照過多,降低了程式啟動和資料同步速度,請考慮執行 [設定 - 關於 - 資料倉儲清理]",diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.jsonindex 3e3c5460a6..c7b96e27b9 100644--- a/app/appearance/langs/zh_CN.json+++ b/app/appearance/langs/zh_CN.json@@ -1484,7 +1484,7 @@"212": "当前版本云端数据同步存在一些缺陷,请升级到最新版,带来不便,敬请谅解","213": "云端校验失败,请尝试升级到最新版并重新登录后再进行同步","214": "该功能需要登录账号并购买 [功能特性] 或者 [年付订阅] 后才能使用",- "215": "保存失败:目标文件并且正在被其他程序占用",+ "215": "TODO","216": "正在重建资源文件内容数据索引,请稍等...","217": "[%d/%d] 已经创建资源文件内容数据索引","218": "检测到数据仓库快照过多,降低了程序启动和数据同步速度,请考虑执行 [设置 - 关于 - 数据仓库清理]",diff --git a/kernel/model/export.go b/kernel/model/export.goindex a37e3fb65d..8a3d4d8c7a 100644--- a/kernel/model/export.go+++ b/kernel/model/export.go@@ -557,12 +557,13 @@ func Preview(id string) (retStdHTML string, retOutline []*Path) {return}-func ExportDocx(id, savePath string, removeAssets, merge bool) (err error) {+func ExportDocx(id, savePath string, removeAssets, merge bool) (fullPath string, err error) {if !util.IsValidPandocBin(Conf.Export.PandocBin) {Conf.Export.PandocBin = util.PandocBinPathConf.Save()if !util.IsValidPandocBin(Conf.Export.PandocBin) {- return errors.New(Conf.Language(115))+ err = errors.New(Conf.Language(115))+ return}}@@ -587,7 +588,8 @@ func ExportDocx(id, savePath string, removeAssets, merge bool) (err error) {if !gulu.File.IsExist(docxTemplate) {logging.LogErrorf("docx template [%s] not found", docxTemplate)msg := fmt.Sprintf(Conf.Language(197), docxTemplate)- return errors.New(msg)+ err = errors.New(msg)+ return}args = append(args, "--reference-doc", docxTemplate)@@ -600,28 +602,23 @@ func ExportDocx(id, savePath string, removeAssets, merge bool) (err error) {if nil != err {logging.LogErrorf("export docx failed: %s", gulu.Str.FromBytes(output))msg := fmt.Sprintf(Conf.Language(14), gulu.Str.FromBytes(output))- return errors.New(msg)- }-- targetPath := filepath.Join(savePath, name+".docx")- if gulu.File.IsExist(targetPath) {- // 先删除目标文件,以检查是否被占用 https://github.com/siyuan-note/siyuan/issues/8822- if err := os.RemoveAll(targetPath); nil != err {- logging.LogErrorf("export docx failed: %s", err)- msg := fmt.Sprintf(Conf.language(215))- return errors.New(msg)- }+ err = errors.New(msg)+ return}- if err = filelock.Copy(tmpDocxPath, targetPath); nil != err {+ fullPath = filepath.Join(savePath, name+".docx")+ fullPath = util.GetUniqueFilename(fullPath)+ if err = filelock.Copy(tmpDocxPath, fullPath); nil != err {logging.LogErrorf("export docx failed: %s", err)- return errors.New(fmt.Sprintf(Conf.Language(14), err))+ err = errors.New(fmt.Sprintf(Conf.Language(14), err))+ return}if tmpAssets := filepath.Join(tmpDir, "assets"); !removeAssets && gulu.File.IsDir(tmpAssets) {if err = filelock.Copy(tmpAssets, filepath.Join(savePath, "assets")); nil != err {logging.LogErrorf("export docx failed: %s", err)- return errors.New(fmt.Sprintf(Conf.Language(14), err))+ err = errors.New(fmt.Sprintf(Conf.Language(14), err))+ return}}return