🎨 Improve cloud sync API count display

This commit is contained in:
Daniel 2023-07-11 21:31:19 +08:00
parent 52ca5e94a1
commit 33470c29ca
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 11 additions and 3 deletions

View file

@ -47,6 +47,7 @@ func renderAttributeView(c *gin.Context) {
view := map[string]interface{}{
"id": v.ID,
"name": v.Name,
"type": v.Type,
}
views = append(views, view)
@ -54,8 +55,10 @@ func renderAttributeView(c *gin.Context) {
ret.Data = map[string]interface{}{
"name": attrView.Name,
"id": attrView.ID,
"viewType": view.GetType(),
"viewID": view.GetID(),
"views": views,
"viewType": view.Type(),
"view": view,
}
}

View file

@ -67,7 +67,8 @@ type Viewable interface {
Sortable
Calculable
Type() ViewType
GetType() ViewType
GetID() string
}
func NewAttributeView(id string) *AttributeView {

View file

@ -33,10 +33,14 @@ type Table struct {
Sorts []*ViewSort `json:"sorts"` // 排序规则
}
func (table *Table) Type() ViewType {
func (table *Table) GetType() ViewType {
return ViewTypeTable
}
func (table *Table) GetID() string {
return table.ID
}
func (table *Table) SortRows() {
if 1 > len(table.Sorts) {
return