2020-11-08 17:19:25 +00:00
|
|
|
package http
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2021-11-16 12:13:58 +00:00
|
|
|
"github.com/distribyted/distribyted/torrent"
|
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)
|
|
|
|
}
|
|
|
|
|
2021-11-16 12:13:58 +00:00
|
|
|
var routesHandler = func(ss *torrent.Stats) gin.HandlerFunc {
|
2020-11-08 17:19:25 +00:00
|
|
|
return func(c *gin.Context) {
|
|
|
|
c.HTML(http.StatusOK, "routes.html", ss.RoutesStats())
|
|
|
|
}
|
|
|
|
}
|
2021-11-20 19:57:25 +00:00
|
|
|
|
|
|
|
var logsHandler = func(c *gin.Context) {
|
|
|
|
c.HTML(http.StatusOK, "logs.html", nil)
|
|
|
|
}
|