mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-09-22 06:46:34 +08:00
Show metrics icon in sidebar if prometheus-addr is specified
This commit is contained in:
15
static.go
15
static.go
@@ -15,10 +15,11 @@ import (
|
||||
// the path to the index file within that static directory are used to
|
||||
// serve the SPA.
|
||||
type uiAssetsHandler struct {
|
||||
rootPath string
|
||||
contents embed.FS
|
||||
staticDirPath string
|
||||
indexFileName string
|
||||
rootPath string
|
||||
contents embed.FS
|
||||
staticDirPath string
|
||||
indexFileName string
|
||||
prometheusAddr string
|
||||
}
|
||||
|
||||
// ServeHTTP inspects the URL path to locate a file within the static dir
|
||||
@@ -59,9 +60,11 @@ func (h *uiAssetsHandler) renderIndexFile(w http.ResponseWriter) error {
|
||||
return err
|
||||
}
|
||||
data := struct {
|
||||
RootPath string
|
||||
RootPath string
|
||||
PrometheusAddr string
|
||||
}{
|
||||
RootPath: h.rootPath,
|
||||
RootPath: h.rootPath,
|
||||
PrometheusAddr: h.prometheusAddr,
|
||||
}
|
||||
return tmpl.Execute(w, data)
|
||||
}
|
||||
|
Reference in New Issue
Block a user