diff --git a/adminui/info.go b/adminui/info.go index d6ad2f1e..9a09a843 100644 --- a/adminui/info.go +++ b/adminui/info.go @@ -40,7 +40,7 @@ func (au *AdminUI) serverInfo(w http.ResponseWriter, r *http.Request) { func (au *AdminUI) consoleLog(w http.ResponseWriter, r *http.Request) { d := LogLinesDTO{} - for _, li := range au.logQueue.ReadAll() { + for _, li := range au.logQueue.w.ReadAll() { d.LogItems = append(d.LogItems, string(li)) } diff --git a/adminui/ui_webserver.go b/adminui/ui_webserver.go index 35e4bb61..9829f2f0 100644 --- a/adminui/ui_webserver.go +++ b/adminui/ui_webserver.go @@ -35,7 +35,7 @@ type AdminUI struct { oidcProvider rp.RelyingParty - logQueue *queue.Queue[[]byte] + logQueue *clonerWriter listenerEvents struct { clusterHealth string @@ -47,6 +47,14 @@ type AdminUI struct { csrfHeaderName string } +type clonerWriter struct { + w *queue.Queue[string] +} + +func (c *clonerWriter) Write(b []byte) (int, error) { + return c.w.Write(string(b)) +} + func New(firewall *router.Firewall, errs chan<- error) (ui *AdminUI, err error) { if firewall == nil { @@ -55,7 +63,9 @@ func New(firewall *router.Firewall, errs chan<- error) (ui *AdminUI, err error) var adminUI AdminUI adminUI.firewall = firewall - adminUI.logQueue = queue.NewQueue[[]byte](40) + adminUI.logQueue = &clonerWriter{ + queue.NewQueue[string](40), + } adminUI.ctrl = wagctl.NewControlClient(config.Values.Socket)