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
27
internal/dis/component/control/info/components.go
Normal file
27
internal/dis/component/control/info/components.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package info
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/control/static"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/lazy"
|
||||
)
|
||||
|
||||
//go:embed "html/components.html"
|
||||
var componentsTemplateString string
|
||||
var componentsTemplate = static.AssetsComponentsIndex.MustParse(componentsTemplateString)
|
||||
|
||||
type componentsPageContext struct {
|
||||
Time time.Time
|
||||
|
||||
Analytics lazy.PoolAnalytics
|
||||
}
|
||||
|
||||
func (info *Info) componentsPageAPI(r *http.Request) (cp componentsPageContext, err error) {
|
||||
cp.Analytics = *info.Analytics
|
||||
cp.Time = time.Now().UTC()
|
||||
|
||||
return
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue