mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
Rename localAssets to useLocalAssets.
This commit is contained in:
parent
f9b4df4284
commit
a5e18b0229
|
@ -42,7 +42,7 @@ func (h *StatusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var t *template.Template
|
var t *template.Template
|
||||||
if *localAssets {
|
if *useLocalAssets {
|
||||||
t, _ = template.ParseFiles("web/templates/status.html")
|
t, _ = template.ParseFiles("web/templates/status.html")
|
||||||
} else {
|
} else {
|
||||||
templateFile, err := blob.GetFile(blob.TemplateFiles, "status.html")
|
templateFile, err := blob.GetFile(blob.TemplateFiles, "status.html")
|
||||||
|
|
|
@ -27,7 +27,7 @@ import (
|
||||||
// Commandline flags.
|
// Commandline flags.
|
||||||
var (
|
var (
|
||||||
listenAddress = flag.String("listenAddress", ":9090", "Address to listen on for web interface.")
|
listenAddress = flag.String("listenAddress", ":9090", "Address to listen on for web interface.")
|
||||||
localAssets = flag.Bool("localAssets", false, "Read assets/templates from file instead of binary.")
|
useLocalAssets = flag.Bool("localAssets", false, "Read assets/templates from file instead of binary.")
|
||||||
)
|
)
|
||||||
|
|
||||||
func StartServing(appState *appstate.ApplicationState) {
|
func StartServing(appState *appstate.ApplicationState) {
|
||||||
|
@ -37,7 +37,7 @@ func StartServing(appState *appstate.ApplicationState) {
|
||||||
http.Handle("/status", &StatusHandler{appState: appState})
|
http.Handle("/status", &StatusHandler{appState: appState})
|
||||||
http.Handle("/api/", gorest.Handle())
|
http.Handle("/api/", gorest.Handle())
|
||||||
http.Handle("/metrics.json", exporter)
|
http.Handle("/metrics.json", exporter)
|
||||||
if *localAssets {
|
if *useLocalAssets {
|
||||||
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("web/static"))))
|
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("web/static"))))
|
||||||
} else {
|
} else {
|
||||||
http.Handle("/static/", http.StripPrefix("/static/", new(blob.Handler)))
|
http.Handle("/static/", http.StripPrefix("/static/", new(blob.Handler)))
|
||||||
|
|
Loading…
Reference in a new issue