🐛 Unable to obtain the correct number of view entries when viewing unreferenced databases or historical databases (#17088)

This commit is contained in:
Jeffrey Chen 2026-03-03 09:49:15 +08:00 committed by GitHub
parent b77580c86e
commit 75d29419c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 88 additions and 49 deletions

View file

@ -721,17 +721,17 @@ func renderSnapshotAttributeView(c *gin.Context) {
return
}
var views []map[string]interface{}
var views []*av.ViewData
for _, v := range attrView.Views {
view := map[string]interface{}{
"id": v.ID,
"icon": v.Icon,
"name": v.Name,
"hideAttrViewName": v.HideAttrViewName,
"type": v.LayoutType,
}
views = append(views, view)
views = append(views, &av.ViewData{
ID: v.ID,
Icon: v.Icon,
Name: v.Name,
Desc: v.Desc,
HideAttrViewName: v.HideAttrViewName,
Type: v.LayoutType,
PageSize: v.PageSize,
})
}
ret.Data = map[string]interface{}{
@ -797,17 +797,17 @@ func renderHistoryAttributeView(c *gin.Context) {
return
}
var views []map[string]interface{}
var views []*av.ViewData
for _, v := range attrView.Views {
view := map[string]interface{}{
"id": v.ID,
"icon": v.Icon,
"name": v.Name,
"hideAttrViewName": v.HideAttrViewName,
"type": v.LayoutType,
}
views = append(views, view)
views = append(views, &av.ViewData{
ID: v.ID,
Icon: v.Icon,
Name: v.Name,
Desc: v.Desc,
HideAttrViewName: v.HideAttrViewName,
Type: v.LayoutType,
PageSize: v.PageSize,
})
}
ret.Data = map[string]interface{}{
@ -883,19 +883,17 @@ func renderAttrView(blockID, avID, viewID, query string, page, pageSize int, gro
return
}
var views []map[string]interface{}
var views []*av.ViewData
for _, v := range attrView.Views {
view := map[string]interface{}{
"id": v.ID,
"icon": v.Icon,
"name": v.Name,
"desc": v.Desc,
"hideAttrViewName": v.HideAttrViewName,
"type": v.LayoutType,
"pageSize": v.PageSize,
}
views = append(views, view)
views = append(views, &av.ViewData{
ID: v.ID,
Icon: v.Icon,
Name: v.Name,
Desc: v.Desc,
HideAttrViewName: v.HideAttrViewName,
Type: v.LayoutType,
PageSize: v.PageSize,
})
}
ret.Data = map[string]interface{}{