2020-11-08 17:19:25 +00:00
|
|
|
package http
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2021-03-01 16:43:28 +00:00
|
|
|
"github.com/distribyted/distribyted/stats"
|
2020-11-08 17:19:25 +00:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
var indexHandler = func(c *gin.Context) {
|
|
|
|
c.HTML(http.StatusOK, "index.html", nil)
|
|
|
|
}
|
|
|
|
|
|
|
|
var routesHandler = func(ss *stats.Torrent) gin.HandlerFunc {
|
|
|
|
return func(c *gin.Context) {
|
|
|
|
c.HTML(http.StatusOK, "routes.html", ss.RoutesStats())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var configHandler = func(c *gin.Context) {
|
|
|
|
c.HTML(http.StatusOK, "config.html", nil)
|
|
|
|
}
|