|
|
@ -118,9 +118,8 @@ type Service struct {
|
|
|
|
|
|
|
|
|
|
|
|
Expvar bool
|
|
|
|
Expvar bool
|
|
|
|
DisableRedirect bool // Disable leader-redirection.
|
|
|
|
DisableRedirect bool // Disable leader-redirection.
|
|
|
|
Version string
|
|
|
|
|
|
|
|
Commit string
|
|
|
|
BuildInfo map[string]interface{}
|
|
|
|
Branch string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger *log.Logger
|
|
|
|
logger *log.Logger
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -296,12 +295,6 @@ func (s *Service) handleStatus(w http.ResponseWriter, r *http.Request) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
buildStatus := map[string]interface{}{
|
|
|
|
|
|
|
|
"version": s.Version,
|
|
|
|
|
|
|
|
"commit": s.Commit,
|
|
|
|
|
|
|
|
"branch": s.Branch,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
httpStatus := map[string]interface{}{
|
|
|
|
httpStatus := map[string]interface{}{
|
|
|
|
"addr": s.Addr().String(),
|
|
|
|
"addr": s.Addr().String(),
|
|
|
|
"auth": prettyEnabled(s.credentialStore != nil),
|
|
|
|
"auth": prettyEnabled(s.credentialStore != nil),
|
|
|
@ -315,13 +308,15 @@ func (s *Service) handleStatus(w http.ResponseWriter, r *http.Request) {
|
|
|
|
// Build the status response.
|
|
|
|
// Build the status response.
|
|
|
|
status := map[string]interface{}{
|
|
|
|
status := map[string]interface{}{
|
|
|
|
"store": results,
|
|
|
|
"store": results,
|
|
|
|
"build": buildStatus,
|
|
|
|
|
|
|
|
"http": httpStatus,
|
|
|
|
"http": httpStatus,
|
|
|
|
"node": nodeStatus,
|
|
|
|
"node": nodeStatus,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if !s.lastBackup.IsZero() {
|
|
|
|
if !s.lastBackup.IsZero() {
|
|
|
|
status["last_backup"] = s.lastBackup
|
|
|
|
status["last_backup"] = s.lastBackup
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if s.BuildInfo != nil {
|
|
|
|
|
|
|
|
status["build"] = s.BuildInfo
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pretty, _ := isPretty(r)
|
|
|
|
pretty, _ := isPretty(r)
|
|
|
|
var b []byte
|
|
|
|
var b []byte
|
|
|
|