mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-10-23 06:46:11 +08:00
Add ReadOnly option for HTTPHandler
This commit is contained in:
@@ -20,6 +20,7 @@ type uiAssetsHandler struct {
|
||||
staticDirPath string
|
||||
indexFileName string
|
||||
prometheusAddr string
|
||||
readOnly bool
|
||||
}
|
||||
|
||||
// ServeHTTP inspects the URL path to locate a file within the static dir
|
||||
@@ -62,9 +63,11 @@ func (h *uiAssetsHandler) renderIndexFile(w http.ResponseWriter) error {
|
||||
data := struct {
|
||||
RootPath string
|
||||
PrometheusAddr string
|
||||
ReadOnly bool
|
||||
}{
|
||||
RootPath: h.rootPath,
|
||||
PrometheusAddr: h.prometheusAddr,
|
||||
ReadOnly: h.readOnly,
|
||||
}
|
||||
return tmpl.Execute(w, data)
|
||||
}
|
||||
|
Reference in New Issue
Block a user