diff --git a/web/ui/react-app/public/index.html b/web/ui/react-app/public/index.html index 5ecd832b4..277da2c11 100755 --- a/web/ui/react-app/public/index.html +++ b/web/ui/react-app/public/index.html @@ -37,7 +37,11 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - Prometheus Expression Browser + + TITLE_PLACEHOLDER diff --git a/web/web.go b/web/web.go index 87b597510..fbd404369 100644 --- a/web/web.go +++ b/web/web.go @@ -396,9 +396,10 @@ func New(logger log.Logger, o *Options) *Handler { fmt.Fprintf(w, "Error reading React index.html: %v", err) return } - prefixedIdx := bytes.ReplaceAll(idx, []byte("PATH_PREFIX_PLACEHOLDER"), []byte(o.ExternalURL.Path)) - prefixedIdx = bytes.ReplaceAll(prefixedIdx, []byte("CONSOLES_LINK_PLACEHOLDER"), []byte(h.consolesPath())) - w.Write(prefixedIdx) + replacedIdx := bytes.ReplaceAll(idx, []byte("PATH_PREFIX_PLACEHOLDER"), []byte(o.ExternalURL.Path)) + replacedIdx = bytes.ReplaceAll(replacedIdx, []byte("CONSOLES_LINK_PLACEHOLDER"), []byte(h.consolesPath())) + replacedIdx = bytes.ReplaceAll(replacedIdx, []byte("TITLE_PLACEHOLDER"), []byte(h.options.PageTitle)) + w.Write(replacedIdx) return }