http: improve UI not enabled response message

Response now clearly indicates:
- the UI is disabled
- how to enable the UI
This commit is contained in:
Jared Kirschner 2021-12-13 08:29:54 -08:00
parent db7c814722
commit 8b8c79ea72
2 changed files with 4 additions and 1 deletions

3
.changelog/11820.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
http: when a user attempts to access the UI but can't because it's disabled, explain this and how to fix it
```

View File

@ -593,7 +593,7 @@ func (s *HTTPHandlers) Index(resp http.ResponseWriter, req *http.Request) {
// Give them something helpful if there's no UI so they at least know // Give them something helpful if there's no UI so they at least know
// what this server is. // what this server is.
if !s.IsUIEnabled() { if !s.IsUIEnabled() {
fmt.Fprint(resp, "Consul Agent") fmt.Fprint(resp, "Consul Agent: UI disabled. To enable, set ui_config.enabled=true in the agent configuration and restart.")
return return
} }