console: add "top" widgets API

This commit is contained in:
Vincent Bernat
2022-04-14 16:00:35 +02:00
parent 793e55db52
commit 506bca0291
4 changed files with 151 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ func (c *Component) Start() error {
c.d.HTTP.GinRouter.GET("/api/v0/console/widget/flow-last", c.widgetFlowLastHandlerFunc)
c.d.HTTP.GinRouter.GET("/api/v0/console/widget/flow-rate", c.widgetFlowRateHandlerFunc)
c.d.HTTP.GinRouter.GET("/api/v0/console/widget/exporters", c.widgetExportersHandlerFunc)
c.d.HTTP.GinRouter.GET("/api/v0/console/widget/top/:name", c.widgetTopHandlerFunc)
c.t.Go(func() error {
select {