mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 16:24:20 +01:00
🎨 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:
parent
a77e0820ad
commit
1fa674e430
6 changed files with 319 additions and 90 deletions
|
|
@ -17,6 +17,7 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
|
|
@ -27,6 +28,24 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func getUnusedAttributeViews(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
unusedAttributeViews := model.UnusedAttributeViews()
|
||||
total := len(unusedAttributeViews)
|
||||
|
||||
const maxUnusedAttributeViews = 512
|
||||
if total > maxUnusedAttributeViews {
|
||||
unusedAttributeViews = unusedAttributeViews[:maxUnusedAttributeViews]
|
||||
util.PushMsg(fmt.Sprintf(model.Conf.Language(251), total, maxUnusedAttributeViews), 5000)
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"unusedAttributeViews": unusedAttributeViews,
|
||||
}
|
||||
}
|
||||
|
||||
func getAttributeViewItemIDsByBoundIDs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue