🎨 Supports cleaning up unreferenced databases https://github.com/siyuan-note/siyuan/issues/11569

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-01-29 22:55:24 +08:00
parent a79d399f0a
commit aa1893e3de
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 38 additions and 3 deletions

View file

@ -222,3 +222,21 @@ func rollbackNotebookHistory(c *gin.Context) {
return
}
}
func rollbackAttributeViewHistory(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
historyPath := arg["historyPath"].(string)
err := model.RollbackAttributeViewHistory(historyPath)
if err != nil {
ret.Code = -1
ret.Msg = err.Error()
return
}
}

View file

@ -146,6 +146,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/format/netImg2LocalAssets", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, netImg2LocalAssets)
ginServer.Handle("POST", "/api/format/netAssets2LocalAssets", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, netAssets2LocalAssets)
ginServer.Handle("POST", "/api/history/rollbackAttributeViewHistory", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, rollbackAttributeViewHistory)
ginServer.Handle("POST", "/api/history/getNotebookHistory", model.CheckAuth, model.CheckAdminRole, getNotebookHistory)
ginServer.Handle("POST", "/api/history/rollbackNotebookHistory", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, rollbackNotebookHistory)
ginServer.Handle("POST", "/api/history/rollbackAssetsHistory", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, rollbackAssetsHistory)