mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
🎨 Reduce the delay in adding rows in database table view https://github.com/siyuan-note/siyuan/issues/10082
This commit is contained in:
parent
d5e098a285
commit
3bfbfbc7e9
3 changed files with 41 additions and 2 deletions
|
|
@ -26,6 +26,24 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func getAttributeViewFilterSort(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, _ := util.JsonArg(c, ret)
|
||||
if nil == arg {
|
||||
return
|
||||
}
|
||||
|
||||
avID := arg["id"].(string)
|
||||
|
||||
filters, sorts := model.GetAttributeViewFilterSort(avID)
|
||||
ret.Data = map[string]interface{}{
|
||||
"filters": filters,
|
||||
"sorts": sorts,
|
||||
}
|
||||
}
|
||||
|
||||
func searchAttributeViewNonRelationKey(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
@ -72,9 +90,8 @@ func getAttributeView(c *gin.Context) {
|
|||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
av := model.GetAttributeView(id)
|
||||
ret.Data = map[string]interface{}{
|
||||
"av": av,
|
||||
"av": model.GetAttributeView(id),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -396,6 +396,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/av/getAttributeView", model.CheckAuth, model.CheckReadonly, getAttributeView)
|
||||
ginServer.Handle("POST", "/api/av/searchAttributeViewRelationKey", model.CheckAuth, model.CheckReadonly, searchAttributeViewRelationKey)
|
||||
ginServer.Handle("POST", "/api/av/searchAttributeViewNonRelationKey", model.CheckAuth, model.CheckReadonly, searchAttributeViewNonRelationKey)
|
||||
ginServer.Handle("POST", "/api/av/getAttributeViewFilterSort", model.CheckAuth, model.CheckReadonly, getAttributeViewFilterSort)
|
||||
|
||||
ginServer.Handle("POST", "/api/ai/chatGPT", model.CheckAuth, chatGPT)
|
||||
ginServer.Handle("POST", "/api/ai/chatGPTWithAction", model.CheckAuth, chatGPTWithAction)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue