Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/1359 批量删除

Vanessa5e6bc7b93396
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json
index 10dcaecb30..cbf6ffcac7 100644
--- a/app/appearance/langs/en_US.json
+++ b/app/appearance/langs/en_US.json
@@ -1,6 +1,6 @@
{
"notBatchRemove": "Notebooks do not support batch deletion",
- "confirmRemove": "Are you sure you want to delete the ${count} selected files?",
+ "confirmRemoveAll": "Are you sure you want to delete all selected files?",
"microphoneDenied": "Need to allow Siyuan to access the microphone in System Preferences",
"microphoneNotAccess": "Access to the microphone is denied, go to System Preferences to reset",
"dynamicLoadBlocks": "Number of dynamically loaded blocks",
diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json
index 97c0e25cde..4c095d293d 100644
--- a/app/appearance/langs/es_ES.json
+++ b/app/appearance/langs/es_ES.json
@@ -1,6 +1,6 @@
{
"notBatchRemove": "Los portátiles no admiten la eliminación por lotes",
- "confirmRemove": "¿Está seguro de que desea eliminar los ${count} archivos seleccionados?",
+ "confirmRemoveAll": "¿Está seguro de que desea eliminar todos los archivos seleccionados?",
"microphoneDenied": "Necesito permitir que Siyuan acceda al micrófono en Preferencias del Sistema",
"microphoneNotAccess": "Acceso al micrófono denegado, ve a Preferencias del Sistema para reiniciar",
"dynamicLoadBlocks": "Número de bloques cargados dinámicamente",
diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json
index 7a06187bc8..2025b6cd39 100644
--- a/app/appearance/langs/fr_FR.json
+++ b/app/appearance/langs/fr_FR.json
@@ -1,6 +1,6 @@
{
"notBatchRemove": "Les blocs-notes ne prennent pas en charge la suppression par lots",
- "confirmRemove": "Êtes-vous sûr de vouloir supprimer les ${count} fichiers sélectionnés ?",
+ "confirmRemoveAll": "Êtes-vous sûr de vouloir supprimer tous les fichiers sélectionnés ?",
"microphoneDenied": "Vous devez autoriser Siyuan à accéder au microphone dans les Préférences Système",
"microphoneNotAccess": "L'accès au microphone est refusé, allez dans les Préférences Système pour réinitialiser",
"dynamicLoadBlocks": "Nombre de blocs chargés dynamiquement",
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index 20767bb42a..4026ea3058 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -1,6 +1,6 @@
{
"notBatchRemove": "筆記本不支持批量刪除",
- "confirmRemove": "確定刪除選中的 ${count} 個文件?",
+ "confirmRemoveAll": "确定删除选中的所有文件?",
"microphoneDenied": "需在系統偏好設置中允許思源訪問麥克風",
"microphoneNotAccess": "麥克風被拒絕訪問,可前往系統偏好設置中重新設置",
"dynamicLoadBlocks": "動態加載塊數",
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index 648363095b..3abed0242c 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -1,6 +1,6 @@
{
"notBatchRemove": "笔记本不支持批量删除",
- "confirmRemove": "确定删除选中的 ${count} 个文件?",
+ "confirmRemoveAll": "确定删除选中的所有文件?",
"microphoneDenied": "需在系统偏好设置中允许思源访问麦克风",
"microphoneNotAccess": "麦克风被拒绝访问,可前往系统偏好设置中重新设置",
"dynamicLoadBlocks": "动态加载块数",
diff --git a/app/src/editor/deleteFile.ts b/app/src/editor/deleteFile.ts
index 2df6794b53..6c042632b8 100644
--- a/app/src/editor/deleteFile.ts
+++ b/app/src/editor/deleteFile.ts
@@ -49,14 +49,17 @@ export const deleteFiles = (liElements: Element[]) => {
} else {
const paths: string[] = []
liElements.forEach(item => {
- paths.push(item.getAttribute("data-path"));
+ const dataPath = item.getAttribute("data-path")
+ if(dataPath !== "/") {
+ paths.push(item.getAttribute("data-path"));
+ }
})
- if (paths.includes("/")) {
+ if (paths.length === 0) {
showMessage(window.siyuan.languages.notBatchRemove);
return;
}
confirmDialog(window.siyuan.languages.deleteOpConfirm,
- window.siyuan.languages.confirmRemove.replace("${count}", liElements.length), () => {
+ window.siyuan.languages.confirmRemoveAll, () => {
fetchPost("/api/notebook/removeDocs", {
paths
});