mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-01 10:20:16 +01:00
🎨 Alert users when .sy file or database .json exceed 8MB https://github.com/siyuan-note/siyuan/issues/15451
This commit is contained in:
parent
f3cc641005
commit
eb13c34fe5
22 changed files with 98 additions and 15 deletions
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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 => {
|
||||
|
|
|
|||
4
app/src/types/config.d.ts
vendored
4
app/src/types/config.d.ts
vendored
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue