ddda39b22a
* Server implementation. - Share the content of a folder as a magnet file. - Web interface with all data needed for sharing data. - New configuration to add several servers - Every time the content of the server folder is changed, the magnet file will be generated again. Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com> * Update dependencies Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com> * Use boltdb piece completion storage. Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
28 lines
575 B
Go
28 lines
575 B
Go
package http
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/distribyted/distribyted/torrent"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
var indexHandler = func(c *gin.Context) {
|
|
c.HTML(http.StatusOK, "index.html", nil)
|
|
}
|
|
|
|
var routesHandler = func(ss *torrent.Stats) gin.HandlerFunc {
|
|
return func(c *gin.Context) {
|
|
c.HTML(http.StatusOK, "routes.html", ss.RoutesStats())
|
|
}
|
|
}
|
|
|
|
var logsHandler = func(c *gin.Context) {
|
|
c.HTML(http.StatusOK, "logs.html", nil)
|
|
}
|
|
|
|
var serversFoldersHandler = func() gin.HandlerFunc {
|
|
return func(c *gin.Context) {
|
|
c.HTML(http.StatusOK, "servers.html", nil)
|
|
}
|
|
}
|