debug: Expose list of components to frontend
This commit is contained in:
parent
e17ab90269
commit
e5cd57cb7d
14 changed files with 307 additions and 14 deletions
|
|
@ -10,12 +10,15 @@ import (
|
|||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/instances"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/httpx"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/lazy"
|
||||
"github.com/tkw1536/goprogram/stream"
|
||||
)
|
||||
|
||||
type Info struct {
|
||||
component.Base
|
||||
|
||||
Analytics *lazy.PoolAnalytics
|
||||
|
||||
Exporter *exporter.Exporter
|
||||
Instances *instances.Instances
|
||||
SnapshotsLog *logger.Logger
|
||||
|
|
@ -41,6 +44,12 @@ func (info *Info) Handler(route string, context context.Context, io stream.IOStr
|
|||
Template: indexTemplate,
|
||||
})
|
||||
|
||||
// add a handler for the component page
|
||||
mux.Handle(route+"components", httpx.HTMLHandler[componentsPageContext]{
|
||||
Handler: info.componentsPageAPI,
|
||||
Template: componentsTemplate,
|
||||
})
|
||||
|
||||
// add a handler for the instance page
|
||||
mux.Handle(route+"instance/", httpx.HTMLHandler[instancePageContext]{
|
||||
Handler: info.instancePageAPI,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue