Vanessa 2022-06-23 11:43:46 +08:00
parent 35cf6d1b49
commit ca8d6d0dc3
8 changed files with 20 additions and 2 deletions

View file

@ -1,4 +1,6 @@
{
"tabLimit": "Tab Limit",
"tabLimit1": "Sort by opening time, close the earliest opened tab",
"pasteEscaped": "Paste escaped text",
"resetRepoTip": "Resetting the data repository will completely delete the key and all snapshots, are you sure you want to reset?",
"resetRepo": "Reset data repo",

View file

@ -1,4 +1,6 @@
{
"tabLimit": "Nombre maximum d'onglets ouverts",
"tabLimit1": "Trier par heure d'ouverture, fermer le premier onglet ouvert",
"pasteEscaped": "Coller le texte échappé",
"resetRepoTip": "La réinitialisation du référentiel de données supprimera complètement la clé et tous les instantanés, êtes-vous sûr de vouloir réinitialiser ?",
"resetRepo": "Réinitialiser le référentiel de données",

View file

@ -1,4 +1,6 @@
{
"tabLimit": "頁簽打開最大數量",
"tabLimit1": "按照打開時間排序,關閉最早打開的頁簽",
"pasteEscaped": "粘貼轉義文本",
"resetRepoTip": "重置數據倉庫會徹底刪除密鑰和所有快照,確定進行重置嗎?",
"resetRepo": "重置數據倉庫",

View file

@ -1,4 +1,6 @@
{
"tabLimit": "页签打开最大数量",
"tabLimit1": "按照打开时间排序,关闭最早打开的页签",
"pasteEscaped": "粘贴转义文本",
"resetRepoTip": "重置数据仓库会彻底删除密钥和所有快照,确定进行重置吗?",
"resetRepo": "重置数据仓库",

View file

@ -58,6 +58,14 @@ export const fileTree = {
</div>
<span class="fn__space"></span>
<input class="b3-text-field fn__flex-center fn__size200" id="maxListCount" type="number" min="1" max="10240" value="${window.siyuan.config.fileTree.maxListCount}">
</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.tabLimit}
<div class="b3-label__text">${window.siyuan.languages.tabLimit1}</div>
</div>
<span class="fn__space"></span>
<input class="b3-text-field fn__flex-center fn__size200" id="maxOpenTabCount" type="number" min="1" max="32" value="${window.siyuan.config.fileTree.maxOpenTabCount}">
</label>`;
},
_send() {
@ -70,6 +78,7 @@ export const fileTree = {
allowCreateDeeper: (fileTree.element.querySelector("#allowCreateDeeper") as HTMLInputElement).checked,
removeDocWithoutConfirm: (fileTree.element.querySelector("#removeDocWithoutConfirm") as HTMLInputElement).checked,
maxListCount: parseInt((fileTree.element.querySelector("#maxListCount") as HTMLInputElement).value),
maxOpenTabCount: parseInt((fileTree.element.querySelector("#maxOpenTabCount") as HTMLInputElement).value),
}, response => {
fileTree.onSetfiletree(response.data);
});

View file

@ -18,7 +18,7 @@ export const initConfigSearch = (element: HTMLElement) => {
]),
// 文档树
getLang(["selectOpen", "fileTree", "fileTree2", "fileTree3", "fileTree4",
getLang(["selectOpen", "tabLimit", "fileTree", "fileTree2", "fileTree3", "fileTree4",
"fileTree5", "fileTree6", "fileTree7", "fileTree8", "fileTree12", "fileTree13", "fileTree15", "fileTree16", "fileTree17"]),
// 图片

View file

@ -425,7 +425,7 @@ export class Wnd {
// 移除 centerLayout 中的 empty
if (this.parent.type === "center" && this.children.length === 2 && !this.children[0].headElement) {
this.removeTab(this.children[0].id);
} else if (this.children.length > 5) { // TODO: 需从后台设置中获取
} else if (this.children.length > window.siyuan.config.fileTree.maxOpenTabCount) {
let removeId: string;
let openTime: string;
this.children.forEach((item, index) => {

View file

@ -231,6 +231,7 @@ declare interface IFileTree {
refCreateSavePath: string
createDocNameTemplate: string
sort: number
maxOpenTabCount: number
maxListCount: number
}