Skip to content

Commit 56cbedc

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents 1b3173d + c4669b4 commit 56cbedc

18 files changed

+62
-27
lines changed

.github/CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Install pnpm: `npm install -g [email protected]`
1414

1515
Set the Electron mirror environment variable and install Electron:
1616

17-
* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v33.3.2 -D`
17+
* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v33.4.0 -D`
1818
* Windows:
1919
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
20-
* `pnpm install electron@v33.3.2 -D`
20+
* `pnpm install electron@v33.4.0 -D`
2121

2222
NPM mirror:
2323

@@ -28,7 +28,7 @@ NPM mirror:
2828

2929
On the desktop, go to the app folder to run:
3030

31-
* `pnpm install electron@v33.3.2 -D`
31+
* `pnpm install electron@v33.4.0 -D`
3232
* `pnpm run dev`
3333
* `pnpm run start`
3434

.github/CONTRIBUTING_zh_CN.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
* macOS/Linux:
1818
```
19-
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v33.3.2 -D
19+
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v33.4.0 -D
2020
```
2121
* Windows:
2222
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
23-
* `pnpm install electron@v33.3.2 -D`
23+
* `pnpm install electron@v33.4.0 -D`
2424

2525
NPM 镜像:
2626

@@ -30,7 +30,7 @@ NPM 镜像:
3030

3131
桌面端进入 app 文件夹运行:
3232

33-
* `pnpm install electron@v33.3.2 -D`
33+
* `pnpm install electron@v33.4.0 -D`
3434
* `pnpm run dev`
3535
* `pnpm run start`
3636

app/appearance/langs/ar_SA.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 قد يقوم Microsoft Defender بحذف النواة عن طريق الخطأ، وحذف البيانات وتقليل الأداء بشكل كبير. يُوصى بإضافة مسار التثبيت ومسار مساحة العمل الخاصة بـ SiYuan إلى قائمة الاستثناءات<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">إضافة</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">تجاهل</button>",
15861586
"253": "جارٍ ضغط الملف [%s]، يرجى الانتظار...",
15871587
"254": "[Region ID] معرّف المنطقة غير صحيح، يرجى الرجوع إلى وثائق مزود خدمة S3 لتكوين معرّف المنطقة",
1588-
"255": "قام الموقع المستهدف بتمكين حماية الروابط المباشرة، لذلك لا يمكن تنزيل [%d] من الموارد"
1588+
"255": "قام الموقع المستهدف بتمكين حماية الروابط المباشرة، لذلك لا يمكن تنزيل [%d] من الموارد",
1589+
"256": "المسار المحدد [%s] يحتوي على مسار مساحة عمل رئيسي [%s]"
15891590
}
15901591
}

app/appearance/langs/de_DE.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 Microsoft Defender kann fälschlicherweise den Kernel löschen, Daten löschen und die Leistung erheblich verringern. Es wird empfohlen, den SiYuan-Installationspfad und den Arbeitsbereichspfad zur Ausschlussliste hinzuzufügen<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Hinzufügen</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignorieren</button>",
15861586
"253": "Datei [%s] wird komprimiert, bitte warten...",
15871587
"254": "[Region ID] Falsche Regions-ID, bitte konsultieren Sie die Dokumentation des S3-Dienstanbieters zur Konfiguration der Regions-ID",
1588-
"255": "Die Zielseite hat den Hotlink-Schutz aktiviert, daher ist es nicht möglich, [%d] Ressourcen herunterzuladen"
1588+
"255": "Die Zielseite hat den Hotlink-Schutz aktiviert, daher ist es nicht möglich, [%d] Ressourcen herunterzuladen",
1589+
"256": "Der angegebene Pfad [%s] hat einen übergeordneten Arbeitsbereichspfad [%s]"
15891590
}
15901591
}

app/appearance/langs/en_US.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 Microsoft Defender may mistakenly delete the kernel, delete data, and significantly reduce performance. It is recommended to add the SiYuan installation path and workspace path to the exclusion list<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Add</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignore</button>",
15861586
"253": "Compressing file [%s], please wait...",
15871587
"254": "[Region ID] Incorrect Region ID, please refer to the S3 service provider's documentation to configure the Region ID",
1588-
"255": "The target site has enabled hotlink protection, so it is not possible to download [%d] resources"
1588+
"255": "The target site has enabled hotlink protection, so it is not possible to download [%d] resources",
1589+
"256": "The specified path [%s] has a parent workspace path [%s]"
15891590
}
15901591
}

app/appearance/langs/es_ES.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 Microsoft Defender puede eliminar por error el núcleo, eliminar datos y reducir significativamente el rendimiento. Se recomienda agregar la ruta de instalación y el espacio de trabajo de SiYuan a la lista de exclusiones<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Agregar</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignorar</button>",
15861586
"253": "Comprimiendo el archivo [%s], por favor espere...",
15871587
"254": "[Region ID] ID de región incorrecto, por favor consulte la documentación del proveedor de servicios S3 para configurar el ID de región",
1588-
"255": "El sitio de destino ha activado la protección contra hotlinking, por lo que no es posible descargar [%d] recursos"
1588+
"255": "El sitio de destino ha activado la protección contra hotlinking, por lo que no es posible descargar [%d] recursos",
1589+
"256": "La ruta especificada [%s] tiene una ruta de espacio de trabajo padre [%s]"
15891590
}
15901591
}

app/appearance/langs/fr_FR.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 Microsoft Defender peut supprimer par erreur le noyau, supprimer des données et réduire considérablement les performances. Il est recommandé d'ajouter le chemin d'installation et l'espace de travail de SiYuan à la liste des exclusions<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Ajouter</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignorer</button>",
15861586
"253": "Compression du fichier [%s], veuillez patienter...",
15871587
"254": "[Region ID] ID de région incorrect, veuillez consulter la documentation du fournisseur de services S3 pour configurer l'ID de région",
1588-
"255": "Le site cible a activé la protection contre le hotlinking, il est donc impossible de télécharger [%d] ressources"
1588+
"255": "Le site cible a activé la protection contre le hotlinking, il est donc impossible de télécharger [%d] ressources",
1589+
"256": "Le chemin spécifié [%s] contient un chemin d'espace de travail parent [%s]"
15891590
}
15901591
}

app/appearance/langs/he_IL.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 Microsoft Defender עלול למחוק בטעות את הליבה, למחוק נתונים ולהפחית משמעותית את הביצועים. מומלץ להוסיף את נתיב ההתקנה ונתיב סביבת העבודה של SiYuan לרשימת החריגים<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">הוסף</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">התעלם</button>",
15861586
"253": "דוחס את הקובץ [%s], אנא המתן...",
15871587
"254": "[Region ID] מזהה האזור שגוי, אנא עיין בתיעוד ספק שירותי S3 כדי להגדיר את מזהה האזור",
1588-
"255": "האתר היעד הפעיל הגנה על קישורים חמים, ולכן לא ניתן להוריד [%d] משאבים"
1588+
"255": "האתר היעד הפעיל הגנה על קישורים חמים, ולכן לא ניתן להוריד [%d] משאבים",
1589+
"256": "הנתיב שצוין [%s] מכיל נתיב מרחב עבודה אב [%s]"
15891590
}
15901591
}

app/appearance/langs/it_IT.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 Microsoft Defender potrebbe eliminare erroneamente il kernel, eliminare i dati e ridurre significativamente le prestazioni. Si consiglia di aggiungere il percorso di installazione e lo spazio di lavoro di SiYuan all'elenco delle esclusioni<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Aggiungi</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignora</button>",
15861586
"253": "Compressione del file [%s], attendere prego...",
15871587
"254": "[Region ID] ID regione non corretto, si prega di consultare la documentazione del fornitore di servizi S3 per configurare l'ID regione",
1588-
"255": "Il sito di destinazione ha abilitato la protezione hotlink, quindi non è possibile scaricare [%d] risorse"
1588+
"255": "Il sito di destinazione ha abilitato la protezione hotlink, quindi non è possibile scaricare [%d] risorse",
1589+
"256": "Il percorso specificato [%s] ha un percorso di spazio di lavoro padre [%s]"
15891590
}
15901591
}

app/appearance/langs/ja_JP.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 Microsoft Defender は、カーネルを誤って削除したり、データを削除したり、パフォーマンスを大幅に低下させたりする可能性があります。SiYuan のインストールパスとワークスペースパスを除外リストに追加することをお勧めします<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">追加</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">無視</button>",
15861586
"253": "ファイル [%s] を圧縮しています、お待ちください...",
15871587
"254": "[Region ID] リージョンIDが正しくありません。S3サービスプロバイダーのドキュメントを参照してリージョンIDを設定してください",
1588-
"255": "ターゲットサイトはホットリンク保護を有効にしているため、[%d] 個のリソースをダウンロードできません"
1588+
"255": "ターゲットサイトはホットリンク保護を有効にしているため、[%d] 個のリソースをダウンロードできません",
1589+
"256": "指定されたパス [%s] の親にワークスペースパス [%s] が存在します"
15891590
}
15901591
}

app/appearance/langs/pl_PL.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 Microsoft Defender może błędnie usunąć jądro, usunąć dane i znacznie obniżyć wydajność. Zaleca się dodanie ścieżki instalacji i przestrzeni roboczej SiYuan do listy wykluczeń<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Dodaj</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Ignoruj</button>",
15861586
"253": "Kompresja pliku [%s], proszę czekać...",
15871587
"254": "[Region ID] Nieprawidłowy identyfikator regionu, proszę zapoznać się z dokumentacją dostawcy usług S3 w celu skonfigurowania identyfikatora regionu",
1588-
"255": "Docelowa strona włączyła ochronę przed hotlinkowaniem, [%d] zasobów nie można pobrać"
1588+
"255": "Docelowa strona włączyła ochronę przed hotlinkowaniem, [%d] zasobów nie można pobrać",
1589+
"256": "Określona ścieżka [%s] ma nadrzędną ścieżkę przestrzeni roboczej [%s]"
15891590
}
15901591
}

app/appearance/langs/ru_RU.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 Microsoft Defender может ошибочно удалить ядро, удалить данные и значительно снизить производительность. Рекомендуется добавить путь установки и рабочее пространство SiYuan в список исключений<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">Добавить</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">Игнорировать</button>",
15861586
"253": "Сжатие файла [%s], пожалуйста, подождите...",
15871587
"254": "[Region ID] Неправильный идентификатор региона, пожалуйста, обратитесь к документации поставщика услуг S3 для настройки идентификатора региона",
1588-
"255": "Целевой сайт включил защиту от хотлинков, [%d] ресурсов невозможно скачать"
1588+
"255": "Целевой сайт включил защиту от хотлинков, [%d] ресурсов невозможно скачать",
1589+
"256": "Указанный путь [%s] имеет родительский путь рабочей области [%s]"
15891590
}
15901591
}

app/appearance/langs/zh_CHT.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 Microsoft Defender 可能會誤殺內核、誤刪數據和嚴重降低運行性能,建議將思源安裝路徑和工作空間路徑添加到排除列表<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">添加</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">忽略</button>",
15861586
"253": "正在壓縮文件 [%s],請稍等...",
15871587
"254": "[Region ID] 不正確,請參考 S3 服務提供商的文檔配置地域 ID",
1588-
"255": "目標站點啟用了防盜鏈,[%d] 個資源無法下載"
1588+
"255": "目標站點啟用了防盜鏈,[%d] 個資源無法下載",
1589+
"256": "指定的路徑 [%s] 父級存在工作空間路徑 [%s]"
15891590
}
15901591
}

app/appearance/langs/zh_CN.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@
15851585
"252": "\uD83D\uDEA8 Microsoft Defender 可能会误杀内核、误删数据和严重降低运行性能,建议将思源安装路径和工作空间路径添加到排除列表<span class=\"fn__space\"></span><button id=\"addMicrosoftDefenderExclusion\" class=\"b3-button\">添加</button><span class=\"fn__space\"></span><button id=\"ignoreAddMicrosoftDefenderExclusion\" class=\"b3-button b3-button--white\">忽略</button>",
15861586
"253": "正在压缩文件 [%s],请稍等...",
15871587
"254": "[Region ID] 不正确,请参考 S3 服务提供商的文档配置地域 ID",
1588-
"255": "目标站点启用了防盗链,[%d] 个资源无法下载"
1588+
"255": "目标站点启用了防盗链,[%d] 个资源无法下载",
1589+
"256": "指定的路径 [%s] 父级存在工作空间路径 [%s]"
15891590
}
15901591
}

app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"clean-webpack-plugin": "^4.0.0",
5757
"css-loader": "^6.7.1",
5858
"dayjs": "^1.11.5",
59-
"electron": "33.3.2",
59+
"electron": "33.4.0",
6060
"electron-builder": "25.1.8",
6161
"encoding": "^0.1.13",
6262
"esbuild-loader": "^3.0.1",

app/pnpm-lock.yaml

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kernel/api/workspace.go

+13
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,19 @@ func setWorkspaceDir(c *gin.Context) {
297297
}
298298
}
299299

300+
// 检查路径是否在已有的工作空间路径中
301+
pathIsWorkspace := util.IsWorkspaceDir(path)
302+
if !pathIsWorkspace {
303+
for p := filepath.Dir(path); "" != p; p = filepath.Dir(p) {
304+
if util.IsWorkspaceDir(p) {
305+
ret.Code = -1
306+
ret.Msg = fmt.Sprintf(model.Conf.Language(256), path, p)
307+
ret.Data = map[string]interface{}{"closeTimeout": 7000}
308+
return
309+
}
310+
}
311+
}
312+
300313
workspacePaths, err := util.ReadWorkspacePaths()
301314
if err != nil {
302315
ret.Code = -1

kernel/util/path.go

+10
Original file line numberDiff line numberDiff line change
@@ -341,3 +341,13 @@ func GetAbsPathInWorkspace(relPath string) (string, error) {
341341
func IsAbsPathInWorkspace(absPath string) bool {
342342
return IsSubPath(WorkspaceDir, absPath)
343343
}
344+
345+
// IsWorkspaceDir 判断指定目录是否是工作空间目录。
346+
func IsWorkspaceDir(dir string) bool {
347+
conf := filepath.Join(dir, "conf", "conf.json")
348+
data, err := os.ReadFile(conf)
349+
if nil != err {
350+
return false
351+
}
352+
return strings.Contains(string(data), "kernelVersion")
353+
}

0 commit comments

Comments
 (0)