mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 18:17:03 +00:00
Add listener configuration details to status page
This commit is contained in:
@@ -139,6 +139,24 @@
|
|||||||
<p>Metrics are polled every 10 seconds. Inbucket does not keep history for the
|
<p>Metrics are polled every 10 seconds. Inbucket does not keep history for the
|
||||||
10 minute graphs, but your web browser will accumulate the data over time.</p>
|
10 minute graphs, but your web browser will accumulate the data over time.</p>
|
||||||
|
|
||||||
|
<div class="box">
|
||||||
|
<h3>Configuration</h3>
|
||||||
|
<table class="metrics">
|
||||||
|
<tr>
|
||||||
|
<th>SMTP Listener:</th>
|
||||||
|
<td><span>{{.smtpListener}}</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>POP3 Listener:</th>
|
||||||
|
<td><span>{{.pop3Listener}}</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>HTTP Listener:</th>
|
||||||
|
<td><span>{{.webListener}}</span></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<p class="last"> </p>
|
||||||
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h3>General Metrics</h3>
|
<h3>General Metrics</h3>
|
||||||
<table class="metrics">
|
<table class="metrics">
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package web
|
package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/jhillyerd/inbucket/config"
|
"github.com/jhillyerd/inbucket/config"
|
||||||
"net/http"
|
"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) {
|
func RootStatus(w http.ResponseWriter, req *http.Request, ctx *Context) (err error) {
|
||||||
retentionMinutes := config.GetDataStoreConfig().RetentionMinutes
|
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{}{
|
return RenderTemplate("root/status.html", w, map[string]interface{}{
|
||||||
"ctx": ctx,
|
"ctx": ctx,
|
||||||
"retentionMinutes": retentionMinutes,
|
"retentionMinutes": retentionMinutes,
|
||||||
|
"smtpListener": smtpListener,
|
||||||
|
"pop3Listener": pop3Listener,
|
||||||
|
"webListener": webListener,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user