1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 10:07:02 +00:00

Add listener configuration details to status page

This commit is contained in:
James Hillyerd
2013-10-09 16:20:13 -07:00
parent 9c924d5659
commit dcc5d240cb
2 changed files with 29 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package web
import (
"fmt"
"github.com/jhillyerd/inbucket/config"
"net/http"
)
@@ -13,8 +14,17 @@ func RootIndex(w http.ResponseWriter, req *http.Request, ctx *Context) (err erro
func RootStatus(w http.ResponseWriter, req *http.Request, ctx *Context) (err error) {
retentionMinutes := config.GetDataStoreConfig().RetentionMinutes
smtpListener := fmt.Sprintf("%s:%d", config.GetSmtpConfig().Ip4address.String(),
config.GetSmtpConfig().Ip4port)
pop3Listener := fmt.Sprintf("%s:%d", config.GetPop3Config().Ip4address.String(),
config.GetPop3Config().Ip4port)
webListener := fmt.Sprintf("%s:%d", config.GetWebConfig().Ip4address.String(),
config.GetWebConfig().Ip4port)
return RenderTemplate("root/status.html", w, map[string]interface{}{
"ctx": ctx,
"ctx": ctx,
"retentionMinutes": retentionMinutes,
"smtpListener": smtpListener,
"pop3Listener": pop3Listener,
"webListener": webListener,
})
}