Skip to content

Commit c43997a

Browse files
committed
feat: add server side apps pagination
Signed-off-by: yang.xiao <[email protected]>
1 parent a1f90b5 commit c43997a

File tree

12 files changed

+4186
-1125
lines changed

12 files changed

+4186
-1125
lines changed

assets/swagger.json

Lines changed: 377 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ require (
7373
github.com/r3labs/diff/v3 v3.0.1
7474
github.com/redis/go-redis/v9 v9.7.3
7575
github.com/robfig/cron/v3 v3.0.2-0.20210106135023-bc59245fe10e
76+
github.com/samber/lo v1.49.1
7677
github.com/sirupsen/logrus v1.9.3
7778
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
7879
github.com/soheilhy/cmux v0.1.5

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,8 @@ github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA=
731731
github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
732732
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
733733
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
734+
github.com/samber/lo v1.49.1 h1:4BIFyVfuQSEpluc7Fua+j1NolZHiEHEpaSEKdsH0tew=
735+
github.com/samber/lo v1.49.1/go.mod h1:dO6KHFzUKXgP8LDhU0oI8d2hekjXnGOu0DB8Jecxd6o=
734736
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
735737
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
736738
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=

pkg/apiclient/application/application.pb.go

Lines changed: 847 additions & 178 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/application/v1alpha1/generated.pb.go

Lines changed: 1836 additions & 922 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/application/v1alpha1/generated.proto

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/application/v1alpha1/types.go

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,31 @@ type ApplicationWatchEvent struct {
16931693
type ApplicationList struct {
16941694
metav1.TypeMeta `json:",inline"`
16951695
metav1.ListMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`
1696-
Items []Application `json:"items" protobuf:"bytes,2,rep,name=items"`
1696+
Items []Application `json:"items" protobuf:"bytes,2,rep,name=items"`
1697+
Stats ApplicationListStats `json:"stats,omitempty" protobuf:"bytes,3,opt,name=stats"`
1698+
}
1699+
1700+
type ApplicationLabelStats struct {
1701+
Key string `json:"key" protobuf:"bytes,1,opt,name=key"`
1702+
Values []string `json:"values" protobuf:"bytes,2,opt,name=values"`
1703+
}
1704+
1705+
// ApplicationListStats holds additional information about the list of applications
1706+
type ApplicationListStats struct {
1707+
Total int64 `json:"total" protobuf:"bytes,1,opt,name=total"`
1708+
TotalBySyncStatus map[SyncStatusCode]int64 `json:"totalBySyncStatus,omitempty" protobuf:"bytes,2,opt,name=totalBySyncStatus"`
1709+
TotalByHealthStatus map[health.HealthStatusCode]int64 `json:"totalByHealthStatus,omitempty" protobuf:"bytes,3,opt,name=totalByHealthStatus"`
1710+
AutoSyncEnabledCount int64 `json:"autoSyncEnabledCount" protobuf:"bytes,4,opt,name=autoSyncEnabledCount"`
1711+
Destinations []ApplicationDestination `json:"destinations" protobuf:"bytes,5,opt,name=destinations"`
1712+
Namespaces []string `json:"namespaces" protobuf:"bytes,6,opt,name=namespaces"`
1713+
Labels []ApplicationLabelStats `json:"labels,omitempty" protobuf:"bytes,7,opt,name=labels"`
1714+
}
1715+
1716+
func NewApplicationListStats() ApplicationListStats {
1717+
return ApplicationListStats{
1718+
TotalBySyncStatus: make(map[SyncStatusCode]int64),
1719+
TotalByHealthStatus: make(map[health.HealthStatusCode]int64),
1720+
}
16971721
}
16981722

16991723
// ComponentParameter contains information about component parameter value

pkg/apis/application/v1alpha1/zz_generated.deepcopy.go

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)