mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 History Retention Days supports a maximum setting of 3650 https://github.com/siyuan-note/siyuan/issues/15979
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
02602f886e
commit
e36592ab5c
4 changed files with 12 additions and 2 deletions
|
|
@ -234,7 +234,7 @@ export const editor = {
|
|||
<div class="fn__flex config__item">
|
||||
<div class="fn__flex-center fn__flex-1 ft__on-surface">${window.siyuan.languages.historyRetentionDays}</div>
|
||||
<span class="fn__space"></span>
|
||||
<input class="b3-text-field fn__flex-center fn__size200" id="historyRetentionDays" type="number" min="0" value="${window.siyuan.config.editor.historyRetentionDays}"/>
|
||||
<input class="b3-text-field fn__flex-center fn__size200" id="historyRetentionDays" type="number" min="1" max="3650" value="${window.siyuan.config.editor.historyRetentionDays}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fn__flex b3-label config__item">
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ export const initEditor = () => {
|
|||
${window.siyuan.languages.historyRetentionDays}
|
||||
<a href="javascript:void(0)" id="clearHistory">${window.siyuan.languages.clearHistory}</a>
|
||||
<span class="fn__hr"></span>
|
||||
<input class="b3-text-field fn__block" id="historyRetentionDays" type="number" min="0" value="${window.siyuan.config.editor.historyRetentionDays}"/>
|
||||
<input class="b3-text-field fn__block" id="historyRetentionDays" type="number" min="1" max="3650" value="${window.siyuan.config.editor.historyRetentionDays}"/>
|
||||
<div class="b3-label__text">${window.siyuan.languages.historyRetentionDaysTip}</div>
|
||||
</div>
|
||||
<div class="b3-label">
|
||||
|
|
|
|||
|
|
@ -309,6 +309,13 @@ func setEditor(c *gin.Context) {
|
|||
editor.KaTexMacros = "{}"
|
||||
}
|
||||
|
||||
if 1 > editor.HistoryRetentionDays {
|
||||
editor.HistoryRetentionDays = 1
|
||||
}
|
||||
if 3650 < editor.HistoryRetentionDays {
|
||||
editor.HistoryRetentionDays = 3650
|
||||
}
|
||||
|
||||
oldVirtualBlockRef := model.Conf.Editor.VirtualBlockRef
|
||||
oldVirtualBlockRefInclude := model.Conf.Editor.VirtualBlockRefInclude
|
||||
oldVirtualBlockRefExclude := model.Conf.Editor.VirtualBlockRefExclude
|
||||
|
|
|
|||
|
|
@ -260,6 +260,9 @@ func InitConf() {
|
|||
if 1 > Conf.Editor.HistoryRetentionDays {
|
||||
Conf.Editor.HistoryRetentionDays = 30
|
||||
}
|
||||
if 3650 < Conf.Editor.HistoryRetentionDays {
|
||||
Conf.Editor.HistoryRetentionDays = 3650
|
||||
}
|
||||
if conf.MinDynamicLoadBlocks > Conf.Editor.DynamicLoadBlocks {
|
||||
Conf.Editor.DynamicLoadBlocks = conf.MinDynamicLoadBlocks
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue