Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-08-24 11:18:11 +08:00
commit 9457d55d14
22 changed files with 98 additions and 15 deletions

View file

@ -1130,6 +1130,8 @@
"fileTree19": "ولبعض نظم التشغيل قيود تقنية قد تحول دون النسخ اليدوي لبيانات مساحة العمل بعد وضع مستندات فرعية تزيد عن 7 مستويات",
"fileTree20": "حفظ بسطر واحد",
"fileTree21": "‫بعد التمكين، سيتم استخدام تنسيق JSON ذي السطر الواحد عند حفظ مستندات .sy وقاعدة بيانات .json، مما يقلل حجم الملف بحوالي 30٪ وتحسين كفاءة القراءة والكتابة بنسبة 50٪",
"fileTree22": "تنبيه ملف كبير",
"fileTree23": "إشعار عند تجاوز ملفات .sy أو قاعدة بيانات .json لهذا الحجم",
"export10": "‫على سبيل المثال <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>‬، إذا كان فارغاً، سيتم استخدام العلامة المائية من النص المخصص أو مسار ملف العلامة المائية.",
"export11": "طريقة معالجة محتوى المراجع عند التصدير",
"export12": "طريقة معالجة محتوى كتلة التضمين عند التصدير",
@ -1646,6 +1648,7 @@
"264": "الحقل [%s] فارغ",
"265": "خارج النطاق",
"266": "Tesseract OCR غير مثبت أو غير مهيأ، يرجى الرجوع إلى دليل المستخدم - قسم ملفات الموارد لإجراء الإعداد",
"267": "قاعدة بيانات غير مسماة"
"267": "قاعدة بيانات غير مسماة",
"268": "يرجى ملاحظة أن الملف [%s] قد تجاوز بالفعل [%d MB]‎، وقد يؤدي ذلك إلى انخفاض الأداء"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "Einige Betriebssysteme haben technische Einschränkungen, die das manuelle Kopieren von Arbeitsbereichsdaten nach der Erstellung von Unterdokumenten mit mehr als 7 Ebenen verhindern können",
"fileTree20": "Speichern mit einer einzigen Zeile",
"fileTree21": "Nach der Aktivierung wird beim Speichern von .sy-Dokumenten und Datenbank-.json-Dateien das Einzeilige JSON-Format verwendet, was die Dateigröße um etwa 30 % reduzieren und die Lese- und Schreibgeschwindigkeit um 50 % verbessern kann",
"fileTree22": "Großdatei-Warnung",
"fileTree23": "Benachrichtigen, wenn .sy-Dateien oder die Datenbank .json diese Größe überschreiten",
"export10": "Beispiel <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, wenn leer, verwenden Sie Wasserzeichentext oder den Pfad zur Wasserzeichen-Datei.",
"export11": "Inhaltsbehandlungsverfahren des Inhaltsreferenzblocks beim Exportieren",
"export12": "Inhaltsbehandlungsverfahren des Inhalteinbettungsblocks beim Exportieren",
@ -1646,6 +1648,7 @@
"264": "Das Feld [%s] ist leer",
"265": "Außerhalb des Bereichs",
"266": "Tesseract OCR ist nicht installiert oder konfiguriert, bitte lesen Sie das Benutzerhandbuch - Abschnitt Ressourcen-Dateien zur Konfiguration",
"267": "Unbenannte Datenbank"
"267": "Unbenannte Datenbank",
"268": "Bitte beachten Sie, dass die Datei [%s] bereits [%d MB] überschritten hat, was die Leistung beeinträchtigen kann"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "Some operating systems have technical limitations that may prevent manual copying of workspace data after creating sub-documents greater than 7 levels",
"fileTree20": "Save with a single line",
"fileTree21": "When enabled, the single-line JSON format will be used when saving .sy docs and database .json files, which can reduce the file size by about 30% and improve read and write efficiency by 50%",
"fileTree22": "Large File Warning",
"fileTree23": "Notify when .sy files or database .json exceed this size",
"export10": "For example <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, if empty, use watermark text or watermark file path.",
"export11": "Content handling method of content ref block when exporting",
"export12": "Content handling method of content embed block when exporting",
@ -1646,6 +1648,7 @@
"264": "Field [%s] is empty",
"265": "Out of range",
"266": "Tesseract OCR is not installed or configured, please refer to the User Guide - Assets section for configuration",
"267": "Unnamed database"
"267": "Unnamed database",
"268": "Please note that the file [%s] has already exceeded [%d MB], which may cause performance degradation"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "Algunos sistemas operativos tienen limitaciones técnicas que pueden impedir la copia manual de los datos del espacio de trabajo después de crear subdocumentos de más de 7 niveles",
"fileTree20": "Guardar con una sola línea",
"fileTree21": "Después de habilitarlo, se utilizará el formato JSON de una sola línea al guardar documentos .sy y archivos .json de bases de datos, lo que puede reducir el tamaño del archivo en aproximadamente un 30 % y mejorar la eficiencia de lectura y escritura en un 50 %.",
"fileTree22": "Aviso de archivo grande",
"fileTree23": "Notificar cuando los archivos .sy o la base de datos .json superen este tamaño",
"export10": "Por ejemplo <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, si está vacío, utilice texto de marca de agua o ruta del archivo de marca de agua.",
"export11": "Método de manejo de contenido del bloque de referencia de contenido al exportar",
"export12": "Método de manejo de contenido del bloque de incrustación de contenido al exportar",
@ -1646,6 +1648,7 @@
"264": "El campo [%s] está vacío",
"265": "Fuera de rango",
"266": "Tesseract OCR no está instalado o configurado, consulte la Guía del Usuario - Sección de archivos de recursos para la configuración",
"267": "Base de datos sin nombre"
"267": "Base de datos sin nombre",
"268": "Atención: el archivo [%s] ya ha superado los [%d MB], lo que puede causar una disminución del rendimiento"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "Certains systèmes d'exploitation ont des limitations techniques qui peuvent empêcher la copie manuelle des données de l'espace de travail après la création de sous-documents supérieurs à 7 niveaux",
"fileTree20": "Enregistrer avec une seule ligne",
"fileTree21": "Après activation, le format JSON sur une seule ligne sera utilisé lors de l'enregistrement des documents .sy et des fichiers .json de base de données, ce qui peut réduire la taille du fichier d'environ 30 % et améliorer l'efficacité de lecture et d'écriture de 50 %",
"fileTree22": "Alerte de fichier volumineux",
"fileTree23": "Notifier lorsque les fichiers .sy ou la base de données .json dépassent cette taille",
"export10": "Par exemple <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, s'il est vide, utilisez le texte du filigrane ou le chemin du fichier du filigrane.",
"export11": "Traitement du contenu des blocs de référence lors de l'exportation",
"export12": "Gestion du contenu des blocs intégrés lors de l'exportation",
@ -1646,6 +1648,7 @@
"264": "Le champ [%s] est vide",
"265": "Hors de portée",
"266": "Tesseract OCR n'est pas installé ou configuré, veuillez consulter le Guide de l'utilisateur - Section des fichiers de ressources pour la configuration",
"267": "Base de données sans nom"
"267": "Base de données sans nom",
"268": "Attention : le fichier [%s] a déjà dépassé [%d MB], ce qui peut entraîner une baisse des performances"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "חלק ממערכות ההפעלה יש הגבלות טכניות שעלולות למנוע העתקה ידנית של נתוני החלל העבודה לאחר יצירת תתי מסמכים גדולים מ-7 רמות",
"fileTree20": "שמור בשורה אחת",
"fileTree21": "לאחר הפעלת אפשרות זו, פורמט ה-JSON בשורה אחת ישמש בעת שמירת קבצי .sy ומסדי נתונים .json, מה שיכול להפחית את גודל הקובץ בכ-30% ולשפר את יעילות הקריאה והכתיבה ב-50%",
"fileTree22": "התראה על קובץ גדול",
"fileTree23": "הצג התראה כאשר קובץ .sy או מסד נתונים .json חורג מגודל זה",
"export10": "למשל <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, אם ריק, השתמש בטקסט סימן מים או בנתיב קובץ סימן מים.",
"export11": "שיטת טיפול תוכן של בלוק תוכן בעת הייצוא",
"export12": "שיטת טיפול תוכן של בלוק הטמעה בעת הייצוא",
@ -1646,6 +1648,7 @@
"264": "השדה [%s] ריק",
"265": "מחוץ לטווח",
"266": "Tesseract OCR לא הותקן או הוגדר, אנא עיין במדריך למשתמש - פרק קבצי משאבים לצורך הגדרה",
"267": "מסד נתונים ללא שם"
"267": "מסד נתונים ללא שם",
"268": "שים לב שהקובץ [%s] כבר חרג מ-[%d MB], דבר שעלול לגרום לירידה בביצועים"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "Alcuni sistemi operativi hanno limitazioni tecniche che possono impedire la copia manuale dei dati dell'area di lavoro dopo la creazione di sotto-documenti superiori a 7 livelli",
"fileTree20": "Salva con una singola riga",
"fileTree21": "Dopo l'abilitazione, il formato JSON a riga singola verrà utilizzato quando si salvano documenti .sy e file di database .json, il che può ridurre le dimensioni del file del 30% circa e migliorare l'efficienza di lettura e scrittura del 50%",
"fileTree22": "Avviso file di grandi dimensioni",
"fileTree23": "Notifica quando i file .sy e il database .json superano questa dimensione",
"export10": "Ad esempio <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, se vuoto, utilizza il testo della filigrana o il percorso del file della filigrana.",
"export11": "Metodo di gestione del contenuto del blocco di riferimento durante l'esportazione",
"export12": "Metodo di gestione del contenuto del blocco incorporato durante l'esportazione",
@ -1646,6 +1648,7 @@
"264": "Il campo [%s] è vuoto",
"265": "Fuori intervallo",
"266": "Tesseract OCR non è installato o configurato, fare riferimento alla Guida utente - Sezione file di risorse per la configurazione",
"267": "Database senza nome"
"267": "Database senza nome",
"268": "Attenzione: il file [%s] ha già superato [%d MB], il che potrebbe causare un calo delle prestazioni"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "一部のオペレーティングシステムでは、7レベルより深いサブドキュメントにワークスペースデータの手動コピーができない場合があります",
"fileTree20": "一行で保存",
"fileTree21": "ドキュメントとデータベースファイルを保存する際に改行を行わない JSON フォーマットを使用します。これによりファイルサイズが約 30% 削減され、読み書きの効率が 50% 向上します",
"fileTree22": "大きなファイルの警告",
"fileTree23": ".sy ドキュメントやデータベース .json がこのサイズを超えると通知します",
"export10": "例: <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code><br>空の場合は透かしテキストまたは透かし画像ファイルのパスを使用します",
"export11": "エクスポート時のブロック参照コンテンツの処理方法",
"export12": "エクスポート時の埋め込みブロックコンテンツの処理方法",
@ -1646,6 +1648,7 @@
"264": "フィールド [%s] が空です",
"265": "範囲外",
"266": "Tesseract OCR がインストールされていないか、設定されていません。ユーザーガイド - リソースファイルセクションを参照して設定してください",
"267": "未命名のデータベース"
"267": "未命名のデータベース",
"268": "ファイル [%s] はすでに [%d MB] を超えており、パフォーマンスが低下する可能性があります"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "Niektóre systemy operacyjne mają ograniczenia techniczne, które mogą uniemożliwić ręczne kopiowanie danych obszaru roboczego po utworzeniu poddokumentów głębszych niż 7 poziomów",
"fileTree20": "Zapisz w pojedynczej linii",
"fileTree21": "Po włączeniu, format JSON w pojedynczej linii będzie używany przy zapisywaniu .sy dokumentów i plików .json bazy danych, co może zmniejszyć rozmiar pliku o około 30% i poprawić wydajność odczytu i zapisu o 50%",
"fileTree22": "Powiadomienie o dużym pliku",
"fileTree23": "Powiadom, gdy plik .sy lub baza danych .json przekroczy ten rozmiar",
"export10": "Na przykład <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, jeśli jest puste, użyj tekstu znaków wodnych lub ścieżki pliku znaku wodnego.",
"export11": "Sposób obsługi treści bloku odniesienia podczas eksportu",
"export12": "Sposób obsługi treści bloku osadzonego podczas eksportu",
@ -1646,6 +1648,7 @@
"264": "Pole [%s] jest puste",
"265": "Poza zakresem",
"266": "Tesseract OCR nie jest zainstalowany lub skonfigurowany, zapoznaj się z Podręcznikiem użytkownika - Sekcja plików zasobów, aby skonfigurować",
"267": "Nienazwana baza danych"
"267": "Nienazwana baza danych",
"268": "Uwaga: plik [%s] przekroczył już [%d MB], co może spowodować spadek wydajności"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "Alguns sistemas operacionais têm limitações técnicas que podem impedir a cópia manual de dados do espaço de trabalho após a criação de subdocumentos maiores que 7 níveis",
"fileTree20": "Salvar com uma única linha",
"fileTree21": "Quando ativado, o formato JSON de linha única será usado ao salvar documentos .sy e arquivos .json de banco de dados, o que pode reduzir o tamanho do arquivo em cerca de 30% e melhorar a eficiência de leitura/gravação em 50%",
"fileTree22": "Aviso de arquivo grande",
"fileTree23": "Notificar quando arquivos .sy e banco de dados .json excederem este tamanho",
"export10": "Por exemplo <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, se vazio, use texto de marca d'água ou caminho do arquivo de marca d'água.",
"export11": "Método de manipulação de conteúdo do bloco de referência ao exportar",
"export12": "Método de manipulação de conteúdo do bloco incorporado ao exportar",
@ -1646,6 +1648,7 @@
"264": "O campo [%s] está vazio",
"265": "Fora do intervalo",
"266": "Tesseract OCR não está instalado ou configurado, consulte o Guia do Usuário - Seção de Arquivos de Recursos para configuração",
"267": "Banco de dados sem nome"
"267": "Banco de dados sem nome",
"268": "Atenção: o arquivo [%s] já excedeu [%d MB], o que pode causar queda de desempenho"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "Некоторые операционные системы имеют технические ограничения, которые могут препятствовать ручному копированию данных рабочего пространства после создания поддокументов глубже 7 уровней",
"fileTree20": "Сохранять в однострочном формате",
"fileTree21": "После включения однострочный формат JSON будет использоваться при сохранении .sy документов и файлов баз данных .json, что может снизить размер файла примерно на 30% и улучшить эффективность чтения и записи на 50%",
"fileTree22": "Уведомление о большом файле",
"fileTree23": "Появится уведомление, если размер файла .sy или базы данных .json превышает этот предел",
"export10": "Например <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code>, если пусто, использовать текст водяного знака или путь к файлу водяного знака.",
"export11": "Обработка блока ссылок при экспорте",
"export12": "Обработка блока встроенного контента при экспорте",
@ -1646,6 +1648,7 @@
"264": "Поле [%s] пусто",
"265": "Вне диапазона",
"266": "Tesseract OCR не установлен или не настроен, пожалуйста, обратитесь к Руководству пользователя - Раздел ресурсов для настройки",
"267": "База данных не названа"
"267": "База данных не названа",
"268": "Обратите внимание, что файл [%s] уже превышает [%d МБ], это может привести к снижению производительности"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "一些操作系統存在技術限制導致建立大於 7 層的子文檔後可能無法正常手動複製工作空間資料",
"fileTree20": "使用單行保存",
"fileTree21": "啟用後儲存 .sy 文件和資料庫 .json 時將使用單行 JSON 格式,大約能減少 30% 檔案大小並提升 50% 讀寫效率",
"fileTree22": "超大檔案提醒",
"fileTree23": ".sy 文件和資料庫 .json 超過該大小時彈出通知提醒",
"export10": "例如 <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code> ,為空時使用水印文字或浮水印檔案路徑。",
"export11": "匯出時關於塊引用內容的處理方式",
"export12": "匯出時關於嵌入塊內容的處理方式",
@ -1646,6 +1648,7 @@
"264": "字段 [%s] 為空",
"265": "不在範圍內",
"266": "Tesseract OCR 未安裝或未配置,請參考 用戶指南-資料文件 章節進行配置",
"267": "未命名資料庫"
"267": "未命名資料庫",
"268": "請注意該檔案 [%s] 已經超過 [%d MB],可能會導致效能下降"
}
}

View file

@ -1130,6 +1130,8 @@
"fileTree19": "一些操作系统存在技术限制导致创建大于 7 层的子文档后可能无法正常手动复制工作空间数据",
"fileTree20": "使用单行保存",
"fileTree21": "启用后保存 .sy 文档和数据库 .json 时将使用单行 JSON 格式,大约能减少 30% 文件大小并提升 50% 读写效率",
"fileTree22": "超大文件提醒",
"fileTree23": ".sy 文档和数据库 .json 超过该大小时弹出通知提醒",
"export10": "例如 <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code> ,为空时使用水印文本或水印文件路径。",
"export11": "导出时关于块引用内容的处理方式",
"export12": "导出时关于嵌入块内容的处理方式",
@ -1646,6 +1648,7 @@
"264": "字段 [%s] 为空",
"265": "不在范围内",
"266": "Tesseract OCR 未安装或未配置,请参考 用户指南-资源文件 章节进行配置",
"267": "未命名数据库"
"267": "未命名数据库",
"268": "请注意该文件 [%s] 已经超过 [%d MB],可能会导致性能下降"
}
}

View file

@ -52,6 +52,14 @@ export const fileTree = {
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="useSingleLineSave" type="checkbox"${window.siyuan.config.fileTree.useSingleLineSave ? " checked" : ""}/>
</label>
<div class="fn__flex b3-label config__item">
<div class="fn__flex-1">
${window.siyuan.languages.fileTree22}
<div class="b3-label__text">${window.siyuan.languages.fileTree23}</div>
</div>
<span class="fn__space"></span>
<input class="b3-text-field fn__flex-center fn__size200" id="largeFileWarningSize" type="number" min="2" max="10240" value="${window.siyuan.config.fileTree.largeFileWarningSize}">
</div>
<div class="fn__flex b3-label config__item">
<div class="fn__flex-1">
${window.siyuan.languages.fileTree16}
@ -113,6 +121,7 @@ export const fileTree = {
allowCreateDeeper: (fileTree.element.querySelector("#allowCreateDeeper") as HTMLInputElement).checked,
removeDocWithoutConfirm: (fileTree.element.querySelector("#removeDocWithoutConfirm") as HTMLInputElement).checked,
useSingleLineSave: (fileTree.element.querySelector("#useSingleLineSave") as HTMLInputElement).checked,
largeFileWarningSize: parseInt((fileTree.element.querySelector("#largeFileWarningSize") as HTMLInputElement).value),
maxListCount: parseInt((fileTree.element.querySelector("#maxListCount") as HTMLInputElement).value),
maxOpenTabCount: inputMaxOpenTabCount,
}, response => {

View file

@ -30,6 +30,12 @@ export const initFileTree = () => {
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="useSingleLineSave" type="checkbox"${window.siyuan.config.fileTree.useSingleLineSave ? " checked" : ""}/>
</label>
<div class="b3-label">
${window.siyuan.languages.fileTree22}
<span class="fn__hr"></span>
<input class="b3-text-field fn__block" id="largeFileWarningSize" type="number" min="2" max="10240" value="${window.siyuan.config.fileTree.largeFileWarningSize}">
<div class="b3-label__text">${window.siyuan.languages.fileTree23}</div>
</div>
<div class="b3-label">
${window.siyuan.languages.fileTree16}
<span class="fn__hr"></span>
@ -69,6 +75,7 @@ export const initFileTree = () => {
allowCreateDeeper: (modelMainElement.querySelector("#allowCreateDeeper") as HTMLInputElement).checked,
removeDocWithoutConfirm: (modelMainElement.querySelector("#removeDocWithoutConfirm") as HTMLInputElement).checked,
useSingleLineSave: (modelMainElement.querySelector("#useSingleLineSave") as HTMLInputElement).checked,
largeFileWarningSize: parseInt((modelMainElement.querySelector("#largeFileWarningSize") as HTMLInputElement).value),
maxListCount: parseInt((modelMainElement.querySelector("#maxListCount") as HTMLInputElement).value),
maxOpenTabCount: window.siyuan.config.fileTree.maxOpenTabCount,
}, response => {

View file

@ -643,6 +643,10 @@ declare namespace Config {
* Whether to save the content of the .sy file as a single-line JSON object
*/
useSingleLineSave: boolean;
/**
* The .sy and database .json files larger than this value will prompt a warning (unit: MB)
*/
largeFileWarningSize: number;
}
/**

View file

@ -418,6 +418,7 @@ func setFiletree(c *gin.Context) {
model.Conf.Save()
util.UseSingleLineSave = model.Conf.FileTree.UseSingleLineSave
util.LargeFileWarningSize = model.Conf.FileTree.LargeFileWarningSize
ret.Data = model.Conf.FileTree
}

View file

@ -19,6 +19,7 @@ package av
import (
"errors"
"fmt"
"os"
"path/filepath"
"sort"
@ -543,6 +544,11 @@ func SaveAttributeView(av *AttributeView) (err error) {
logging.LogErrorf("save attribute view [%s] failed: %s", av.ID, err)
return
}
if util.ExceedLargeFileWarningSize(len(data)) {
msg := fmt.Sprintf(util.Langs[util.Lang][268], av.Name+" "+filepath.Base(avJSONPath), util.LargeFileWarningSize)
util.PushErrMsg(msg, 7000)
}
return
}

View file

@ -33,6 +33,7 @@ type FileTree struct {
RemoveDocWithoutConfirm bool `json:"removeDocWithoutConfirm"` // 删除文档时是否不需要确认
CloseTabsOnStart bool `json:"closeTabsOnStart"` // 启动时关闭所有页签
UseSingleLineSave bool `json:"useSingleLineSave"` // 使用单行保存文档 .sy 和属性视图 .json
LargeFileWarningSize int `json:"largeFileWarningSize"` // 大文件警告大小单位MB
Sort int `json:"sort"` // 排序方式
}
@ -47,5 +48,6 @@ func NewFileTree() *FileTree {
AllowCreateDeeper: false,
CloseTabsOnStart: false,
UseSingleLineSave: util.UseSingleLineSave,
LargeFileWarningSize: util.LargeFileWarningSize,
}
}

View file

@ -220,6 +220,11 @@ func WriteTree(tree *parse.Tree) (size uint64, err error) {
return
}
if util.ExceedLargeFileWarningSize(len(data)) {
msg := fmt.Sprintf(util.Langs[util.Lang][268], tree.Root.IALAttr("title")+" "+filepath.Base(filePath), util.LargeFileWarningSize)
util.PushErrMsg(msg, 7000)
}
afterWriteTree(tree)
return
}

View file

@ -218,6 +218,10 @@ func InitConf() {
Conf.FileTree.DocCreateSavePath = util.TrimSpaceInPath(Conf.FileTree.DocCreateSavePath)
Conf.FileTree.RefCreateSavePath = util.TrimSpaceInPath(Conf.FileTree.RefCreateSavePath)
util.UseSingleLineSave = Conf.FileTree.UseSingleLineSave
if 2 > Conf.FileTree.LargeFileWarningSize {
Conf.FileTree.LargeFileWarningSize = 8
}
util.LargeFileWarningSize = Conf.FileTree.LargeFileWarningSize
util.CurrentCloudRegion = Conf.CloudRegion

View file

@ -46,8 +46,14 @@ func DisableFeature(feature string) {
DisabledFeatures = gulu.Str.RemoveDuplicatedElem(DisabledFeatures)
}
// UseSingleLineSave 是否使用单行保存 .sy 和数据库 .json 文件。
var UseSingleLineSave = true
var (
UseSingleLineSave = true // UseSingleLineSave 是否使用单行保存 .sy 和数据库 .json 文件。
LargeFileWarningSize = 8 // LargeFileWarningSize 大文件警告大小单位MB
)
func ExceedLargeFileWarningSize(fileSize int) bool {
return fileSize > LargeFileWarningSize*1024*1024
}
// IsUILoaded 是否已经加载了 UI。
var IsUILoaded = false